From 8289a919b8002d71fe250c527fd5d793678ccd59 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 11:01:22 -0700 Subject: [PATCH] feat: users can skip validation, search personalization, return ids, and more; docs: suggest search users to not send IP, deprecate request_id, and more (#160) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: users can self enroll retail search feature on cloud console docs: suggest search users not to send IP and use hashed user id docs: deprecate request_id in ImportProductsRequest docs: deprecate search dynamic_facet_spec and suggest to config on cloud console docs: keep the API doc up-to-date with recent changes feat: add new AddLocalInventories and RemoveLocalInventories APIs feat: users cannot switch to empty default branch unless force override feat: allow search users to skip validation for invalid boost specs feat: support search personalization feat: search returns applied control ids in the response PiperOrigin-RevId: 437355889 Source-Link: https://github.com/googleapis/googleapis/commit/4d0081513142e1e38446d53da72a301119a77847 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b2b798247d46c932737cf689744a827fae7e5313 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjJiNzk4MjQ3ZDQ2YzkzMjczN2NmNjg5NzQ0YTgyN2ZhZTdlNTMxMyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: users can self enroll retail search feature on cloud console (v2beta) docs: suggest search users not to send IP and use hashed user id (v2beta) docs: deprecate request_id in ImportProductsRequest (v2beta) docs: deprecate search dynamic_facet_spec and suggest to config on cloud console (v2beta) docs: keep the API doc up-to-date with recent changes (v2beta) feat: add new AddLocalInventories and RemoveLocalInventories APIs (v2beta) feat: users cannot switch to empty default branch unless force override (v2beta) feat: allow search users to skip validation for invalid boost specs (v2beta) feat: support search personalization (v2beta) feat: search returns applied control ids in the response (v2beta) PiperOrigin-RevId: 438326512 Source-Link: https://github.com/googleapis/googleapis/commit/d6abf6387774457c50d8024a66b7ee78728c8841 Source-Link: https://github.com/googleapis/googleapis-gen/commit/bfbcd23aa990e0df8364d478028f61ad7ff5c8c9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmZiY2QyM2FhOTkwZTBkZjgzNjRkNDc4MDI4ZjYxYWQ3ZmY1YzhjOSJ9 * 🦉 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 --- .../cloud/retail/v2/catalog_service.proto | 17 +- .../google/cloud/retail/v2/common.proto | 105 +- .../cloud/retail/v2/completion_service.proto | 47 +- .../cloud/retail/v2/import_config.proto | 54 +- .../cloud/retail/v2/prediction_service.proto | 9 +- .../google/cloud/retail/v2/product.proto | 88 +- .../cloud/retail/v2/product_service.proto | 202 +- .../google/cloud/retail/v2/promotion.proto | 40 + .../google/cloud/retail/v2/purge_config.proto | 1 + .../cloud/retail/v2/search_service.proto | 80 +- .../google/cloud/retail/v2/user_event.proto | 37 +- .../cloud/retail/v2/user_event_service.proto | 8 +- .../google/cloud/retail/v2beta/catalog.proto | 286 +- .../cloud/retail/v2beta/catalog_service.proto | 251 +- .../google/cloud/retail/v2beta/common.proto | 129 +- .../retail/v2beta/completion_service.proto | 50 +- .../google/cloud/retail/v2beta/control.proto | 84 + .../cloud/retail/v2beta/control_service.proto | 184 + .../cloud/retail/v2beta/export_config.proto | 1 - .../cloud/retail/v2beta/import_config.proto | 51 +- .../retail/v2beta/prediction_service.proto | 9 +- .../google/cloud/retail/v2beta/product.proto | 16 +- .../cloud/retail/v2beta/product_service.proto | 201 +- .../cloud/retail/v2beta/promotion.proto | 40 + .../cloud/retail/v2beta/purge_config.proto | 2 - .../cloud/retail/v2beta/search_service.proto | 68 +- .../cloud/retail/v2beta/serving_config.proto | 247 + .../v2beta/serving_config_service.proto | 240 + .../cloud/retail/v2beta/user_event.proto | 16 +- .../retail/v2beta/user_event_service.proto | 9 +- .../google-cloud-retail/protos/protos.d.ts | 34327 +++--- packages/google-cloud-retail/protos/protos.js | 95540 +++++++++------- .../google-cloud-retail/protos/protos.json | 3008 +- .../v2/catalog_service.set_default_branch.js | 9 + .../v2/completion_service.complete_query.js | 20 +- .../v2/prediction_service.predict.js | 9 +- .../product_service.add_local_inventories.js | 99 + .../v2/product_service.import_products.js | 11 - ...roduct_service.remove_local_inventories.js | 85 + .../v2/product_service.set_inventory.js | 18 +- .../generated/v2/search_service.search.js | 33 +- ...ippet_metadata.google.cloud.retail.v2.json | 144 +- .../catalog_service.add_catalog_attribute.js | 65 + .../catalog_service.get_attributes_config.js | 59 + .../catalog_service.get_completion_config.js | 59 + ...atalog_service.remove_catalog_attribute.js | 65 + ...talog_service.replace_catalog_attribute.js | 73 + .../catalog_service.set_default_branch.js | 9 + ...atalog_service.update_attributes_config.js | 67 + ...atalog_service.update_completion_config.js | 75 + .../completion_service.complete_query.js | 23 +- .../v2beta/control_service.create_control.js | 72 + .../v2beta/control_service.delete_control.js | 59 + .../v2beta/control_service.get_control.js | 59 + .../v2beta/control_service.list_controls.js | 79 + .../v2beta/control_service.update_control.js | 66 + .../v2beta/prediction_service.predict.js | 9 +- .../product_service.add_local_inventories.js | 100 + .../v2beta/product_service.import_products.js | 11 - ...roduct_service.remove_local_inventories.js | 85 + .../v2beta/product_service.set_inventory.js | 14 + .../generated/v2beta/search_service.search.js | 25 +- .../serving_config_service.add_control.js | 65 + ...ng_config_service.create_serving_config.js | 72 + ...ng_config_service.delete_serving_config.js | 59 + ...rving_config_service.get_serving_config.js | 59 + ...ing_config_service.list_serving_configs.js | 72 + .../serving_config_service.remove_control.js | 65 + ...ng_config_service.update_serving_config.js | 66 + ...t_metadata.google.cloud.retail.v2beta.json | 1452 +- packages/google-cloud-retail/src/index.ts | 8 + .../src/v2/catalog_service_client.ts | 16 +- .../src/v2/catalog_service_proto_list.json | 1 + .../src/v2/completion_service_client.ts | 35 +- .../src/v2/completion_service_proto_list.json | 1 + .../src/v2/gapic_metadata.json | 20 + .../src/v2/prediction_service_client.ts | 9 +- .../src/v2/prediction_service_proto_list.json | 1 + .../src/v2/product_service_client.ts | 443 +- .../src/v2/product_service_client_config.json | 10 + .../src/v2/product_service_proto_list.json | 1 + .../src/v2/search_service_client.ts | 102 +- .../src/v2/search_service_proto_list.json | 1 + .../src/v2/user_event_service_client.ts | 7 +- .../src/v2/user_event_service_proto_list.json | 1 + .../src/v2beta/catalog_service_client.ts | 1174 +- .../v2beta/catalog_service_client_config.json | 35 + .../v2beta/catalog_service_proto_list.json | 5 + .../src/v2beta/completion_service_client.ts | 298 +- .../v2beta/completion_service_proto_list.json | 5 + .../src/v2beta/control_service_client.ts | 1340 + .../v2beta/control_service_client_config.json | 46 + .../v2beta/control_service_proto_list.json | 20 + .../src/v2beta/gapic_metadata.json | 246 + .../google-cloud-retail/src/v2beta/index.ts | 2 + .../src/v2beta/prediction_service_client.ts | 269 +- .../v2beta/prediction_service_proto_list.json | 5 + .../src/v2beta/product_service_client.ts | 701 +- .../v2beta/product_service_client_config.json | 10 + .../v2beta/product_service_proto_list.json | 5 + .../src/v2beta/search_service_client.ts | 335 +- .../src/v2beta/search_service_proto_list.json | 5 + .../v2beta/serving_config_service_client.ts | 1520 + .../serving_config_service_client_config.json | 54 + .../serving_config_service_proto_list.json | 20 + .../src/v2beta/user_event_service_client.ts | 267 +- .../v2beta/user_event_service_proto_list.json | 5 + .../system-test/fixtures/sample/src/index.js | 2 + .../system-test/fixtures/sample/src/index.ts | 16 + .../test/gapic_catalog_service_v2beta.ts | 1207 + .../test/gapic_completion_service_v2beta.ts | 294 + .../test/gapic_control_service_v2beta.ts | 1443 + .../test/gapic_prediction_service_v2beta.ts | 294 + .../test/gapic_product_service_v2.ts | 391 + .../test/gapic_product_service_v2beta.ts | 677 + .../test/gapic_search_service_v2beta.ts | 286 + .../gapic_serving_config_service_v2beta.ts | 1767 + .../test/gapic_user_event_service_v2beta.ts | 286 + 118 files changed, 94567 insertions(+), 57978 deletions(-) create mode 100644 packages/google-cloud-retail/protos/google/cloud/retail/v2/promotion.proto create mode 100644 packages/google-cloud-retail/protos/google/cloud/retail/v2beta/control.proto create mode 100644 packages/google-cloud-retail/protos/google/cloud/retail/v2beta/control_service.proto create mode 100644 packages/google-cloud-retail/protos/google/cloud/retail/v2beta/promotion.proto create mode 100644 packages/google-cloud-retail/protos/google/cloud/retail/v2beta/serving_config.proto create mode 100644 packages/google-cloud-retail/protos/google/cloud/retail/v2beta/serving_config_service.proto create mode 100644 packages/google-cloud-retail/samples/generated/v2/product_service.add_local_inventories.js create mode 100644 packages/google-cloud-retail/samples/generated/v2/product_service.remove_local_inventories.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/catalog_service.add_catalog_attribute.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/catalog_service.get_attributes_config.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/catalog_service.get_completion_config.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/catalog_service.remove_catalog_attribute.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/catalog_service.replace_catalog_attribute.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/catalog_service.update_attributes_config.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/catalog_service.update_completion_config.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/control_service.create_control.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/control_service.delete_control.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/control_service.get_control.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/control_service.list_controls.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/control_service.update_control.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/product_service.add_local_inventories.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/product_service.remove_local_inventories.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.add_control.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.create_serving_config.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.delete_serving_config.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.get_serving_config.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.list_serving_configs.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.remove_control.js create mode 100644 packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.update_serving_config.js create mode 100644 packages/google-cloud-retail/src/v2beta/control_service_client.ts create mode 100644 packages/google-cloud-retail/src/v2beta/control_service_client_config.json create mode 100644 packages/google-cloud-retail/src/v2beta/control_service_proto_list.json create mode 100644 packages/google-cloud-retail/src/v2beta/serving_config_service_client.ts create mode 100644 packages/google-cloud-retail/src/v2beta/serving_config_service_client_config.json create mode 100644 packages/google-cloud-retail/src/v2beta/serving_config_service_proto_list.json create mode 100644 packages/google-cloud-retail/test/gapic_control_service_v2beta.ts create mode 100644 packages/google-cloud-retail/test/gapic_serving_config_service_v2beta.ts diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/catalog_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/catalog_service.proto index 41523ac809d..ec7a23a8d66 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/catalog_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/catalog_service.proto @@ -91,10 +91,6 @@ service CatalogService { // (if branch is not explicitly set). // * UserEventService will only join events with products from branch // {newBranch}. - // - // This feature is only available for users who have Retail Search enabled. - // Please submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. rpc SetDefaultBranch(SetDefaultBranchRequest) returns (google.protobuf.Empty) { option (google.api.http) = { @@ -107,10 +103,6 @@ service CatalogService { // Get which branch is currently default branch set by // [CatalogService.SetDefaultBranch][google.cloud.retail.v2.CatalogService.SetDefaultBranch] // method under a specified parent catalog. - // - // This feature is only available for users who have Retail Search enabled. - // Please submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. rpc GetDefaultBranch(GetDefaultBranchRequest) returns (GetDefaultBranchResponse) { option (google.api.http) = { @@ -205,6 +197,10 @@ message SetDefaultBranchRequest { // // This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT // error is returned. + // + // If there are no sufficient active products in the targeted branch and + // [force][google.cloud.retail.v2.SetDefaultBranchRequest.force] is not set, a + // FAILED_PRECONDITION error is returned. string branch_id = 2 [ (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } ]; @@ -216,6 +212,11 @@ message SetDefaultBranchRequest { // This field must be a UTF-8 encoded string with a length limit of 1,000 // characters. Otherwise, an INVALID_ARGUMENT error is returned. string note = 3; + + // If set to true, it permits switching to a branch with + // [branch_id][google.cloud.retail.v2.SetDefaultBranchRequest.branch_id] even + // if it has no sufficient active products. + bool force = 4; } // Request message to show which branch is currently the default branch. diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/common.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/common.proto index 9f0e1fc16f1..733b8cca913 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/common.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/common.proto @@ -99,9 +99,8 @@ message CustomAttribute { // The textual values of this custom attribute. For example, `["yellow", // "green"]` when the key is "color". // - // At most 400 values are allowed. Empty values are not allowed. Each value - // must be a UTF-8 encoded string with a length limit of 256 characters. - // Otherwise, an INVALID_ARGUMENT error is returned. + // Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is + // returned. // // Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or // [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. @@ -111,15 +110,16 @@ message CustomAttribute { // The numerical values of this custom attribute. For example, `[2.3, 15.4]` // when the key is "lengths_cm". // - // At most 400 values are allowed.Otherwise, an INVALID_ARGUMENT error is - // returned. - // // Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or // [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set. // Otherwise, an INVALID_ARGUMENT error is returned. repeated double numbers = 2; - // If true, custom attribute values are searchable by text queries in + // This field will only be used when + // [AttributesConfig.attribute_config_level][] of the + // [Catalog][google.cloud.retail.v2.Catalog] is + // 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are + // searchable by text queries in // [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. // // This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. @@ -128,8 +128,11 @@ message CustomAttribute { // set. Otherwise, a INVALID_ARGUMENT error is returned. optional bool searchable = 3; - // If true, custom attribute values are indexed, so that it can be filtered, - // faceted or boosted in + // This field will only be used when + // [AttributesConfig.attribute_config_level][] of the + // [Catalog][google.cloud.retail.v2.Catalog] is + // 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are + // indexed, so that it can be filtered, faceted or boosted in // [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. // // This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent]. @@ -178,7 +181,10 @@ message FulfillmentInfo { repeated string place_ids = 2; } -// [Product][google.cloud.retail.v2.Product] thumbnail/detail image. +// [Product][google.cloud.retail.v2.Product] image. Recommendations AI and +// Retail Search do not use product images to improve prediction and search +// results. However, product images can be returned in results, and are shown in +// prediction or search previews in the console. message Image { // Required. URI of the image. // @@ -274,7 +280,7 @@ message PriceInfo { // // Google Merchant Center property // [price](https://support.google.com/merchants/answer/6324371). Schema.org - // property [Offer.priceSpecification](https://schema.org/priceSpecification). + // property [Offer.price](https://schema.org/price). float price = 2; // Price of the product without any discount. If zero, by default set to be @@ -364,19 +370,24 @@ message UserInfo { // Highly recommended for logged-in users. Unique identifier for logged-in // user, such as a user name. // + // Always use a hashed value for this ID. + // // The field must be a UTF-8 encoded string with a length limit of 128 // characters. Otherwise, an INVALID_ARGUMENT error is returned. string user_id = 1; - // The end user's IP address. Required for getting - // [SearchResponse.sponsored_results][google.cloud.retail.v2.SearchResponse.sponsored_results]. - // This field is used to extract location information for personalization. + // The end user's IP address. This field is used to extract location + // information for personalization. // // This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6 // address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an // INVALID_ARGUMENT error is returned. // - // This should not be set when using the JavaScript tag in + // This should not be set when: + // + // * setting + // [SearchRequest.user_info][google.cloud.retail.v2.SearchRequest.user_info]. + // * using the JavaScript tag in // [UserEventService.CollectUserEvent][google.cloud.retail.v2.UserEventService.CollectUserEvent] // or if // [direct_user_request][google.cloud.retail.v2.UserInfo.direct_user_request] @@ -409,16 +420,60 @@ message UserInfo { bool direct_user_request = 4; } -// Promotion information. -message Promotion { - // ID of the promotion. For example, "free gift". - // - // The value value must be a UTF-8 encoded string with a length limit of 128 - // characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, - // id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is - // returned. +// The inventory information at a place (e.g. a store) identified +// by a place ID. +message LocalInventory { + // The place ID for the current set of inventory information. + string place_id = 1; + + // Product price and cost information. // // Google Merchant Center property - // [promotion](https://support.google.com/merchants/answer/7050148). - string promotion_id = 1; + // [price](https://support.google.com/merchants/answer/6324371). + PriceInfo price_info = 2; + + // Additional local inventory attributes, for example, store name, promotion + // tags, etc. + // + // This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + // error is returned: + // + // * At most 30 attributes are allowed. + // * The key must be a UTF-8 encoded string with a length limit of 32 + // characters. + // * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, + // key0LikeThis or KEY_1_LIKE_THIS. + // * The attribute values must be of the same type (text or number). + // * Only 1 value is allowed for each attribute. + // * For text values, the length limit is 256 UTF-8 characters. + // * The attribute does not support search. The `searchable` field should be + // unset or set to false. + // * The max summed total bytes of custom attribute keys and values per + // product is 5MiB. + map attributes = 3; + + // Input only. Supported fulfillment types. Valid fulfillment type values + // include commonly used types (such as pickup in store and same day + // delivery), and custom types. Customers have to map custom types to their + // display names before rendering UI. + // + // Supported values: + // + // * "pickup-in-store" + // * "ship-to-store" + // * "same-day-delivery" + // * "next-day-delivery" + // * "custom-type-1" + // * "custom-type-2" + // * "custom-type-3" + // * "custom-type-4" + // * "custom-type-5" + // + // If this field is set to an invalid value other than these, an + // INVALID_ARGUMENT error is returned. + // + // All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is + // returned. + repeated string fulfillment_types = 4 + [(google.api.field_behavior) = INPUT_ONLY]; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/completion_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/completion_service.proto index f17db9fa311..5e7e9a6c713 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/completion_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/completion_service.proto @@ -36,8 +36,7 @@ option ruby_package = "Google::Cloud::Retail::V2"; // Auto-completion service for retail. // // This feature is only available for users who have Retail Search enabled. -// Please submit a form [here](https://cloud.google.com/contact) to contact -// cloud sales if you are interested in using Retail Search. +// Please 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) = @@ -46,8 +45,7 @@ service CompletionService { // Completes the specified prefix with keyword suggestions. // // This feature is only available for users who have Retail Search enabled. - // Please submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. + // Please enable Retail Search on Cloud Console before using this feature. rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) { option (google.api.http) = { get: "/v2/{catalog=projects/*/locations/*/catalogs/*}:completeQuery" @@ -56,11 +54,13 @@ service CompletionService { // Bulk import of processed completion dataset. // - // Request processing may be synchronous. Partial updating is not supported. + // 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 submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. + // Please enable Retail Search on Cloud Console before using this feature. rpc ImportCompletionData(ImportCompletionDataRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -90,22 +90,21 @@ message CompleteQueryRequest { // The maximum number of allowed characters is 255. string query = 2 [(google.api.field_behavior) = REQUIRED]; - // A unique identifier for tracking visitors. For example, this could be - // implemented with an HTTP cookie, which should be able to uniquely identify - // a visitor on a single device. This unique identifier should not change if - // the visitor logs in or out of the website. + // Required field. A unique identifier for tracking visitors. For example, + // this could be implemented with an HTTP cookie, which should be able to + // uniquely identify a visitor on a single device. This unique identifier + // should not change if the visitor logs in or out of the website. // // The field must be a UTF-8 encoded string with a length limit of 128 // characters. Otherwise, an INVALID_ARGUMENT error is returned. string visitor_id = 7; - // The list of languages of the query. This is - // the BCP-47 language code, such as "en-US" or "sr-Latn". - // For more information, see - // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - // - // The maximum number of allowed characters is 255. - // Only "en-US" is currently supported. + // The language filters applied to the output suggestions. If set, it should + // contain the language of the query. If not set, suggestions are returned + // without considering language restrictions. This is the BCP-47 language + // code, such as "en-US" or "sr-Latn". For more information, see [Tags for + // Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum + // number of language codes is 3. repeated string language_codes = 3; // The device type context for completion suggestions. @@ -154,7 +153,11 @@ message CompleteQueryResponse { // The suggestion for the query. string suggestion = 1; - // Additional custom attributes ingested through BigQuery. + // Custom attributes for the suggestion term. + // * For "user-data", the attributes are additional custom attributes + // ingested through BigQuery. + // * For "cloud-retail", the attributes are product attributes generated + // by Cloud Retail. map attributes = 2; } @@ -169,9 +172,9 @@ message CompleteQueryResponse { repeated CompletionResult completion_results = 1; // A unique complete token. This should be included in the - // [SearchRequest][google.cloud.retail.v2.SearchRequest] resulting from this - // completion, which enables accurate attribution of complete model - // performance. + // [UserEvent.completion_detail][google.cloud.retail.v2.UserEvent.completion_detail] + // for search events resulting from this completion, which enables accurate + // attribution of complete model performance. string attribution_token = 2; // Matched recent searches of this user. The maximum number of recent searches diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/import_config.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/import_config.proto index 770a93eadb6..74cec22a637 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/import_config.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/import_config.proto @@ -63,6 +63,14 @@ message GcsSource { // [UserEvent][google.cloud.retail.v2.UserEvent] per line. // * `user_event_ga360`: Using // https://support.google.com/analytics/answer/3437719. + // + // Supported values for control imports: + // + // * 'control' (default): One JSON [Control][] per line. + // + // Supported values for catalog attribute imports: + // + // * 'catalog_attribute' (default): One CSV [CatalogAttribute][] per line. string data_schema = 2; } @@ -111,8 +119,19 @@ message BigQuerySource { // // * `user_event` (default): One JSON // [UserEvent][google.cloud.retail.v2.UserEvent] per line. - // * `user_event_ga360`: Using + // * `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. + // The schema is available here: + // https://support.google.com/analytics/answer/7029846. + // + // Supported values for auto-completion imports: + // + // * `suggestions` (default): One JSON completion suggestion per line. + // * `denylist`: One JSON deny suggestion per line. + // * `allowlist`: One JSON allow suggestion per line. string data_schema = 4; } @@ -134,9 +153,9 @@ message UserEventInlineSource { message ImportErrorsConfig { // Required. Errors destination. oneof destination { - // Google Cloud Storage path for import errors. This must be an empty, - // existing Cloud Storage bucket. Import errors will be written to a file in - // this bucket, one per line, as a JSON-encoded + // Google Cloud Storage prefix for import errors. This must be an empty, + // existing Cloud Storage directory. Import errors will be written to + // sharded files in this directory, one per line, as a JSON-encoded // `google.rpc.Status` message. string gcs_prefix = 1; } @@ -156,16 +175,14 @@ 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 while using - // [BigQuerySource][google.cloud.retail.v2.BigQuerySource]. + // Can only be set while using + // [BigQuerySource][google.cloud.retail.v2.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. - // - // This feature is only available for users who have Retail Search enabled. - // Please submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. FULL = 2; } @@ -179,16 +196,8 @@ message ImportProductsRequest { (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } ]; - // Unique identifier provided by client, within the ancestor - // dataset scope. Ensures idempotency and used for request deduplication. - // Server-generated if unspecified. Up to 128 characters long and must match - // the pattern: `[a-zA-Z0-9_]+`. This is returned as [Operation.name][] in - // [ImportMetadata][google.cloud.retail.v2.ImportMetadata]. - // - // Only supported when - // [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode] - // is set to `FULL`. - string request_id = 6; + // Deprecated. This field has no effect. + string request_id = 6 [deprecated = true]; // Required. The desired input location of the data. ProductInputConfig input_config = 2 [(google.api.field_behavior) = REQUIRED]; @@ -326,9 +335,8 @@ message ImportMetadata { // Count of entries that encountered errors while processing. int64 failure_count = 4; - // Id of the request / operation. This is parroting back the requestId - // that was passed in the request. - string request_id = 5; + // Deprecated. This field is never set. + 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 diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/prediction_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/prediction_service.proto index da588a03c2a..061db1427b0 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/prediction_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/prediction_service.proto @@ -97,9 +97,12 @@ message PredictRequest { // * filterOutOfStockItems tag=(-"promotional") // * filterOutOfStockItems // - // If your filter blocks all prediction results, nothing will be returned. If - // you want generic (unfiltered) popular products to be returned instead, set - // `strictFiltering` to false in `PredictRequest.params`. + // 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. string filter = 5; // Use validate only mode for this prediction query. If set to true, a diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/product.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/product.proto index 3bec3b06cd1..ea861fb6cfb 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/product.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/product.proto @@ -19,6 +19,7 @@ package google.cloud.retail.v2; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/retail/v2/common.proto"; +import "google/cloud/retail/v2/promotion.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -119,7 +120,7 @@ message Product { // [publish_time][google.cloud.retail.v2.Product.publish_time], otherwise an // INVALID_ARGUMENT error is thrown. // - // Google Merchant Center property + // Corresponding properties: Google Merchant Center property // [expiration_date](https://support.google.com/merchants/answer/6324499). google.protobuf.Timestamp expire_time = 16; @@ -156,9 +157,9 @@ message Product { // This field must be a UTF-8 encoded string with a length limit of 128 // characters. Otherwise, an INVALID_ARGUMENT error is returned. // - // Google Merchant Center property + // Corresponding properties: Google Merchant Center property // [id](https://support.google.com/merchants/answer/6324405). Schema.org - // Property [Product.sku](https://schema.org/sku). + // property [Product.sku](https://schema.org/sku). string id = 2 [(google.api.field_behavior) = IMMUTABLE]; // Immutable. The type of the product. Default to @@ -180,21 +181,23 @@ message Product { // [Product][google.cloud.retail.v2.Product]. Otherwise, an INVALID_ARGUMENT // error is returned. // - // Google Merchant Center Property + // Corresponding properties: Google Merchant Center property // [item_group_id](https://support.google.com/merchants/answer/6324507). - // Schema.org Property + // Schema.org property // [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID). - // - // This field must be enabled before it can be used. [Learn - // more](/recommendations-ai/docs/catalog#item-group-id). string primary_product_id = 4; // The [id][google.cloud.retail.v2.Product.id] of the collection members when // [type][google.cloud.retail.v2.Product.type] is // [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]. // - // Should not set it for other types. A maximum of 1000 values are allowed. - // Otherwise, an INVALID_ARGUMENT error is return. + // Non-existent product ids are allowed. + // The [type][google.cloud.retail.v2.Product.type] of the members must be + // either [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] or + // [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] otherwise and + // 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; // The Global Trade Item Number (GTIN) of the product. @@ -205,13 +208,13 @@ message Product { // This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is // returned. // - // Google Merchant Center property + // Corresponding properties: Google Merchant Center property // [gtin](https://support.google.com/merchants/answer/6324461). // Schema.org property - // [Product.isbn](https://schema.org/isbn) or - // [Product.gtin8](https://schema.org/gtin8) or - // [Product.gtin12](https://schema.org/gtin12) or - // [Product.gtin13](https://schema.org/gtin13) or + // [Product.isbn](https://schema.org/isbn), + // [Product.gtin8](https://schema.org/gtin8), + // [Product.gtin12](https://schema.org/gtin12), + // [Product.gtin13](https://schema.org/gtin13), or // [Product.gtin14](https://schema.org/gtin14). // // If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned. @@ -245,7 +248,7 @@ message Product { // Each value must be a UTF-8 encoded string with a length limit of 5,000 // characters. Otherwise, an INVALID_ARGUMENT error is returned. // - // Google Merchant Center property + // Corresponding properties: Google Merchant Center property // [google_product_category][mc_google_product_category]. Schema.org property // [Product.category] (https://schema.org/category). // @@ -258,7 +261,7 @@ message Product { // This field must be a UTF-8 encoded string with a length limit of 1,000 // characters. Otherwise, an INVALID_ARGUMENT error is returned. // - // Google Merchant Center property + // Corresponding properties: Google Merchant Center property // [title](https://support.google.com/merchants/answer/6324415). Schema.org // property [Product.name](https://schema.org/name). string title = 8 [(google.api.field_behavior) = REQUIRED]; @@ -269,7 +272,7 @@ message Product { // string with a length limit of 1,000 characters. Otherwise, an // INVALID_ARGUMENT error is returned. // - // Google Merchant Center property + // Corresponding properties: Google Merchant Center property // [brand](https://support.google.com/merchants/answer/6324351). Schema.org // property [Product.brand](https://schema.org/brand). repeated string brands = 9; @@ -279,13 +282,13 @@ message Product { // This field must be a UTF-8 encoded string with a length limit of 5,000 // characters. Otherwise, an INVALID_ARGUMENT error is returned. // - // Google Merchant Center property + // Corresponding properties: Google Merchant Center property // [description](https://support.google.com/merchants/answer/6324468). - // schema.org property [Product.description](https://schema.org/description). + // Schema.org property [Product.description](https://schema.org/description). string description = 10; // Language of the title/description and other string attributes. Use language - // tags defined by [BCP 47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt]. + // tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). // // For product prediction, this field is ignored and the model automatically // detects the text language. The [Product][google.cloud.retail.v2.Product] @@ -319,7 +322,12 @@ message Product { // * The key must be a UTF-8 encoded string with a length limit of 128 // characters. // * For indexable attribute, the key must match the pattern: - // `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, key0LikeThis or KEY_1_LIKE_THIS. + // `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or + // `KEY_1_LIKE_THIS`. + // * For text attributes, at most 400 values are allowed. Empty values are not + // allowed. Each value must be a non-empty UTF-8 encoded string with a + // length limit of 256 characters. + // * For number attributes, at most 400 values are allowed. map attributes = 12; // Custom tags associated with the product. @@ -333,13 +341,13 @@ message Product { // tag as part of the // [PredictRequest.filter][google.cloud.retail.v2.PredictRequest.filter]. // - // Google Merchant Center property + // Corresponding properties: Google Merchant Center property // [custom_label_0–4](https://support.google.com/merchants/answer/6324473). repeated string tags = 13; // Product price and cost information. // - // Google Merchant Center property + // Corresponding properties: Google Merchant Center property // [price](https://support.google.com/merchants/answer/6324371). PriceInfo price_info = 14; @@ -355,9 +363,9 @@ message Product { // Default to // [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK]. // - // Google Merchant Center Property + // Corresponding properties: Google Merchant Center property // [availability](https://support.google.com/merchants/answer/6324448). - // Schema.org Property [Offer.availability](https://schema.org/availability). + // Schema.org property [Offer.availability](https://schema.org/availability). Availability availability = 19; // The available quantity of the item. @@ -379,17 +387,17 @@ message Product { // This field must be a UTF-8 encoded string with a length limit of 5,000 // characters. Otherwise, an INVALID_ARGUMENT error is returned. // - // Google Merchant Center property + // Corresponding properties: Google Merchant Center property // [link](https://support.google.com/merchants/answer/6324416). Schema.org // property [Offer.url](https://schema.org/url). string uri = 22; - // Product images for the product.Highly recommended to put the main image - // to the first. + // Product images for the product. We highly recommend putting the main + // image first. // // A maximum of 300 images are allowed. // - // Google Merchant Center property + // Corresponding properties: Google Merchant Center property // [image_link](https://support.google.com/merchants/answer/6324350). // Schema.org property [Product.image](https://schema.org/image). repeated Image images = 23; @@ -400,7 +408,7 @@ message Product { // The color of the product. // - // Google Merchant Center property + // Corresponding properties: Google Merchant Center property // [color](https://support.google.com/merchants/answer/6324487). Schema.org // property [Product.color](https://schema.org/color). ColorInfo color_info = 25; @@ -418,9 +426,9 @@ message Product { // encoded string with a length limit of 128 characters. Otherwise, an // INVALID_ARGUMENT error is returned. // - // Google Merchant Center property + // Corresponding properties: Google Merchant Center property // [size](https://support.google.com/merchants/answer/6324492), - // [size_type](https://support.google.com/merchants/answer/6324497) and + // [size_type](https://support.google.com/merchants/answer/6324497), and // [size_system](https://support.google.com/merchants/answer/6324502). // Schema.org property [Product.size](https://schema.org/size). repeated string sizes = 26; @@ -428,10 +436,10 @@ message Product { // The material of the product. For example, "leather", "wooden". // // A maximum of 20 values are allowed. Each value must be a UTF-8 encoded - // string with a length limit of 128 characters. Otherwise, an + // string with a length limit of 200 characters. Otherwise, an // INVALID_ARGUMENT error is returned. // - // Google Merchant Center property + // Corresponding properties: Google Merchant Center property // [material](https://support.google.com/merchants/answer/6324410). Schema.org // property [Product.material](https://schema.org/material). repeated string materials = 27; @@ -444,7 +452,7 @@ message Product { // encoded string with a length limit of 128 characters. Otherwise, an // INVALID_ARGUMENT error is returned. // - // Google Merchant Center property + // Corresponding properties: Google Merchant Center property // [pattern](https://support.google.com/merchants/answer/6324483). Schema.org // property [Product.pattern](https://schema.org/pattern). repeated string patterns = 28; @@ -452,19 +460,21 @@ message Product { // The condition of the product. Strongly encouraged to use the standard // values: "new", "refurbished", "used". // - // A maximum of 5 values are allowed per + // A maximum of 1 value is allowed per // [Product][google.cloud.retail.v2.Product]. Each value must be a UTF-8 // encoded string with a length limit of 128 characters. Otherwise, an // INVALID_ARGUMENT error is returned. // - // Google Merchant Center property + // Corresponding properties: Google Merchant Center property // [condition](https://support.google.com/merchants/answer/6324469). // Schema.org property // [Offer.itemCondition](https://schema.org/itemCondition). repeated string conditions = 29; // The promotions applied to the product. A maximum of 10 values are allowed - // per [Product][google.cloud.retail.v2.Product]. + // per [Product][google.cloud.retail.v2.Product]. Only + // [Promotion.promotion_id][google.cloud.retail.v2.Promotion.promotion_id] + // will be used, other fields will be ignored if set. repeated Promotion promotions = 34; // The timestamp when the product is published by the retailer for the first diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/product_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/product_service.proto index ca157d896d5..7131983460d 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/product_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/product_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/resource.proto"; +import "google/cloud/retail/v2/common.proto"; import "google/cloud/retail/v2/import_config.proto"; import "google/cloud/retail/v2/product.proto"; import "google/longrunning/operations.proto"; @@ -132,7 +133,8 @@ service ProductService { // [CreateProductRequest.product][google.cloud.retail.v2.CreateProductRequest.product], // then any pre-existing inventory information for this product will be used. // - // If no inventory fields are set in [UpdateProductRequest.set_mask][], + // If no inventory fields are set in + // [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask], // then any existing inventory information will be preserved. // // Pre-existing inventory information can only be updated with @@ -142,8 +144,7 @@ service ProductService { // [RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]. // // This feature is only available for users who have Retail Search enabled. - // Please submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. + // Please enable Retail Search on Cloud Console before using this feature. rpc SetInventory(SetInventoryRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v2/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory" @@ -169,8 +170,7 @@ service ProductService { // [ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. // // This feature is only available for users who have Retail Search enabled. - // Please submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. + // Please enable Retail Search on Cloud Console before using this feature. rpc AddFulfillmentPlaces(AddFulfillmentPlacesRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -197,8 +197,7 @@ service ProductService { // [ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. // // This feature is only available for users who have Retail Search enabled. - // Please submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. + // Please enable Retail Search on Cloud Console before using this feature. rpc RemoveFulfillmentPlaces(RemoveFulfillmentPlacesRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -211,6 +210,70 @@ service ProductService { metadata_type: "google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata" }; } + + // Updates local inventory information for a + // [Product][google.cloud.retail.v2.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.v2.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.v2.Product] queried by + // [GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or + // [ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + // + // Local inventory information can only be modified using this method. + // [CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and + // [UpdateProduct][google.cloud.retail.v2.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. + rpc AddLocalInventories(AddLocalInventoriesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addLocalInventories" + body: "*" + }; + option (google.api.method_signature) = "product"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2.AddLocalInventoriesResponse" + metadata_type: "google.cloud.retail.v2.AddLocalInventoriesMetadata" + }; + } + + // Remove local inventory information for a + // [Product][google.cloud.retail.v2.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.v2.Product] queried by + // [GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or + // [ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + // + // Local inventory information can only be removed using this method. + // [CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and + // [UpdateProduct][google.cloud.retail.v2.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. + rpc RemoveLocalInventories(RemoveLocalInventoriesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeLocalInventories" + body: "*" + }; + option (google.api.method_signature) = "product"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2.RemoveLocalInventoriesResponse" + metadata_type: "google.cloud.retail.v2.RemoveLocalInventoriesMetadata" + }; + } } // Request message for [CreateProduct][] method. @@ -448,6 +511,24 @@ message SetInventoryRequest { // provided or default value for // [SetInventoryRequest.set_time][google.cloud.retail.v2.SetInventoryRequest.set_time]. // + // The caller can replace place IDs for a subset of fulfillment types in the + // following ways: + // + // * Adds "fulfillment_info" in + // [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] + // * Specifies only the desired fulfillment types and corresponding place IDs + // to update in [SetInventoryRequest.inventory.fulfillment_info][] + // + // The caller can clear all place IDs from a subset of fulfillment types in + // the following ways: + // + // * Adds "fulfillment_info" in + // [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask] + // * Specifies only the desired fulfillment types to clear in + // [SetInventoryRequest.inventory.fulfillment_info][] + // * Checks that only the desired fulfillment info types have empty + // [SetInventoryRequest.inventory.fulfillment_info.place_ids][] + // // The last update time is recorded for the following inventory fields: // * [Product.price_info][google.cloud.retail.v2.Product.price_info] // * [Product.availability][google.cloud.retail.v2.Product.availability] @@ -459,8 +540,9 @@ message SetInventoryRequest { Product inventory = 1 [(google.api.field_behavior) = REQUIRED]; // Indicates which inventory fields in the provided - // [Product][google.cloud.retail.v2.Product] to update. If not set or set with - // empty paths, all inventory fields will be updated. + // [Product][google.cloud.retail.v2.Product] to update. + // + // At least one field must be provided. // // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error // is returned and the entire update will be ignored. @@ -566,6 +648,108 @@ message AddFulfillmentPlacesMetadata {} // method. message AddFulfillmentPlacesResponse {} +// Request message for [AddLocalInventories][] method. +message AddLocalInventoriesRequest { + // Required. Full resource name of [Product][google.cloud.retail.v2.Product], + // such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + // + // If the caller does not have permission to access the + // [Product][google.cloud.retail.v2.Product], regardless of whether or not it + // exists, a PERMISSION_DENIED error is returned. + string product = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; + + // Required. A list of inventory information at difference places. Each place + // is identified by its place ID. At most 3000 inventories are allowed per + // request. + repeated LocalInventory local_inventories = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Indicates which inventory fields in the provided list of + // [LocalInventory][google.cloud.retail.v2.LocalInventory] to update. The + // field is updated to the provided value. + // + // If a field is set while the place does not have a previous local inventory, + // the local inventory at that store is created. + // + // If a field is set while the value of that field is not provided, the + // original field value, if it exists, is deleted. + // + // If the mask is not set or set with empty paths, all inventory fields will + // be updated. + // + // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + // is returned and the entire update will be ignored. + google.protobuf.FieldMask add_mask = 4; + + // The time when the inventory updates are issued. Used to prevent + // out-of-order updates on local inventory fields. If not provided, the + // internal system time will be used. + google.protobuf.Timestamp add_time = 5; + + // If set to true, and the [Product][google.cloud.retail.v2.Product] is not + // found, the local inventory will still be processed and retained for at most + // 1 day and processed once the [Product][google.cloud.retail.v2.Product] is + // created. If set to false, a NOT_FOUND error is returned if the + // [Product][google.cloud.retail.v2.Product] is not found. + bool allow_missing = 6; +} + +// Metadata related to the progress of the AddLocalInventories operation. +// Currently empty because there is no meaningful metadata populated from the +// [AddLocalInventories][] method. +message AddLocalInventoriesMetadata {} + +// Response of the [AddLocalInventories][] API. Currently empty because +// there is no meaningful response populated from the [AddLocalInventories][] +// method. +message AddLocalInventoriesResponse {} + +// Request message for [RemoveLocalInventories][] method. +message RemoveLocalInventoriesRequest { + // Required. Full resource name of [Product][google.cloud.retail.v2.Product], + // such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + // + // If the caller does not have permission to access the + // [Product][google.cloud.retail.v2.Product], regardless of whether or not it + // exists, a PERMISSION_DENIED error is returned. + string product = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; + + // Required. A list of place IDs to have their inventory deleted. + // At most 3000 place IDs are allowed per request. + repeated string place_ids = 2 [(google.api.field_behavior) = REQUIRED]; + + // The time when the inventory deletions are issued. Used to prevent + // out-of-order updates and deletions on local inventory fields. If not + // provided, the internal system time will be used. + google.protobuf.Timestamp remove_time = 5; + + // If set to true, and the [Product][google.cloud.retail.v2.Product] is not + // found, the local inventory removal request will still be processed and + // retained for at most 1 day and processed once the + // [Product][google.cloud.retail.v2.Product] is created. If set to false, a + // NOT_FOUND error is returned if the + // [Product][google.cloud.retail.v2.Product] is not found. + bool allow_missing = 3; +} + +// Metadata related to the progress of the RemoveLocalInventories operation. +// Currently empty because there is no meaningful metadata populated from the +// [RemoveLocalInventories][] method. +message RemoveLocalInventoriesMetadata {} + +// Response of the [RemoveLocalInventories][] API. Currently empty because +// there is no meaningful response populated from the [RemoveLocalInventories][] +// method. +message RemoveLocalInventoriesResponse {} + // Request message for [RemoveFulfillmentPlaces][] method. message RemoveFulfillmentPlacesRequest { // Required. Full resource name of [Product][google.cloud.retail.v2.Product], diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/promotion.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/promotion.proto new file mode 100644 index 00000000000..9ba323475f2 --- /dev/null +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/promotion.proto @@ -0,0 +1,40 @@ +// Copyright 2021 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.retail.v2; + +option csharp_namespace = "Google.Cloud.Retail.V2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2;retail"; +option java_multiple_files = true; +option java_outer_classname = "PromotionProto"; +option java_package = "com.google.cloud.retail.v2"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2"; +option ruby_package = "Google::Cloud::Retail::V2"; + +// Promotion information. +message Promotion { + // ID of the promotion. For example, "free gift". + // + // The value must be a UTF-8 encoded string with a length limit of 128 + // characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, + // id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is + // returned. + // + // Google Merchant Center property + // [promotion](https://support.google.com/merchants/answer/7050148). + string promotion_id = 1; +} diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/purge_config.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/purge_config.proto index b87d3177436..6c8d54c7e06 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/purge_config.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/purge_config.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.retail.v2; import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; option csharp_namespace = "Google.Cloud.Retail.V2"; option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2;retail"; diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/search_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/search_service.proto index 8bd231332f8..ec8750ae30a 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/search_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/search_service.proto @@ -37,8 +37,7 @@ option ruby_package = "Google::Cloud::Retail::V2"; // Service for search. // // This feature is only available for users who have Retail Search enabled. -// Please submit a form [here](https://cloud.google.com/contact) to contact -// cloud sales if you are interested in using Retail Search. +// Please 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) = @@ -47,8 +46,7 @@ service SearchService { // Performs a search. // // This feature is only available for users who have Retail Search enabled. - // Please submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. + // Please enable Retail Search on Cloud Console before using this feature. rpc Search(SearchRequest) returns (SearchResponse) { option (google.api.http) = { post: "/v2/{placement=projects/*/locations/*/catalogs/*/placements/*}:search" @@ -103,6 +101,7 @@ message SearchRequest { // * "ratingCount" // * "attributes.key" // * "inventory(place_id,price)" + // * "inventory(place_id,original_price)" // * "inventory(place_id,attributes.key)" string key = 1 [(google.api.field_behavior) = REQUIRED]; @@ -320,6 +319,14 @@ message SearchRequest { // applied and combined in a non-linear way. Maximum number of // specifications is 10. repeated ConditionBoostSpec condition_boost_specs = 1; + + // Whether to skip boostspec validation. If this field is set to true, + // invalid + // [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] + // will be ignored and valid + // [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] + // will still be applied. + optional bool skip_boost_spec_validation = 2; } // Specification to determine under which conditions query expansion should @@ -350,6 +357,26 @@ message SearchRequest { bool pin_unexpanded_results = 2; } + // The specification for personalization. + message PersonalizationSpec { + // The personalization mode of each search request. + enum Mode { + // Default value. Defaults to + // [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. + MODE_UNSPECIFIED = 0; + + // Let CRS decide whether to use personalization. + AUTO = 1; + + // Disable personalization. + DISABLED = 2; + } + + // Defaults to + // [Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. + Mode mode = 1; + } + // The search mode of each search request. enum SearchMode { // Default value. In this case both product search and faceted search will @@ -380,7 +407,7 @@ message SearchRequest { } // Required. The resource name of the search engine placement, such as - // `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. + // `projects/*/locations/global/catalogs/default_catalog/placements/default_search` // This field is used to identify the serving configuration name and the set // of models that will be used to make the search. string placement = 1 [(google.api.field_behavior) = REQUIRED]; @@ -402,6 +429,9 @@ message SearchRequest { // identify a visitor on a single device. This unique identifier should not // change if the visitor logs in or out of the website. // + // This should be the same identifier as + // [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id]. + // // The field must be a UTF-8 encoded string with a length limit of 128 // characters. Otherwise, an INVALID_ARGUMENT error is returned. string visitor_id = 4 [(google.api.field_behavior) = REQUIRED]; @@ -445,6 +475,9 @@ message SearchRequest { // If this field is unrecognizable, an INVALID_ARGUMENT is returned. string filter = 10; + // The default filter that is applied when a user performs a search without + // checking any filters on the search page. + // // The filter applied to every search request when quality improvement such as // query expansion is needed. For example, if a query does not have enough // results, an expanded query with @@ -471,12 +504,12 @@ message SearchRequest { // is returned. repeated FacetSpec facet_specs = 12; + // Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic + // to enable dynamic facets. Do not set this field. + // // The specification for dynamically generated facets. Notice that only // textual facets can be dynamically generated. - // - // This feature requires additional allowlisting. Contact Retail Search - // support team if you are interested in using dynamic facet feature. - DynamicFacetSpec dynamic_facet_spec = 21; + DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; // Boost specification to boost certain products. See more details at this // [user guide](https://cloud.google.com/retail/docs/boosting). @@ -495,12 +528,15 @@ message SearchRequest { // The keys to fetch and rollup the matching // [variant][google.cloud.retail.v2.Product.Type.VARIANT] - // [Product][google.cloud.retail.v2.Product]s attributes. The attributes from - // all the matching [variant][google.cloud.retail.v2.Product.Type.VARIANT] - // [Product][google.cloud.retail.v2.Product]s are merged and de-duplicated. - // Notice that rollup [variant][google.cloud.retail.v2.Product.Type.VARIANT] - // [Product][google.cloud.retail.v2.Product]s attributes will lead to extra - // query latency. Maximum number of keys is 10. + // [Product][google.cloud.retail.v2.Product]s attributes, + // [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo] or + // [LocalInventory][google.cloud.retail.v2.LocalInventory]s attributes. The + // attributes from all the matching + // [variant][google.cloud.retail.v2.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2.Product]s or + // [LocalInventory][google.cloud.retail.v2.LocalInventory]s are merged and + // de-duplicated. Notice that rollup attributes will lead to extra query + // latency. Maximum number of keys is 30. // // For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], a // fulfillment type and a fulfillment ID must be provided in the format of @@ -515,6 +551,7 @@ message SearchRequest { // * discount // * variantId // * inventory(place_id,price) + // * inventory(place_id,original_price) // * inventory(place_id,attributes.key), where key is any key in the // [Product.inventories.attributes][] map. // * attributes.key, where key is any key in the @@ -577,6 +614,9 @@ message SearchRequest { // The search mode of the search request. If not specified, a single search // request triggers both product search and faceted search. SearchMode search_mode = 31; + + // The specification for personalization. + PersonalizationSpec personalization_spec = 32; } // Response message for @@ -733,4 +773,14 @@ message SearchResponse { // [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] // will be set in the response. string redirect_uri = 10; + + // The fully qualified resource name of applied + // [controls](https://cloud.google.com/retail/docs/serving-control-rules). + repeated string applied_controls = 12; + + // The invalid + // [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] + // that are not applied during serving. + repeated SearchRequest.BoostSpec.ConditionBoostSpec + invalid_condition_boost_specs = 14; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/user_event.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/user_event.proto index c0023cf2d03..8e21f8aa0cb 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/user_event.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/user_event.proto @@ -39,7 +39,6 @@ message UserEvent { // * `add-to-cart`: Products being added to cart. // * `category-page-view`: Special pages such as sale or promotion pages // viewed. - // * `completion`: Completion query result showed/clicked. // * `detail-page-view`: Products detail page viewed. // * `home-page-view`: Homepage viewed. // * `promotion-offered`: Promotion is offered to a user. @@ -117,6 +116,7 @@ message UserEvent { // * `add-to-cart` // * `detail-page-view` // * `purchase-complete` + // * `search` // // In a `search` event, this field represents the products returned to the end // user on the current page (the end user may have not finished browsing the @@ -127,22 +127,35 @@ message UserEvent { // desired. The end user may have not finished browsing the whole page yet. repeated ProductDetail product_details = 6; - // The main completion details related to the event. + // The main auto-completion details related to the event. // - // In a `completion` event, this field represents the completions returned to - // the end user and the clicked completion by the end user. In a `search` - // event, it represents the search event happens after clicking completion. + // This field should be set for `search` event when autocomplete function is + // enabled and the user clicks a suggestion for search. CompletionDetail completion_detail = 22; // Extra user event features to include in the recommendation model. // - // The key must be a UTF-8 encoded string with a length limit of 5,000 - // characters. Otherwise, an INVALID_ARGUMENT error is returned. - // - // For product recommendation, an example of extra user information is - // traffic_channel, i.e. how user arrives at the site. Users can arrive - // at the site by coming to the site directly, or coming through Google - // search, and etc. + // If you provide custom attributes for ingested user events, also include + // them in the user events that you associate with prediction requests. Custom + // attribute formatting must be consistent between imported events and events + // provided with prediction requests. This lets the Retail API use + // those custom attributes when training models and serving predictions, which + // helps improve recommendation quality. + // + // This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + // error is returned: + // + // * The key must be a UTF-8 encoded string with a length limit of 5,000 + // characters. + // * For text attributes, at most 400 values are allowed. Empty values are not + // allowed. Each value must be a UTF-8 encoded string with a length limit of + // 256 characters. + // * For number attributes, at most 400 values are allowed. + // + // For product recommendations, an example of extra user information is + // traffic_channel, which is how a user arrives at the site. Users can arrive + // at the site by coming to the site directly, coming through Google + // search, or in other ways. map attributes = 7; // The ID or name of the associated shopping cart. This ID is used diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/user_event_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/user_event_service.proto index 2d48a511d8c..4446906a21a 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/user_event_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/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/v2/import_config.proto"; import "google/cloud/retail/v2/purge_config.proto"; import "google/cloud/retail/v2/user_event.proto"; @@ -94,13 +95,14 @@ service UserEventService { }; } - // Triggers a user event rejoin operation with latest product catalog. Events + // 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 API can be used to trigger a 'join' operation on specified + // 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 wrong product catalog. + // 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) = { diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/catalog.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/catalog.proto index ffec074fe4d..e6d768f5f56 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/catalog.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/catalog.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.cloud.retail.v2beta; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/retail/v2beta/common.proto"; @@ -85,6 +84,285 @@ message ProductLevelConfig { string merchant_center_product_id_field = 2; } +// Catalog level attribute config for an attribute. For example, if customers +// want to enable/disable facet for a specific attribute. +message CatalogAttribute { + // The type of an attribute. + enum AttributeType { + // The type of the attribute is unknown. + // + // Used when type cannot be derived from attribute that is not + // [in_use][google.cloud.retail.v2beta.CatalogAttribute.in_use]. + UNKNOWN = 0; + + // Textual attribute. + TEXTUAL = 1; + + // Numerical attribute. + NUMERICAL = 2; + } + + // The status of the indexable option of a catalog attribute. + enum IndexableOption { + // Value used when unset. Defaults to + // [INDEXABLE_ENABLED][google.cloud.retail.v2beta.CatalogAttribute.IndexableOption.INDEXABLE_ENABLED]. + INDEXABLE_OPTION_UNSPECIFIED = 0; + + // Indexable option enabled for an attribute. + INDEXABLE_ENABLED = 1; + + // Indexable option disabled for an attribute. + INDEXABLE_DISABLED = 2; + } + + // 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.v2beta.CatalogAttribute.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED]. + DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0; + + // Dynamic facetable option enabled for an attribute. + DYNAMIC_FACETABLE_ENABLED = 1; + + // Dynamic facetable option disabled for an attribute. + DYNAMIC_FACETABLE_DISABLED = 2; + } + + // The status of the searchable option of a catalog attribute. + enum SearchableOption { + // Value used when unset. Defaults to + // [SEARCHABLE_DISABLED][google.cloud.retail.v2beta.CatalogAttribute.SearchableOption.SEARCHABLE_DISABLED]. + SEARCHABLE_OPTION_UNSPECIFIED = 0; + + // Searchable option enabled for an attribute. + SEARCHABLE_ENABLED = 1; + + // Searchable option disabled for an attribute. + SEARCHABLE_DISABLED = 2; + } + + // Required. Attribute name. + // For example: `color`, `brands`, `attributes.custom_attribute`, such as + // `attributes.xyz`. + string key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Indicates whether this attribute has been used by any + // products. `True` if at least one + // [Product][google.cloud.retail.v2beta.Product] is using this attribute in + // [Product.attributes][google.cloud.retail.v2beta.Product.attributes]. + // Otherwise, this field is `False`. + // + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] can be + // pre-loaded by using [AddCatalogAttribute][], [ImportCatalogAttributes][], + // or [UpdateAttributesConfig][] APIs. This field is `False` for pre-loaded + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s. + // + // Only [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s that + // are not in use by products can be deleted. + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s that are + // in use by products 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]; + + // Output only. The type of this attribute. This is derived from the attribute + // in [Product.attributes][google.cloud.retail.v2beta.Product.attributes]. + AttributeType type = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // When + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level] + // 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.v2beta.SearchService.Search]. + 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.v2beta.CatalogAttribute.indexable_option] + // is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned. + DynamicFacetableOption dynamic_facetable_option = 6; + + // When + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level] + // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values + // are searchable by text queries in + // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]. + // + // If SEARCHABLE_ENABLED but attribute type is numerical, attribute values + // will not be searchable by text queries in + // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], as + // there are no text values associated to numerical attributes. + SearchableOption searchable_option = 7; +} + +// Catalog level attribute config. +message AttributesConfig { + option (google.api.resource) = { + type: "retail.googleapis.com/AttributesConfig" + pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig" + }; + + // Required. Immutable. The fully qualified resource name of the attribute + // config. Format: "projects/*/locations/*/catalogs/*/attributesConfig" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Enable attribute(s) config at catalog level. + // For example, indexable, dynamic_facetable, or searchable for each + // attribute. + // + // The key is catalog attribute's name. + // For example: `color`, `brands`, `attributes.custom_attribute`, such as + // `attributes.xyz`. + // + // The maximum number of catalog attributes allowed in a request is 1000. + map catalog_attributes = 2; + + // Output only. The + // [AttributeConfigLevel][google.cloud.retail.v2beta.AttributeConfigLevel] + // used for this catalog. + AttributeConfigLevel attribute_config_level = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Catalog level autocomplete config for customers to customize autocomplete +// feature's settings. +message CompletionConfig { + option (google.api.resource) = { + type: "retail.googleapis.com/CompletionConfig" + pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig" + }; + + // Required. Immutable. Fully qualified name + // projects/*/locations/*/catalogs/*/completionConfig + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Specifies the matching order for autocomplete suggestions, e.g., a query + // consisting of 'sh' with 'out-of-order' specified would suggest "women's + // shoes", whereas a query of 'red s' with 'exact-prefix' specified would + // suggest "red shoes". Currently supported values: + // + // * 'out-of-order' + // * 'exact-prefix' + // + // Default value: 'exact-prefix'. + string matching_order = 2; + + // The maximum number of autocomplete suggestions returned per term. The + // maximum allowed max suggestions is 20. Default value is 20. If left unset + // or set to 0, then will fallback to default value. + int32 max_suggestions = 3; + + // The minimum number of characters needed to be typed in order to get + // suggestions. Default value is 2. If left unset or set to 0, then will + // fallback to default value. + int32 min_prefix_length = 4; + + // If set to true, the auto learning function is enabled. Auto learning uses + // user data to generate suggestions using ML techniques. Default value is + // false. Only after enabling auto learning can users use `cloud-retail` + // data in + // [CompleteQueryRequest][google.cloud.retail.v2beta.CompleteQueryRequest]. + bool auto_learning = 11; + + // Output only. The input config for the import of the source data that + // contains the autocomplete phrases uploaded by the customer. + CompletionDataInputConfig suggestions_input_config = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the LRO corresponding to the latest suggestion terms + // list import. + // + // Can use [GetOperation][google.longrunning.Operations.GetOperation] API to + // retrieve the latest state of the Long Running Operation. + string last_suggestions_import_operation = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The input config for the import of the source data that + // contains the / autocomplete denylist phrases uploaded by the customer. + CompletionDataInputConfig denylist_input_config = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. LRO corresponding to the latest denylist import. + // + // Can use [GetOperation][google.longrunning.Operations.GetOperation] API to + // retrieve the latest state of the Long Running Operation. + string last_denylist_import_operation = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The input config for the import of the source data that + // contains the autocomplete allowlist phrases uploaded by the customer. + CompletionDataInputConfig allowlist_input_config = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. LRO corresponding to the latest allowlist import. + // + // Can use [GetOperation][google.longrunning.Operations.GetOperation] API to + // retrieve the latest state of the Long Running Operation. + string last_allowlist_import_operation = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents a link between a Merchant Center account and a branch. +// Once a link is established, products from the linked merchant center account +// will be streamed to the linked branch. +message MerchantCenterLink { + // Required. The linked [Merchant center account + // 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 + // 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. + 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 allowed string values: + // "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory + // _ads", "Free_listings", "Free_local_listings" + // NOTE: The string values are case sensitive. + repeated string destinations = 3; + + // Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2 + // code. List of values can be found + // [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry) + // under the `region` tag. If left blank no region filtering will be + // performed. + // + // Example value: `US`. + string region_code = 4; + + // Language of the title/description and other string attributes. Use language + // tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + // ISO 639-1. + // + // This specifies the language of offers in Merchant Center that will be + // accepted. If empty no language filtering will be performed. + // + // Example value: `en`. + string language_code = 5; +} + +// Configures Merchant Center linking. +// Links contained in the config will be used to sync data from a Merchant +// Center account to a Cloud Retail branch. +message MerchantCenterLinkingConfig { + // Links between Merchant Center accounts and branches. + repeated MerchantCenterLink links = 1; +} + // The catalog configuration. message Catalog { option (google.api.resource) = { @@ -110,4 +388,10 @@ message Catalog { // Required. The product level configuration. ProductLevelConfig product_level_config = 4 [(google.api.field_behavior) = REQUIRED]; + + // The Merchant Center linking configuration. + // Once a link is added, the data stream from Merchant Center to Cloud Retail + // will be enabled automatically. The requester must have access to the + // merchant center account in order to make changes to this field. + MerchantCenterLinkingConfig merchant_center_linking_config = 6; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/catalog_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/catalog_service.proto index 5f2892858e8..7e27c916b1e 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/catalog_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/catalog_service.proto @@ -21,8 +21,6 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/retail/v2beta/catalog.proto"; -import "google/cloud/retail/v2beta/import_config.proto"; -import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -93,10 +91,6 @@ service CatalogService { // (if branch is not explicitly set). // * UserEventService will only join events with products from branch // {newBranch}. - // - // This feature is only available for users who have Retail Search enabled. - // Please submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. rpc SetDefaultBranch(SetDefaultBranchRequest) returns (google.protobuf.Empty) { option (google.api.http) = { @@ -109,10 +103,6 @@ service CatalogService { // Get which branch is currently default branch set by // [CatalogService.SetDefaultBranch][google.cloud.retail.v2beta.CatalogService.SetDefaultBranch] // method under a specified parent catalog. - // - // This feature is only available for users who have Retail Search enabled. - // Please submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. rpc GetDefaultBranch(GetDefaultBranchRequest) returns (GetDefaultBranchResponse) { option (google.api.http) = { @@ -120,6 +110,97 @@ service CatalogService { }; option (google.api.method_signature) = "catalog"; } + + // Gets a [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]. + rpc GetCompletionConfig(GetCompletionConfigRequest) + returns (CompletionConfig) { + option (google.api.http) = { + get: "/v2beta/{name=projects/*/locations/*/catalogs/*/completionConfig}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the + // [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]s. + rpc UpdateCompletionConfig(UpdateCompletionConfigRequest) + returns (CompletionConfig) { + option (google.api.http) = { + patch: "/v2beta/{completion_config.name=projects/*/locations/*/catalogs/*/completionConfig}" + body: "completion_config" + }; + option (google.api.method_signature) = "completion_config,update_mask"; + } + + // Gets an [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. + rpc GetAttributesConfig(GetAttributesConfigRequest) + returns (AttributesConfig) { + option (google.api.http) = { + get: "/v2beta/{name=projects/*/locations/*/catalogs/*/attributesConfig}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the + // [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. + // + // The catalog attributes in the request will be updated in the catalog, or + // inserted if they do not exist. Existing catalog attributes not included in + // the request will remain unchanged. Attributes that are assigned to + // products, but do not exist at the catalog level, are always included in the + // response. The product attribute is assigned default values for missing + // catalog attribute fields, e.g., searchable and dynamic facetable options. + rpc UpdateAttributesConfig(UpdateAttributesConfigRequest) + returns (AttributesConfig) { + option (google.api.http) = { + patch: "/v2beta/{attributes_config.name=projects/*/locations/*/catalogs/*/attributesConfig}" + body: "attributes_config" + }; + option (google.api.method_signature) = "attributes_config,update_mask"; + } + + // Adds the specified + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to the + // [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. + // + // If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to + // add already exists, an ALREADY_EXISTS error is returned. + rpc AddCatalogAttribute(AddCatalogAttributeRequest) + returns (AttributesConfig) { + option (google.api.http) = { + post: "/v2beta/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:addCatalogAttribute" + body: "*" + }; + } + + // Removes the specified + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] from the + // [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. + // + // If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to + // remove does not exist, a NOT_FOUND error is returned. + rpc RemoveCatalogAttribute(RemoveCatalogAttributeRequest) + returns (AttributesConfig) { + option (google.api.http) = { + post: "/v2beta/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:removeCatalogAttribute" + body: "*" + }; + } + + // Replaces the specified + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] in the + // [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] by updating + // the catalog attribute with the same + // [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]. + // + // If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to + // replace does not exist, a NOT_FOUND error is returned. + rpc ReplaceCatalogAttribute(ReplaceCatalogAttributeRequest) + returns (AttributesConfig) { + option (google.api.http) = { + post: "/v2beta/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:replaceCatalogAttribute" + body: "*" + }; + } } // Request for @@ -207,6 +288,10 @@ message SetDefaultBranchRequest { // // This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT // error is returned. + // + // If there are no sufficient active products in the targeted branch and + // [force][google.cloud.retail.v2beta.SetDefaultBranchRequest.force] is not + // set, a FAILED_PRECONDITION error is returned. string branch_id = 2 [ (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } ]; @@ -218,6 +303,11 @@ message SetDefaultBranchRequest { // This field must be a UTF-8 encoded string with a length limit of 1,000 // characters. Otherwise, an INVALID_ARGUMENT error is returned. string note = 3; + + // If set to true, it permits switching to a branch with + // [branch_id][google.cloud.retail.v2beta.SetDefaultBranchRequest.branch_id] + // even if it has no sufficient active products. + bool force = 4; } // Request message to show which branch is currently the default branch. @@ -245,3 +335,144 @@ message GetDefaultBranchResponse { // field, when this branch was set as default. string note = 3; } + +// Request for +// [CatalogService.GetCompletionConfig][google.cloud.retail.v2beta.CatalogService.GetCompletionConfig] +// method. +message GetCompletionConfigRequest { + // Required. Full CompletionConfig resource name. Format: + // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/CompletionConfig" + } + ]; +} + +// Request for +// [CatalogService.UpdateCompletionConfig][google.cloud.retail.v2beta.CatalogService.UpdateCompletionConfig] +// method. +message UpdateCompletionConfigRequest { + // Required. The + // [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update. + // + // If the caller does not have permission to update the + // [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a + // PERMISSION_DENIED error is returned. + // + // If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to + // update does not exist, a NOT_FOUND error is returned. + CompletionConfig completion_config = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update. + // The following are the only supported fields: + // + // * [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order] + // * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions] + // * [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length] + // * [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning] + // + // If not set, all supported fields are updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request for +// [CatalogService.GetAttributesConfig][google.cloud.retail.v2beta.CatalogService.GetAttributesConfig] +// method. +message GetAttributesConfigRequest { + // Required. Full AttributesConfig resource name. Format: + // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/AttributesConfig" + } + ]; +} + +// Request for +// [CatalogService.UpdateAttributesConfig][google.cloud.retail.v2beta.CatalogService.UpdateAttributesConfig] +// method. +message UpdateAttributesConfigRequest { + // Required. The + // [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update. + AttributesConfig attributes_config = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update. + // The following is the only supported field: + // + // * [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes] + // + // If not set, all supported fields are updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request for +// [CatalogService.AddCatalogAttribute][google.cloud.retail.v2beta.CatalogService.AddCatalogAttribute] +// method. +message AddCatalogAttributeRequest { + // Required. Full AttributesConfig resource name. 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 + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add. + CatalogAttribute catalog_attribute = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request for +// [CatalogService.RemoveCatalogAttribute][google.cloud.retail.v2beta.CatalogService.RemoveCatalogAttribute] +// method. +message RemoveCatalogAttributeRequest { + // Required. Full AttributesConfig resource name. 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 key of the + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to remove. + string key = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for +// [CatalogService.ReplaceCatalogAttribute][google.cloud.retail.v2beta.CatalogService.ReplaceCatalogAttribute] +// method. +message ReplaceCatalogAttributeRequest { + // Required. Full AttributesConfig resource name. 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 updated + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]. + CatalogAttribute catalog_attribute = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to update. + // The following are NOT supported: + // + // * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key] + // + // If not set, all supported fields are updated. + google.protobuf.FieldMask update_mask = 3; +} diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/common.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/common.proto index 27208c8618a..ada7dd1508d 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/common.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/common.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.cloud.retail.v2beta; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/protobuf/timestamp.proto"; @@ -29,6 +28,21 @@ option objc_class_prefix = "RETAIL"; option php_namespace = "Google\\Cloud\\Retail\\V2beta"; option ruby_package = "Google::Cloud::Retail::V2beta"; +// At which level we offer configuration for attributes. +enum AttributeConfigLevel { + // Value used when unset. Defaults to + // [CATALOG_LEVEL_ATTRIBUTE_CONFIG][google.cloud.retail.v2beta.AttributeConfigLevel.CATALOG_LEVEL_ATTRIBUTE_CONFIG]. + ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0; + + // At this level, we honor the attribute configurations set in + // [Product.attributes][google.cloud.retail.v2beta.Product.attributes]. + PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1; + + // At this level, we honor the attribute configurations set in + // [CatalogConfig.attribute_configs][]. + CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2; +} + // The type of solution. enum SolutionType { // Default value. @@ -41,6 +55,21 @@ enum SolutionType { SOLUTION_TYPE_SEARCH = 2; } +// The use case of Cloud Retail Search. +enum SearchSolutionUseCase { + // The value when it's unspecified. Defaults to + // [SEARCH][]. + SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0; + + // Search use case. Expects the traffic has a non-empty + // [query][google.cloud.retail.v2beta.SearchRequest.query]. + SEARCH_SOLUTION_USE_CASE_SEARCH = 1; + + // Browse use case. Expects the traffic has an empty + // [query][google.cloud.retail.v2beta.SearchRequest.query]. + SEARCH_SOLUTION_USE_CASE_BROWSE = 2; +} + // Metadata that is used to define a condition that triggers an action. // A valid condition must specify at least one of 'query_terms' or // 'products_filter'. If multiple fields are specified, the condition is met if @@ -343,6 +372,9 @@ message CustomAttribute { // The textual values of this custom attribute. For example, `["yellow", // "green"]` when the key is "color". // + // Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is + // returned. + // // Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or // [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be // set. Otherwise, an INVALID_ARGUMENT error is returned. @@ -356,7 +388,11 @@ message CustomAttribute { // set. Otherwise, an INVALID_ARGUMENT error is returned. repeated double numbers = 2; - // If true, custom attribute values are searchable by text queries in + // This field will only be used when + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level] + // of the [Catalog][google.cloud.retail.v2beta.Catalog] is + // 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are + // searchable by text queries in // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]. // // This field is ignored in a @@ -366,8 +402,11 @@ message CustomAttribute { // set. Otherwise, a INVALID_ARGUMENT error is returned. optional bool searchable = 3; - // If true, custom attribute values are indexed, so that it can be filtered, - // faceted or boosted in + // This field will only be used when + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level] + // of the [Catalog][google.cloud.retail.v2beta.Catalog] is + // 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are + // indexed, so that it can be filtered, faceted or boosted in // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]. // // This field is ignored in a @@ -418,7 +457,10 @@ message FulfillmentInfo { repeated string place_ids = 2; } -// [Product][google.cloud.retail.v2beta.Product] thumbnail/detail image. +// [Product][google.cloud.retail.v2beta.Product] image. Recommendations AI and +// Retail Search do not use product images to improve prediction and search +// results. However, product images can be returned in results, and are shown in +// prediction or search previews in the console. message Image { // Required. URI of the image. // @@ -609,19 +651,24 @@ message UserInfo { // Highly recommended for logged-in users. Unique identifier for logged-in // user, such as a user name. // + // Always use a hashed value for this ID. + // // The field must be a UTF-8 encoded string with a length limit of 128 // characters. Otherwise, an INVALID_ARGUMENT error is returned. string user_id = 1; - // The end user's IP address. Required for getting - // [SearchResponse.sponsored_results][google.cloud.retail.v2beta.SearchResponse.sponsored_results]. - // This field is used to extract location information for personalization. + // The end user's IP address. This field is used to extract location + // information for personalization. // // This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6 // address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an // INVALID_ARGUMENT error is returned. // - // This should not be set when using the JavaScript tag in + // This should not be set when: + // + // * setting + // [SearchRequest.user_info][google.cloud.retail.v2beta.SearchRequest.user_info]. + // * using the JavaScript tag in // [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent] // or if // [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request] @@ -654,16 +701,60 @@ message UserInfo { bool direct_user_request = 4; } -// Promotion information. -message Promotion { - // ID of the promotion. For example, "free gift". - // - // The value value must be a UTF-8 encoded string with a length limit of 128 - // characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, - // id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is - // returned. +// The inventory information at a place (e.g. a store) identified +// by a place ID. +message LocalInventory { + // The place ID for the current set of inventory information. + string place_id = 1; + + // Product price and cost information. // // Google Merchant Center property - // [promotion](https://support.google.com/merchants/answer/7050148). - string promotion_id = 1; + // [price](https://support.google.com/merchants/answer/6324371). + PriceInfo price_info = 2; + + // Additional local inventory attributes, for example, store name, promotion + // tags, etc. + // + // This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + // error is returned: + // + // * At most 30 attributes are allowed. + // * The key must be a UTF-8 encoded string with a length limit of 32 + // characters. + // * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, + // key0LikeThis or KEY_1_LIKE_THIS. + // * The attribute values must be of the same type (text or number). + // * Only 1 value is allowed for each attribute. + // * For text values, the length limit is 256 UTF-8 characters. + // * The attribute does not support search. The `searchable` field should be + // unset or set to false. + // * The max summed total bytes of custom attribute keys and values per + // product is 5MiB. + map attributes = 3; + + // Input only. Supported fulfillment types. Valid fulfillment type values + // include commonly used types (such as pickup in store and same day + // delivery), and custom types. Customers have to map custom types to their + // display names before rendering UI. + // + // Supported values: + // + // * "pickup-in-store" + // * "ship-to-store" + // * "same-day-delivery" + // * "next-day-delivery" + // * "custom-type-1" + // * "custom-type-2" + // * "custom-type-3" + // * "custom-type-4" + // * "custom-type-5" + // + // If this field is set to an invalid value other than these, an + // INVALID_ARGUMENT error is returned. + // + // All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is + // returned. + repeated string fulfillment_types = 4 + [(google.api.field_behavior) = INPUT_ONLY]; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/completion_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/completion_service.proto index b7de4ce72d9..6a1f2907681 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/completion_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/completion_service.proto @@ -36,8 +36,7 @@ option ruby_package = "Google::Cloud::Retail::V2beta"; // Auto-completion service for retail. // // This feature is only available for users who have Retail Search enabled. -// Please submit a form [here](https://cloud.google.com/contact) to contact -// cloud sales if you are interested in using Retail Search. +// Please 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) = @@ -46,8 +45,7 @@ service CompletionService { // Completes the specified prefix with keyword suggestions. // // This feature is only available for users who have Retail Search enabled. - // Please submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. + // Please enable Retail Search on Cloud Console before using this feature. rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) { option (google.api.http) = { get: "/v2beta/{catalog=projects/*/locations/*/catalogs/*}:completeQuery" @@ -56,11 +54,13 @@ service CompletionService { // Bulk import of processed completion dataset. // - // Request processing may be synchronous. Partial updating is not supported. + // 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 submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. + // Please enable Retail Search on Cloud Console before using this feature. rpc ImportCompletionData(ImportCompletionDataRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -90,22 +90,21 @@ message CompleteQueryRequest { // The maximum number of allowed characters is 255. string query = 2 [(google.api.field_behavior) = REQUIRED]; - // A unique identifier for tracking visitors. For example, this could be - // implemented with an HTTP cookie, which should be able to uniquely identify - // a visitor on a single device. This unique identifier should not change if - // the visitor logs in or out of the website. + // Required field. A unique identifier for tracking visitors. For example, + // this could be implemented with an HTTP cookie, which should be able to + // uniquely identify a visitor on a single device. This unique identifier + // should not change if the visitor logs in or out of the website. // // The field must be a UTF-8 encoded string with a length limit of 128 // characters. Otherwise, an INVALID_ARGUMENT error is returned. string visitor_id = 7; - // The list of languages of the query. This is - // the BCP-47 language code, such as "en-US" or "sr-Latn". - // For more information, see - // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - // - // The maximum number of allowed characters is 255. - // Only "en-US" is currently supported. + // The language filters applied to the output suggestions. If set, it should + // contain the language of the query. If not set, suggestions are returned + // without considering language restrictions. This is the BCP-47 language + // code, such as "en-US" or "sr-Latn". For more information, see [Tags for + // Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum + // number of language codes is 3. repeated string language_codes = 3; // The device type context for completion suggestions. @@ -140,7 +139,8 @@ message CompleteQueryRequest { string dataset = 6; // Completion max suggestions. If left unset or set to 0, then will fallback - // to the configured value [CompletionConfig.max_suggestions][]. + // to the configured value + // [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions]. // // The maximum allowed max suggestions is 20. If it is set higher, it will be // capped by 20. @@ -154,7 +154,11 @@ message CompleteQueryResponse { // The suggestion for the query. string suggestion = 1; - // Additional custom attributes ingested through BigQuery. + // Custom attributes for the suggestion term. + // * For "user-data", the attributes are additional custom attributes + // ingested through BigQuery. + // * For "cloud-retail", the attributes are product attributes generated + // by Cloud Retail. map attributes = 2; } @@ -169,9 +173,9 @@ message CompleteQueryResponse { repeated CompletionResult completion_results = 1; // A unique complete token. This should be included in the - // [SearchRequest][google.cloud.retail.v2beta.SearchRequest] resulting from - // this completion, which enables accurate attribution of complete model - // performance. + // [UserEvent.completion_detail][google.cloud.retail.v2beta.UserEvent.completion_detail] + // for search events resulting from this completion, which enables accurate + // attribution of complete model performance. string attribution_token = 2; // Matched recent searches of this user. The maximum number of recent searches diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/control.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/control.proto new file mode 100644 index 00000000000..e55622272a4 --- /dev/null +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/control.proto @@ -0,0 +1,84 @@ +// Copyright 2021 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2beta/common.proto"; +import "google/cloud/retail/v2beta/search_service.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Beta"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2beta;retail"; +option java_multiple_files = true; +option java_outer_classname = "ControlProto"; +option java_package = "com.google.cloud.retail.v2beta"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2beta"; +option ruby_package = "Google::Cloud::Retail::V2beta"; + +// Configures dynamic serving time metadata that is used to pre and post +// process search/recommendation model results. +message Control { + option (google.api.resource) = { + type: "retail.googleapis.com/Control" + pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}" + }; + + // The behavior/type of the control + // + // A behavior/type must be specified on creation. Type cannot be changed once + // specified (e.g. A Rule control will always be a Rule control.). An + // INVALID_ARGUMENT will be returned if either condition is violated. + oneof control { + // A facet specification to perform faceted search. + SearchRequest.FacetSpec facet_spec = 3; + + // A rule control - a condition-action pair. + // Enacts a set action when the condition is triggered. + // For example: Boost "gShoe" when query full matches "Running Shoes". + Rule rule = 4; + } + + // Immutable. Fully qualified name + // projects/*/locations/global/catalogs/*/controls/* + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. The human readable control display name. Used in Retail UI. + // + // This field must be a UTF-8 encoded string with a length limit of 128 + // 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. + 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. + // + // 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. + repeated SolutionType solution_types = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; +} diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/control_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/control_service.proto new file mode 100644 index 00000000000..922c46f2fb6 --- /dev/null +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/control_service.proto @@ -0,0 +1,184 @@ +// Copyright 2021 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +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/v2beta/control.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Beta"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2beta;retail"; +option java_multiple_files = true; +option java_outer_classname = "ControlServiceProto"; +option java_package = "com.google.cloud.retail.v2beta"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2beta"; +option ruby_package = "Google::Cloud::Retail::V2beta"; + +// Service for modifying Control. +service ControlService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a Control. + // + // If the [Control][google.cloud.retail.v2beta.Control] to create already + // exists, an ALREADY_EXISTS error is returned. + rpc CreateControl(CreateControlRequest) returns (Control) { + option (google.api.http) = { + post: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/controls" + body: "control" + }; + option (google.api.method_signature) = "parent,control,control_id"; + } + + // Deletes a Control. + // + // If the [Control][google.cloud.retail.v2beta.Control] to delete does not + // exist, a NOT_FOUND error is returned. + rpc DeleteControl(DeleteControlRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2beta/{name=projects/*/locations/*/catalogs/*/controls/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a Control. + // + // [Control][google.cloud.retail.v2beta.Control] cannot be set to a different + // oneof field, if so an INVALID_ARGUMENT is returned. If the + // [Control][google.cloud.retail.v2beta.Control] to delete does not exist, a + // NOT_FOUND error is returned. + rpc UpdateControl(UpdateControlRequest) returns (Control) { + option (google.api.http) = { + patch: "/v2beta/{control.name=projects/*/locations/*/catalogs/*/controls/*}" + body: "control" + }; + option (google.api.method_signature) = "control,update_mask"; + } + + // Gets a Control. + rpc GetControl(GetControlRequest) returns (Control) { + option (google.api.http) = { + get: "/v2beta/{name=projects/*/locations/*/catalogs/*/controls/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all Controls linked to this catalog. + rpc ListControls(ListControlsRequest) returns (ListControlsResponse) { + option (google.api.http) = { + get: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/controls" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request for CreateControl method. +message CreateControlRequest { + // Required. Full resource name of parent catalog. Format: + // 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 Control to create. + Control control = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the Control, which will become the final + // component of the Control's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-_/. + string control_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for UpdateControl method. +message UpdateControlRequest { + // Required. The Control to update. + Control control = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [Control][google.cloud.retail.v2beta.Control] to update. The following are + // NOT supported: + // + // * [Control.name][google.cloud.retail.v2beta.Control.name] + // + // If not set or empty, all supported fields are updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request for DeleteControl method. +message DeleteControlRequest { + // Required. The resource name of the Control to delete. Format: + // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Control" } + ]; +} + +// Request for GetControl method. +message GetControlRequest { + // Required. The resource name of the Control to delete. Format: + // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Control" } + ]; +} + +// Request for ListControls method. +message ListControlsRequest { + // Required. The catalog resource name. Format: + // 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" } + ]; + + // Optional. Maximum number of results to return. If unspecified, defaults + // to 50. Max allowed value is 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListControls` call. + // Provide this to retrieve the subsequent page. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter to apply on the list results. Supported features: + // + // * List all the products under the parent branch if + // [filter][google.cloud.retail.v2beta.ListControlsRequest.filter] is unset. + // * List controls that are used in a single ServingConfig: + // 'serving_config = "boosted_home_page_cvr"' + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for ListControls method. +message ListControlsResponse { + // All the Controls for a given catalog. + repeated Control controls = 1; + + // Pagination token, if not returned indicates the last page. + string next_page_token = 2; +} diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/export_config.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/export_config.proto index 0324d0edbe4..249f50119d4 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/export_config.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/export_config.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.cloud.retail.v2beta; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/import_config.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/import_config.proto index f2e27174d73..c1390ab0d1c 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/import_config.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/import_config.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.cloud.retail.v2beta; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/retail/v2beta/product.proto"; @@ -72,7 +71,8 @@ message GcsSource { // // Supported values for catalog attribute imports: // - // * 'catalog_attribute' (default): One CSV [CatalogAttribute][] per line. + // * 'catalog_attribute' (default): One CSV + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line. string data_schema = 2; } @@ -121,8 +121,19 @@ message BigQuerySource { // // * `user_event` (default): One JSON // [UserEvent][google.cloud.retail.v2beta.UserEvent] per line. - // * `user_event_ga360`: Using + // * `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. + // The schema is available here: + // https://support.google.com/analytics/answer/7029846. + // + // Supported values for auto-completion imports: + // + // * `suggestions` (default): One JSON completion suggestion per line. + // * `denylist`: One JSON deny suggestion per line. + // * `allowlist`: One JSON allow suggestion per line. string data_schema = 4; } @@ -144,9 +155,9 @@ message UserEventInlineSource { message ImportErrorsConfig { // Required. Errors destination. oneof destination { - // Google Cloud Storage path for import errors. This must be an empty, - // existing Cloud Storage bucket. Import errors will be written to a file in - // this bucket, one per line, as a JSON-encoded + // Google Cloud Storage prefix for import errors. This must be an empty, + // existing Cloud Storage directory. Import errors will be written to + // sharded files in this directory, one per line, as a JSON-encoded // `google.rpc.Status` message. string gcs_prefix = 1; } @@ -166,16 +177,15 @@ 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 while using - // [BigQuerySource][google.cloud.retail.v2beta.BigQuerySource]. + // Can only be set while using + // [BigQuerySource][google.cloud.retail.v2beta.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. - // - // This feature is only available for users who have Retail Search enabled. - // Please submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. FULL = 2; } @@ -189,16 +199,8 @@ message ImportProductsRequest { (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } ]; - // Unique identifier provided by client, within the ancestor - // dataset scope. Ensures idempotency and used for request deduplication. - // Server-generated if unspecified. Up to 128 characters long and must match - // the pattern: `[a-zA-Z0-9_]+`. This is returned as [Operation.name][] in - // [ImportMetadata][google.cloud.retail.v2beta.ImportMetadata]. - // - // Only supported when - // [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode] - // is set to `FULL`. - string request_id = 6; + // Deprecated. This field has no effect. + string request_id = 6 [deprecated = true]; // Required. The desired input location of the data. ProductInputConfig input_config = 2 [(google.api.field_behavior) = REQUIRED]; @@ -336,9 +338,8 @@ message ImportMetadata { // Count of entries that encountered errors while processing. int64 failure_count = 4; - // Id of the request / operation. This is parroting back the requestId - // that was passed in the request. - string request_id = 5; + // Deprecated. This field is never set. + 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 diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/prediction_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/prediction_service.proto index 37d364c8c12..c5ec1871580 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/prediction_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/prediction_service.proto @@ -97,9 +97,12 @@ message PredictRequest { // * filterOutOfStockItems tag=(-"promotional") // * filterOutOfStockItems // - // If your filter blocks all prediction results, nothing will be returned. If - // you want generic (unfiltered) popular products to be returned instead, set - // `strictFiltering` to false in `PredictRequest.params`. + // 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. string filter = 5; // Use validate only mode for this prediction query. If set to true, a diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/product.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/product.proto index 0899d387264..4e6dfec8239 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/product.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/product.proto @@ -16,10 +16,10 @@ syntax = "proto3"; package google.cloud.retail.v2beta; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/retail/v2beta/common.proto"; +import "google/cloud/retail/v2beta/promotion.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -331,8 +331,8 @@ message Product { // `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or // `KEY_1_LIKE_THIS`. // * For text attributes, at most 400 values are allowed. Empty values are not - // allowed. Each value must be a UTF-8 encoded string with a length limit of - // 256 characters. + // allowed. Each value must be a non-empty UTF-8 encoded string with a + // length limit of 256 characters. // * For number attributes, at most 400 values are allowed. map attributes = 12; @@ -398,8 +398,8 @@ message Product { // property [Offer.url](https://schema.org/url). string uri = 22; - // Product images for the product.Highly recommended to put the main image - // to the first. + // Product images for the product. We highly recommend putting the main + // image first. // // A maximum of 300 images are allowed. // @@ -442,7 +442,7 @@ message Product { // The material of the product. For example, "leather", "wooden". // // A maximum of 20 values are allowed. Each value must be a UTF-8 encoded - // string with a length limit of 128 characters. Otherwise, an + // string with a length limit of 200 characters. Otherwise, an // INVALID_ARGUMENT error is returned. // // Corresponding properties: Google Merchant Center property @@ -478,7 +478,9 @@ message Product { repeated string conditions = 29; // The promotions applied to the product. A maximum of 10 values are allowed - // per [Product][google.cloud.retail.v2beta.Product]. + // per [Product][google.cloud.retail.v2beta.Product]. Only + // [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id] + // will be used, other fields will be ignored if set. repeated Promotion promotions = 34; // The timestamp when the product is published by the retailer for the first diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/product_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/product_service.proto index beb380e7404..0ad73436d3e 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/product_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/product_service.proto @@ -21,10 +21,8 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/retail/v2beta/common.proto"; -import "google/cloud/retail/v2beta/export_config.proto"; import "google/cloud/retail/v2beta/import_config.proto"; import "google/cloud/retail/v2beta/product.proto"; -import "google/cloud/retail/v2beta/purge_config.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; @@ -136,7 +134,8 @@ service ProductService { // [CreateProductRequest.product][google.cloud.retail.v2beta.CreateProductRequest.product], // then any pre-existing inventory information for this product will be used. // - // If no inventory fields are set in [UpdateProductRequest.set_mask][], + // If no inventory fields are set in + // [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask], // then any existing inventory information will be preserved. // // Pre-existing inventory information can only be updated with @@ -146,8 +145,7 @@ service ProductService { // [RemoveFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces]. // // This feature is only available for users who have Retail Search enabled. - // Please submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. + // Please enable Retail Search on Cloud Console before using this feature. rpc SetInventory(SetInventoryRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v2beta/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory" @@ -173,8 +171,7 @@ service ProductService { // [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. // // This feature is only available for users who have Retail Search enabled. - // Please submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. + // Please enable Retail Search on Cloud Console before using this feature. rpc AddFulfillmentPlaces(AddFulfillmentPlacesRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -201,8 +198,7 @@ service ProductService { // [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. // // This feature is only available for users who have Retail Search enabled. - // Please submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. + // Please enable Retail Search on Cloud Console before using this feature. rpc RemoveFulfillmentPlaces(RemoveFulfillmentPlacesRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -215,6 +211,72 @@ service ProductService { metadata_type: "google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata" }; } + + // Updates local inventory information for a + // [Product][google.cloud.retail.v2beta.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.v2beta.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.v2beta.Product] queried by + // [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or + // [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. + // + // Local inventory information can only be modified using this method. + // [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] + // and + // [UpdateProduct][google.cloud.retail.v2beta.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. + rpc AddLocalInventories(AddLocalInventoriesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addLocalInventories" + body: "*" + }; + option (google.api.method_signature) = "product"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2beta.AddLocalInventoriesResponse" + metadata_type: "google.cloud.retail.v2beta.AddLocalInventoriesMetadata" + }; + } + + // Remove local inventory information for a + // [Product][google.cloud.retail.v2beta.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.v2beta.Product] queried by + // [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or + // [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. + // + // Local inventory information can only be removed using this method. + // [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] + // and + // [UpdateProduct][google.cloud.retail.v2beta.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. + rpc RemoveLocalInventories(RemoveLocalInventoriesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeLocalInventories" + body: "*" + }; + option (google.api.method_signature) = "product"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2beta.RemoveLocalInventoriesResponse" + metadata_type: "google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata" + }; + } } // Request message for [CreateProduct][] method. @@ -455,6 +517,24 @@ message SetInventoryRequest { // provided or default value for // [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time]. // + // The caller can replace place IDs for a subset of fulfillment types in the + // following ways: + // + // * Adds "fulfillment_info" in + // [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask] + // * Specifies only the desired fulfillment types and corresponding place IDs + // to update in [SetInventoryRequest.inventory.fulfillment_info][] + // + // The caller can clear all place IDs from a subset of fulfillment types in + // the following ways: + // + // * Adds "fulfillment_info" in + // [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask] + // * Specifies only the desired fulfillment types to clear in + // [SetInventoryRequest.inventory.fulfillment_info][] + // * Checks that only the desired fulfillment info types have empty + // [SetInventoryRequest.inventory.fulfillment_info.place_ids][] + // // The last update time is recorded for the following inventory fields: // * [Product.price_info][google.cloud.retail.v2beta.Product.price_info] // * [Product.availability][google.cloud.retail.v2beta.Product.availability] @@ -574,6 +654,109 @@ message AddFulfillmentPlacesMetadata {} // method. message AddFulfillmentPlacesResponse {} +// Request message for [AddLocalInventories][] method. +message AddLocalInventoriesRequest { + // Required. Full resource name of + // [Product][google.cloud.retail.v2beta.Product], such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + // + // If the caller does not have permission to access the + // [Product][google.cloud.retail.v2beta.Product], regardless of whether or not + // it exists, a PERMISSION_DENIED error is returned. + string product = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; + + // Required. A list of inventory information at difference places. Each place + // is identified by its place ID. At most 3000 inventories are allowed per + // request. + repeated LocalInventory local_inventories = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Indicates which inventory fields in the provided list of + // [LocalInventory][google.cloud.retail.v2beta.LocalInventory] to update. The + // field is updated to the provided value. + // + // If a field is set while the place does not have a previous local inventory, + // the local inventory at that store is created. + // + // If a field is set while the value of that field is not provided, the + // original field value, if it exists, is deleted. + // + // If the mask is not set or set with empty paths, all inventory fields will + // be updated. + // + // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + // is returned and the entire update will be ignored. + google.protobuf.FieldMask add_mask = 4; + + // The time when the inventory updates are issued. Used to prevent + // out-of-order updates on local inventory fields. If not provided, the + // internal system time will be used. + google.protobuf.Timestamp add_time = 5; + + // If set to true, and the [Product][google.cloud.retail.v2beta.Product] is + // not found, the local inventory will still be processed and retained for at + // most 1 day and processed once the + // [Product][google.cloud.retail.v2beta.Product] is created. If set to false, + // a NOT_FOUND error is returned if the + // [Product][google.cloud.retail.v2beta.Product] is not found. + bool allow_missing = 6; +} + +// Metadata related to the progress of the AddLocalInventories operation. +// Currently empty because there is no meaningful metadata populated from the +// [AddLocalInventories][] method. +message AddLocalInventoriesMetadata {} + +// Response of the [AddLocalInventories][] API. Currently empty because +// there is no meaningful response populated from the [AddLocalInventories][] +// method. +message AddLocalInventoriesResponse {} + +// Request message for [RemoveLocalInventories][] method. +message RemoveLocalInventoriesRequest { + // Required. Full resource name of + // [Product][google.cloud.retail.v2beta.Product], such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + // + // If the caller does not have permission to access the + // [Product][google.cloud.retail.v2beta.Product], regardless of whether or not + // it exists, a PERMISSION_DENIED error is returned. + string product = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; + + // Required. A list of place IDs to have their inventory deleted. + // At most 3000 place IDs are allowed per request. + repeated string place_ids = 2 [(google.api.field_behavior) = REQUIRED]; + + // The time when the inventory deletions are issued. Used to prevent + // out-of-order updates and deletions on local inventory fields. If not + // provided, the internal system time will be used. + google.protobuf.Timestamp remove_time = 5; + + // If set to true, and the [Product][google.cloud.retail.v2beta.Product] is + // not found, the local inventory removal request will still be processed and + // retained for at most 1 day and processed once the + // [Product][google.cloud.retail.v2beta.Product] is created. If set to false, + // a NOT_FOUND error is returned if the + // [Product][google.cloud.retail.v2beta.Product] is not found. + bool allow_missing = 3; +} + +// Metadata related to the progress of the RemoveLocalInventories operation. +// Currently empty because there is no meaningful metadata populated from the +// [RemoveLocalInventories][] method. +message RemoveLocalInventoriesMetadata {} + +// Response of the [RemoveLocalInventories][] API. Currently empty because +// there is no meaningful response populated from the [RemoveLocalInventories][] +// method. +message RemoveLocalInventoriesResponse {} + // Request message for [RemoveFulfillmentPlaces][] method. message RemoveFulfillmentPlacesRequest { // Required. Full resource name of diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/promotion.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/promotion.proto new file mode 100644 index 00000000000..5346f14d363 --- /dev/null +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/promotion.proto @@ -0,0 +1,40 @@ +// Copyright 2021 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +option csharp_namespace = "Google.Cloud.Retail.V2Beta"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2beta;retail"; +option java_multiple_files = true; +option java_outer_classname = "PromotionProto"; +option java_package = "com.google.cloud.retail.v2beta"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2beta"; +option ruby_package = "Google::Cloud::Retail::V2beta"; + +// Promotion information. +message Promotion { + // ID of the promotion. For example, "free gift". + // + // The value must be a UTF-8 encoded string with a length limit of 128 + // characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, + // id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is + // returned. + // + // Google Merchant Center property + // [promotion](https://support.google.com/merchants/answer/7050148). + string promotion_id = 1; +} diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/purge_config.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/purge_config.proto index 1474fe8d6dd..5ab09aa348b 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/purge_config.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/purge_config.proto @@ -16,10 +16,8 @@ syntax = "proto3"; package google.cloud.retail.v2beta; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Retail.V2Beta"; option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2beta;retail"; diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/search_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/search_service.proto index d38f1eb4a57..b8b2156a840 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/search_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/search_service.proto @@ -24,8 +24,6 @@ import "google/cloud/retail/v2beta/common.proto"; import "google/cloud/retail/v2beta/product.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; option csharp_namespace = "Google.Cloud.Retail.V2Beta"; option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2beta;retail"; @@ -39,8 +37,7 @@ option ruby_package = "Google::Cloud::Retail::V2beta"; // Service for search. // // This feature is only available for users who have Retail Search enabled. -// Please submit a form [here](https://cloud.google.com/contact) to contact -// cloud sales if you are interested in using Retail Search. +// Please 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) = @@ -49,8 +46,7 @@ service SearchService { // Performs a search. // // This feature is only available for users who have Retail Search enabled. - // Please submit a form [here](https://cloud.google.com/contact) to contact - // cloud sales if you are interested in using Retail Search. + // Please enable Retail Search on Cloud Console before using this feature. rpc Search(SearchRequest) returns (SearchResponse) { option (google.api.http) = { post: "/v2beta/{placement=projects/*/locations/*/catalogs/*/placements/*}:search" @@ -325,6 +321,14 @@ message SearchRequest { // applied and combined in a non-linear way. Maximum number of // specifications is 10. repeated ConditionBoostSpec condition_boost_specs = 1; + + // Whether to skip boostspec validation. If this field is set to true, + // invalid + // [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs] + // will be ignored and valid + // [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs] + // will still be applied. + optional bool skip_boost_spec_validation = 2; } // Specification to determine under which conditions query expansion should @@ -355,6 +359,26 @@ message SearchRequest { bool pin_unexpanded_results = 2; } + // The specification for personalization. + message PersonalizationSpec { + // The personalization mode of each search request. + enum Mode { + // Default value. Defaults to + // [Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO]. + MODE_UNSPECIFIED = 0; + + // Let CRS decide whether to use personalization. + AUTO = 1; + + // Disable personalization. + DISABLED = 2; + } + + // Defaults to + // [Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO]. + Mode mode = 1; + } + // The search mode of each search request. enum SearchMode { // Default value. In this case both product search and faceted search will @@ -385,7 +409,7 @@ message SearchRequest { } // Required. The resource name of the search engine placement, such as - // `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. + // `projects/*/locations/global/catalogs/default_catalog/placements/default_search` // This field is used to identify the serving configuration name and the set // of models that will be used to make the search. string placement = 1 [(google.api.field_behavior) = REQUIRED]; @@ -453,6 +477,9 @@ message SearchRequest { // If this field is unrecognizable, an INVALID_ARGUMENT is returned. string filter = 10; + // The default filter that is applied when a user performs a search without + // checking any filters on the search page. + // // The filter applied to every search request when quality improvement such as // query expansion is needed. For example, if a query does not have enough // results, an expanded query with @@ -479,12 +506,12 @@ message SearchRequest { // is returned. repeated FacetSpec facet_specs = 12; + // Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic + // to enable dynamic facets. Do not set this field. + // // The specification for dynamically generated facets. Notice that only // textual facets can be dynamically generated. - // - // This feature requires additional allowlisting. Contact Retail Search - // support team if you are interested in using dynamic facet feature. - DynamicFacetSpec dynamic_facet_spec = 21; + DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; // Boost specification to boost certain products. See more details at this // [user guide](https://cloud.google.com/retail/docs/boosting). @@ -506,11 +533,13 @@ message SearchRequest { // [variant][google.cloud.retail.v2beta.Product.Type.VARIANT] // [Product][google.cloud.retail.v2beta.Product]s attributes, // [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or - // [LocalInventory][]s attributes. The attributes from all the matching + // [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes. + // The attributes from all the matching // [variant][google.cloud.retail.v2beta.Product.Type.VARIANT] - // [Product][google.cloud.retail.v2beta.Product]s or [LocalInventory][]s are - // merged and de-duplicated. Notice that rollup attributes will lead to extra - // query latency. Maximum number of keys is 30. + // [Product][google.cloud.retail.v2beta.Product]s or + // [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and + // de-duplicated. Notice that rollup attributes will lead to extra query + // latency. Maximum number of keys is 30. // // For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a // fulfillment type and a fulfillment ID must be provided in the format of @@ -588,6 +617,9 @@ message SearchRequest { // The search mode of the search request. If not specified, a single search // request triggers both product search and faceted search. SearchMode search_mode = 31; + + // The specification for personalization. + PersonalizationSpec personalization_spec = 32; } // Response message for @@ -750,4 +782,10 @@ message SearchResponse { // The fully qualified resource name of applied // [controls](https://cloud.google.com/retail/docs/serving-control-rules). repeated string applied_controls = 12; + + // The invalid + // [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs] + // that are not applied during serving. + repeated SearchRequest.BoostSpec.ConditionBoostSpec + invalid_condition_boost_specs = 14; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/serving_config.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/serving_config.proto new file mode 100644 index 00000000000..20112e61570 --- /dev/null +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/serving_config.proto @@ -0,0 +1,247 @@ +// Copyright 2021 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2beta/common.proto"; +import "google/cloud/retail/v2beta/search_service.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Beta"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2beta;retail"; +option java_multiple_files = true; +option java_outer_classname = "ServingConfigProto"; +option java_package = "com.google.cloud.retail.v2beta"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2beta"; +option ruby_package = "Google::Cloud::Retail::V2beta"; + +// 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}" + }; + + // Immutable. Fully qualified name + // projects/*/locations/global/catalogs/*/servingConfig/* + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. The human readable serving config display name. Used in Retail + // UI. + // + // This field must be a UTF-8 encoded string with a length limit of 128 + // 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. + // 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. + // others-you-may-like CTR to others-you-may-like CVR). + // + // Required when + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + string model_id = 3; + + // How much price ranking we want in serving results. + // Price reranking causes product items with a similar + // recommendation probability to be ordered by price, with the + // highest-priced items first. This setting could result in a decrease in + // click-through and conversion rates. + // Allowed values are: + // + // * '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'. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + string price_reranking_level = 4; + + // Facet specifications for faceted search. If empty, no facets are returned. + // The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control] + // resources with only the Facet control set. These controls are assumed to be + // in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the + // [ServingConfig][google.cloud.retail.v2beta.ServingConfig]. + // A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + // is returned. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + repeated string facet_control_ids = 5; + + // The specification for dynamically generated facets. Notice that only + // textual facets can be dynamically generated. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + + // Condition boost specifications. If a product matches multiple conditions + // in the specifications, boost scores from these specifications are all + // applied and combined in a non-linear way. Maximum number of + // specifications is 100. + // + // Notice that if both + // [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids] + // and [SearchRequest.boost_spec] are set, the boost conditions from both + // places are evaluated. If a search request matches multiple boost + // conditions, the final boost score is equal to the sum of the boost scores + // from all matched boost conditions. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + repeated string boost_control_ids = 7; + + // Condition filter specifications. If a product matches multiple conditions + // in the specifications, filters from these specifications are all + // applied and combined via the AND operator. Maximum number of + // specifications is 100. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + repeated string filter_control_ids = 9; + + // Condition redirect specifications. Only the first triggered redirect action + // is applied, even if multiple apply. Maximum number of specifications is + // 1000. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + repeated string redirect_control_ids = 10; + + // Condition synonyms specifications. If multiple syonyms conditions match, + // all matching synonyms control in the list will execute. Order of controls + // in the list will not matter. Maximum number of specifications is + // 100. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + repeated string twoway_synonyms_control_ids = 18; + + // Condition oneway synonyms specifications. If multiple oneway synonyms + // conditions match, all matching oneway synonyms controls in the list will + // execute. Order of controls in the list will not matter. Maximum number of + // specifications is 100. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + repeated string oneway_synonyms_control_ids = 12; + + // Condition do not associate specifications. If multiple do not associate + // conditions match, all matching do not associate controls in the list will + // execute. + // - Order does not matter. + // - Maximum number of specifications is 100. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + repeated string do_not_associate_control_ids = 13; + + // Condition replacement specifications. + // - Applied according to the order in the list. + // - A previously replaced term can not be re-replaced. + // - Maximum number of specifications is 100. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + repeated string replacement_control_ids = 14; + + // Condition ignore specifications. If multiple ignore + // conditions match, all matching ignore controls in the list will + // execute. + // - Order does not matter. + // - Maximum number of specifications is 100. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + 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: + // + // * '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'. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [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. + // If not specified, we enable it by default. + // Allowed values are: + // + // * '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 + // 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). + // + // Can only be set if + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + string enable_category_filter_level = 16; + + // 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 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; +} diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/serving_config_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/serving_config_service.proto new file mode 100644 index 00000000000..e56c28accc0 --- /dev/null +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/serving_config_service.proto @@ -0,0 +1,240 @@ +// Copyright 2021 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +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/v2beta/serving_config.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Beta"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2beta;retail"; +option java_multiple_files = true; +option java_outer_classname = "ServingConfigServiceProto"; +option java_package = "com.google.cloud.retail.v2beta"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2beta"; +option ruby_package = "Google::Cloud::Retail::V2beta"; + +// Service for modifying ServingConfig. +service ServingConfigService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a ServingConfig. + // + // A maximum of 100 [ServingConfig][google.cloud.retail.v2beta.ServingConfig]s + // are allowed in a [Catalog][google.cloud.retail.v2beta.Catalog], otherwise + // a FAILED_PRECONDITION error is returned. + rpc CreateServingConfig(CreateServingConfigRequest) returns (ServingConfig) { + option (google.api.http) = { + post: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/servingConfigs" + body: "serving_config" + }; + option (google.api.method_signature) = + "parent,serving_config,serving_config_id"; + } + + // Deletes a ServingConfig. + // + // Returns a NotFound error if the ServingConfig does not exist. + rpc DeleteServingConfig(DeleteServingConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2beta/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a ServingConfig. + rpc UpdateServingConfig(UpdateServingConfigRequest) returns (ServingConfig) { + option (google.api.http) = { + patch: "/v2beta/{serving_config.name=projects/*/locations/*/catalogs/*/servingConfigs/*}" + body: "serving_config" + }; + option (google.api.method_signature) = "serving_config,update_mask"; + } + + // Gets a ServingConfig. + // + // Returns a NotFound error if the ServingConfig does not exist. + rpc GetServingConfig(GetServingConfigRequest) returns (ServingConfig) { + option (google.api.http) = { + get: "/v2beta/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all ServingConfigs linked to this catalog. + rpc ListServingConfigs(ListServingConfigsRequest) + returns (ListServingConfigsResponse) { + option (google.api.http) = { + get: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/servingConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Enables a Control on the specified ServingConfig. + // The control is added in the last position of the list of controls + // it belongs to (e.g. if it's a facet spec control it will be applied + // in the last position of servingConfig.facetSpecIds) + // Returns a ALREADY_EXISTS error if the control has already been applied. + // Returns a FAILED_PRECONDITION error if the addition could exceed maximum + // number of control allowed for that type of control. + rpc AddControl(AddControlRequest) returns (ServingConfig) { + option (google.api.http) = { + post: "/v2beta/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:addControl" + body: "*" + }; + option (google.api.method_signature) = "serving_config"; + } + + // Disables a Control on the specified ServingConfig. + // The control is removed from the ServingConfig. + // Returns a NOT_FOUND error if the Control is not enabled for the + // ServingConfig. + rpc RemoveControl(RemoveControlRequest) returns (ServingConfig) { + option (google.api.http) = { + post: "/v2beta/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:removeControl" + body: "*" + }; + option (google.api.method_signature) = "serving_config"; + } +} + +// Request for CreateServingConfig method. +message CreateServingConfigRequest { + // Required. Full resource name of parent. Format: + // 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 ServingConfig to create. + ServingConfig serving_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the ServingConfig, which will become the final + // component of the ServingConfig's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-_/. + string serving_config_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for UpdateServingConfig method. +message UpdateServingConfigRequest { + // Required. The ServingConfig to update. + ServingConfig serving_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The + // following are NOT supported: + // + // * [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name] + // + // If not set, all supported fields are updated. + google.protobuf.FieldMask update_mask = 2; +} + +// 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} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/ServingConfig" + } + ]; +} + +// 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} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/ServingConfig" + } + ]; +} + +// Request for ListServingConfigs method. +message ListServingConfigsRequest { + // Required. The catalog resource name. Format: + // 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" } + ]; + + // 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 + // returned. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListServingConfigs` call. + // Provide this to retrieve the subsequent page. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for ListServingConfigs method. +message ListServingConfigsResponse { + // All the ServingConfigs for a given catalog. + repeated ServingConfig serving_configs = 1; + + // Pagination token, if not returned indicates the last page. + string next_page_token = 2; +} + +// 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} + string serving_config = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/ServingConfig" + } + ]; + + // 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. + string control_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// 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} + string serving_config = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/ServingConfig" + } + ]; + + // Required. The id of the control to apply. Assumed to be in the same catalog + // as the serving config. + string control_id = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/user_event.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/user_event.proto index 637697ef9ed..e21758012ee 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/user_event.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/user_event.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.cloud.retail.v2beta; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/cloud/retail/v2beta/common.proto"; import "google/cloud/retail/v2beta/product.proto"; @@ -136,6 +135,13 @@ message UserEvent { // Extra user event features to include in the recommendation model. // + // If you provide custom attributes for ingested user events, also include + // them in the user events that you associate with prediction requests. Custom + // attribute formatting must be consistent between imported events and events + // provided with prediction requests. This lets the Retail API use + // those custom attributes when training models and serving predictions, which + // helps improve recommendation quality. + // // This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT // error is returned: // @@ -146,10 +152,10 @@ message UserEvent { // 256 characters. // * For number attributes, at most 400 values are allowed. // - // For product recommendation, an example of extra user information is - // traffic_channel, i.e. how user arrives at the site. Users can arrive - // at the site by coming to the site directly, or coming through Google - // search, and etc. + // For product recommendations, an example of extra user information is + // traffic_channel, which is how a user arrives at the site. Users can arrive + // at the site by coming to the site directly, coming through Google + // search, or in other ways. map attributes = 7; // The ID or name of the associated shopping cart. This ID is used diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/user_event_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/user_event_service.proto index c2da08739a8..ab7a0b3514a 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/user_event_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/user_event_service.proto @@ -20,7 +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/cloud/retail/v2beta/export_config.proto"; +import "google/api/resource.proto"; import "google/cloud/retail/v2beta/import_config.proto"; import "google/cloud/retail/v2beta/purge_config.proto"; import "google/cloud/retail/v2beta/user_event.proto"; @@ -95,13 +95,14 @@ service UserEventService { }; } - // Triggers a user event rejoin operation with latest product catalog. Events + // 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 API can be used to trigger a 'join' operation on specified + // 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 wrong product catalog. + // 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) = { diff --git a/packages/google-cloud-retail/protos/protos.d.ts b/packages/google-cloud-retail/protos/protos.d.ts index 87780c6ce97..20740410363 100644 --- a/packages/google-cloud-retail/protos/protos.d.ts +++ b/packages/google-cloud-retail/protos/protos.d.ts @@ -637,6 +637,9 @@ export namespace google { /** SetDefaultBranchRequest note */ note?: (string|null); + + /** SetDefaultBranchRequest force */ + force?: (boolean|null); } /** Represents a SetDefaultBranchRequest. */ @@ -657,6 +660,9 @@ export namespace google { /** SetDefaultBranchRequest note. */ public note: string; + /** SetDefaultBranchRequest force. */ + public force: boolean; + /** * Creates a new SetDefaultBranchRequest instance using the specified properties. * @param [properties] Properties to set @@ -1973,91 +1979,109 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of a Promotion. */ - interface IPromotion { + /** Properties of a LocalInventory. */ + interface ILocalInventory { - /** Promotion promotionId */ - promotionId?: (string|null); + /** LocalInventory placeId */ + placeId?: (string|null); + + /** LocalInventory priceInfo */ + priceInfo?: (google.cloud.retail.v2.IPriceInfo|null); + + /** LocalInventory attributes */ + attributes?: ({ [k: string]: google.cloud.retail.v2.ICustomAttribute }|null); + + /** LocalInventory fulfillmentTypes */ + fulfillmentTypes?: (string[]|null); } - /** Represents a Promotion. */ - class Promotion implements IPromotion { + /** Represents a LocalInventory. */ + class LocalInventory implements ILocalInventory { /** - * Constructs a new Promotion. + * Constructs a new LocalInventory. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2.IPromotion); + constructor(properties?: google.cloud.retail.v2.ILocalInventory); - /** Promotion promotionId. */ - public promotionId: string; + /** LocalInventory placeId. */ + public placeId: string; + + /** LocalInventory priceInfo. */ + public priceInfo?: (google.cloud.retail.v2.IPriceInfo|null); + + /** LocalInventory attributes. */ + public attributes: { [k: string]: google.cloud.retail.v2.ICustomAttribute }; + + /** LocalInventory fulfillmentTypes. */ + public fulfillmentTypes: string[]; /** - * Creates a new Promotion instance using the specified properties. + * Creates a new LocalInventory instance using the specified properties. * @param [properties] Properties to set - * @returns Promotion instance + * @returns LocalInventory instance */ - public static create(properties?: google.cloud.retail.v2.IPromotion): google.cloud.retail.v2.Promotion; + public static create(properties?: google.cloud.retail.v2.ILocalInventory): google.cloud.retail.v2.LocalInventory; /** - * Encodes the specified Promotion message. Does not implicitly {@link google.cloud.retail.v2.Promotion.verify|verify} messages. - * @param message Promotion message or plain object to encode + * Encodes the specified LocalInventory message. Does not implicitly {@link google.cloud.retail.v2.LocalInventory.verify|verify} messages. + * @param message LocalInventory message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2.IPromotion, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2.ILocalInventory, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Promotion message, length delimited. Does not implicitly {@link google.cloud.retail.v2.Promotion.verify|verify} messages. - * @param message Promotion message or plain object to encode + * Encodes the specified LocalInventory message, length delimited. Does not implicitly {@link google.cloud.retail.v2.LocalInventory.verify|verify} messages. + * @param message LocalInventory message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2.IPromotion, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2.ILocalInventory, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Promotion message from the specified reader or buffer. + * Decodes a LocalInventory message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Promotion + * @returns LocalInventory * @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.v2.Promotion; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.LocalInventory; /** - * Decodes a Promotion message from the specified reader or buffer, length delimited. + * Decodes a LocalInventory message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Promotion + * @returns LocalInventory * @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.v2.Promotion; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.LocalInventory; /** - * Verifies a Promotion message. + * Verifies a LocalInventory 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 Promotion message from a plain object. Also converts values to their respective internal types. + * Creates a LocalInventory message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Promotion + * @returns LocalInventory */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.Promotion; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.LocalInventory; /** - * Creates a plain object from a Promotion message. Also converts values to other types if specified. - * @param message Promotion + * Creates a plain object from a LocalInventory message. Also converts values to other types if specified. + * @param message LocalInventory * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2.Promotion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2.LocalInventory, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Promotion to JSON. + * Converts this LocalInventory to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -4490,6 +4514,96 @@ export namespace google { } } + /** Properties of a Promotion. */ + interface IPromotion { + + /** Promotion promotionId */ + promotionId?: (string|null); + } + + /** Represents a Promotion. */ + class Promotion implements IPromotion { + + /** + * Constructs a new Promotion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.IPromotion); + + /** Promotion promotionId. */ + public promotionId: string; + + /** + * Creates a new Promotion instance using the specified properties. + * @param [properties] Properties to set + * @returns Promotion instance + */ + public static create(properties?: google.cloud.retail.v2.IPromotion): google.cloud.retail.v2.Promotion; + + /** + * Encodes the specified Promotion message. Does not implicitly {@link google.cloud.retail.v2.Promotion.verify|verify} messages. + * @param message Promotion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.IPromotion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Promotion message, length delimited. Does not implicitly {@link google.cloud.retail.v2.Promotion.verify|verify} messages. + * @param message Promotion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.IPromotion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Promotion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Promotion + * @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.v2.Promotion; + + /** + * Decodes a Promotion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Promotion + * @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.v2.Promotion; + + /** + * Verifies a Promotion 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 Promotion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Promotion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.Promotion; + + /** + * Creates a plain object from a Promotion message. Also converts values to other types if specified. + * @param message Promotion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.Promotion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Promotion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a UserEvent. */ interface IUserEvent { @@ -5535,6 +5649,34 @@ export namespace google { * @returns Promise */ public removeFulfillmentPlaces(request: google.cloud.retail.v2.IRemoveFulfillmentPlacesRequest): Promise; + + /** + * Calls AddLocalInventories. + * @param request AddLocalInventoriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addLocalInventories(request: google.cloud.retail.v2.IAddLocalInventoriesRequest, callback: google.cloud.retail.v2.ProductService.AddLocalInventoriesCallback): void; + + /** + * Calls AddLocalInventories. + * @param request AddLocalInventoriesRequest message or plain object + * @returns Promise + */ + public addLocalInventories(request: google.cloud.retail.v2.IAddLocalInventoriesRequest): Promise; + + /** + * Calls RemoveLocalInventories. + * @param request RemoveLocalInventoriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public removeLocalInventories(request: google.cloud.retail.v2.IRemoveLocalInventoriesRequest, callback: google.cloud.retail.v2.ProductService.RemoveLocalInventoriesCallback): void; + + /** + * Calls RemoveLocalInventories. + * @param request RemoveLocalInventoriesRequest message or plain object + * @returns Promise + */ + public removeLocalInventories(request: google.cloud.retail.v2.IRemoveLocalInventoriesRequest): Promise; } namespace ProductService { @@ -5601,6 +5743,20 @@ export namespace google { * @param [response] Operation */ type RemoveFulfillmentPlacesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.retail.v2.ProductService#addLocalInventories}. + * @param error Error, if any + * @param [response] Operation + */ + type AddLocalInventoriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.retail.v2.ProductService#removeLocalInventories}. + * @param error Error, if any + * @param [response] Operation + */ + type RemoveLocalInventoriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of a CreateProductRequest. */ @@ -6755,20189 +6911,25687 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of a RemoveFulfillmentPlacesRequest. */ - interface IRemoveFulfillmentPlacesRequest { + /** Properties of an AddLocalInventoriesRequest. */ + interface IAddLocalInventoriesRequest { - /** RemoveFulfillmentPlacesRequest product */ + /** AddLocalInventoriesRequest product */ product?: (string|null); - /** RemoveFulfillmentPlacesRequest type */ - type?: (string|null); + /** AddLocalInventoriesRequest localInventories */ + localInventories?: (google.cloud.retail.v2.ILocalInventory[]|null); - /** RemoveFulfillmentPlacesRequest placeIds */ - placeIds?: (string[]|null); + /** AddLocalInventoriesRequest addMask */ + addMask?: (google.protobuf.IFieldMask|null); - /** RemoveFulfillmentPlacesRequest removeTime */ - removeTime?: (google.protobuf.ITimestamp|null); + /** AddLocalInventoriesRequest addTime */ + addTime?: (google.protobuf.ITimestamp|null); - /** RemoveFulfillmentPlacesRequest allowMissing */ + /** AddLocalInventoriesRequest allowMissing */ allowMissing?: (boolean|null); } - /** Represents a RemoveFulfillmentPlacesRequest. */ - class RemoveFulfillmentPlacesRequest implements IRemoveFulfillmentPlacesRequest { + /** Represents an AddLocalInventoriesRequest. */ + class AddLocalInventoriesRequest implements IAddLocalInventoriesRequest { /** - * Constructs a new RemoveFulfillmentPlacesRequest. + * Constructs a new AddLocalInventoriesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2.IRemoveFulfillmentPlacesRequest); + constructor(properties?: google.cloud.retail.v2.IAddLocalInventoriesRequest); - /** RemoveFulfillmentPlacesRequest product. */ + /** AddLocalInventoriesRequest product. */ public product: string; - /** RemoveFulfillmentPlacesRequest type. */ - public type: string; + /** AddLocalInventoriesRequest localInventories. */ + public localInventories: google.cloud.retail.v2.ILocalInventory[]; - /** RemoveFulfillmentPlacesRequest placeIds. */ - public placeIds: string[]; + /** AddLocalInventoriesRequest addMask. */ + public addMask?: (google.protobuf.IFieldMask|null); - /** RemoveFulfillmentPlacesRequest removeTime. */ - public removeTime?: (google.protobuf.ITimestamp|null); + /** AddLocalInventoriesRequest addTime. */ + public addTime?: (google.protobuf.ITimestamp|null); - /** RemoveFulfillmentPlacesRequest allowMissing. */ + /** AddLocalInventoriesRequest allowMissing. */ public allowMissing: boolean; /** - * Creates a new RemoveFulfillmentPlacesRequest instance using the specified properties. + * Creates a new AddLocalInventoriesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns RemoveFulfillmentPlacesRequest instance + * @returns AddLocalInventoriesRequest instance */ - public static create(properties?: google.cloud.retail.v2.IRemoveFulfillmentPlacesRequest): google.cloud.retail.v2.RemoveFulfillmentPlacesRequest; + public static create(properties?: google.cloud.retail.v2.IAddLocalInventoriesRequest): google.cloud.retail.v2.AddLocalInventoriesRequest; /** - * Encodes the specified RemoveFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.verify|verify} messages. - * @param message RemoveFulfillmentPlacesRequest message or plain object to encode + * Encodes the specified AddLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2.AddLocalInventoriesRequest.verify|verify} messages. + * @param message AddLocalInventoriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2.IRemoveFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2.IAddLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RemoveFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.verify|verify} messages. - * @param message RemoveFulfillmentPlacesRequest message or plain object to encode + * Encodes the specified AddLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.AddLocalInventoriesRequest.verify|verify} messages. + * @param message AddLocalInventoriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2.IRemoveFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2.IAddLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer. + * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RemoveFulfillmentPlacesRequest + * @returns AddLocalInventoriesRequest * @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.v2.RemoveFulfillmentPlacesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.AddLocalInventoriesRequest; /** - * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. + * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RemoveFulfillmentPlacesRequest + * @returns AddLocalInventoriesRequest * @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.v2.RemoveFulfillmentPlacesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.AddLocalInventoriesRequest; /** - * Verifies a RemoveFulfillmentPlacesRequest message. + * Verifies an AddLocalInventoriesRequest 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 RemoveFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AddLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RemoveFulfillmentPlacesRequest + * @returns AddLocalInventoriesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.RemoveFulfillmentPlacesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.AddLocalInventoriesRequest; /** - * Creates a plain object from a RemoveFulfillmentPlacesRequest message. Also converts values to other types if specified. - * @param message RemoveFulfillmentPlacesRequest + * Creates a plain object from an AddLocalInventoriesRequest message. Also converts values to other types if specified. + * @param message AddLocalInventoriesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2.RemoveFulfillmentPlacesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2.AddLocalInventoriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RemoveFulfillmentPlacesRequest to JSON. + * Converts this AddLocalInventoriesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RemoveFulfillmentPlacesMetadata. */ - interface IRemoveFulfillmentPlacesMetadata { + /** Properties of an AddLocalInventoriesMetadata. */ + interface IAddLocalInventoriesMetadata { } - /** Represents a RemoveFulfillmentPlacesMetadata. */ - class RemoveFulfillmentPlacesMetadata implements IRemoveFulfillmentPlacesMetadata { + /** Represents an AddLocalInventoriesMetadata. */ + class AddLocalInventoriesMetadata implements IAddLocalInventoriesMetadata { /** - * Constructs a new RemoveFulfillmentPlacesMetadata. + * Constructs a new AddLocalInventoriesMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2.IRemoveFulfillmentPlacesMetadata); + constructor(properties?: google.cloud.retail.v2.IAddLocalInventoriesMetadata); /** - * Creates a new RemoveFulfillmentPlacesMetadata instance using the specified properties. + * Creates a new AddLocalInventoriesMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns RemoveFulfillmentPlacesMetadata instance + * @returns AddLocalInventoriesMetadata instance */ - public static create(properties?: google.cloud.retail.v2.IRemoveFulfillmentPlacesMetadata): google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata; + public static create(properties?: google.cloud.retail.v2.IAddLocalInventoriesMetadata): google.cloud.retail.v2.AddLocalInventoriesMetadata; /** - * Encodes the specified RemoveFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata.verify|verify} messages. - * @param message RemoveFulfillmentPlacesMetadata message or plain object to encode + * Encodes the specified AddLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2.AddLocalInventoriesMetadata.verify|verify} messages. + * @param message AddLocalInventoriesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2.IRemoveFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2.IAddLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RemoveFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata.verify|verify} messages. - * @param message RemoveFulfillmentPlacesMetadata message or plain object to encode + * Encodes the specified AddLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.AddLocalInventoriesMetadata.verify|verify} messages. + * @param message AddLocalInventoriesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2.IRemoveFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2.IAddLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer. + * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RemoveFulfillmentPlacesMetadata + * @returns AddLocalInventoriesMetadata * @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.v2.RemoveFulfillmentPlacesMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.AddLocalInventoriesMetadata; /** - * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. + * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RemoveFulfillmentPlacesMetadata + * @returns AddLocalInventoriesMetadata * @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.v2.RemoveFulfillmentPlacesMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.AddLocalInventoriesMetadata; /** - * Verifies a RemoveFulfillmentPlacesMetadata message. + * Verifies an AddLocalInventoriesMetadata 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 RemoveFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an AddLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RemoveFulfillmentPlacesMetadata + * @returns AddLocalInventoriesMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.AddLocalInventoriesMetadata; /** - * Creates a plain object from a RemoveFulfillmentPlacesMetadata message. Also converts values to other types if specified. - * @param message RemoveFulfillmentPlacesMetadata + * Creates a plain object from an AddLocalInventoriesMetadata message. Also converts values to other types if specified. + * @param message AddLocalInventoriesMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2.AddLocalInventoriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RemoveFulfillmentPlacesMetadata to JSON. + * Converts this AddLocalInventoriesMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RemoveFulfillmentPlacesResponse. */ - interface IRemoveFulfillmentPlacesResponse { + /** Properties of an AddLocalInventoriesResponse. */ + interface IAddLocalInventoriesResponse { } - /** Represents a RemoveFulfillmentPlacesResponse. */ - class RemoveFulfillmentPlacesResponse implements IRemoveFulfillmentPlacesResponse { + /** Represents an AddLocalInventoriesResponse. */ + class AddLocalInventoriesResponse implements IAddLocalInventoriesResponse { /** - * Constructs a new RemoveFulfillmentPlacesResponse. + * Constructs a new AddLocalInventoriesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2.IRemoveFulfillmentPlacesResponse); + constructor(properties?: google.cloud.retail.v2.IAddLocalInventoriesResponse); /** - * Creates a new RemoveFulfillmentPlacesResponse instance using the specified properties. + * Creates a new AddLocalInventoriesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns RemoveFulfillmentPlacesResponse instance + * @returns AddLocalInventoriesResponse instance */ - public static create(properties?: google.cloud.retail.v2.IRemoveFulfillmentPlacesResponse): google.cloud.retail.v2.RemoveFulfillmentPlacesResponse; + public static create(properties?: google.cloud.retail.v2.IAddLocalInventoriesResponse): google.cloud.retail.v2.AddLocalInventoriesResponse; /** - * Encodes the specified RemoveFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesResponse.verify|verify} messages. - * @param message RemoveFulfillmentPlacesResponse message or plain object to encode + * Encodes the specified AddLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2.AddLocalInventoriesResponse.verify|verify} messages. + * @param message AddLocalInventoriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2.IRemoveFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2.IAddLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RemoveFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesResponse.verify|verify} messages. - * @param message RemoveFulfillmentPlacesResponse message or plain object to encode + * Encodes the specified AddLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.AddLocalInventoriesResponse.verify|verify} messages. + * @param message AddLocalInventoriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2.IRemoveFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2.IAddLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer. + * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RemoveFulfillmentPlacesResponse + * @returns AddLocalInventoriesResponse * @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.v2.RemoveFulfillmentPlacesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.AddLocalInventoriesResponse; /** - * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. + * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RemoveFulfillmentPlacesResponse + * @returns AddLocalInventoriesResponse * @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.v2.RemoveFulfillmentPlacesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.AddLocalInventoriesResponse; /** - * Verifies a RemoveFulfillmentPlacesResponse message. + * Verifies an AddLocalInventoriesResponse 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 RemoveFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AddLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RemoveFulfillmentPlacesResponse + * @returns AddLocalInventoriesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.RemoveFulfillmentPlacesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.AddLocalInventoriesResponse; /** - * Creates a plain object from a RemoveFulfillmentPlacesResponse message. Also converts values to other types if specified. - * @param message RemoveFulfillmentPlacesResponse + * Creates a plain object from an AddLocalInventoriesResponse message. Also converts values to other types if specified. + * @param message AddLocalInventoriesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2.RemoveFulfillmentPlacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2.AddLocalInventoriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RemoveFulfillmentPlacesResponse to JSON. + * Converts this AddLocalInventoriesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PurgeMetadata. */ - interface IPurgeMetadata { + /** Properties of a RemoveLocalInventoriesRequest. */ + interface IRemoveLocalInventoriesRequest { + + /** RemoveLocalInventoriesRequest product */ + product?: (string|null); + + /** RemoveLocalInventoriesRequest placeIds */ + placeIds?: (string[]|null); + + /** RemoveLocalInventoriesRequest removeTime */ + removeTime?: (google.protobuf.ITimestamp|null); + + /** RemoveLocalInventoriesRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a PurgeMetadata. */ - class PurgeMetadata implements IPurgeMetadata { + /** Represents a RemoveLocalInventoriesRequest. */ + class RemoveLocalInventoriesRequest implements IRemoveLocalInventoriesRequest { /** - * Constructs a new PurgeMetadata. + * Constructs a new RemoveLocalInventoriesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2.IPurgeMetadata); + constructor(properties?: google.cloud.retail.v2.IRemoveLocalInventoriesRequest); + + /** RemoveLocalInventoriesRequest product. */ + public product: string; + + /** RemoveLocalInventoriesRequest placeIds. */ + public placeIds: string[]; + + /** RemoveLocalInventoriesRequest removeTime. */ + public removeTime?: (google.protobuf.ITimestamp|null); + + /** RemoveLocalInventoriesRequest allowMissing. */ + public allowMissing: boolean; /** - * Creates a new PurgeMetadata instance using the specified properties. + * Creates a new RemoveLocalInventoriesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PurgeMetadata instance + * @returns RemoveLocalInventoriesRequest instance */ - public static create(properties?: google.cloud.retail.v2.IPurgeMetadata): google.cloud.retail.v2.PurgeMetadata; + public static create(properties?: google.cloud.retail.v2.IRemoveLocalInventoriesRequest): google.cloud.retail.v2.RemoveLocalInventoriesRequest; /** - * Encodes the specified PurgeMetadata message. Does not implicitly {@link google.cloud.retail.v2.PurgeMetadata.verify|verify} messages. - * @param message PurgeMetadata message or plain object to encode + * Encodes the specified RemoveLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2.RemoveLocalInventoriesRequest.verify|verify} messages. + * @param message RemoveLocalInventoriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2.IPurgeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2.IRemoveLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PurgeMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeMetadata.verify|verify} messages. - * @param message PurgeMetadata message or plain object to encode + * Encodes the specified RemoveLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveLocalInventoriesRequest.verify|verify} messages. + * @param message RemoveLocalInventoriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2.IPurgeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2.IRemoveLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PurgeMetadata message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PurgeMetadata + * @returns RemoveLocalInventoriesRequest * @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.v2.PurgeMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.RemoveLocalInventoriesRequest; /** - * Decodes a PurgeMetadata message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PurgeMetadata + * @returns RemoveLocalInventoriesRequest * @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.v2.PurgeMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.RemoveLocalInventoriesRequest; /** - * Verifies a PurgeMetadata message. + * Verifies a RemoveLocalInventoriesRequest 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 PurgeMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PurgeMetadata + * @returns RemoveLocalInventoriesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.PurgeMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.RemoveLocalInventoriesRequest; /** - * Creates a plain object from a PurgeMetadata message. Also converts values to other types if specified. - * @param message PurgeMetadata + * Creates a plain object from a RemoveLocalInventoriesRequest message. Also converts values to other types if specified. + * @param message RemoveLocalInventoriesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2.PurgeMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2.RemoveLocalInventoriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PurgeMetadata to JSON. + * Converts this RemoveLocalInventoriesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PurgeUserEventsRequest. */ - interface IPurgeUserEventsRequest { - - /** PurgeUserEventsRequest parent */ - parent?: (string|null); - - /** PurgeUserEventsRequest filter */ - filter?: (string|null); - - /** PurgeUserEventsRequest force */ - force?: (boolean|null); + /** Properties of a RemoveLocalInventoriesMetadata. */ + interface IRemoveLocalInventoriesMetadata { } - /** Represents a PurgeUserEventsRequest. */ - class PurgeUserEventsRequest implements IPurgeUserEventsRequest { + /** Represents a RemoveLocalInventoriesMetadata. */ + class RemoveLocalInventoriesMetadata implements IRemoveLocalInventoriesMetadata { /** - * Constructs a new PurgeUserEventsRequest. + * Constructs a new RemoveLocalInventoriesMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2.IPurgeUserEventsRequest); - - /** PurgeUserEventsRequest parent. */ - public parent: string; - - /** PurgeUserEventsRequest filter. */ - public filter: string; - - /** PurgeUserEventsRequest force. */ - public force: boolean; + constructor(properties?: google.cloud.retail.v2.IRemoveLocalInventoriesMetadata); /** - * Creates a new PurgeUserEventsRequest instance using the specified properties. + * Creates a new RemoveLocalInventoriesMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns PurgeUserEventsRequest instance + * @returns RemoveLocalInventoriesMetadata instance */ - public static create(properties?: google.cloud.retail.v2.IPurgeUserEventsRequest): google.cloud.retail.v2.PurgeUserEventsRequest; + public static create(properties?: google.cloud.retail.v2.IRemoveLocalInventoriesMetadata): google.cloud.retail.v2.RemoveLocalInventoriesMetadata; /** - * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsRequest.verify|verify} messages. - * @param message PurgeUserEventsRequest message or plain object to encode + * Encodes the specified RemoveLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2.RemoveLocalInventoriesMetadata.verify|verify} messages. + * @param message RemoveLocalInventoriesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2.IPurgeUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2.IRemoveLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsRequest.verify|verify} messages. - * @param message PurgeUserEventsRequest message or plain object to encode + * Encodes the specified RemoveLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveLocalInventoriesMetadata.verify|verify} messages. + * @param message RemoveLocalInventoriesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2.IPurgeUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2.IRemoveLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PurgeUserEventsRequest + * @returns RemoveLocalInventoriesMetadata * @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.v2.PurgeUserEventsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.RemoveLocalInventoriesMetadata; /** - * Decodes a PurgeUserEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PurgeUserEventsRequest + * @returns RemoveLocalInventoriesMetadata * @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.v2.PurgeUserEventsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.RemoveLocalInventoriesMetadata; /** - * Verifies a PurgeUserEventsRequest message. + * Verifies a RemoveLocalInventoriesMetadata 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 PurgeUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PurgeUserEventsRequest + * @returns RemoveLocalInventoriesMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.PurgeUserEventsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.RemoveLocalInventoriesMetadata; /** - * Creates a plain object from a PurgeUserEventsRequest message. Also converts values to other types if specified. - * @param message PurgeUserEventsRequest + * Creates a plain object from a RemoveLocalInventoriesMetadata message. Also converts values to other types if specified. + * @param message RemoveLocalInventoriesMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2.PurgeUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2.RemoveLocalInventoriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PurgeUserEventsRequest to JSON. + * Converts this RemoveLocalInventoriesMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PurgeUserEventsResponse. */ - interface IPurgeUserEventsResponse { - - /** PurgeUserEventsResponse purgedEventsCount */ - purgedEventsCount?: (number|Long|string|null); + /** Properties of a RemoveLocalInventoriesResponse. */ + interface IRemoveLocalInventoriesResponse { } - /** Represents a PurgeUserEventsResponse. */ - class PurgeUserEventsResponse implements IPurgeUserEventsResponse { + /** Represents a RemoveLocalInventoriesResponse. */ + class RemoveLocalInventoriesResponse implements IRemoveLocalInventoriesResponse { /** - * Constructs a new PurgeUserEventsResponse. + * Constructs a new RemoveLocalInventoriesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2.IPurgeUserEventsResponse); - - /** PurgeUserEventsResponse purgedEventsCount. */ - public purgedEventsCount: (number|Long|string); + constructor(properties?: google.cloud.retail.v2.IRemoveLocalInventoriesResponse); /** - * Creates a new PurgeUserEventsResponse instance using the specified properties. + * Creates a new RemoveLocalInventoriesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns PurgeUserEventsResponse instance + * @returns RemoveLocalInventoriesResponse instance */ - public static create(properties?: google.cloud.retail.v2.IPurgeUserEventsResponse): google.cloud.retail.v2.PurgeUserEventsResponse; + public static create(properties?: google.cloud.retail.v2.IRemoveLocalInventoriesResponse): google.cloud.retail.v2.RemoveLocalInventoriesResponse; /** - * Encodes the specified PurgeUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsResponse.verify|verify} messages. - * @param message PurgeUserEventsResponse message or plain object to encode + * Encodes the specified RemoveLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2.RemoveLocalInventoriesResponse.verify|verify} messages. + * @param message RemoveLocalInventoriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2.IPurgeUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2.IRemoveLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PurgeUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsResponse.verify|verify} messages. - * @param message PurgeUserEventsResponse message or plain object to encode + * Encodes the specified RemoveLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveLocalInventoriesResponse.verify|verify} messages. + * @param message RemoveLocalInventoriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2.IPurgeUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2.IRemoveLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PurgeUserEventsResponse message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PurgeUserEventsResponse + * @returns RemoveLocalInventoriesResponse * @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.v2.PurgeUserEventsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.RemoveLocalInventoriesResponse; /** - * Decodes a PurgeUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PurgeUserEventsResponse + * @returns RemoveLocalInventoriesResponse * @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.v2.PurgeUserEventsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.RemoveLocalInventoriesResponse; /** - * Verifies a PurgeUserEventsResponse message. + * Verifies a RemoveLocalInventoriesResponse 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 PurgeUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PurgeUserEventsResponse + * @returns RemoveLocalInventoriesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.PurgeUserEventsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.RemoveLocalInventoriesResponse; /** - * Creates a plain object from a PurgeUserEventsResponse message. Also converts values to other types if specified. - * @param message PurgeUserEventsResponse + * Creates a plain object from a RemoveLocalInventoriesResponse message. Also converts values to other types if specified. + * @param message RemoveLocalInventoriesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2.PurgeUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2.RemoveLocalInventoriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PurgeUserEventsResponse to JSON. + * Converts this RemoveLocalInventoriesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents a SearchService */ - class SearchService extends $protobuf.rpc.Service { - - /** - * Constructs a new SearchService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new SearchService service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SearchService; - - /** - * Calls Search. - * @param request SearchRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SearchResponse - */ - public search(request: google.cloud.retail.v2.ISearchRequest, callback: google.cloud.retail.v2.SearchService.SearchCallback): void; - - /** - * Calls Search. - * @param request SearchRequest message or plain object - * @returns Promise - */ - public search(request: google.cloud.retail.v2.ISearchRequest): Promise; - } - - namespace SearchService { - - /** - * Callback as used by {@link google.cloud.retail.v2.SearchService#search}. - * @param error Error, if any - * @param [response] SearchResponse - */ - type SearchCallback = (error: (Error|null), response?: google.cloud.retail.v2.SearchResponse) => void; - } - - /** Properties of a SearchRequest. */ - interface ISearchRequest { - - /** SearchRequest placement */ - placement?: (string|null); - - /** SearchRequest branch */ - branch?: (string|null); - - /** SearchRequest query */ - query?: (string|null); - - /** SearchRequest visitorId */ - visitorId?: (string|null); - - /** SearchRequest userInfo */ - userInfo?: (google.cloud.retail.v2.IUserInfo|null); - - /** SearchRequest pageSize */ - pageSize?: (number|null); - - /** SearchRequest pageToken */ - pageToken?: (string|null); - - /** SearchRequest offset */ - offset?: (number|null); - - /** SearchRequest filter */ - filter?: (string|null); - - /** SearchRequest canonicalFilter */ - canonicalFilter?: (string|null); - - /** SearchRequest orderBy */ - orderBy?: (string|null); - - /** SearchRequest facetSpecs */ - facetSpecs?: (google.cloud.retail.v2.SearchRequest.IFacetSpec[]|null); - - /** SearchRequest dynamicFacetSpec */ - dynamicFacetSpec?: (google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec|null); + /** Properties of a RemoveFulfillmentPlacesRequest. */ + interface IRemoveFulfillmentPlacesRequest { - /** SearchRequest boostSpec */ - boostSpec?: (google.cloud.retail.v2.SearchRequest.IBoostSpec|null); + /** RemoveFulfillmentPlacesRequest product */ + product?: (string|null); - /** SearchRequest queryExpansionSpec */ - queryExpansionSpec?: (google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec|null); + /** RemoveFulfillmentPlacesRequest type */ + type?: (string|null); - /** SearchRequest variantRollupKeys */ - variantRollupKeys?: (string[]|null); + /** RemoveFulfillmentPlacesRequest placeIds */ + placeIds?: (string[]|null); - /** SearchRequest pageCategories */ - pageCategories?: (string[]|null); + /** RemoveFulfillmentPlacesRequest removeTime */ + removeTime?: (google.protobuf.ITimestamp|null); - /** SearchRequest searchMode */ - searchMode?: (google.cloud.retail.v2.SearchRequest.SearchMode|keyof typeof google.cloud.retail.v2.SearchRequest.SearchMode|null); + /** RemoveFulfillmentPlacesRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a SearchRequest. */ - class SearchRequest implements ISearchRequest { + /** Represents a RemoveFulfillmentPlacesRequest. */ + class RemoveFulfillmentPlacesRequest implements IRemoveFulfillmentPlacesRequest { /** - * Constructs a new SearchRequest. + * Constructs a new RemoveFulfillmentPlacesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2.ISearchRequest); - - /** SearchRequest placement. */ - public placement: string; - - /** SearchRequest branch. */ - public branch: string; - - /** SearchRequest query. */ - public query: string; - - /** SearchRequest visitorId. */ - public visitorId: string; - - /** SearchRequest userInfo. */ - public userInfo?: (google.cloud.retail.v2.IUserInfo|null); - - /** SearchRequest pageSize. */ - public pageSize: number; - - /** SearchRequest pageToken. */ - public pageToken: string; - - /** SearchRequest offset. */ - public offset: number; - - /** SearchRequest filter. */ - public filter: string; - - /** SearchRequest canonicalFilter. */ - public canonicalFilter: string; - - /** SearchRequest orderBy. */ - public orderBy: string; - - /** SearchRequest facetSpecs. */ - public facetSpecs: google.cloud.retail.v2.SearchRequest.IFacetSpec[]; - - /** SearchRequest dynamicFacetSpec. */ - public dynamicFacetSpec?: (google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec|null); + constructor(properties?: google.cloud.retail.v2.IRemoveFulfillmentPlacesRequest); - /** SearchRequest boostSpec. */ - public boostSpec?: (google.cloud.retail.v2.SearchRequest.IBoostSpec|null); + /** RemoveFulfillmentPlacesRequest product. */ + public product: string; - /** SearchRequest queryExpansionSpec. */ - public queryExpansionSpec?: (google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec|null); + /** RemoveFulfillmentPlacesRequest type. */ + public type: string; - /** SearchRequest variantRollupKeys. */ - public variantRollupKeys: string[]; + /** RemoveFulfillmentPlacesRequest placeIds. */ + public placeIds: string[]; - /** SearchRequest pageCategories. */ - public pageCategories: string[]; + /** RemoveFulfillmentPlacesRequest removeTime. */ + public removeTime?: (google.protobuf.ITimestamp|null); - /** SearchRequest searchMode. */ - public searchMode: (google.cloud.retail.v2.SearchRequest.SearchMode|keyof typeof google.cloud.retail.v2.SearchRequest.SearchMode); + /** RemoveFulfillmentPlacesRequest allowMissing. */ + public allowMissing: boolean; /** - * Creates a new SearchRequest instance using the specified properties. + * Creates a new RemoveFulfillmentPlacesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SearchRequest instance + * @returns RemoveFulfillmentPlacesRequest instance */ - public static create(properties?: google.cloud.retail.v2.ISearchRequest): google.cloud.retail.v2.SearchRequest; + public static create(properties?: google.cloud.retail.v2.IRemoveFulfillmentPlacesRequest): google.cloud.retail.v2.RemoveFulfillmentPlacesRequest; /** - * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.verify|verify} messages. - * @param message SearchRequest message or plain object to encode + * Encodes the specified RemoveFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.verify|verify} messages. + * @param message RemoveFulfillmentPlacesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2.IRemoveFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.verify|verify} messages. - * @param message SearchRequest message or plain object to encode + * Encodes the specified RemoveFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.verify|verify} messages. + * @param message RemoveFulfillmentPlacesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2.IRemoveFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SearchRequest message from the specified reader or buffer. + * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SearchRequest + * @returns RemoveFulfillmentPlacesRequest * @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.v2.SearchRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.RemoveFulfillmentPlacesRequest; /** - * Decodes a SearchRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SearchRequest + * @returns RemoveFulfillmentPlacesRequest * @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.v2.SearchRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.RemoveFulfillmentPlacesRequest; /** - * Verifies a SearchRequest message. + * Verifies a RemoveFulfillmentPlacesRequest 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 SearchRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SearchRequest + * @returns RemoveFulfillmentPlacesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.RemoveFulfillmentPlacesRequest; /** - * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. - * @param message SearchRequest + * Creates a plain object from a RemoveFulfillmentPlacesRequest message. Also converts values to other types if specified. + * @param message RemoveFulfillmentPlacesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2.SearchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2.RemoveFulfillmentPlacesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SearchRequest to JSON. + * Converts this RemoveFulfillmentPlacesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace SearchRequest { - - /** Properties of a FacetSpec. */ - interface IFacetSpec { - - /** FacetSpec facetKey */ - facetKey?: (google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey|null); + /** Properties of a RemoveFulfillmentPlacesMetadata. */ + interface IRemoveFulfillmentPlacesMetadata { + } - /** FacetSpec limit */ - limit?: (number|null); + /** Represents a RemoveFulfillmentPlacesMetadata. */ + class RemoveFulfillmentPlacesMetadata implements IRemoveFulfillmentPlacesMetadata { - /** FacetSpec excludedFilterKeys */ - excludedFilterKeys?: (string[]|null); + /** + * Constructs a new RemoveFulfillmentPlacesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.IRemoveFulfillmentPlacesMetadata); - /** FacetSpec enableDynamicPosition */ - enableDynamicPosition?: (boolean|null); - } + /** + * Creates a new RemoveFulfillmentPlacesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveFulfillmentPlacesMetadata instance + */ + public static create(properties?: google.cloud.retail.v2.IRemoveFulfillmentPlacesMetadata): google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata; - /** Represents a FacetSpec. */ - class FacetSpec implements IFacetSpec { + /** + * Encodes the specified RemoveFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata.verify|verify} messages. + * @param message RemoveFulfillmentPlacesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.IRemoveFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new FacetSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2.SearchRequest.IFacetSpec); + /** + * Encodes the specified RemoveFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata.verify|verify} messages. + * @param message RemoveFulfillmentPlacesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.IRemoveFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** FacetSpec facetKey. */ - public facetKey?: (google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey|null); + /** + * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveFulfillmentPlacesMetadata + * @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.v2.RemoveFulfillmentPlacesMetadata; - /** FacetSpec limit. */ - public limit: number; + /** + * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveFulfillmentPlacesMetadata + * @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.v2.RemoveFulfillmentPlacesMetadata; - /** FacetSpec excludedFilterKeys. */ - public excludedFilterKeys: string[]; + /** + * Verifies a RemoveFulfillmentPlacesMetadata 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); - /** FacetSpec enableDynamicPosition. */ - public enableDynamicPosition: boolean; + /** + * Creates a RemoveFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveFulfillmentPlacesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata; - /** - * Creates a new FacetSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns FacetSpec instance - */ - public static create(properties?: google.cloud.retail.v2.SearchRequest.IFacetSpec): google.cloud.retail.v2.SearchRequest.FacetSpec; + /** + * Creates a plain object from a RemoveFulfillmentPlacesMetadata message. Also converts values to other types if specified. + * @param message RemoveFulfillmentPlacesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified FacetSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.FacetSpec.verify|verify} messages. - * @param message FacetSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2.SearchRequest.IFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this RemoveFulfillmentPlacesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified FacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.FacetSpec.verify|verify} messages. - * @param message FacetSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2.SearchRequest.IFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a RemoveFulfillmentPlacesResponse. */ + interface IRemoveFulfillmentPlacesResponse { + } - /** - * Decodes a FacetSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FacetSpec - * @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.v2.SearchRequest.FacetSpec; + /** Represents a RemoveFulfillmentPlacesResponse. */ + class RemoveFulfillmentPlacesResponse implements IRemoveFulfillmentPlacesResponse { - /** - * Decodes a FacetSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FacetSpec - * @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.v2.SearchRequest.FacetSpec; + /** + * Constructs a new RemoveFulfillmentPlacesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.IRemoveFulfillmentPlacesResponse); - /** - * Verifies a FacetSpec 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 new RemoveFulfillmentPlacesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveFulfillmentPlacesResponse instance + */ + public static create(properties?: google.cloud.retail.v2.IRemoveFulfillmentPlacesResponse): google.cloud.retail.v2.RemoveFulfillmentPlacesResponse; - /** - * Creates a FacetSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FacetSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchRequest.FacetSpec; + /** + * Encodes the specified RemoveFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * @param message RemoveFulfillmentPlacesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.IRemoveFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a FacetSpec message. Also converts values to other types if specified. - * @param message FacetSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2.SearchRequest.FacetSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified RemoveFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * @param message RemoveFulfillmentPlacesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.IRemoveFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this FacetSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveFulfillmentPlacesResponse + * @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.v2.RemoveFulfillmentPlacesResponse; - namespace FacetSpec { + /** + * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveFulfillmentPlacesResponse + * @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.v2.RemoveFulfillmentPlacesResponse; - /** Properties of a FacetKey. */ - interface IFacetKey { + /** + * Verifies a RemoveFulfillmentPlacesResponse 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); - /** FacetKey key */ - key?: (string|null); + /** + * Creates a RemoveFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveFulfillmentPlacesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.RemoveFulfillmentPlacesResponse; - /** FacetKey intervals */ - intervals?: (google.cloud.retail.v2.IInterval[]|null); + /** + * Creates a plain object from a RemoveFulfillmentPlacesResponse message. Also converts values to other types if specified. + * @param message RemoveFulfillmentPlacesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.RemoveFulfillmentPlacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FacetKey restrictedValues */ - restrictedValues?: (string[]|null); + /** + * Converts this RemoveFulfillmentPlacesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FacetKey prefixes */ - prefixes?: (string[]|null); + /** Properties of a PurgeMetadata. */ + interface IPurgeMetadata { + } - /** FacetKey contains */ - contains?: (string[]|null); + /** Represents a PurgeMetadata. */ + class PurgeMetadata implements IPurgeMetadata { - /** FacetKey orderBy */ - orderBy?: (string|null); + /** + * Constructs a new PurgeMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.IPurgeMetadata); - /** FacetKey query */ - query?: (string|null); - } + /** + * Creates a new PurgeMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns PurgeMetadata instance + */ + public static create(properties?: google.cloud.retail.v2.IPurgeMetadata): google.cloud.retail.v2.PurgeMetadata; - /** Represents a FacetKey. */ - class FacetKey implements IFacetKey { + /** + * Encodes the specified PurgeMetadata message. Does not implicitly {@link google.cloud.retail.v2.PurgeMetadata.verify|verify} messages. + * @param message PurgeMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.IPurgeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new FacetKey. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey); + /** + * Encodes the specified PurgeMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeMetadata.verify|verify} messages. + * @param message PurgeMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.IPurgeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** FacetKey key. */ - public key: string; + /** + * Decodes a PurgeMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurgeMetadata + * @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.v2.PurgeMetadata; - /** FacetKey intervals. */ - public intervals: google.cloud.retail.v2.IInterval[]; + /** + * Decodes a PurgeMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurgeMetadata + * @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.v2.PurgeMetadata; - /** FacetKey restrictedValues. */ - public restrictedValues: string[]; + /** + * Verifies a PurgeMetadata 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); - /** FacetKey prefixes. */ - public prefixes: string[]; + /** + * Creates a PurgeMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurgeMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.PurgeMetadata; - /** FacetKey contains. */ - public contains: string[]; + /** + * Creates a plain object from a PurgeMetadata message. Also converts values to other types if specified. + * @param message PurgeMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.PurgeMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FacetKey orderBy. */ - public orderBy: string; + /** + * Converts this PurgeMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FacetKey query. */ - public query: string; + /** Properties of a PurgeUserEventsRequest. */ + interface IPurgeUserEventsRequest { - /** - * Creates a new FacetKey instance using the specified properties. - * @param [properties] Properties to set - * @returns FacetKey instance - */ - public static create(properties?: google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey): google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey; + /** PurgeUserEventsRequest parent */ + parent?: (string|null); - /** - * Encodes the specified FacetKey message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. - * @param message FacetKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey, writer?: $protobuf.Writer): $protobuf.Writer; + /** PurgeUserEventsRequest filter */ + filter?: (string|null); - /** - * Encodes the specified FacetKey message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. - * @param message FacetKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey, writer?: $protobuf.Writer): $protobuf.Writer; + /** PurgeUserEventsRequest force */ + force?: (boolean|null); + } - /** - * Decodes a FacetKey message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FacetKey - * @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.v2.SearchRequest.FacetSpec.FacetKey; + /** Represents a PurgeUserEventsRequest. */ + class PurgeUserEventsRequest implements IPurgeUserEventsRequest { - /** - * Decodes a FacetKey message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FacetKey - * @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.v2.SearchRequest.FacetSpec.FacetKey; + /** + * Constructs a new PurgeUserEventsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.IPurgeUserEventsRequest); - /** - * Verifies a FacetKey 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); + /** PurgeUserEventsRequest parent. */ + public parent: string; - /** - * Creates a FacetKey message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FacetKey - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey; + /** PurgeUserEventsRequest filter. */ + public filter: string; - /** - * Creates a plain object from a FacetKey message. Also converts values to other types if specified. - * @param message FacetKey - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** PurgeUserEventsRequest force. */ + public force: boolean; - /** - * Converts this FacetKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Creates a new PurgeUserEventsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PurgeUserEventsRequest instance + */ + public static create(properties?: google.cloud.retail.v2.IPurgeUserEventsRequest): google.cloud.retail.v2.PurgeUserEventsRequest; - /** Properties of a DynamicFacetSpec. */ - interface IDynamicFacetSpec { + /** + * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsRequest.verify|verify} messages. + * @param message PurgeUserEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.IPurgeUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** DynamicFacetSpec mode */ - mode?: (google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode|keyof typeof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode|null); - } + /** + * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsRequest.verify|verify} messages. + * @param message PurgeUserEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.IPurgeUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a DynamicFacetSpec. */ - class DynamicFacetSpec implements IDynamicFacetSpec { + /** + * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurgeUserEventsRequest + * @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.v2.PurgeUserEventsRequest; - /** - * Constructs a new DynamicFacetSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec); + /** + * Decodes a PurgeUserEventsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurgeUserEventsRequest + * @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.v2.PurgeUserEventsRequest; - /** DynamicFacetSpec mode. */ - public mode: (google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode|keyof typeof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode); + /** + * Verifies a PurgeUserEventsRequest 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 new DynamicFacetSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns DynamicFacetSpec instance - */ + /** + * Creates a PurgeUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurgeUserEventsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.PurgeUserEventsRequest; + + /** + * Creates a plain object from a PurgeUserEventsRequest message. Also converts values to other types if specified. + * @param message PurgeUserEventsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.PurgeUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PurgeUserEventsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PurgeUserEventsResponse. */ + interface IPurgeUserEventsResponse { + + /** PurgeUserEventsResponse purgedEventsCount */ + purgedEventsCount?: (number|Long|string|null); + } + + /** Represents a PurgeUserEventsResponse. */ + class PurgeUserEventsResponse implements IPurgeUserEventsResponse { + + /** + * Constructs a new PurgeUserEventsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.IPurgeUserEventsResponse); + + /** PurgeUserEventsResponse purgedEventsCount. */ + public purgedEventsCount: (number|Long|string); + + /** + * Creates a new PurgeUserEventsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PurgeUserEventsResponse instance + */ + public static create(properties?: google.cloud.retail.v2.IPurgeUserEventsResponse): google.cloud.retail.v2.PurgeUserEventsResponse; + + /** + * Encodes the specified PurgeUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsResponse.verify|verify} messages. + * @param message PurgeUserEventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.IPurgeUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PurgeUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsResponse.verify|verify} messages. + * @param message PurgeUserEventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.IPurgeUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PurgeUserEventsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurgeUserEventsResponse + * @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.v2.PurgeUserEventsResponse; + + /** + * Decodes a PurgeUserEventsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurgeUserEventsResponse + * @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.v2.PurgeUserEventsResponse; + + /** + * Verifies a PurgeUserEventsResponse 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 PurgeUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurgeUserEventsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.PurgeUserEventsResponse; + + /** + * Creates a plain object from a PurgeUserEventsResponse message. Also converts values to other types if specified. + * @param message PurgeUserEventsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.PurgeUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PurgeUserEventsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Represents a SearchService */ + class SearchService extends $protobuf.rpc.Service { + + /** + * Constructs a new SearchService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new SearchService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SearchService; + + /** + * Calls Search. + * @param request SearchRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchResponse + */ + public search(request: google.cloud.retail.v2.ISearchRequest, callback: google.cloud.retail.v2.SearchService.SearchCallback): void; + + /** + * Calls Search. + * @param request SearchRequest message or plain object + * @returns Promise + */ + public search(request: google.cloud.retail.v2.ISearchRequest): Promise; + } + + namespace SearchService { + + /** + * Callback as used by {@link google.cloud.retail.v2.SearchService#search}. + * @param error Error, if any + * @param [response] SearchResponse + */ + type SearchCallback = (error: (Error|null), response?: google.cloud.retail.v2.SearchResponse) => void; + } + + /** Properties of a SearchRequest. */ + interface ISearchRequest { + + /** SearchRequest placement */ + placement?: (string|null); + + /** SearchRequest branch */ + branch?: (string|null); + + /** SearchRequest query */ + query?: (string|null); + + /** SearchRequest visitorId */ + visitorId?: (string|null); + + /** SearchRequest userInfo */ + userInfo?: (google.cloud.retail.v2.IUserInfo|null); + + /** SearchRequest pageSize */ + pageSize?: (number|null); + + /** SearchRequest pageToken */ + pageToken?: (string|null); + + /** SearchRequest offset */ + offset?: (number|null); + + /** SearchRequest filter */ + filter?: (string|null); + + /** SearchRequest canonicalFilter */ + canonicalFilter?: (string|null); + + /** SearchRequest orderBy */ + orderBy?: (string|null); + + /** SearchRequest facetSpecs */ + facetSpecs?: (google.cloud.retail.v2.SearchRequest.IFacetSpec[]|null); + + /** SearchRequest dynamicFacetSpec */ + dynamicFacetSpec?: (google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec|null); + + /** SearchRequest boostSpec */ + boostSpec?: (google.cloud.retail.v2.SearchRequest.IBoostSpec|null); + + /** SearchRequest queryExpansionSpec */ + queryExpansionSpec?: (google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec|null); + + /** SearchRequest variantRollupKeys */ + variantRollupKeys?: (string[]|null); + + /** SearchRequest pageCategories */ + pageCategories?: (string[]|null); + + /** SearchRequest searchMode */ + searchMode?: (google.cloud.retail.v2.SearchRequest.SearchMode|keyof typeof google.cloud.retail.v2.SearchRequest.SearchMode|null); + + /** SearchRequest personalizationSpec */ + personalizationSpec?: (google.cloud.retail.v2.SearchRequest.IPersonalizationSpec|null); + } + + /** Represents a SearchRequest. */ + class SearchRequest implements ISearchRequest { + + /** + * Constructs a new SearchRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.ISearchRequest); + + /** SearchRequest placement. */ + public placement: string; + + /** SearchRequest branch. */ + public branch: string; + + /** SearchRequest query. */ + public query: string; + + /** SearchRequest visitorId. */ + public visitorId: string; + + /** SearchRequest userInfo. */ + public userInfo?: (google.cloud.retail.v2.IUserInfo|null); + + /** SearchRequest pageSize. */ + public pageSize: number; + + /** SearchRequest pageToken. */ + public pageToken: string; + + /** SearchRequest offset. */ + public offset: number; + + /** SearchRequest filter. */ + public filter: string; + + /** SearchRequest canonicalFilter. */ + public canonicalFilter: string; + + /** SearchRequest orderBy. */ + public orderBy: string; + + /** SearchRequest facetSpecs. */ + public facetSpecs: google.cloud.retail.v2.SearchRequest.IFacetSpec[]; + + /** SearchRequest dynamicFacetSpec. */ + public dynamicFacetSpec?: (google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec|null); + + /** SearchRequest boostSpec. */ + public boostSpec?: (google.cloud.retail.v2.SearchRequest.IBoostSpec|null); + + /** SearchRequest queryExpansionSpec. */ + public queryExpansionSpec?: (google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec|null); + + /** SearchRequest variantRollupKeys. */ + public variantRollupKeys: string[]; + + /** SearchRequest pageCategories. */ + public pageCategories: string[]; + + /** SearchRequest searchMode. */ + public searchMode: (google.cloud.retail.v2.SearchRequest.SearchMode|keyof typeof google.cloud.retail.v2.SearchRequest.SearchMode); + + /** SearchRequest personalizationSpec. */ + public personalizationSpec?: (google.cloud.retail.v2.SearchRequest.IPersonalizationSpec|null); + + /** + * Creates a new SearchRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchRequest instance + */ + public static create(properties?: google.cloud.retail.v2.ISearchRequest): google.cloud.retail.v2.SearchRequest; + + /** + * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.verify|verify} messages. + * @param message SearchRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.verify|verify} messages. + * @param message SearchRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchRequest + * @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.v2.SearchRequest; + + /** + * Decodes a SearchRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchRequest + * @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.v2.SearchRequest; + + /** + * Verifies a SearchRequest 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 SearchRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchRequest; + + /** + * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. + * @param message SearchRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.SearchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SearchRequest { + + /** Properties of a FacetSpec. */ + interface IFacetSpec { + + /** FacetSpec facetKey */ + facetKey?: (google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey|null); + + /** FacetSpec limit */ + limit?: (number|null); + + /** FacetSpec excludedFilterKeys */ + excludedFilterKeys?: (string[]|null); + + /** FacetSpec enableDynamicPosition */ + enableDynamicPosition?: (boolean|null); + } + + /** Represents a FacetSpec. */ + class FacetSpec implements IFacetSpec { + + /** + * Constructs a new FacetSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.SearchRequest.IFacetSpec); + + /** FacetSpec facetKey. */ + public facetKey?: (google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey|null); + + /** FacetSpec limit. */ + public limit: number; + + /** FacetSpec excludedFilterKeys. */ + public excludedFilterKeys: string[]; + + /** FacetSpec enableDynamicPosition. */ + public enableDynamicPosition: boolean; + + /** + * Creates a new FacetSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetSpec instance + */ + public static create(properties?: google.cloud.retail.v2.SearchRequest.IFacetSpec): google.cloud.retail.v2.SearchRequest.FacetSpec; + + /** + * Encodes the specified FacetSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.FacetSpec.verify|verify} messages. + * @param message FacetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.SearchRequest.IFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.FacetSpec.verify|verify} messages. + * @param message FacetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.SearchRequest.IFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FacetSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetSpec + * @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.v2.SearchRequest.FacetSpec; + + /** + * Decodes a FacetSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetSpec + * @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.v2.SearchRequest.FacetSpec; + + /** + * Verifies a FacetSpec 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 FacetSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchRequest.FacetSpec; + + /** + * Creates a plain object from a FacetSpec message. Also converts values to other types if specified. + * @param message FacetSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.SearchRequest.FacetSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FacetSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FacetSpec { + + /** Properties of a FacetKey. */ + interface IFacetKey { + + /** FacetKey key */ + key?: (string|null); + + /** FacetKey intervals */ + intervals?: (google.cloud.retail.v2.IInterval[]|null); + + /** FacetKey restrictedValues */ + restrictedValues?: (string[]|null); + + /** FacetKey prefixes */ + prefixes?: (string[]|null); + + /** FacetKey contains */ + contains?: (string[]|null); + + /** FacetKey orderBy */ + orderBy?: (string|null); + + /** FacetKey query */ + query?: (string|null); + } + + /** Represents a FacetKey. */ + class FacetKey implements IFacetKey { + + /** + * Constructs a new FacetKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey); + + /** FacetKey key. */ + public key: string; + + /** FacetKey intervals. */ + public intervals: google.cloud.retail.v2.IInterval[]; + + /** FacetKey restrictedValues. */ + public restrictedValues: string[]; + + /** FacetKey prefixes. */ + public prefixes: string[]; + + /** FacetKey contains. */ + public contains: string[]; + + /** FacetKey orderBy. */ + public orderBy: string; + + /** FacetKey query. */ + public query: string; + + /** + * Creates a new FacetKey instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetKey instance + */ + public static create(properties?: google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey): google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey; + + /** + * Encodes the specified FacetKey message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. + * @param message FacetKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FacetKey message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. + * @param message FacetKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FacetKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetKey + * @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.v2.SearchRequest.FacetSpec.FacetKey; + + /** + * Decodes a FacetKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetKey + * @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.v2.SearchRequest.FacetSpec.FacetKey; + + /** + * Verifies a FacetKey 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 FacetKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey; + + /** + * Creates a plain object from a FacetKey message. Also converts values to other types if specified. + * @param message FacetKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FacetKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a DynamicFacetSpec. */ + interface IDynamicFacetSpec { + + /** DynamicFacetSpec mode */ + mode?: (google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode|keyof typeof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode|null); + } + + /** Represents a DynamicFacetSpec. */ + class DynamicFacetSpec implements IDynamicFacetSpec { + + /** + * Constructs a new DynamicFacetSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec); + + /** DynamicFacetSpec mode. */ + public mode: (google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode|keyof typeof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode); + + /** + * Creates a new DynamicFacetSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns DynamicFacetSpec instance + */ public static create(properties?: google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec): google.cloud.retail.v2.SearchRequest.DynamicFacetSpec; - /** - * Encodes the specified DynamicFacetSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.verify|verify} messages. - * @param message DynamicFacetSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified DynamicFacetSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.verify|verify} messages. + * @param message DynamicFacetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DynamicFacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.verify|verify} messages. + * @param message DynamicFacetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DynamicFacetSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DynamicFacetSpec + * @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.v2.SearchRequest.DynamicFacetSpec; + + /** + * Decodes a DynamicFacetSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DynamicFacetSpec + * @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.v2.SearchRequest.DynamicFacetSpec; + + /** + * Verifies a DynamicFacetSpec 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 DynamicFacetSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DynamicFacetSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchRequest.DynamicFacetSpec; + + /** + * Creates a plain object from a DynamicFacetSpec message. Also converts values to other types if specified. + * @param message DynamicFacetSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.SearchRequest.DynamicFacetSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DynamicFacetSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DynamicFacetSpec { + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + DISABLED = 1, + ENABLED = 2 + } + } + + /** Properties of a BoostSpec. */ + interface IBoostSpec { + + /** BoostSpec conditionBoostSpecs */ + conditionBoostSpecs?: (google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec[]|null); + + /** BoostSpec skipBoostSpecValidation */ + skipBoostSpecValidation?: (boolean|null); + } + + /** Represents a BoostSpec. */ + class BoostSpec implements IBoostSpec { + + /** + * Constructs a new BoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.SearchRequest.IBoostSpec); + + /** BoostSpec conditionBoostSpecs. */ + public conditionBoostSpecs: google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec[]; + + /** BoostSpec skipBoostSpecValidation. */ + public skipBoostSpecValidation?: (boolean|null); + + /** BoostSpec _skipBoostSpecValidation. */ + public _skipBoostSpecValidation?: "skipBoostSpecValidation"; + + /** + * Creates a new BoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostSpec instance + */ + public static create(properties?: google.cloud.retail.v2.SearchRequest.IBoostSpec): google.cloud.retail.v2.SearchRequest.BoostSpec; + + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.SearchRequest.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.SearchRequest.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostSpec + * @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.v2.SearchRequest.BoostSpec; + + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostSpec + * @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.v2.SearchRequest.BoostSpec; + + /** + * Verifies a BoostSpec 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 BoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchRequest.BoostSpec; + + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @param message BoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.SearchRequest.BoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BoostSpec { + + /** Properties of a ConditionBoostSpec. */ + interface IConditionBoostSpec { + + /** ConditionBoostSpec condition */ + condition?: (string|null); + + /** ConditionBoostSpec boost */ + boost?: (number|null); + } + + /** Represents a ConditionBoostSpec. */ + class ConditionBoostSpec implements IConditionBoostSpec { + + /** + * Constructs a new ConditionBoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec); + + /** ConditionBoostSpec condition. */ + public condition: string; + + /** ConditionBoostSpec boost. */ + public boost: number; + + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionBoostSpec instance + */ + public static create(properties?: google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec): google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec; + + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionBoostSpec + * @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.v2.SearchRequest.BoostSpec.ConditionBoostSpec; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionBoostSpec + * @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.v2.SearchRequest.BoostSpec.ConditionBoostSpec; + + /** + * Verifies a ConditionBoostSpec 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 ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionBoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec; + + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @param message ConditionBoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionBoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a QueryExpansionSpec. */ + interface IQueryExpansionSpec { + + /** QueryExpansionSpec condition */ + condition?: (google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition|null); + + /** QueryExpansionSpec pinUnexpandedResults */ + pinUnexpandedResults?: (boolean|null); + } + + /** Represents a QueryExpansionSpec. */ + class QueryExpansionSpec implements IQueryExpansionSpec { + + /** + * Constructs a new QueryExpansionSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec); + + /** QueryExpansionSpec condition. */ + public condition: (google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition); + + /** QueryExpansionSpec pinUnexpandedResults. */ + public pinUnexpandedResults: boolean; + + /** + * Creates a new QueryExpansionSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryExpansionSpec instance + */ + public static create(properties?: google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec): google.cloud.retail.v2.SearchRequest.QueryExpansionSpec; + + /** + * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * @param message QueryExpansionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * @param message QueryExpansionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryExpansionSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryExpansionSpec + * @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.v2.SearchRequest.QueryExpansionSpec; + + /** + * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryExpansionSpec + * @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.v2.SearchRequest.QueryExpansionSpec; + + /** + * Verifies a QueryExpansionSpec 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 QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryExpansionSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchRequest.QueryExpansionSpec; + + /** + * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. + * @param message QueryExpansionSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.SearchRequest.QueryExpansionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryExpansionSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace QueryExpansionSpec { + + /** Condition enum. */ + enum Condition { + CONDITION_UNSPECIFIED = 0, + DISABLED = 1, + AUTO = 3 + } + } + + /** Properties of a PersonalizationSpec. */ + interface IPersonalizationSpec { + + /** PersonalizationSpec mode */ + mode?: (google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode|keyof typeof google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode|null); + } + + /** Represents a PersonalizationSpec. */ + class PersonalizationSpec implements IPersonalizationSpec { + + /** + * Constructs a new PersonalizationSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.SearchRequest.IPersonalizationSpec); + + /** PersonalizationSpec mode. */ + public mode: (google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode|keyof typeof google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode); + + /** + * Creates a new PersonalizationSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonalizationSpec instance + */ + public static create(properties?: google.cloud.retail.v2.SearchRequest.IPersonalizationSpec): google.cloud.retail.v2.SearchRequest.PersonalizationSpec; + + /** + * Encodes the specified PersonalizationSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.PersonalizationSpec.verify|verify} messages. + * @param message PersonalizationSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.SearchRequest.IPersonalizationSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonalizationSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.PersonalizationSpec.verify|verify} messages. + * @param message PersonalizationSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.SearchRequest.IPersonalizationSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonalizationSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonalizationSpec + * @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.v2.SearchRequest.PersonalizationSpec; + + /** + * Decodes a PersonalizationSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonalizationSpec + * @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.v2.SearchRequest.PersonalizationSpec; + + /** + * Verifies a PersonalizationSpec 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 PersonalizationSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonalizationSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchRequest.PersonalizationSpec; + + /** + * Creates a plain object from a PersonalizationSpec message. Also converts values to other types if specified. + * @param message PersonalizationSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.SearchRequest.PersonalizationSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonalizationSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace PersonalizationSpec { + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + AUTO = 1, + DISABLED = 2 + } + } + + /** SearchMode enum. */ + enum SearchMode { + SEARCH_MODE_UNSPECIFIED = 0, + PRODUCT_SEARCH_ONLY = 1, + FACETED_SEARCH_ONLY = 2 + } + } + + /** Properties of a SearchResponse. */ + interface ISearchResponse { + + /** SearchResponse results */ + results?: (google.cloud.retail.v2.SearchResponse.ISearchResult[]|null); + + /** SearchResponse facets */ + facets?: (google.cloud.retail.v2.SearchResponse.IFacet[]|null); + + /** SearchResponse totalSize */ + totalSize?: (number|null); + + /** SearchResponse correctedQuery */ + correctedQuery?: (string|null); + + /** SearchResponse attributionToken */ + attributionToken?: (string|null); + + /** SearchResponse nextPageToken */ + nextPageToken?: (string|null); + + /** SearchResponse queryExpansionInfo */ + queryExpansionInfo?: (google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo|null); + + /** SearchResponse redirectUri */ + redirectUri?: (string|null); + + /** SearchResponse appliedControls */ + appliedControls?: (string[]|null); + + /** SearchResponse invalidConditionBoostSpecs */ + invalidConditionBoostSpecs?: (google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec[]|null); + } + + /** Represents a SearchResponse. */ + class SearchResponse implements ISearchResponse { + + /** + * Constructs a new SearchResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.ISearchResponse); + + /** SearchResponse results. */ + public results: google.cloud.retail.v2.SearchResponse.ISearchResult[]; + + /** SearchResponse facets. */ + public facets: google.cloud.retail.v2.SearchResponse.IFacet[]; + + /** SearchResponse totalSize. */ + public totalSize: number; + + /** SearchResponse correctedQuery. */ + public correctedQuery: string; + + /** SearchResponse attributionToken. */ + public attributionToken: string; + + /** SearchResponse nextPageToken. */ + public nextPageToken: string; + + /** SearchResponse queryExpansionInfo. */ + public queryExpansionInfo?: (google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo|null); + + /** SearchResponse redirectUri. */ + public redirectUri: string; + + /** SearchResponse appliedControls. */ + public appliedControls: string[]; + + /** SearchResponse invalidConditionBoostSpecs. */ + public invalidConditionBoostSpecs: google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec[]; + + /** + * Creates a new SearchResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchResponse instance + */ + public static create(properties?: google.cloud.retail.v2.ISearchResponse): google.cloud.retail.v2.SearchResponse; + + /** + * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.verify|verify} messages. + * @param message SearchResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.verify|verify} messages. + * @param message SearchResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchResponse + * @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.v2.SearchResponse; + + /** + * Decodes a SearchResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchResponse + * @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.v2.SearchResponse; + + /** + * Verifies a SearchResponse 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 SearchResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchResponse; + + /** + * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. + * @param message SearchResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.SearchResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SearchResponse { + + /** Properties of a SearchResult. */ + interface ISearchResult { + + /** SearchResult id */ + id?: (string|null); + + /** SearchResult product */ + product?: (google.cloud.retail.v2.IProduct|null); + + /** SearchResult matchingVariantCount */ + matchingVariantCount?: (number|null); + + /** SearchResult matchingVariantFields */ + matchingVariantFields?: ({ [k: string]: google.protobuf.IFieldMask }|null); + + /** SearchResult variantRollupValues */ + variantRollupValues?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a SearchResult. */ + class SearchResult implements ISearchResult { + + /** + * Constructs a new SearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.SearchResponse.ISearchResult); + + /** SearchResult id. */ + public id: string; + + /** SearchResult product. */ + public product?: (google.cloud.retail.v2.IProduct|null); + + /** SearchResult matchingVariantCount. */ + public matchingVariantCount: number; + + /** SearchResult matchingVariantFields. */ + public matchingVariantFields: { [k: string]: google.protobuf.IFieldMask }; + + /** SearchResult variantRollupValues. */ + public variantRollupValues: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new SearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchResult instance + */ + public static create(properties?: google.cloud.retail.v2.SearchResponse.ISearchResult): google.cloud.retail.v2.SearchResponse.SearchResult; + + /** + * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.SearchResult.verify|verify} messages. + * @param message SearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.SearchResult.verify|verify} messages. + * @param message SearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchResult + * @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.v2.SearchResponse.SearchResult; + + /** + * Decodes a SearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchResult + * @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.v2.SearchResponse.SearchResult; + + /** + * Verifies a SearchResult 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 SearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchResponse.SearchResult; + + /** + * Creates a plain object from a SearchResult message. Also converts values to other types if specified. + * @param message SearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.SearchResponse.SearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Facet. */ + interface IFacet { + + /** Facet key */ + key?: (string|null); + + /** Facet values */ + values?: (google.cloud.retail.v2.SearchResponse.Facet.IFacetValue[]|null); + + /** Facet dynamicFacet */ + dynamicFacet?: (boolean|null); + } + + /** Represents a Facet. */ + class Facet implements IFacet { + + /** + * Constructs a new Facet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.SearchResponse.IFacet); + + /** Facet key. */ + public key: string; + + /** Facet values. */ + public values: google.cloud.retail.v2.SearchResponse.Facet.IFacetValue[]; + + /** Facet dynamicFacet. */ + public dynamicFacet: boolean; + + /** + * Creates a new Facet instance using the specified properties. + * @param [properties] Properties to set + * @returns Facet instance + */ + public static create(properties?: google.cloud.retail.v2.SearchResponse.IFacet): google.cloud.retail.v2.SearchResponse.Facet; + + /** + * Encodes the specified Facet message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.Facet.verify|verify} messages. + * @param message Facet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.SearchResponse.IFacet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Facet message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.Facet.verify|verify} messages. + * @param message Facet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.SearchResponse.IFacet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Facet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Facet + * @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.v2.SearchResponse.Facet; + + /** + * Decodes a Facet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Facet + * @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.v2.SearchResponse.Facet; + + /** + * Verifies a Facet 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 Facet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Facet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchResponse.Facet; + + /** + * Creates a plain object from a Facet message. Also converts values to other types if specified. + * @param message Facet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.SearchResponse.Facet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Facet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Facet { + + /** Properties of a FacetValue. */ + interface IFacetValue { + + /** FacetValue value */ + value?: (string|null); + + /** FacetValue interval */ + interval?: (google.cloud.retail.v2.IInterval|null); + + /** FacetValue count */ + count?: (number|Long|string|null); + } + + /** Represents a FacetValue. */ + class FacetValue implements IFacetValue { + + /** + * Constructs a new FacetValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.SearchResponse.Facet.IFacetValue); + + /** FacetValue value. */ + public value?: (string|null); + + /** FacetValue interval. */ + public interval?: (google.cloud.retail.v2.IInterval|null); + + /** FacetValue count. */ + public count: (number|Long|string); + + /** FacetValue facetValue. */ + public facetValue?: ("value"|"interval"); + + /** + * Creates a new FacetValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetValue instance + */ + public static create(properties?: google.cloud.retail.v2.SearchResponse.Facet.IFacetValue): google.cloud.retail.v2.SearchResponse.Facet.FacetValue; + + /** + * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.Facet.FacetValue.verify|verify} messages. + * @param message FacetValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.SearchResponse.Facet.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.Facet.FacetValue.verify|verify} messages. + * @param message FacetValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.SearchResponse.Facet.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FacetValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetValue + * @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.v2.SearchResponse.Facet.FacetValue; + + /** + * Decodes a FacetValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetValue + * @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.v2.SearchResponse.Facet.FacetValue; + + /** + * Verifies a FacetValue 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 FacetValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchResponse.Facet.FacetValue; + + /** + * Creates a plain object from a FacetValue message. Also converts values to other types if specified. + * @param message FacetValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.SearchResponse.Facet.FacetValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FacetValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a QueryExpansionInfo. */ + interface IQueryExpansionInfo { + + /** QueryExpansionInfo expandedQuery */ + expandedQuery?: (boolean|null); + + /** QueryExpansionInfo pinnedResultCount */ + pinnedResultCount?: (number|Long|string|null); + } + + /** Represents a QueryExpansionInfo. */ + class QueryExpansionInfo implements IQueryExpansionInfo { + + /** + * Constructs a new QueryExpansionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo); + + /** QueryExpansionInfo expandedQuery. */ + public expandedQuery: boolean; + + /** QueryExpansionInfo pinnedResultCount. */ + public pinnedResultCount: (number|Long|string); + + /** + * Creates a new QueryExpansionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryExpansionInfo instance + */ + public static create(properties?: google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo): google.cloud.retail.v2.SearchResponse.QueryExpansionInfo; + + /** + * Encodes the specified QueryExpansionInfo message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.verify|verify} messages. + * @param message QueryExpansionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryExpansionInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.verify|verify} messages. + * @param message QueryExpansionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryExpansionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryExpansionInfo + * @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.v2.SearchResponse.QueryExpansionInfo; + + /** + * Decodes a QueryExpansionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryExpansionInfo + * @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.v2.SearchResponse.QueryExpansionInfo; + + /** + * Verifies a QueryExpansionInfo 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 QueryExpansionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryExpansionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchResponse.QueryExpansionInfo; + + /** + * Creates a plain object from a QueryExpansionInfo message. Also converts values to other types if specified. + * @param message QueryExpansionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.SearchResponse.QueryExpansionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryExpansionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Represents a UserEventService */ + class UserEventService extends $protobuf.rpc.Service { + + /** + * Constructs a new UserEventService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new UserEventService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): UserEventService; + + /** + * Calls WriteUserEvent. + * @param request WriteUserEventRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UserEvent + */ + public writeUserEvent(request: google.cloud.retail.v2.IWriteUserEventRequest, callback: google.cloud.retail.v2.UserEventService.WriteUserEventCallback): void; + + /** + * Calls WriteUserEvent. + * @param request WriteUserEventRequest message or plain object + * @returns Promise + */ + public writeUserEvent(request: google.cloud.retail.v2.IWriteUserEventRequest): Promise; + + /** + * Calls CollectUserEvent. + * @param request CollectUserEventRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HttpBody + */ + public collectUserEvent(request: google.cloud.retail.v2.ICollectUserEventRequest, callback: google.cloud.retail.v2.UserEventService.CollectUserEventCallback): void; + + /** + * Calls CollectUserEvent. + * @param request CollectUserEventRequest message or plain object + * @returns Promise + */ + public collectUserEvent(request: google.cloud.retail.v2.ICollectUserEventRequest): Promise; + + /** + * Calls PurgeUserEvents. + * @param request PurgeUserEventsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public purgeUserEvents(request: google.cloud.retail.v2.IPurgeUserEventsRequest, callback: google.cloud.retail.v2.UserEventService.PurgeUserEventsCallback): void; + + /** + * Calls PurgeUserEvents. + * @param request PurgeUserEventsRequest message or plain object + * @returns Promise + */ + public purgeUserEvents(request: google.cloud.retail.v2.IPurgeUserEventsRequest): Promise; + + /** + * Calls ImportUserEvents. + * @param request ImportUserEventsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importUserEvents(request: google.cloud.retail.v2.IImportUserEventsRequest, callback: google.cloud.retail.v2.UserEventService.ImportUserEventsCallback): void; + + /** + * Calls ImportUserEvents. + * @param request ImportUserEventsRequest message or plain object + * @returns Promise + */ + public importUserEvents(request: google.cloud.retail.v2.IImportUserEventsRequest): Promise; + + /** + * Calls RejoinUserEvents. + * @param request RejoinUserEventsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public rejoinUserEvents(request: google.cloud.retail.v2.IRejoinUserEventsRequest, callback: google.cloud.retail.v2.UserEventService.RejoinUserEventsCallback): void; + + /** + * Calls RejoinUserEvents. + * @param request RejoinUserEventsRequest message or plain object + * @returns Promise + */ + public rejoinUserEvents(request: google.cloud.retail.v2.IRejoinUserEventsRequest): Promise; + } + + namespace UserEventService { + + /** + * Callback as used by {@link google.cloud.retail.v2.UserEventService#writeUserEvent}. + * @param error Error, if any + * @param [response] UserEvent + */ + type WriteUserEventCallback = (error: (Error|null), response?: google.cloud.retail.v2.UserEvent) => void; + + /** + * Callback as used by {@link google.cloud.retail.v2.UserEventService#collectUserEvent}. + * @param error Error, if any + * @param [response] HttpBody + */ + type CollectUserEventCallback = (error: (Error|null), response?: google.api.HttpBody) => void; + + /** + * Callback as used by {@link google.cloud.retail.v2.UserEventService#purgeUserEvents}. + * @param error Error, if any + * @param [response] Operation + */ + type PurgeUserEventsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.retail.v2.UserEventService#importUserEvents}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportUserEventsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.retail.v2.UserEventService#rejoinUserEvents}. + * @param error Error, if any + * @param [response] Operation + */ + type RejoinUserEventsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a WriteUserEventRequest. */ + interface IWriteUserEventRequest { + + /** WriteUserEventRequest parent */ + parent?: (string|null); + + /** WriteUserEventRequest userEvent */ + userEvent?: (google.cloud.retail.v2.IUserEvent|null); + } + + /** Represents a WriteUserEventRequest. */ + class WriteUserEventRequest implements IWriteUserEventRequest { + + /** + * Constructs a new WriteUserEventRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.IWriteUserEventRequest); + + /** WriteUserEventRequest parent. */ + public parent: string; + + /** WriteUserEventRequest userEvent. */ + public userEvent?: (google.cloud.retail.v2.IUserEvent|null); + + /** + * Creates a new WriteUserEventRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WriteUserEventRequest instance + */ + public static create(properties?: google.cloud.retail.v2.IWriteUserEventRequest): google.cloud.retail.v2.WriteUserEventRequest; + + /** + * Encodes the specified WriteUserEventRequest message. Does not implicitly {@link google.cloud.retail.v2.WriteUserEventRequest.verify|verify} messages. + * @param message WriteUserEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.IWriteUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WriteUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.WriteUserEventRequest.verify|verify} messages. + * @param message WriteUserEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.IWriteUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WriteUserEventRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WriteUserEventRequest + * @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.v2.WriteUserEventRequest; + + /** + * Decodes a WriteUserEventRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WriteUserEventRequest + * @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.v2.WriteUserEventRequest; + + /** + * Verifies a WriteUserEventRequest 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 WriteUserEventRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WriteUserEventRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.WriteUserEventRequest; + + /** + * Creates a plain object from a WriteUserEventRequest message. Also converts values to other types if specified. + * @param message WriteUserEventRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.WriteUserEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WriteUserEventRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CollectUserEventRequest. */ + interface ICollectUserEventRequest { + + /** CollectUserEventRequest parent */ + parent?: (string|null); + + /** CollectUserEventRequest userEvent */ + userEvent?: (string|null); + + /** CollectUserEventRequest uri */ + uri?: (string|null); + + /** CollectUserEventRequest ets */ + ets?: (number|Long|string|null); + } + + /** Represents a CollectUserEventRequest. */ + class CollectUserEventRequest implements ICollectUserEventRequest { + + /** + * Constructs a new CollectUserEventRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.ICollectUserEventRequest); + + /** CollectUserEventRequest parent. */ + public parent: string; + + /** CollectUserEventRequest userEvent. */ + public userEvent: string; + + /** CollectUserEventRequest uri. */ + public uri: string; + + /** CollectUserEventRequest ets. */ + public ets: (number|Long|string); + + /** + * Creates a new CollectUserEventRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CollectUserEventRequest instance + */ + public static create(properties?: google.cloud.retail.v2.ICollectUserEventRequest): google.cloud.retail.v2.CollectUserEventRequest; + + /** + * Encodes the specified CollectUserEventRequest message. Does not implicitly {@link google.cloud.retail.v2.CollectUserEventRequest.verify|verify} messages. + * @param message CollectUserEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.ICollectUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CollectUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.CollectUserEventRequest.verify|verify} messages. + * @param message CollectUserEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.ICollectUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CollectUserEventRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CollectUserEventRequest + * @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.v2.CollectUserEventRequest; + + /** + * Decodes a CollectUserEventRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CollectUserEventRequest + * @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.v2.CollectUserEventRequest; + + /** + * Verifies a CollectUserEventRequest 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 CollectUserEventRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CollectUserEventRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.CollectUserEventRequest; + + /** + * Creates a plain object from a CollectUserEventRequest message. Also converts values to other types if specified. + * @param message CollectUserEventRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.CollectUserEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CollectUserEventRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RejoinUserEventsRequest. */ + interface IRejoinUserEventsRequest { + + /** RejoinUserEventsRequest parent */ + parent?: (string|null); + + /** RejoinUserEventsRequest userEventRejoinScope */ + userEventRejoinScope?: (google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope|keyof typeof google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope|null); + } + + /** Represents a RejoinUserEventsRequest. */ + class RejoinUserEventsRequest implements IRejoinUserEventsRequest { + + /** + * Constructs a new RejoinUserEventsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.IRejoinUserEventsRequest); + + /** RejoinUserEventsRequest parent. */ + public parent: string; + + /** RejoinUserEventsRequest userEventRejoinScope. */ + public userEventRejoinScope: (google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope|keyof typeof google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope); + + /** + * Creates a new RejoinUserEventsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RejoinUserEventsRequest instance + */ + public static create(properties?: google.cloud.retail.v2.IRejoinUserEventsRequest): google.cloud.retail.v2.RejoinUserEventsRequest; + + /** + * Encodes the specified RejoinUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsRequest.verify|verify} messages. + * @param message RejoinUserEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.IRejoinUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RejoinUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsRequest.verify|verify} messages. + * @param message RejoinUserEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.IRejoinUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RejoinUserEventsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RejoinUserEventsRequest + * @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.v2.RejoinUserEventsRequest; + + /** + * Decodes a RejoinUserEventsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RejoinUserEventsRequest + * @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.v2.RejoinUserEventsRequest; + + /** + * Verifies a RejoinUserEventsRequest 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 RejoinUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RejoinUserEventsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.RejoinUserEventsRequest; + + /** + * Creates a plain object from a RejoinUserEventsRequest message. Also converts values to other types if specified. + * @param message RejoinUserEventsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.RejoinUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RejoinUserEventsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RejoinUserEventsRequest { + + /** UserEventRejoinScope enum. */ + enum UserEventRejoinScope { + USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0, + JOINED_EVENTS = 1, + UNJOINED_EVENTS = 2 + } + } + + /** Properties of a RejoinUserEventsResponse. */ + interface IRejoinUserEventsResponse { + + /** RejoinUserEventsResponse rejoinedUserEventsCount */ + rejoinedUserEventsCount?: (number|Long|string|null); + } + + /** Represents a RejoinUserEventsResponse. */ + class RejoinUserEventsResponse implements IRejoinUserEventsResponse { + + /** + * Constructs a new RejoinUserEventsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.IRejoinUserEventsResponse); + + /** RejoinUserEventsResponse rejoinedUserEventsCount. */ + public rejoinedUserEventsCount: (number|Long|string); + + /** + * Creates a new RejoinUserEventsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RejoinUserEventsResponse instance + */ + public static create(properties?: google.cloud.retail.v2.IRejoinUserEventsResponse): google.cloud.retail.v2.RejoinUserEventsResponse; + + /** + * Encodes the specified RejoinUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsResponse.verify|verify} messages. + * @param message RejoinUserEventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.IRejoinUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RejoinUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsResponse.verify|verify} messages. + * @param message RejoinUserEventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.IRejoinUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RejoinUserEventsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RejoinUserEventsResponse + * @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.v2.RejoinUserEventsResponse; + + /** + * Decodes a RejoinUserEventsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RejoinUserEventsResponse + * @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.v2.RejoinUserEventsResponse; + + /** + * Verifies a RejoinUserEventsResponse 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 RejoinUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RejoinUserEventsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.RejoinUserEventsResponse; + + /** + * Creates a plain object from a RejoinUserEventsResponse message. Also converts values to other types if specified. + * @param message RejoinUserEventsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.RejoinUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RejoinUserEventsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RejoinUserEventsMetadata. */ + interface IRejoinUserEventsMetadata { + } + + /** Represents a RejoinUserEventsMetadata. */ + class RejoinUserEventsMetadata implements IRejoinUserEventsMetadata { + + /** + * Constructs a new RejoinUserEventsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.IRejoinUserEventsMetadata); + + /** + * Creates a new RejoinUserEventsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RejoinUserEventsMetadata instance + */ + public static create(properties?: google.cloud.retail.v2.IRejoinUserEventsMetadata): google.cloud.retail.v2.RejoinUserEventsMetadata; + + /** + * Encodes the specified RejoinUserEventsMetadata message. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsMetadata.verify|verify} messages. + * @param message RejoinUserEventsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.IRejoinUserEventsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RejoinUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsMetadata.verify|verify} messages. + * @param message RejoinUserEventsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.IRejoinUserEventsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RejoinUserEventsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RejoinUserEventsMetadata + * @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.v2.RejoinUserEventsMetadata; + + /** + * Decodes a RejoinUserEventsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RejoinUserEventsMetadata + * @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.v2.RejoinUserEventsMetadata; + + /** + * Verifies a RejoinUserEventsMetadata 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 RejoinUserEventsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RejoinUserEventsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.RejoinUserEventsMetadata; + + /** + * Creates a plain object from a RejoinUserEventsMetadata message. Also converts values to other types if specified. + * @param message RejoinUserEventsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.RejoinUserEventsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RejoinUserEventsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace v2alpha. */ + namespace v2alpha { + + /** Properties of a ProductLevelConfig. */ + interface IProductLevelConfig { + + /** ProductLevelConfig ingestionProductType */ + ingestionProductType?: (string|null); + + /** ProductLevelConfig merchantCenterProductIdField */ + merchantCenterProductIdField?: (string|null); + } + + /** Represents a ProductLevelConfig. */ + class ProductLevelConfig implements IProductLevelConfig { + + /** + * Constructs a new ProductLevelConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IProductLevelConfig); + + /** ProductLevelConfig ingestionProductType. */ + public ingestionProductType: string; + + /** ProductLevelConfig merchantCenterProductIdField. */ + public merchantCenterProductIdField: string; + + /** + * Creates a new ProductLevelConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductLevelConfig instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IProductLevelConfig): google.cloud.retail.v2alpha.ProductLevelConfig; + + /** + * Encodes the specified ProductLevelConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductLevelConfig.verify|verify} messages. + * @param message ProductLevelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IProductLevelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProductLevelConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductLevelConfig.verify|verify} messages. + * @param message ProductLevelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IProductLevelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProductLevelConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductLevelConfig + * @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.ProductLevelConfig; + + /** + * Decodes a ProductLevelConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductLevelConfig + * @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.ProductLevelConfig; + + /** + * Verifies a ProductLevelConfig 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 ProductLevelConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductLevelConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ProductLevelConfig; + + /** + * Creates a plain object from a ProductLevelConfig message. Also converts values to other types if specified. + * @param message ProductLevelConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ProductLevelConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProductLevelConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MerchantCenterLink. */ + interface IMerchantCenterLink { + + /** MerchantCenterLink merchantCenterAccountId */ + merchantCenterAccountId?: (number|Long|string|null); + + /** MerchantCenterLink branchId */ + branchId?: (string|null); + + /** MerchantCenterLink destinations */ + destinations?: (string[]|null); + + /** MerchantCenterLink regionCode */ + regionCode?: (string|null); + + /** MerchantCenterLink languageCode */ + languageCode?: (string|null); + } + + /** Represents a MerchantCenterLink. */ + class MerchantCenterLink implements IMerchantCenterLink { + + /** + * Constructs a new MerchantCenterLink. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IMerchantCenterLink); + + /** MerchantCenterLink merchantCenterAccountId. */ + public merchantCenterAccountId: (number|Long|string); + + /** MerchantCenterLink branchId. */ + public branchId: string; + + /** MerchantCenterLink destinations. */ + public destinations: string[]; + + /** MerchantCenterLink regionCode. */ + public regionCode: string; + + /** MerchantCenterLink languageCode. */ + public languageCode: string; + + /** + * Creates a new MerchantCenterLink instance using the specified properties. + * @param [properties] Properties to set + * @returns MerchantCenterLink instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IMerchantCenterLink): google.cloud.retail.v2alpha.MerchantCenterLink; + + /** + * Encodes the specified MerchantCenterLink message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLink.verify|verify} messages. + * @param message MerchantCenterLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IMerchantCenterLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MerchantCenterLink message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLink.verify|verify} messages. + * @param message MerchantCenterLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IMerchantCenterLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MerchantCenterLink message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MerchantCenterLink + * @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.MerchantCenterLink; + + /** + * Decodes a MerchantCenterLink message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MerchantCenterLink + * @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.MerchantCenterLink; + + /** + * Verifies a MerchantCenterLink 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 MerchantCenterLink message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MerchantCenterLink + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.MerchantCenterLink; + + /** + * Creates a plain object from a MerchantCenterLink message. Also converts values to other types if specified. + * @param message MerchantCenterLink + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.MerchantCenterLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MerchantCenterLink to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MerchantCenterLinkingConfig. */ + interface IMerchantCenterLinkingConfig { + + /** MerchantCenterLinkingConfig links */ + links?: (google.cloud.retail.v2alpha.IMerchantCenterLink[]|null); + } + + /** Represents a MerchantCenterLinkingConfig. */ + class MerchantCenterLinkingConfig implements IMerchantCenterLinkingConfig { + + /** + * Constructs a new MerchantCenterLinkingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig); + + /** MerchantCenterLinkingConfig links. */ + public links: google.cloud.retail.v2alpha.IMerchantCenterLink[]; + + /** + * Creates a new MerchantCenterLinkingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns MerchantCenterLinkingConfig instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig): google.cloud.retail.v2alpha.MerchantCenterLinkingConfig; + + /** + * Encodes the specified MerchantCenterLinkingConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.verify|verify} messages. + * @param message MerchantCenterLinkingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MerchantCenterLinkingConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.verify|verify} messages. + * @param message MerchantCenterLinkingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MerchantCenterLinkingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MerchantCenterLinkingConfig + * @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.MerchantCenterLinkingConfig; + + /** + * Decodes a MerchantCenterLinkingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MerchantCenterLinkingConfig + * @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.MerchantCenterLinkingConfig; + + /** + * Verifies a MerchantCenterLinkingConfig 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 MerchantCenterLinkingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MerchantCenterLinkingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.MerchantCenterLinkingConfig; + + /** + * Creates a plain object from a MerchantCenterLinkingConfig message. Also converts values to other types if specified. + * @param message MerchantCenterLinkingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.MerchantCenterLinkingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MerchantCenterLinkingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Catalog. */ + interface ICatalog { + + /** Catalog name */ + name?: (string|null); + + /** Catalog displayName */ + displayName?: (string|null); + + /** Catalog productLevelConfig */ + productLevelConfig?: (google.cloud.retail.v2alpha.IProductLevelConfig|null); + + /** Catalog merchantCenterLinkingConfig */ + merchantCenterLinkingConfig?: (google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig|null); + } + + /** Represents a Catalog. */ + class Catalog implements ICatalog { + + /** + * Constructs a new Catalog. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.ICatalog); + + /** Catalog name. */ + public name: string; + + /** Catalog displayName. */ + public displayName: string; + + /** Catalog productLevelConfig. */ + public productLevelConfig?: (google.cloud.retail.v2alpha.IProductLevelConfig|null); + + /** Catalog merchantCenterLinkingConfig. */ + public merchantCenterLinkingConfig?: (google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig|null); + + /** + * Creates a new Catalog instance using the specified properties. + * @param [properties] Properties to set + * @returns Catalog instance + */ + public static create(properties?: google.cloud.retail.v2alpha.ICatalog): google.cloud.retail.v2alpha.Catalog; + + /** + * Encodes the specified Catalog message. Does not implicitly {@link google.cloud.retail.v2alpha.Catalog.verify|verify} messages. + * @param message Catalog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.ICatalog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Catalog message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Catalog.verify|verify} messages. + * @param message Catalog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICatalog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Catalog message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Catalog + * @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.Catalog; + + /** + * Decodes a Catalog message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Catalog + * @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.Catalog; + + /** + * Verifies a Catalog 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 Catalog message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Catalog + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Catalog; + + /** + * Creates a plain object from a Catalog message. Also converts values to other types if specified. + * @param message Catalog + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Catalog, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Catalog to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** SolutionType enum. */ + enum SolutionType { + SOLUTION_TYPE_UNSPECIFIED = 0, + SOLUTION_TYPE_RECOMMENDATION = 1, + SOLUTION_TYPE_SEARCH = 2 + } + + /** Properties of a Condition. */ + interface ICondition { + + /** Condition queryTerms */ + queryTerms?: (google.cloud.retail.v2alpha.Condition.IQueryTerm[]|null); + + /** Condition activeTimeRange */ + activeTimeRange?: (google.cloud.retail.v2alpha.Condition.ITimeRange[]|null); + } + + /** Represents a Condition. */ + class Condition implements ICondition { + + /** + * Constructs a new Condition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.ICondition); + + /** Condition queryTerms. */ + public queryTerms: google.cloud.retail.v2alpha.Condition.IQueryTerm[]; + + /** Condition activeTimeRange. */ + public activeTimeRange: google.cloud.retail.v2alpha.Condition.ITimeRange[]; + + /** + * Creates a new Condition instance using the specified properties. + * @param [properties] Properties to set + * @returns Condition instance + */ + public static create(properties?: google.cloud.retail.v2alpha.ICondition): google.cloud.retail.v2alpha.Condition; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Condition + * @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.Condition; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Condition + * @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.Condition; + + /** + * Verifies a Condition 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 Condition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Condition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Condition; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @param message Condition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Condition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Condition { + + /** Properties of a QueryTerm. */ + interface IQueryTerm { + + /** QueryTerm value */ + value?: (string|null); + + /** QueryTerm fullMatch */ + fullMatch?: (boolean|null); + } + + /** Represents a QueryTerm. */ + class QueryTerm implements IQueryTerm { + + /** + * Constructs a new QueryTerm. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Condition.IQueryTerm); + + /** QueryTerm value. */ + public value: string; + + /** QueryTerm fullMatch. */ + public fullMatch: boolean; + + /** + * Creates a new QueryTerm instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryTerm instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Condition.IQueryTerm): google.cloud.retail.v2alpha.Condition.QueryTerm; + + /** + * Encodes the specified QueryTerm message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.QueryTerm.verify|verify} messages. + * @param message QueryTerm message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Condition.IQueryTerm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryTerm message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.QueryTerm.verify|verify} messages. + * @param message QueryTerm message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Condition.IQueryTerm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryTerm message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryTerm + * @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.Condition.QueryTerm; + + /** + * Decodes a QueryTerm message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryTerm + * @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.Condition.QueryTerm; + + /** + * Verifies a QueryTerm 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 QueryTerm message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryTerm + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Condition.QueryTerm; + + /** + * Creates a plain object from a QueryTerm message. Also converts values to other types if specified. + * @param message QueryTerm + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Condition.QueryTerm, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryTerm to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TimeRange. */ + interface ITimeRange { + + /** TimeRange startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeRange endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TimeRange. */ + class TimeRange implements ITimeRange { + + /** + * Constructs a new TimeRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Condition.ITimeRange); + + /** TimeRange startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimeRange endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TimeRange instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeRange instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Condition.ITimeRange): google.cloud.retail.v2alpha.Condition.TimeRange; + + /** + * Encodes the specified TimeRange message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.TimeRange.verify|verify} messages. + * @param message TimeRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Condition.ITimeRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.TimeRange.verify|verify} messages. + * @param message TimeRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Condition.ITimeRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeRange + * @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.Condition.TimeRange; + + /** + * Decodes a TimeRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeRange + * @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.Condition.TimeRange; + + /** + * Verifies a TimeRange 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 TimeRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Condition.TimeRange; + + /** + * Creates a plain object from a TimeRange message. Also converts values to other types if specified. + * @param message TimeRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Condition.TimeRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a Rule. */ + interface IRule { + + /** Rule boostAction */ + boostAction?: (google.cloud.retail.v2alpha.Rule.IBoostAction|null); + + /** Rule redirectAction */ + redirectAction?: (google.cloud.retail.v2alpha.Rule.IRedirectAction|null); + + /** Rule onewaySynonymsAction */ + onewaySynonymsAction?: (google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction|null); + + /** Rule doNotAssociateAction */ + doNotAssociateAction?: (google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction|null); + + /** Rule replacementAction */ + replacementAction?: (google.cloud.retail.v2alpha.Rule.IReplacementAction|null); + + /** Rule ignoreAction */ + ignoreAction?: (google.cloud.retail.v2alpha.Rule.IIgnoreAction|null); + + /** Rule filterAction */ + filterAction?: (google.cloud.retail.v2alpha.Rule.IFilterAction|null); + + /** Rule twowaySynonymsAction */ + twowaySynonymsAction?: (google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction|null); + + /** Rule condition */ + condition?: (google.cloud.retail.v2alpha.ICondition|null); + } + + /** Represents a Rule. */ + class Rule implements IRule { + + /** + * Constructs a new Rule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IRule); + + /** Rule boostAction. */ + public boostAction?: (google.cloud.retail.v2alpha.Rule.IBoostAction|null); + + /** Rule redirectAction. */ + public redirectAction?: (google.cloud.retail.v2alpha.Rule.IRedirectAction|null); + + /** Rule onewaySynonymsAction. */ + public onewaySynonymsAction?: (google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction|null); + + /** Rule doNotAssociateAction. */ + public doNotAssociateAction?: (google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction|null); + + /** Rule replacementAction. */ + public replacementAction?: (google.cloud.retail.v2alpha.Rule.IReplacementAction|null); + + /** Rule ignoreAction. */ + public ignoreAction?: (google.cloud.retail.v2alpha.Rule.IIgnoreAction|null); + + /** Rule filterAction. */ + public filterAction?: (google.cloud.retail.v2alpha.Rule.IFilterAction|null); + + /** Rule twowaySynonymsAction. */ + public twowaySynonymsAction?: (google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction|null); + + /** Rule condition. */ + public condition?: (google.cloud.retail.v2alpha.ICondition|null); + + /** Rule action. */ + public action?: ("boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"); + + /** + * Creates a new Rule instance using the specified properties. + * @param [properties] Properties to set + * @returns Rule instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IRule): google.cloud.retail.v2alpha.Rule; + + /** + * Encodes the specified Rule message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.verify|verify} messages. + * @param message Rule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.verify|verify} messages. + * @param message Rule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Rule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Rule + * @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.Rule; + + /** + * Decodes a Rule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Rule + * @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.Rule; + + /** + * Verifies a Rule 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 Rule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Rule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule; + + /** + * Creates a plain object from a Rule message. Also converts values to other types if specified. + * @param message Rule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Rule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Rule { + + /** Properties of a BoostAction. */ + interface IBoostAction { + + /** BoostAction boost */ + boost?: (number|null); + + /** BoostAction productsFilter */ + productsFilter?: (string|null); + } + + /** Represents a BoostAction. */ + class BoostAction implements IBoostAction { + + /** + * Constructs a new BoostAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.IBoostAction); + + /** BoostAction boost. */ + public boost: number; + + /** BoostAction productsFilter. */ + public productsFilter: string; + + /** + * Creates a new BoostAction instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.IBoostAction): google.cloud.retail.v2alpha.Rule.BoostAction; + + /** + * Encodes the specified BoostAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.BoostAction.verify|verify} messages. + * @param message BoostAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.IBoostAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.BoostAction.verify|verify} messages. + * @param message BoostAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IBoostAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostAction + * @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.Rule.BoostAction; + + /** + * Decodes a BoostAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostAction + * @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.Rule.BoostAction; + + /** + * Verifies a BoostAction 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 BoostAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.BoostAction; + + /** + * Creates a plain object from a BoostAction message. Also converts values to other types if specified. + * @param message BoostAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.BoostAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FilterAction. */ + interface IFilterAction { + + /** FilterAction filter */ + filter?: (string|null); + } + + /** Represents a FilterAction. */ + class FilterAction implements IFilterAction { + + /** + * Constructs a new FilterAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.IFilterAction); + + /** FilterAction filter. */ + public filter: string; + + /** + * Creates a new FilterAction instance using the specified properties. + * @param [properties] Properties to set + * @returns FilterAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.IFilterAction): google.cloud.retail.v2alpha.Rule.FilterAction; + + /** + * Encodes the specified FilterAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.FilterAction.verify|verify} messages. + * @param message FilterAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.IFilterAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FilterAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.FilterAction.verify|verify} messages. + * @param message FilterAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IFilterAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FilterAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FilterAction + * @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.Rule.FilterAction; + + /** + * Decodes a FilterAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FilterAction + * @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.Rule.FilterAction; + + /** + * Verifies a FilterAction 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 FilterAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FilterAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.FilterAction; + + /** + * Creates a plain object from a FilterAction message. Also converts values to other types if specified. + * @param message FilterAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.FilterAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FilterAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RedirectAction. */ + interface IRedirectAction { + + /** RedirectAction redirectUri */ + redirectUri?: (string|null); + } + + /** Represents a RedirectAction. */ + class RedirectAction implements IRedirectAction { + + /** + * Constructs a new RedirectAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.IRedirectAction); + + /** RedirectAction redirectUri. */ + public redirectUri: string; + + /** + * Creates a new RedirectAction instance using the specified properties. + * @param [properties] Properties to set + * @returns RedirectAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.IRedirectAction): google.cloud.retail.v2alpha.Rule.RedirectAction; + + /** + * Encodes the specified RedirectAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RedirectAction.verify|verify} messages. + * @param message RedirectAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.IRedirectAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RedirectAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RedirectAction.verify|verify} messages. + * @param message RedirectAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IRedirectAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RedirectAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RedirectAction + * @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.Rule.RedirectAction; + + /** + * Decodes a RedirectAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RedirectAction + * @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.Rule.RedirectAction; + + /** + * Verifies a RedirectAction 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 RedirectAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RedirectAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.RedirectAction; + + /** + * Creates a plain object from a RedirectAction message. Also converts values to other types if specified. + * @param message RedirectAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.RedirectAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RedirectAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TwowaySynonymsAction. */ + interface ITwowaySynonymsAction { + + /** TwowaySynonymsAction synonyms */ + synonyms?: (string[]|null); + } + + /** Represents a TwowaySynonymsAction. */ + class TwowaySynonymsAction implements ITwowaySynonymsAction { + + /** + * Constructs a new TwowaySynonymsAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction); + + /** TwowaySynonymsAction synonyms. */ + public synonyms: string[]; + + /** + * Creates a new TwowaySynonymsAction instance using the specified properties. + * @param [properties] Properties to set + * @returns TwowaySynonymsAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction): google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction; + + /** + * Encodes the specified TwowaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify|verify} messages. + * @param message TwowaySynonymsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TwowaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify|verify} messages. + * @param message TwowaySynonymsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TwowaySynonymsAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TwowaySynonymsAction + * @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.Rule.TwowaySynonymsAction; + + /** + * Decodes a TwowaySynonymsAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TwowaySynonymsAction + * @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.Rule.TwowaySynonymsAction; + + /** + * Verifies a TwowaySynonymsAction 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 TwowaySynonymsAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TwowaySynonymsAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction; + + /** + * Creates a plain object from a TwowaySynonymsAction message. Also converts values to other types if specified. + * @param message TwowaySynonymsAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TwowaySynonymsAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OnewaySynonymsAction. */ + interface IOnewaySynonymsAction { + + /** OnewaySynonymsAction queryTerms */ + queryTerms?: (string[]|null); + + /** OnewaySynonymsAction synonyms */ + synonyms?: (string[]|null); + + /** OnewaySynonymsAction onewayTerms */ + onewayTerms?: (string[]|null); + } + + /** Represents an OnewaySynonymsAction. */ + class OnewaySynonymsAction implements IOnewaySynonymsAction { + + /** + * Constructs a new OnewaySynonymsAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction); + + /** OnewaySynonymsAction queryTerms. */ + public queryTerms: string[]; + + /** OnewaySynonymsAction synonyms. */ + public synonyms: string[]; + + /** OnewaySynonymsAction onewayTerms. */ + public onewayTerms: string[]; + + /** + * Creates a new OnewaySynonymsAction instance using the specified properties. + * @param [properties] Properties to set + * @returns OnewaySynonymsAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction): google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction; + + /** + * Encodes the specified OnewaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify|verify} messages. + * @param message OnewaySynonymsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OnewaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify|verify} messages. + * @param message OnewaySynonymsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OnewaySynonymsAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OnewaySynonymsAction + * @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.Rule.OnewaySynonymsAction; + + /** + * Decodes an OnewaySynonymsAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OnewaySynonymsAction + * @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.Rule.OnewaySynonymsAction; + + /** + * Verifies an OnewaySynonymsAction 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 OnewaySynonymsAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OnewaySynonymsAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction; + + /** + * Creates a plain object from an OnewaySynonymsAction message. Also converts values to other types if specified. + * @param message OnewaySynonymsAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OnewaySynonymsAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DoNotAssociateAction. */ + interface IDoNotAssociateAction { + + /** DoNotAssociateAction queryTerms */ + queryTerms?: (string[]|null); + + /** DoNotAssociateAction doNotAssociateTerms */ + doNotAssociateTerms?: (string[]|null); + + /** DoNotAssociateAction terms */ + terms?: (string[]|null); + } + + /** Represents a DoNotAssociateAction. */ + class DoNotAssociateAction implements IDoNotAssociateAction { + + /** + * Constructs a new DoNotAssociateAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction); + + /** DoNotAssociateAction queryTerms. */ + public queryTerms: string[]; + + /** DoNotAssociateAction doNotAssociateTerms. */ + public doNotAssociateTerms: string[]; + + /** DoNotAssociateAction terms. */ + public terms: string[]; + + /** + * Creates a new DoNotAssociateAction instance using the specified properties. + * @param [properties] Properties to set + * @returns DoNotAssociateAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction): google.cloud.retail.v2alpha.Rule.DoNotAssociateAction; + + /** + * Encodes the specified DoNotAssociateAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify|verify} messages. + * @param message DoNotAssociateAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoNotAssociateAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify|verify} messages. + * @param message DoNotAssociateAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoNotAssociateAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoNotAssociateAction + * @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.Rule.DoNotAssociateAction; + + /** + * Decodes a DoNotAssociateAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoNotAssociateAction + * @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.Rule.DoNotAssociateAction; + + /** + * Verifies a DoNotAssociateAction 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 DoNotAssociateAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoNotAssociateAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.DoNotAssociateAction; + + /** + * Creates a plain object from a DoNotAssociateAction message. Also converts values to other types if specified. + * @param message DoNotAssociateAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.DoNotAssociateAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoNotAssociateAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReplacementAction. */ + interface IReplacementAction { + + /** ReplacementAction queryTerms */ + queryTerms?: (string[]|null); + + /** ReplacementAction replacementTerm */ + replacementTerm?: (string|null); + + /** ReplacementAction term */ + term?: (string|null); + } + + /** Represents a ReplacementAction. */ + class ReplacementAction implements IReplacementAction { + + /** + * Constructs a new ReplacementAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.IReplacementAction); + + /** ReplacementAction queryTerms. */ + public queryTerms: string[]; + + /** ReplacementAction replacementTerm. */ + public replacementTerm: string; + + /** ReplacementAction term. */ + public term: string; + + /** + * Creates a new ReplacementAction instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplacementAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.IReplacementAction): google.cloud.retail.v2alpha.Rule.ReplacementAction; + + /** + * Encodes the specified ReplacementAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ReplacementAction.verify|verify} messages. + * @param message ReplacementAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.IReplacementAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplacementAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ReplacementAction.verify|verify} messages. + * @param message ReplacementAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IReplacementAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplacementAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplacementAction + * @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.Rule.ReplacementAction; + + /** + * Decodes a ReplacementAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplacementAction + * @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.Rule.ReplacementAction; + + /** + * Verifies a ReplacementAction 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 ReplacementAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplacementAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.ReplacementAction; + + /** + * Creates a plain object from a ReplacementAction message. Also converts values to other types if specified. + * @param message ReplacementAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.ReplacementAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplacementAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an IgnoreAction. */ + interface IIgnoreAction { + + /** IgnoreAction ignoreTerms */ + ignoreTerms?: (string[]|null); + } + + /** Represents an IgnoreAction. */ + class IgnoreAction implements IIgnoreAction { + + /** + * Constructs a new IgnoreAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.IIgnoreAction); + + /** IgnoreAction ignoreTerms. */ + public ignoreTerms: string[]; + + /** + * Creates a new IgnoreAction instance using the specified properties. + * @param [properties] Properties to set + * @returns IgnoreAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.IIgnoreAction): google.cloud.retail.v2alpha.Rule.IgnoreAction; + + /** + * Encodes the specified IgnoreAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.IgnoreAction.verify|verify} messages. + * @param message IgnoreAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.IIgnoreAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IgnoreAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.IgnoreAction.verify|verify} messages. + * @param message IgnoreAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IIgnoreAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IgnoreAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IgnoreAction + * @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.Rule.IgnoreAction; + + /** + * Decodes an IgnoreAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IgnoreAction + * @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.Rule.IgnoreAction; + + /** + * Verifies an IgnoreAction 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 IgnoreAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IgnoreAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.IgnoreAction; + + /** + * Creates a plain object from an IgnoreAction message. Also converts values to other types if specified. + * @param message IgnoreAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.IgnoreAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IgnoreAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an Audience. */ + interface IAudience { + + /** Audience genders */ + genders?: (string[]|null); + + /** Audience ageGroups */ + ageGroups?: (string[]|null); + } + + /** Represents an Audience. */ + class Audience implements IAudience { + + /** + * Constructs a new Audience. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IAudience); + + /** Audience genders. */ + public genders: string[]; + + /** Audience ageGroups. */ + public ageGroups: string[]; + + /** + * Creates a new Audience instance using the specified properties. + * @param [properties] Properties to set + * @returns Audience instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IAudience): google.cloud.retail.v2alpha.Audience; + + /** + * Encodes the specified Audience message. Does not implicitly {@link google.cloud.retail.v2alpha.Audience.verify|verify} messages. + * @param message Audience message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IAudience, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Audience message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Audience.verify|verify} messages. + * @param message Audience message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAudience, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Audience message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Audience + * @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.Audience; + + /** + * Decodes an Audience message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Audience + * @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.Audience; + + /** + * Verifies an Audience 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 Audience message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Audience + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Audience; + + /** + * Creates a plain object from an Audience message. Also converts values to other types if specified. + * @param message Audience + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Audience, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Audience to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ColorInfo. */ + interface IColorInfo { + + /** ColorInfo colorFamilies */ + colorFamilies?: (string[]|null); + + /** ColorInfo colors */ + colors?: (string[]|null); + } + + /** Represents a ColorInfo. */ + class ColorInfo implements IColorInfo { + + /** + * Constructs a new ColorInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IColorInfo); + + /** ColorInfo colorFamilies. */ + public colorFamilies: string[]; + + /** ColorInfo colors. */ + public colors: string[]; + + /** + * Creates a new ColorInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ColorInfo instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IColorInfo): google.cloud.retail.v2alpha.ColorInfo; + + /** + * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.ColorInfo.verify|verify} messages. + * @param message ColorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ColorInfo.verify|verify} messages. + * @param message ColorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColorInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColorInfo + * @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.ColorInfo; + + /** + * Decodes a ColorInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColorInfo + * @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.ColorInfo; + + /** + * Verifies a ColorInfo 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 ColorInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColorInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ColorInfo; + + /** + * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. + * @param message ColorInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ColorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColorInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CustomAttribute. */ + interface ICustomAttribute { + + /** CustomAttribute text */ + text?: (string[]|null); + + /** CustomAttribute numbers */ + numbers?: (number[]|null); + + /** CustomAttribute searchable */ + searchable?: (boolean|null); + + /** CustomAttribute indexable */ + indexable?: (boolean|null); + } + + /** Represents a CustomAttribute. */ + class CustomAttribute implements ICustomAttribute { + + /** + * Constructs a new CustomAttribute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.ICustomAttribute); + + /** CustomAttribute text. */ + public text: string[]; + + /** CustomAttribute numbers. */ + public numbers: number[]; + + /** CustomAttribute searchable. */ + public searchable?: (boolean|null); + + /** CustomAttribute indexable. */ + public indexable?: (boolean|null); + + /** CustomAttribute _searchable. */ + public _searchable?: "searchable"; + + /** CustomAttribute _indexable. */ + public _indexable?: "indexable"; + + /** + * Creates a new CustomAttribute instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomAttribute instance + */ + public static create(properties?: google.cloud.retail.v2alpha.ICustomAttribute): google.cloud.retail.v2alpha.CustomAttribute; + + /** + * Encodes the specified CustomAttribute message. Does not implicitly {@link google.cloud.retail.v2alpha.CustomAttribute.verify|verify} messages. + * @param message CustomAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CustomAttribute.verify|verify} messages. + * @param message CustomAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomAttribute + * @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.CustomAttribute; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomAttribute + * @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.CustomAttribute; + + /** + * Verifies a CustomAttribute 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 CustomAttribute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomAttribute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CustomAttribute; + + /** + * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. + * @param message CustomAttribute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CustomAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomAttribute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FulfillmentInfo. */ + interface IFulfillmentInfo { + + /** FulfillmentInfo type */ + type?: (string|null); + + /** FulfillmentInfo placeIds */ + placeIds?: (string[]|null); + } + + /** Represents a FulfillmentInfo. */ + class FulfillmentInfo implements IFulfillmentInfo { + + /** + * Constructs a new FulfillmentInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IFulfillmentInfo); + + /** FulfillmentInfo type. */ + public type: string; + + /** FulfillmentInfo placeIds. */ + public placeIds: string[]; + + /** + * Creates a new FulfillmentInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FulfillmentInfo instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IFulfillmentInfo): google.cloud.retail.v2alpha.FulfillmentInfo; + + /** + * Encodes the specified FulfillmentInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.FulfillmentInfo.verify|verify} messages. + * @param message FulfillmentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IFulfillmentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FulfillmentInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.FulfillmentInfo.verify|verify} messages. + * @param message FulfillmentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IFulfillmentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FulfillmentInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FulfillmentInfo + * @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.FulfillmentInfo; + + /** + * Decodes a FulfillmentInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FulfillmentInfo + * @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.FulfillmentInfo; + + /** + * Verifies a FulfillmentInfo 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 FulfillmentInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FulfillmentInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.FulfillmentInfo; + + /** + * Creates a plain object from a FulfillmentInfo message. Also converts values to other types if specified. + * @param message FulfillmentInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.FulfillmentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FulfillmentInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image uri */ + uri?: (string|null); + + /** Image height */ + height?: (number|null); + + /** Image width */ + width?: (number|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IImage); + + /** Image uri. */ + public uri: string; + + /** Image height. */ + public height: number; + + /** Image width. */ + public width: number; + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IImage): google.cloud.retail.v2alpha.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.retail.v2alpha.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Image message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Image + * @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.Image; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Image + * @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.Image; + + /** + * Verifies an Image 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 Image message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Image + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Image; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @param message Image + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Interval. */ + interface IInterval { - /** - * Encodes the specified DynamicFacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.verify|verify} messages. - * @param message DynamicFacetSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** Interval minimum */ + minimum?: (number|null); - /** - * Decodes a DynamicFacetSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DynamicFacetSpec - * @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.v2.SearchRequest.DynamicFacetSpec; + /** Interval exclusiveMinimum */ + exclusiveMinimum?: (number|null); - /** - * Decodes a DynamicFacetSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DynamicFacetSpec - * @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.v2.SearchRequest.DynamicFacetSpec; + /** Interval maximum */ + maximum?: (number|null); - /** - * Verifies a DynamicFacetSpec 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); + /** Interval exclusiveMaximum */ + exclusiveMaximum?: (number|null); + } - /** - * Creates a DynamicFacetSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DynamicFacetSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchRequest.DynamicFacetSpec; + /** Represents an Interval. */ + class Interval implements IInterval { + + /** + * Constructs a new Interval. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IInterval); + + /** Interval minimum. */ + public minimum?: (number|null); + + /** Interval exclusiveMinimum. */ + public exclusiveMinimum?: (number|null); + + /** Interval maximum. */ + public maximum?: (number|null); + + /** Interval exclusiveMaximum. */ + public exclusiveMaximum?: (number|null); + + /** Interval min. */ + public min?: ("minimum"|"exclusiveMinimum"); + + /** Interval max. */ + public max?: ("maximum"|"exclusiveMaximum"); + + /** + * Creates a new Interval instance using the specified properties. + * @param [properties] Properties to set + * @returns Interval instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IInterval): google.cloud.retail.v2alpha.Interval; + + /** + * Encodes the specified Interval message. Does not implicitly {@link google.cloud.retail.v2alpha.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Interval message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Interval + * @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.Interval; + + /** + * Decodes an Interval message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Interval + * @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.Interval; + + /** + * Verifies an Interval 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 Interval message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Interval + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Interval; + + /** + * Creates a plain object from an Interval message. Also converts values to other types if specified. + * @param message Interval + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Interval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Interval to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PriceInfo. */ + interface IPriceInfo { + + /** PriceInfo currencyCode */ + currencyCode?: (string|null); + + /** PriceInfo price */ + price?: (number|null); + + /** PriceInfo originalPrice */ + originalPrice?: (number|null); + + /** PriceInfo cost */ + cost?: (number|null); + + /** PriceInfo priceEffectiveTime */ + priceEffectiveTime?: (google.protobuf.ITimestamp|null); + + /** PriceInfo priceExpireTime */ + priceExpireTime?: (google.protobuf.ITimestamp|null); + + /** PriceInfo priceRange */ + priceRange?: (google.cloud.retail.v2alpha.PriceInfo.IPriceRange|null); + } + + /** Represents a PriceInfo. */ + class PriceInfo implements IPriceInfo { + + /** + * Constructs a new PriceInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IPriceInfo); + + /** PriceInfo currencyCode. */ + public currencyCode: string; + + /** PriceInfo price. */ + public price: number; + + /** PriceInfo originalPrice. */ + public originalPrice: number; + + /** PriceInfo cost. */ + public cost: number; + + /** PriceInfo priceEffectiveTime. */ + public priceEffectiveTime?: (google.protobuf.ITimestamp|null); + + /** PriceInfo priceExpireTime. */ + public priceExpireTime?: (google.protobuf.ITimestamp|null); + + /** PriceInfo priceRange. */ + public priceRange?: (google.cloud.retail.v2alpha.PriceInfo.IPriceRange|null); + + /** + * Creates a new PriceInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PriceInfo instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IPriceInfo): google.cloud.retail.v2alpha.PriceInfo; + + /** + * Encodes the specified PriceInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.verify|verify} messages. + * @param message PriceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IPriceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PriceInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.verify|verify} messages. + * @param message PriceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPriceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PriceInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PriceInfo + * @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.PriceInfo; + + /** + * Decodes a PriceInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PriceInfo + * @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.PriceInfo; + + /** + * Verifies a PriceInfo 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 PriceInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PriceInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PriceInfo; - /** - * Creates a plain object from a DynamicFacetSpec message. Also converts values to other types if specified. - * @param message DynamicFacetSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2.SearchRequest.DynamicFacetSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a PriceInfo message. Also converts values to other types if specified. + * @param message PriceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.PriceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this DynamicFacetSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this PriceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - namespace DynamicFacetSpec { + namespace PriceInfo { - /** Mode enum. */ - enum Mode { - MODE_UNSPECIFIED = 0, - DISABLED = 1, - ENABLED = 2 - } - } + /** Properties of a PriceRange. */ + interface IPriceRange { - /** Properties of a BoostSpec. */ - interface IBoostSpec { + /** PriceRange price */ + price?: (google.cloud.retail.v2alpha.IInterval|null); - /** BoostSpec conditionBoostSpecs */ - conditionBoostSpecs?: (google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec[]|null); + /** PriceRange originalPrice */ + originalPrice?: (google.cloud.retail.v2alpha.IInterval|null); } - /** Represents a BoostSpec. */ - class BoostSpec implements IBoostSpec { + /** Represents a PriceRange. */ + class PriceRange implements IPriceRange { /** - * Constructs a new BoostSpec. + * Constructs a new PriceRange. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2.SearchRequest.IBoostSpec); + constructor(properties?: google.cloud.retail.v2alpha.PriceInfo.IPriceRange); - /** BoostSpec conditionBoostSpecs. */ - public conditionBoostSpecs: google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec[]; + /** PriceRange price. */ + public price?: (google.cloud.retail.v2alpha.IInterval|null); + + /** PriceRange originalPrice. */ + public originalPrice?: (google.cloud.retail.v2alpha.IInterval|null); /** - * Creates a new BoostSpec instance using the specified properties. + * Creates a new PriceRange instance using the specified properties. * @param [properties] Properties to set - * @returns BoostSpec instance + * @returns PriceRange instance */ - public static create(properties?: google.cloud.retail.v2.SearchRequest.IBoostSpec): google.cloud.retail.v2.SearchRequest.BoostSpec; + public static create(properties?: google.cloud.retail.v2alpha.PriceInfo.IPriceRange): google.cloud.retail.v2alpha.PriceInfo.PriceRange; /** - * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.BoostSpec.verify|verify} messages. - * @param message BoostSpec message or plain object to encode + * Encodes the specified PriceRange message. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.PriceRange.verify|verify} messages. + * @param message PriceRange message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2.SearchRequest.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.PriceInfo.IPriceRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.BoostSpec.verify|verify} messages. - * @param message BoostSpec message or plain object to encode + * Encodes the specified PriceRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.PriceRange.verify|verify} messages. + * @param message PriceRange message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2.SearchRequest.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.PriceInfo.IPriceRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BoostSpec message from the specified reader or buffer. + * Decodes a PriceRange message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BoostSpec + * @returns PriceRange * @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.v2.SearchRequest.BoostSpec; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PriceInfo.PriceRange; /** - * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * Decodes a PriceRange message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BoostSpec + * @returns PriceRange * @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.v2.SearchRequest.BoostSpec; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PriceInfo.PriceRange; /** - * Verifies a BoostSpec message. + * Verifies a PriceRange 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 BoostSpec message from a plain object. Also converts values to their respective internal types. + * Creates a PriceRange message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BoostSpec + * @returns PriceRange */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchRequest.BoostSpec; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PriceInfo.PriceRange; /** - * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. - * @param message BoostSpec + * Creates a plain object from a PriceRange message. Also converts values to other types if specified. + * @param message PriceRange * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2.SearchRequest.BoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.PriceInfo.PriceRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BoostSpec to JSON. + * Converts this PriceRange to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - namespace BoostSpec { + /** Properties of a Rating. */ + interface IRating { - /** Properties of a ConditionBoostSpec. */ - interface IConditionBoostSpec { + /** Rating ratingCount */ + ratingCount?: (number|null); - /** ConditionBoostSpec condition */ - condition?: (string|null); + /** Rating averageRating */ + averageRating?: (number|null); - /** ConditionBoostSpec boost */ - boost?: (number|null); - } + /** Rating ratingHistogram */ + ratingHistogram?: (number[]|null); + } - /** Represents a ConditionBoostSpec. */ - class ConditionBoostSpec implements IConditionBoostSpec { + /** Represents a Rating. */ + class Rating implements IRating { - /** - * Constructs a new ConditionBoostSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec); + /** + * Constructs a new Rating. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IRating); - /** ConditionBoostSpec condition. */ - public condition: string; + /** Rating ratingCount. */ + public ratingCount: number; - /** ConditionBoostSpec boost. */ - public boost: number; + /** Rating averageRating. */ + public averageRating: number; - /** - * Creates a new ConditionBoostSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns ConditionBoostSpec instance - */ - public static create(properties?: google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec): google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec; + /** Rating ratingHistogram. */ + public ratingHistogram: number[]; - /** - * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @param message ConditionBoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new Rating instance using the specified properties. + * @param [properties] Properties to set + * @returns Rating instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IRating): google.cloud.retail.v2alpha.Rating; - /** - * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @param message ConditionBoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Rating message. Does not implicitly {@link google.cloud.retail.v2alpha.Rating.verify|verify} messages. + * @param message Rating message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IRating, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConditionBoostSpec - * @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.v2.SearchRequest.BoostSpec.ConditionBoostSpec; + /** + * Encodes the specified Rating message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rating.verify|verify} messages. + * @param message Rating message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRating, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Rating message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Rating + * @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.Rating; + + /** + * Decodes a Rating message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Rating + * @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.Rating; + + /** + * Verifies a Rating 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 Rating message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Rating + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rating; + + /** + * Creates a plain object from a Rating message. Also converts values to other types if specified. + * @param message Rating + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rating, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Rating to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a UserInfo. */ + interface IUserInfo { + + /** UserInfo userId */ + userId?: (string|null); - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConditionBoostSpec - * @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.v2.SearchRequest.BoostSpec.ConditionBoostSpec; + /** UserInfo ipAddress */ + ipAddress?: (string|null); - /** - * Verifies a ConditionBoostSpec 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); + /** UserInfo userAgent */ + userAgent?: (string|null); - /** - * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConditionBoostSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec; + /** UserInfo directUserRequest */ + directUserRequest?: (boolean|null); + } - /** - * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. - * @param message ConditionBoostSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a UserInfo. */ + class UserInfo implements IUserInfo { - /** - * Converts this ConditionBoostSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Constructs a new UserInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IUserInfo); - /** Properties of a QueryExpansionSpec. */ - interface IQueryExpansionSpec { + /** UserInfo userId. */ + public userId: string; - /** QueryExpansionSpec condition */ - condition?: (google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition|null); + /** UserInfo ipAddress. */ + public ipAddress: string; - /** QueryExpansionSpec pinUnexpandedResults */ - pinUnexpandedResults?: (boolean|null); - } + /** UserInfo userAgent. */ + public userAgent: string; - /** Represents a QueryExpansionSpec. */ - class QueryExpansionSpec implements IQueryExpansionSpec { + /** UserInfo directUserRequest. */ + public directUserRequest: boolean; - /** - * Constructs a new QueryExpansionSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec); + /** + * Creates a new UserInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns UserInfo instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IUserInfo): google.cloud.retail.v2alpha.UserInfo; - /** QueryExpansionSpec condition. */ - public condition: (google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition); + /** + * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.UserInfo.verify|verify} messages. + * @param message UserInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; - /** QueryExpansionSpec pinUnexpandedResults. */ - public pinUnexpandedResults: boolean; + /** + * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserInfo.verify|verify} messages. + * @param message UserInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new QueryExpansionSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryExpansionSpec instance - */ - public static create(properties?: google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec): google.cloud.retail.v2.SearchRequest.QueryExpansionSpec; + /** + * Decodes a UserInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserInfo + * @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.UserInfo; - /** - * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.verify|verify} messages. - * @param message QueryExpansionSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a UserInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserInfo + * @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.UserInfo; - /** - * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.verify|verify} messages. - * @param message QueryExpansionSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a UserInfo 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); - /** - * Decodes a QueryExpansionSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryExpansionSpec - * @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.v2.SearchRequest.QueryExpansionSpec; + /** + * Creates a UserInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserInfo; - /** - * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryExpansionSpec - * @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.v2.SearchRequest.QueryExpansionSpec; + /** + * Creates a plain object from a UserInfo message. Also converts values to other types if specified. + * @param message UserInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.UserInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a QueryExpansionSpec 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); + /** + * Converts this UserInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryExpansionSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchRequest.QueryExpansionSpec; + /** Properties of a Promotion. */ + interface IPromotion { - /** - * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. - * @param message QueryExpansionSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2.SearchRequest.QueryExpansionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Promotion promotionId */ + promotionId?: (string|null); + } - /** - * Converts this QueryExpansionSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents a Promotion. */ + class Promotion implements IPromotion { - namespace QueryExpansionSpec { + /** + * Constructs a new Promotion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IPromotion); - /** Condition enum. */ - enum Condition { - CONDITION_UNSPECIFIED = 0, - DISABLED = 1, - AUTO = 3 - } - } + /** Promotion promotionId. */ + public promotionId: string; - /** SearchMode enum. */ - enum SearchMode { - SEARCH_MODE_UNSPECIFIED = 0, - PRODUCT_SEARCH_ONLY = 1, - FACETED_SEARCH_ONLY = 2 - } - } + /** + * Creates a new Promotion instance using the specified properties. + * @param [properties] Properties to set + * @returns Promotion instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IPromotion): google.cloud.retail.v2alpha.Promotion; + + /** + * Encodes the specified Promotion message. Does not implicitly {@link google.cloud.retail.v2alpha.Promotion.verify|verify} messages. + * @param message Promotion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IPromotion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Promotion message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Promotion.verify|verify} messages. + * @param message Promotion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPromotion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Promotion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Promotion + * @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.Promotion; - /** Properties of a SearchResponse. */ - interface ISearchResponse { + /** + * Decodes a Promotion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Promotion + * @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.Promotion; - /** SearchResponse results */ - results?: (google.cloud.retail.v2.SearchResponse.ISearchResult[]|null); + /** + * Verifies a Promotion 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); - /** SearchResponse facets */ - facets?: (google.cloud.retail.v2.SearchResponse.IFacet[]|null); + /** + * Creates a Promotion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Promotion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Promotion; - /** SearchResponse totalSize */ - totalSize?: (number|null); + /** + * Creates a plain object from a Promotion message. Also converts values to other types if specified. + * @param message Promotion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Promotion, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** SearchResponse correctedQuery */ - correctedQuery?: (string|null); + /** + * Converts this Promotion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** SearchResponse attributionToken */ - attributionToken?: (string|null); + /** Properties of a LocalInventory. */ + interface ILocalInventory { - /** SearchResponse nextPageToken */ - nextPageToken?: (string|null); + /** LocalInventory placeId */ + placeId?: (string|null); - /** SearchResponse queryExpansionInfo */ - queryExpansionInfo?: (google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo|null); + /** LocalInventory priceInfo */ + priceInfo?: (google.cloud.retail.v2alpha.IPriceInfo|null); - /** SearchResponse redirectUri */ - redirectUri?: (string|null); + /** LocalInventory attributes */ + attributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }|null); } - /** Represents a SearchResponse. */ - class SearchResponse implements ISearchResponse { + /** Represents a LocalInventory. */ + class LocalInventory implements ILocalInventory { /** - * Constructs a new SearchResponse. + * Constructs a new LocalInventory. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2.ISearchResponse); - - /** SearchResponse results. */ - public results: google.cloud.retail.v2.SearchResponse.ISearchResult[]; - - /** SearchResponse facets. */ - public facets: google.cloud.retail.v2.SearchResponse.IFacet[]; - - /** SearchResponse totalSize. */ - public totalSize: number; - - /** SearchResponse correctedQuery. */ - public correctedQuery: string; - - /** SearchResponse attributionToken. */ - public attributionToken: string; + constructor(properties?: google.cloud.retail.v2alpha.ILocalInventory); - /** SearchResponse nextPageToken. */ - public nextPageToken: string; + /** LocalInventory placeId. */ + public placeId: string; - /** SearchResponse queryExpansionInfo. */ - public queryExpansionInfo?: (google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo|null); + /** LocalInventory priceInfo. */ + public priceInfo?: (google.cloud.retail.v2alpha.IPriceInfo|null); - /** SearchResponse redirectUri. */ - public redirectUri: string; + /** LocalInventory attributes. */ + public attributes: { [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }; /** - * Creates a new SearchResponse instance using the specified properties. + * Creates a new LocalInventory instance using the specified properties. * @param [properties] Properties to set - * @returns SearchResponse instance + * @returns LocalInventory instance */ - public static create(properties?: google.cloud.retail.v2.ISearchResponse): google.cloud.retail.v2.SearchResponse; + public static create(properties?: google.cloud.retail.v2alpha.ILocalInventory): google.cloud.retail.v2alpha.LocalInventory; /** - * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.verify|verify} messages. - * @param message SearchResponse message or plain object to encode + * Encodes the specified LocalInventory message. Does not implicitly {@link google.cloud.retail.v2alpha.LocalInventory.verify|verify} messages. + * @param message LocalInventory message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ILocalInventory, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SearchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.verify|verify} messages. - * @param message SearchResponse message or plain object to encode + * Encodes the specified LocalInventory message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.LocalInventory.verify|verify} messages. + * @param message LocalInventory message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ILocalInventory, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SearchResponse message from the specified reader or buffer. + * Decodes a LocalInventory message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SearchResponse + * @returns LocalInventory * @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.v2.SearchResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.LocalInventory; /** - * Decodes a SearchResponse message from the specified reader or buffer, length delimited. + * Decodes a LocalInventory message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SearchResponse + * @returns LocalInventory * @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.v2.SearchResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.LocalInventory; /** - * Verifies a SearchResponse message. + * Verifies a LocalInventory 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 SearchResponse message from a plain object. Also converts values to their respective internal types. + * Creates a LocalInventory message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SearchResponse + * @returns LocalInventory */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.LocalInventory; /** - * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. - * @param message SearchResponse + * Creates a plain object from a LocalInventory message. Also converts values to other types if specified. + * @param message LocalInventory * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2.SearchResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.LocalInventory, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SearchResponse to JSON. + * Converts this LocalInventory to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace SearchResponse { - - /** Properties of a SearchResult. */ - interface ISearchResult { - - /** SearchResult id */ - id?: (string|null); - - /** SearchResult product */ - product?: (google.cloud.retail.v2.IProduct|null); - - /** SearchResult matchingVariantCount */ - matchingVariantCount?: (number|null); - - /** SearchResult matchingVariantFields */ - matchingVariantFields?: ({ [k: string]: google.protobuf.IFieldMask }|null); - - /** SearchResult variantRollupValues */ - variantRollupValues?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a SearchResult. */ - class SearchResult implements ISearchResult { + /** Properties of a GcsSource. */ + interface IGcsSource { - /** - * Constructs a new SearchResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2.SearchResponse.ISearchResult); + /** GcsSource inputUris */ + inputUris?: (string[]|null); - /** SearchResult id. */ - public id: string; + /** GcsSource dataSchema */ + dataSchema?: (string|null); + } - /** SearchResult product. */ - public product?: (google.cloud.retail.v2.IProduct|null); + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { - /** SearchResult matchingVariantCount. */ - public matchingVariantCount: number; + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IGcsSource); - /** SearchResult matchingVariantFields. */ - public matchingVariantFields: { [k: string]: google.protobuf.IFieldMask }; + /** GcsSource inputUris. */ + public inputUris: string[]; - /** SearchResult variantRollupValues. */ - public variantRollupValues: { [k: string]: google.protobuf.IValue }; + /** GcsSource dataSchema. */ + public dataSchema: string; - /** - * Creates a new SearchResult instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchResult instance - */ - public static create(properties?: google.cloud.retail.v2.SearchResponse.ISearchResult): google.cloud.retail.v2.SearchResponse.SearchResult; + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IGcsSource): google.cloud.retail.v2alpha.GcsSource; - /** - * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.SearchResult.verify|verify} messages. - * @param message SearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.retail.v2alpha.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.SearchResult.verify|verify} messages. - * @param message SearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a SearchResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchResult - * @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.v2.SearchResponse.SearchResult; + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsSource + * @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.GcsSource; - /** - * Decodes a SearchResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchResult - * @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.v2.SearchResponse.SearchResult; + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsSource + * @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.GcsSource; - /** - * Verifies a SearchResult 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); + /** + * Verifies a GcsSource 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 SearchResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchResponse.SearchResult; + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GcsSource; - /** - * Creates a plain object from a SearchResult message. Also converts values to other types if specified. - * @param message SearchResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2.SearchResponse.SearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @param message GcsSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this SearchResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this GcsSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of a Facet. */ - interface IFacet { + /** Properties of a BigQuerySource. */ + interface IBigQuerySource { - /** Facet key */ - key?: (string|null); + /** BigQuerySource partitionDate */ + partitionDate?: (google.type.IDate|null); - /** Facet values */ - values?: (google.cloud.retail.v2.SearchResponse.Facet.IFacetValue[]|null); + /** BigQuerySource projectId */ + projectId?: (string|null); - /** Facet dynamicFacet */ - dynamicFacet?: (boolean|null); - } + /** BigQuerySource datasetId */ + datasetId?: (string|null); - /** Represents a Facet. */ - class Facet implements IFacet { + /** BigQuerySource tableId */ + tableId?: (string|null); - /** - * Constructs a new Facet. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2.SearchResponse.IFacet); + /** BigQuerySource gcsStagingDir */ + gcsStagingDir?: (string|null); - /** Facet key. */ - public key: string; + /** BigQuerySource dataSchema */ + dataSchema?: (string|null); + } - /** Facet values. */ - public values: google.cloud.retail.v2.SearchResponse.Facet.IFacetValue[]; + /** Represents a BigQuerySource. */ + class BigQuerySource implements IBigQuerySource { - /** Facet dynamicFacet. */ - public dynamicFacet: boolean; + /** + * Constructs a new BigQuerySource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IBigQuerySource); - /** - * Creates a new Facet instance using the specified properties. - * @param [properties] Properties to set - * @returns Facet instance - */ - public static create(properties?: google.cloud.retail.v2.SearchResponse.IFacet): google.cloud.retail.v2.SearchResponse.Facet; + /** BigQuerySource partitionDate. */ + public partitionDate?: (google.type.IDate|null); - /** - * Encodes the specified Facet message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.Facet.verify|verify} messages. - * @param message Facet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2.SearchResponse.IFacet, writer?: $protobuf.Writer): $protobuf.Writer; + /** BigQuerySource projectId. */ + public projectId: string; - /** - * Encodes the specified Facet message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.Facet.verify|verify} messages. - * @param message Facet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2.SearchResponse.IFacet, writer?: $protobuf.Writer): $protobuf.Writer; + /** BigQuerySource datasetId. */ + public datasetId: string; - /** - * Decodes a Facet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Facet - * @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.v2.SearchResponse.Facet; + /** BigQuerySource tableId. */ + public tableId: string; - /** - * Decodes a Facet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Facet - * @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.v2.SearchResponse.Facet; + /** BigQuerySource gcsStagingDir. */ + public gcsStagingDir: string; - /** - * Verifies a Facet 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); + /** BigQuerySource dataSchema. */ + public dataSchema: string; - /** - * Creates a Facet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Facet - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchResponse.Facet; + /** BigQuerySource partition. */ + public partition?: "partitionDate"; - /** - * Creates a plain object from a Facet message. Also converts values to other types if specified. - * @param message Facet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2.SearchResponse.Facet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a new BigQuerySource instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQuerySource instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IBigQuerySource): google.cloud.retail.v2alpha.BigQuerySource; - /** - * Converts this Facet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.retail.v2alpha.BigQuerySource.verify|verify} messages. + * @param message BigQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; - namespace Facet { + /** + * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BigQuerySource.verify|verify} messages. + * @param message BigQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a FacetValue. */ - interface IFacetValue { + /** + * Decodes a BigQuerySource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQuerySource + * @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.BigQuerySource; - /** FacetValue value */ - value?: (string|null); + /** + * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQuerySource + * @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.BigQuerySource; - /** FacetValue interval */ - interval?: (google.cloud.retail.v2.IInterval|null); + /** + * Verifies a BigQuerySource 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); - /** FacetValue count */ - count?: (number|Long|string|null); - } + /** + * Creates a BigQuerySource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQuerySource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.BigQuerySource; - /** Represents a FacetValue. */ - class FacetValue implements IFacetValue { + /** + * Creates a plain object from a BigQuerySource message. Also converts values to other types if specified. + * @param message BigQuerySource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.BigQuerySource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new FacetValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2.SearchResponse.Facet.IFacetValue); + /** + * Converts this BigQuerySource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FacetValue value. */ - public value?: (string|null); + /** Properties of a ProductInlineSource. */ + interface IProductInlineSource { - /** FacetValue interval. */ - public interval?: (google.cloud.retail.v2.IInterval|null); + /** ProductInlineSource products */ + products?: (google.cloud.retail.v2alpha.IProduct[]|null); + } - /** FacetValue count. */ - public count: (number|Long|string); + /** Represents a ProductInlineSource. */ + class ProductInlineSource implements IProductInlineSource { - /** FacetValue facetValue. */ - public facetValue?: ("value"|"interval"); + /** + * Constructs a new ProductInlineSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IProductInlineSource); - /** - * Creates a new FacetValue instance using the specified properties. - * @param [properties] Properties to set - * @returns FacetValue instance - */ - public static create(properties?: google.cloud.retail.v2.SearchResponse.Facet.IFacetValue): google.cloud.retail.v2.SearchResponse.Facet.FacetValue; + /** ProductInlineSource products. */ + public products: google.cloud.retail.v2alpha.IProduct[]; - /** - * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.Facet.FacetValue.verify|verify} messages. - * @param message FacetValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2.SearchResponse.Facet.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new ProductInlineSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductInlineSource instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IProductInlineSource): google.cloud.retail.v2alpha.ProductInlineSource; - /** - * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.Facet.FacetValue.verify|verify} messages. - * @param message FacetValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2.SearchResponse.Facet.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified ProductInlineSource message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInlineSource.verify|verify} messages. + * @param message ProductInlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IProductInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a FacetValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FacetValue - * @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.v2.SearchResponse.Facet.FacetValue; + /** + * Encodes the specified ProductInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInlineSource.verify|verify} messages. + * @param message ProductInlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IProductInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a FacetValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FacetValue - * @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.v2.SearchResponse.Facet.FacetValue; + /** + * Decodes a ProductInlineSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductInlineSource + * @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.ProductInlineSource; - /** - * Verifies a FacetValue 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); + /** + * Decodes a ProductInlineSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductInlineSource + * @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.ProductInlineSource; - /** - * Creates a FacetValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FacetValue - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchResponse.Facet.FacetValue; + /** + * Verifies a ProductInlineSource 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 plain object from a FacetValue message. Also converts values to other types if specified. - * @param message FacetValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2.SearchResponse.Facet.FacetValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a ProductInlineSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductInlineSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ProductInlineSource; - /** - * Converts this FacetValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Creates a plain object from a ProductInlineSource message. Also converts values to other types if specified. + * @param message ProductInlineSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ProductInlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a QueryExpansionInfo. */ - interface IQueryExpansionInfo { + /** + * Converts this ProductInlineSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** QueryExpansionInfo expandedQuery */ - expandedQuery?: (boolean|null); + /** Properties of a UserEventInlineSource. */ + interface IUserEventInlineSource { - /** QueryExpansionInfo pinnedResultCount */ - pinnedResultCount?: (number|Long|string|null); - } + /** UserEventInlineSource userEvents */ + userEvents?: (google.cloud.retail.v2alpha.IUserEvent[]|null); + } - /** Represents a QueryExpansionInfo. */ - class QueryExpansionInfo implements IQueryExpansionInfo { + /** Represents a UserEventInlineSource. */ + class UserEventInlineSource implements IUserEventInlineSource { - /** - * Constructs a new QueryExpansionInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo); + /** + * Constructs a new UserEventInlineSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IUserEventInlineSource); - /** QueryExpansionInfo expandedQuery. */ - public expandedQuery: boolean; + /** UserEventInlineSource userEvents. */ + public userEvents: google.cloud.retail.v2alpha.IUserEvent[]; - /** QueryExpansionInfo pinnedResultCount. */ - public pinnedResultCount: (number|Long|string); + /** + * Creates a new UserEventInlineSource instance using the specified properties. + * @param [properties] Properties to set + * @returns UserEventInlineSource instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IUserEventInlineSource): google.cloud.retail.v2alpha.UserEventInlineSource; - /** - * Creates a new QueryExpansionInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryExpansionInfo instance - */ - public static create(properties?: google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo): google.cloud.retail.v2.SearchResponse.QueryExpansionInfo; + /** + * Encodes the specified UserEventInlineSource message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInlineSource.verify|verify} messages. + * @param message UserEventInlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IUserEventInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified QueryExpansionInfo message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.verify|verify} messages. - * @param message QueryExpansionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified UserEventInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInlineSource.verify|verify} messages. + * @param message UserEventInlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserEventInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified QueryExpansionInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.verify|verify} messages. - * @param message QueryExpansionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a UserEventInlineSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserEventInlineSource + * @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.UserEventInlineSource; - /** - * Decodes a QueryExpansionInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryExpansionInfo - * @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.v2.SearchResponse.QueryExpansionInfo; + /** + * Decodes a UserEventInlineSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserEventInlineSource + * @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.UserEventInlineSource; - /** - * Decodes a QueryExpansionInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryExpansionInfo - * @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.v2.SearchResponse.QueryExpansionInfo; + /** + * Verifies a UserEventInlineSource 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); - /** - * Verifies a QueryExpansionInfo 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 UserEventInlineSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserEventInlineSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserEventInlineSource; - /** - * Creates a QueryExpansionInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryExpansionInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.SearchResponse.QueryExpansionInfo; + /** + * Creates a plain object from a UserEventInlineSource message. Also converts values to other types if specified. + * @param message UserEventInlineSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.UserEventInlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a QueryExpansionInfo message. Also converts values to other types if specified. - * @param message QueryExpansionInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2.SearchResponse.QueryExpansionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this UserEventInlineSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this QueryExpansionInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of an ImportErrorsConfig. */ + interface IImportErrorsConfig { + + /** ImportErrorsConfig gcsPrefix */ + gcsPrefix?: (string|null); } - /** Represents a UserEventService */ - class UserEventService extends $protobuf.rpc.Service { + /** Represents an ImportErrorsConfig. */ + class ImportErrorsConfig implements IImportErrorsConfig { /** - * Constructs a new UserEventService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Constructs a new ImportErrorsConfig. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.cloud.retail.v2alpha.IImportErrorsConfig); + + /** ImportErrorsConfig gcsPrefix. */ + public gcsPrefix?: (string|null); + + /** ImportErrorsConfig destination. */ + public destination?: "gcsPrefix"; /** - * Creates new UserEventService service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. + * Creates a new ImportErrorsConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportErrorsConfig instance */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): UserEventService; + public static create(properties?: google.cloud.retail.v2alpha.IImportErrorsConfig): google.cloud.retail.v2alpha.ImportErrorsConfig; /** - * Calls WriteUserEvent. - * @param request WriteUserEventRequest message or plain object - * @param callback Node-style callback called with the error, if any, and UserEvent + * Encodes the specified ImportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportErrorsConfig.verify|verify} messages. + * @param message ImportErrorsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public writeUserEvent(request: google.cloud.retail.v2.IWriteUserEventRequest, callback: google.cloud.retail.v2.UserEventService.WriteUserEventCallback): void; + public static encode(message: google.cloud.retail.v2alpha.IImportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls WriteUserEvent. - * @param request WriteUserEventRequest message or plain object - * @returns Promise + * Encodes the specified ImportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportErrorsConfig.verify|verify} messages. + * @param message ImportErrorsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public writeUserEvent(request: google.cloud.retail.v2.IWriteUserEventRequest): Promise; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CollectUserEvent. - * @param request CollectUserEventRequest message or plain object - * @param callback Node-style callback called with the error, if any, and HttpBody + * Decodes an ImportErrorsConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportErrorsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public collectUserEvent(request: google.cloud.retail.v2.ICollectUserEventRequest, callback: google.cloud.retail.v2.UserEventService.CollectUserEventCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportErrorsConfig; /** - * Calls CollectUserEvent. - * @param request CollectUserEventRequest message or plain object - * @returns Promise + * Decodes an ImportErrorsConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportErrorsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public collectUserEvent(request: google.cloud.retail.v2.ICollectUserEventRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportErrorsConfig; /** - * Calls PurgeUserEvents. - * @param request PurgeUserEventsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Verifies an ImportErrorsConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public purgeUserEvents(request: google.cloud.retail.v2.IPurgeUserEventsRequest, callback: google.cloud.retail.v2.UserEventService.PurgeUserEventsCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls PurgeUserEvents. - * @param request PurgeUserEventsRequest message or plain object - * @returns Promise + * Creates an ImportErrorsConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportErrorsConfig */ - public purgeUserEvents(request: google.cloud.retail.v2.IPurgeUserEventsRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportErrorsConfig; /** - * Calls ImportUserEvents. - * @param request ImportUserEventsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a plain object from an ImportErrorsConfig message. Also converts values to other types if specified. + * @param message ImportErrorsConfig + * @param [options] Conversion options + * @returns Plain object */ - public importUserEvents(request: google.cloud.retail.v2.IImportUserEventsRequest, callback: google.cloud.retail.v2.UserEventService.ImportUserEventsCallback): void; + public static toObject(message: google.cloud.retail.v2alpha.ImportErrorsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls ImportUserEvents. - * @param request ImportUserEventsRequest message or plain object - * @returns Promise + * Converts this ImportErrorsConfig to JSON. + * @returns JSON object */ - public importUserEvents(request: google.cloud.retail.v2.IImportUserEventsRequest): Promise; + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportProductsRequest. */ + interface IImportProductsRequest { + + /** ImportProductsRequest parent */ + parent?: (string|null); + + /** ImportProductsRequest requestId */ + requestId?: (string|null); + + /** ImportProductsRequest inputConfig */ + inputConfig?: (google.cloud.retail.v2alpha.IProductInputConfig|null); + + /** ImportProductsRequest errorsConfig */ + errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); + + /** ImportProductsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** ImportProductsRequest reconciliationMode */ + reconciliationMode?: (google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode|keyof typeof google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode|null); + + /** ImportProductsRequest notificationPubsubTopic */ + notificationPubsubTopic?: (string|null); + } + + /** Represents an ImportProductsRequest. */ + class ImportProductsRequest implements IImportProductsRequest { /** - * Calls RejoinUserEvents. - * @param request RejoinUserEventsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Constructs a new ImportProductsRequest. + * @param [properties] Properties to set */ - public rejoinUserEvents(request: google.cloud.retail.v2.IRejoinUserEventsRequest, callback: google.cloud.retail.v2.UserEventService.RejoinUserEventsCallback): void; + constructor(properties?: google.cloud.retail.v2alpha.IImportProductsRequest); + + /** ImportProductsRequest parent. */ + public parent: string; + + /** ImportProductsRequest requestId. */ + public requestId: string; + + /** ImportProductsRequest inputConfig. */ + public inputConfig?: (google.cloud.retail.v2alpha.IProductInputConfig|null); + + /** ImportProductsRequest errorsConfig. */ + public errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); + + /** ImportProductsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** ImportProductsRequest reconciliationMode. */ + public reconciliationMode: (google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode|keyof typeof google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode); + + /** ImportProductsRequest notificationPubsubTopic. */ + public notificationPubsubTopic: string; /** - * Calls RejoinUserEvents. - * @param request RejoinUserEventsRequest message or plain object - * @returns Promise + * Creates a new ImportProductsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProductsRequest instance */ - public rejoinUserEvents(request: google.cloud.retail.v2.IRejoinUserEventsRequest): Promise; - } + public static create(properties?: google.cloud.retail.v2alpha.IImportProductsRequest): google.cloud.retail.v2alpha.ImportProductsRequest; - namespace UserEventService { + /** + * Encodes the specified ImportProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsRequest.verify|verify} messages. + * @param message ImportProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IImportProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.retail.v2.UserEventService#writeUserEvent}. - * @param error Error, if any - * @param [response] UserEvent + * Encodes the specified ImportProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsRequest.verify|verify} messages. + * @param message ImportProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportProductsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProductsRequest + * @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.ImportProductsRequest; + + /** + * Decodes an ImportProductsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type WriteUserEventCallback = (error: (Error|null), response?: google.cloud.retail.v2.UserEvent) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportProductsRequest; /** - * Callback as used by {@link google.cloud.retail.v2.UserEventService#collectUserEvent}. - * @param error Error, if any - * @param [response] HttpBody + * Verifies an ImportProductsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type CollectUserEventCallback = (error: (Error|null), response?: google.api.HttpBody) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.retail.v2.UserEventService#purgeUserEvents}. - * @param error Error, if any - * @param [response] Operation + * Creates an ImportProductsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProductsRequest */ - type PurgeUserEventsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportProductsRequest; /** - * Callback as used by {@link google.cloud.retail.v2.UserEventService#importUserEvents}. - * @param error Error, if any - * @param [response] Operation + * Creates a plain object from an ImportProductsRequest message. Also converts values to other types if specified. + * @param message ImportProductsRequest + * @param [options] Conversion options + * @returns Plain object */ - type ImportUserEventsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static toObject(message: google.cloud.retail.v2alpha.ImportProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.retail.v2.UserEventService#rejoinUserEvents}. - * @param error Error, if any - * @param [response] Operation + * Converts this ImportProductsRequest to JSON. + * @returns JSON object */ - type RejoinUserEventsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public toJSON(): { [k: string]: any }; } - /** Properties of a WriteUserEventRequest. */ - interface IWriteUserEventRequest { + namespace ImportProductsRequest { - /** WriteUserEventRequest parent */ + /** ReconciliationMode enum. */ + enum ReconciliationMode { + RECONCILIATION_MODE_UNSPECIFIED = 0, + INCREMENTAL = 1, + FULL = 2 + } + } + + /** Properties of an ImportUserEventsRequest. */ + interface IImportUserEventsRequest { + + /** ImportUserEventsRequest parent */ parent?: (string|null); - /** WriteUserEventRequest userEvent */ - userEvent?: (google.cloud.retail.v2.IUserEvent|null); + /** ImportUserEventsRequest inputConfig */ + inputConfig?: (google.cloud.retail.v2alpha.IUserEventInputConfig|null); + + /** ImportUserEventsRequest errorsConfig */ + errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); } - /** Represents a WriteUserEventRequest. */ - class WriteUserEventRequest implements IWriteUserEventRequest { + /** Represents an ImportUserEventsRequest. */ + class ImportUserEventsRequest implements IImportUserEventsRequest { /** - * Constructs a new WriteUserEventRequest. + * Constructs a new ImportUserEventsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2.IWriteUserEventRequest); + constructor(properties?: google.cloud.retail.v2alpha.IImportUserEventsRequest); - /** WriteUserEventRequest parent. */ + /** ImportUserEventsRequest parent. */ public parent: string; - /** WriteUserEventRequest userEvent. */ - public userEvent?: (google.cloud.retail.v2.IUserEvent|null); + /** ImportUserEventsRequest inputConfig. */ + public inputConfig?: (google.cloud.retail.v2alpha.IUserEventInputConfig|null); + + /** ImportUserEventsRequest errorsConfig. */ + public errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); /** - * Creates a new WriteUserEventRequest instance using the specified properties. + * Creates a new ImportUserEventsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns WriteUserEventRequest instance + * @returns ImportUserEventsRequest instance */ - public static create(properties?: google.cloud.retail.v2.IWriteUserEventRequest): google.cloud.retail.v2.WriteUserEventRequest; + public static create(properties?: google.cloud.retail.v2alpha.IImportUserEventsRequest): google.cloud.retail.v2alpha.ImportUserEventsRequest; /** - * Encodes the specified WriteUserEventRequest message. Does not implicitly {@link google.cloud.retail.v2.WriteUserEventRequest.verify|verify} messages. - * @param message WriteUserEventRequest message or plain object to encode + * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsRequest.verify|verify} messages. + * @param message ImportUserEventsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2.IWriteUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WriteUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.WriteUserEventRequest.verify|verify} messages. - * @param message WriteUserEventRequest message or plain object to encode + * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsRequest.verify|verify} messages. + * @param message ImportUserEventsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2.IWriteUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WriteUserEventRequest message from the specified reader or buffer. + * Decodes an ImportUserEventsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WriteUserEventRequest + * @returns ImportUserEventsRequest * @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.v2.WriteUserEventRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportUserEventsRequest; /** - * Decodes a WriteUserEventRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WriteUserEventRequest + * @returns ImportUserEventsRequest * @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.v2.WriteUserEventRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportUserEventsRequest; /** - * Verifies a WriteUserEventRequest message. + * Verifies an ImportUserEventsRequest 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 WriteUserEventRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WriteUserEventRequest + * @returns ImportUserEventsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.WriteUserEventRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportUserEventsRequest; /** - * Creates a plain object from a WriteUserEventRequest message. Also converts values to other types if specified. - * @param message WriteUserEventRequest + * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. + * @param message ImportUserEventsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2.WriteUserEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ImportUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WriteUserEventRequest to JSON. + * Converts this ImportUserEventsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CollectUserEventRequest. */ - interface ICollectUserEventRequest { + /** Properties of an ImportCompletionDataRequest. */ + interface IImportCompletionDataRequest { - /** CollectUserEventRequest parent */ + /** ImportCompletionDataRequest parent */ parent?: (string|null); - /** CollectUserEventRequest userEvent */ - userEvent?: (string|null); - - /** CollectUserEventRequest uri */ - uri?: (string|null); + /** ImportCompletionDataRequest inputConfig */ + inputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); - /** CollectUserEventRequest ets */ - ets?: (number|Long|string|null); + /** ImportCompletionDataRequest notificationPubsubTopic */ + notificationPubsubTopic?: (string|null); } - /** Represents a CollectUserEventRequest. */ - class CollectUserEventRequest implements ICollectUserEventRequest { + /** Represents an ImportCompletionDataRequest. */ + class ImportCompletionDataRequest implements IImportCompletionDataRequest { /** - * Constructs a new CollectUserEventRequest. + * Constructs a new ImportCompletionDataRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2.ICollectUserEventRequest); + constructor(properties?: google.cloud.retail.v2alpha.IImportCompletionDataRequest); - /** CollectUserEventRequest parent. */ + /** ImportCompletionDataRequest parent. */ public parent: string; - /** CollectUserEventRequest userEvent. */ - public userEvent: string; - - /** CollectUserEventRequest uri. */ - public uri: string; + /** ImportCompletionDataRequest inputConfig. */ + public inputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); - /** CollectUserEventRequest ets. */ - public ets: (number|Long|string); + /** ImportCompletionDataRequest notificationPubsubTopic. */ + public notificationPubsubTopic: string; /** - * Creates a new CollectUserEventRequest instance using the specified properties. + * Creates a new ImportCompletionDataRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CollectUserEventRequest instance + * @returns ImportCompletionDataRequest instance */ - public static create(properties?: google.cloud.retail.v2.ICollectUserEventRequest): google.cloud.retail.v2.CollectUserEventRequest; + public static create(properties?: google.cloud.retail.v2alpha.IImportCompletionDataRequest): google.cloud.retail.v2alpha.ImportCompletionDataRequest; /** - * Encodes the specified CollectUserEventRequest message. Does not implicitly {@link google.cloud.retail.v2.CollectUserEventRequest.verify|verify} messages. - * @param message CollectUserEventRequest message or plain object to encode + * Encodes the specified ImportCompletionDataRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataRequest.verify|verify} messages. + * @param message ImportCompletionDataRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2.ICollectUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IImportCompletionDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CollectUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.CollectUserEventRequest.verify|verify} messages. - * @param message CollectUserEventRequest message or plain object to encode + * Encodes the specified ImportCompletionDataRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataRequest.verify|verify} messages. + * @param message ImportCompletionDataRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2.ICollectUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportCompletionDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CollectUserEventRequest message from the specified reader or buffer. + * Decodes an ImportCompletionDataRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CollectUserEventRequest + * @returns ImportCompletionDataRequest * @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.v2.CollectUserEventRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportCompletionDataRequest; /** - * Decodes a CollectUserEventRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportCompletionDataRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CollectUserEventRequest + * @returns ImportCompletionDataRequest * @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.v2.CollectUserEventRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportCompletionDataRequest; /** - * Verifies a CollectUserEventRequest message. + * Verifies an ImportCompletionDataRequest 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 CollectUserEventRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImportCompletionDataRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CollectUserEventRequest + * @returns ImportCompletionDataRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.CollectUserEventRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportCompletionDataRequest; /** - * Creates a plain object from a CollectUserEventRequest message. Also converts values to other types if specified. - * @param message CollectUserEventRequest + * Creates a plain object from an ImportCompletionDataRequest message. Also converts values to other types if specified. + * @param message ImportCompletionDataRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2.CollectUserEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ImportCompletionDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CollectUserEventRequest to JSON. + * Converts this ImportCompletionDataRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RejoinUserEventsRequest. */ - interface IRejoinUserEventsRequest { + /** Properties of a ProductInputConfig. */ + interface IProductInputConfig { - /** RejoinUserEventsRequest parent */ - parent?: (string|null); + /** ProductInputConfig productInlineSource */ + productInlineSource?: (google.cloud.retail.v2alpha.IProductInlineSource|null); - /** RejoinUserEventsRequest userEventRejoinScope */ - userEventRejoinScope?: (google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope|keyof typeof google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope|null); + /** ProductInputConfig gcsSource */ + gcsSource?: (google.cloud.retail.v2alpha.IGcsSource|null); + + /** ProductInputConfig bigQuerySource */ + bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); } - /** Represents a RejoinUserEventsRequest. */ - class RejoinUserEventsRequest implements IRejoinUserEventsRequest { + /** Represents a ProductInputConfig. */ + class ProductInputConfig implements IProductInputConfig { /** - * Constructs a new RejoinUserEventsRequest. + * Constructs a new ProductInputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2.IRejoinUserEventsRequest); + constructor(properties?: google.cloud.retail.v2alpha.IProductInputConfig); - /** RejoinUserEventsRequest parent. */ - public parent: string; + /** ProductInputConfig productInlineSource. */ + public productInlineSource?: (google.cloud.retail.v2alpha.IProductInlineSource|null); - /** RejoinUserEventsRequest userEventRejoinScope. */ - public userEventRejoinScope: (google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope|keyof typeof google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope); + /** ProductInputConfig gcsSource. */ + public gcsSource?: (google.cloud.retail.v2alpha.IGcsSource|null); + + /** ProductInputConfig bigQuerySource. */ + public bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); + + /** ProductInputConfig source. */ + public source?: ("productInlineSource"|"gcsSource"|"bigQuerySource"); /** - * Creates a new RejoinUserEventsRequest instance using the specified properties. + * Creates a new ProductInputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns RejoinUserEventsRequest instance + * @returns ProductInputConfig instance */ - public static create(properties?: google.cloud.retail.v2.IRejoinUserEventsRequest): google.cloud.retail.v2.RejoinUserEventsRequest; + public static create(properties?: google.cloud.retail.v2alpha.IProductInputConfig): google.cloud.retail.v2alpha.ProductInputConfig; /** - * Encodes the specified RejoinUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsRequest.verify|verify} messages. - * @param message RejoinUserEventsRequest message or plain object to encode + * Encodes the specified ProductInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInputConfig.verify|verify} messages. + * @param message ProductInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2.IRejoinUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IProductInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RejoinUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsRequest.verify|verify} messages. - * @param message RejoinUserEventsRequest message or plain object to encode + * Encodes the specified ProductInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInputConfig.verify|verify} messages. + * @param message ProductInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2.IRejoinUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IProductInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RejoinUserEventsRequest message from the specified reader or buffer. + * Decodes a ProductInputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RejoinUserEventsRequest + * @returns ProductInputConfig * @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.v2.RejoinUserEventsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ProductInputConfig; /** - * Decodes a RejoinUserEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a ProductInputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RejoinUserEventsRequest + * @returns ProductInputConfig * @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.v2.RejoinUserEventsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ProductInputConfig; /** - * Verifies a RejoinUserEventsRequest message. + * Verifies a ProductInputConfig 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 RejoinUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ProductInputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RejoinUserEventsRequest + * @returns ProductInputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.RejoinUserEventsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ProductInputConfig; /** - * Creates a plain object from a RejoinUserEventsRequest message. Also converts values to other types if specified. - * @param message RejoinUserEventsRequest + * Creates a plain object from a ProductInputConfig message. Also converts values to other types if specified. + * @param message ProductInputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2.RejoinUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ProductInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RejoinUserEventsRequest to JSON. + * Converts this ProductInputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace RejoinUserEventsRequest { + /** Properties of a UserEventInputConfig. */ + interface IUserEventInputConfig { - /** UserEventRejoinScope enum. */ - enum UserEventRejoinScope { - USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0, - JOINED_EVENTS = 1, - UNJOINED_EVENTS = 2 - } - } + /** UserEventInputConfig userEventInlineSource */ + userEventInlineSource?: (google.cloud.retail.v2alpha.IUserEventInlineSource|null); - /** Properties of a RejoinUserEventsResponse. */ - interface IRejoinUserEventsResponse { + /** UserEventInputConfig gcsSource */ + gcsSource?: (google.cloud.retail.v2alpha.IGcsSource|null); - /** RejoinUserEventsResponse rejoinedUserEventsCount */ - rejoinedUserEventsCount?: (number|Long|string|null); + /** UserEventInputConfig bigQuerySource */ + bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); } - /** Represents a RejoinUserEventsResponse. */ - class RejoinUserEventsResponse implements IRejoinUserEventsResponse { + /** Represents a UserEventInputConfig. */ + class UserEventInputConfig implements IUserEventInputConfig { /** - * Constructs a new RejoinUserEventsResponse. + * Constructs a new UserEventInputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2.IRejoinUserEventsResponse); + constructor(properties?: google.cloud.retail.v2alpha.IUserEventInputConfig); - /** RejoinUserEventsResponse rejoinedUserEventsCount. */ - public rejoinedUserEventsCount: (number|Long|string); + /** UserEventInputConfig userEventInlineSource. */ + public userEventInlineSource?: (google.cloud.retail.v2alpha.IUserEventInlineSource|null); + + /** UserEventInputConfig gcsSource. */ + public gcsSource?: (google.cloud.retail.v2alpha.IGcsSource|null); + + /** UserEventInputConfig bigQuerySource. */ + public bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); + + /** UserEventInputConfig source. */ + public source?: ("userEventInlineSource"|"gcsSource"|"bigQuerySource"); /** - * Creates a new RejoinUserEventsResponse instance using the specified properties. + * Creates a new UserEventInputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns RejoinUserEventsResponse instance + * @returns UserEventInputConfig instance */ - public static create(properties?: google.cloud.retail.v2.IRejoinUserEventsResponse): google.cloud.retail.v2.RejoinUserEventsResponse; + public static create(properties?: google.cloud.retail.v2alpha.IUserEventInputConfig): google.cloud.retail.v2alpha.UserEventInputConfig; /** - * Encodes the specified RejoinUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsResponse.verify|verify} messages. - * @param message RejoinUserEventsResponse message or plain object to encode + * Encodes the specified UserEventInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInputConfig.verify|verify} messages. + * @param message UserEventInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2.IRejoinUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IUserEventInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RejoinUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsResponse.verify|verify} messages. - * @param message RejoinUserEventsResponse message or plain object to encode + * Encodes the specified UserEventInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInputConfig.verify|verify} messages. + * @param message UserEventInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2.IRejoinUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserEventInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RejoinUserEventsResponse message from the specified reader or buffer. + * Decodes a UserEventInputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RejoinUserEventsResponse + * @returns UserEventInputConfig * @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.v2.RejoinUserEventsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UserEventInputConfig; /** - * Decodes a RejoinUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes a UserEventInputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RejoinUserEventsResponse + * @returns UserEventInputConfig * @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.v2.RejoinUserEventsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UserEventInputConfig; /** - * Verifies a RejoinUserEventsResponse message. + * Verifies a UserEventInputConfig 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 RejoinUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a UserEventInputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RejoinUserEventsResponse + * @returns UserEventInputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.RejoinUserEventsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserEventInputConfig; /** - * Creates a plain object from a RejoinUserEventsResponse message. Also converts values to other types if specified. - * @param message RejoinUserEventsResponse + * Creates a plain object from a UserEventInputConfig message. Also converts values to other types if specified. + * @param message UserEventInputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2.RejoinUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.UserEventInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RejoinUserEventsResponse to JSON. + * Converts this UserEventInputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RejoinUserEventsMetadata. */ - interface IRejoinUserEventsMetadata { + /** Properties of a CompletionDataInputConfig. */ + interface ICompletionDataInputConfig { + + /** CompletionDataInputConfig bigQuerySource */ + bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); } - /** Represents a RejoinUserEventsMetadata. */ - class RejoinUserEventsMetadata implements IRejoinUserEventsMetadata { + /** Represents a CompletionDataInputConfig. */ + class CompletionDataInputConfig implements ICompletionDataInputConfig { /** - * Constructs a new RejoinUserEventsMetadata. + * Constructs a new CompletionDataInputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2.IRejoinUserEventsMetadata); + constructor(properties?: google.cloud.retail.v2alpha.ICompletionDataInputConfig); + + /** CompletionDataInputConfig bigQuerySource. */ + public bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); + + /** CompletionDataInputConfig source. */ + public source?: "bigQuerySource"; /** - * Creates a new RejoinUserEventsMetadata instance using the specified properties. + * Creates a new CompletionDataInputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns RejoinUserEventsMetadata instance + * @returns CompletionDataInputConfig instance */ - public static create(properties?: google.cloud.retail.v2.IRejoinUserEventsMetadata): google.cloud.retail.v2.RejoinUserEventsMetadata; + public static create(properties?: google.cloud.retail.v2alpha.ICompletionDataInputConfig): google.cloud.retail.v2alpha.CompletionDataInputConfig; /** - * Encodes the specified RejoinUserEventsMetadata message. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsMetadata.verify|verify} messages. - * @param message RejoinUserEventsMetadata message or plain object to encode + * Encodes the specified CompletionDataInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDataInputConfig.verify|verify} messages. + * @param message CompletionDataInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2.IRejoinUserEventsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ICompletionDataInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RejoinUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsMetadata.verify|verify} messages. - * @param message RejoinUserEventsMetadata message or plain object to encode + * Encodes the specified CompletionDataInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDataInputConfig.verify|verify} messages. + * @param message CompletionDataInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2.IRejoinUserEventsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompletionDataInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RejoinUserEventsMetadata message from the specified reader or buffer. + * Decodes a CompletionDataInputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RejoinUserEventsMetadata + * @returns CompletionDataInputConfig * @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.v2.RejoinUserEventsMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompletionDataInputConfig; /** - * Decodes a RejoinUserEventsMetadata message from the specified reader or buffer, length delimited. + * Decodes a CompletionDataInputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RejoinUserEventsMetadata + * @returns CompletionDataInputConfig * @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.v2.RejoinUserEventsMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompletionDataInputConfig; /** - * Verifies a RejoinUserEventsMetadata message. + * Verifies a CompletionDataInputConfig 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 RejoinUserEventsMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a CompletionDataInputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RejoinUserEventsMetadata + * @returns CompletionDataInputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.RejoinUserEventsMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompletionDataInputConfig; /** - * Creates a plain object from a RejoinUserEventsMetadata message. Also converts values to other types if specified. - * @param message RejoinUserEventsMetadata + * Creates a plain object from a CompletionDataInputConfig message. Also converts values to other types if specified. + * @param message CompletionDataInputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2.RejoinUserEventsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.CompletionDataInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RejoinUserEventsMetadata to JSON. + * Converts this CompletionDataInputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - /** Namespace v2alpha. */ - namespace v2alpha { + /** Properties of an ImportMetadata. */ + interface IImportMetadata { - /** Properties of a ProductLevelConfig. */ - interface IProductLevelConfig { + /** ImportMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** ProductLevelConfig ingestionProductType */ - ingestionProductType?: (string|null); + /** ImportMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** ProductLevelConfig merchantCenterProductIdField */ - merchantCenterProductIdField?: (string|null); + /** ImportMetadata successCount */ + successCount?: (number|Long|string|null); + + /** ImportMetadata failureCount */ + failureCount?: (number|Long|string|null); + + /** ImportMetadata requestId */ + requestId?: (string|null); + + /** ImportMetadata notificationPubsubTopic */ + notificationPubsubTopic?: (string|null); } - /** Represents a ProductLevelConfig. */ - class ProductLevelConfig implements IProductLevelConfig { + /** Represents an ImportMetadata. */ + class ImportMetadata implements IImportMetadata { /** - * Constructs a new ProductLevelConfig. + * Constructs a new ImportMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IProductLevelConfig); + constructor(properties?: google.cloud.retail.v2alpha.IImportMetadata); - /** ProductLevelConfig ingestionProductType. */ - public ingestionProductType: string; + /** ImportMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** ProductLevelConfig merchantCenterProductIdField. */ - public merchantCenterProductIdField: string; + /** ImportMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ImportMetadata successCount. */ + public successCount: (number|Long|string); + + /** ImportMetadata failureCount. */ + public failureCount: (number|Long|string); + + /** ImportMetadata requestId. */ + public requestId: string; + + /** ImportMetadata notificationPubsubTopic. */ + public notificationPubsubTopic: string; /** - * Creates a new ProductLevelConfig instance using the specified properties. + * Creates a new ImportMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns ProductLevelConfig instance + * @returns ImportMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.IProductLevelConfig): google.cloud.retail.v2alpha.ProductLevelConfig; + public static create(properties?: google.cloud.retail.v2alpha.IImportMetadata): google.cloud.retail.v2alpha.ImportMetadata; /** - * Encodes the specified ProductLevelConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductLevelConfig.verify|verify} messages. - * @param message ProductLevelConfig message or plain object to encode + * Encodes the specified ImportMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportMetadata.verify|verify} messages. + * @param message ImportMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IProductLevelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IImportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ProductLevelConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductLevelConfig.verify|verify} messages. - * @param message ProductLevelConfig message or plain object to encode + * Encodes the specified ImportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportMetadata.verify|verify} messages. + * @param message ImportMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IProductLevelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ProductLevelConfig message from the specified reader or buffer. + * Decodes an ImportMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ProductLevelConfig + * @returns ImportMetadata * @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.ProductLevelConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportMetadata; /** - * Decodes a ProductLevelConfig message from the specified reader or buffer, length delimited. + * Decodes an ImportMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ProductLevelConfig + * @returns ImportMetadata * @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.ProductLevelConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportMetadata; /** - * Verifies a ProductLevelConfig message. + * Verifies an ImportMetadata 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 ProductLevelConfig message from a plain object. Also converts values to their respective internal types. + * Creates an ImportMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ProductLevelConfig + * @returns ImportMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ProductLevelConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportMetadata; /** - * Creates a plain object from a ProductLevelConfig message. Also converts values to other types if specified. - * @param message ProductLevelConfig + * Creates a plain object from an ImportMetadata message. Also converts values to other types if specified. + * @param message ImportMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ProductLevelConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ImportMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ProductLevelConfig to JSON. + * Converts this ImportMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a MerchantCenterLink. */ - interface IMerchantCenterLink { - - /** MerchantCenterLink merchantCenterAccountId */ - merchantCenterAccountId?: (number|Long|string|null); - - /** MerchantCenterLink branchId */ - branchId?: (string|null); - - /** MerchantCenterLink destinations */ - destinations?: (string[]|null); + /** Properties of an ImportProductsResponse. */ + interface IImportProductsResponse { - /** MerchantCenterLink regionCode */ - regionCode?: (string|null); + /** ImportProductsResponse errorSamples */ + errorSamples?: (google.rpc.IStatus[]|null); - /** MerchantCenterLink languageCode */ - languageCode?: (string|null); + /** ImportProductsResponse errorsConfig */ + errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); } - /** Represents a MerchantCenterLink. */ - class MerchantCenterLink implements IMerchantCenterLink { + /** Represents an ImportProductsResponse. */ + class ImportProductsResponse implements IImportProductsResponse { /** - * Constructs a new MerchantCenterLink. + * Constructs a new ImportProductsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IMerchantCenterLink); - - /** MerchantCenterLink merchantCenterAccountId. */ - public merchantCenterAccountId: (number|Long|string); - - /** MerchantCenterLink branchId. */ - public branchId: string; - - /** MerchantCenterLink destinations. */ - public destinations: string[]; + constructor(properties?: google.cloud.retail.v2alpha.IImportProductsResponse); - /** MerchantCenterLink regionCode. */ - public regionCode: string; + /** ImportProductsResponse errorSamples. */ + public errorSamples: google.rpc.IStatus[]; - /** MerchantCenterLink languageCode. */ - public languageCode: string; + /** ImportProductsResponse errorsConfig. */ + public errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); /** - * Creates a new MerchantCenterLink instance using the specified properties. + * Creates a new ImportProductsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns MerchantCenterLink instance + * @returns ImportProductsResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IMerchantCenterLink): google.cloud.retail.v2alpha.MerchantCenterLink; + public static create(properties?: google.cloud.retail.v2alpha.IImportProductsResponse): google.cloud.retail.v2alpha.ImportProductsResponse; /** - * Encodes the specified MerchantCenterLink message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLink.verify|verify} messages. - * @param message MerchantCenterLink message or plain object to encode + * Encodes the specified ImportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsResponse.verify|verify} messages. + * @param message ImportProductsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IMerchantCenterLink, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IImportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MerchantCenterLink message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLink.verify|verify} messages. - * @param message MerchantCenterLink message or plain object to encode + * Encodes the specified ImportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsResponse.verify|verify} messages. + * @param message ImportProductsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IMerchantCenterLink, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MerchantCenterLink message from the specified reader or buffer. + * Decodes an ImportProductsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MerchantCenterLink + * @returns ImportProductsResponse * @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.MerchantCenterLink; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportProductsResponse; /** - * Decodes a MerchantCenterLink message from the specified reader or buffer, length delimited. + * Decodes an ImportProductsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MerchantCenterLink + * @returns ImportProductsResponse * @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.MerchantCenterLink; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportProductsResponse; /** - * Verifies a MerchantCenterLink message. + * Verifies an ImportProductsResponse 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 MerchantCenterLink message from a plain object. Also converts values to their respective internal types. + * Creates an ImportProductsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MerchantCenterLink + * @returns ImportProductsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.MerchantCenterLink; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportProductsResponse; /** - * Creates a plain object from a MerchantCenterLink message. Also converts values to other types if specified. - * @param message MerchantCenterLink + * Creates a plain object from an ImportProductsResponse message. Also converts values to other types if specified. + * @param message ImportProductsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.MerchantCenterLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ImportProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MerchantCenterLink to JSON. + * Converts this ImportProductsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a MerchantCenterLinkingConfig. */ - interface IMerchantCenterLinkingConfig { + /** Properties of an ImportUserEventsResponse. */ + interface IImportUserEventsResponse { - /** MerchantCenterLinkingConfig links */ - links?: (google.cloud.retail.v2alpha.IMerchantCenterLink[]|null); + /** ImportUserEventsResponse errorSamples */ + errorSamples?: (google.rpc.IStatus[]|null); + + /** ImportUserEventsResponse errorsConfig */ + errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); + + /** ImportUserEventsResponse importSummary */ + importSummary?: (google.cloud.retail.v2alpha.IUserEventImportSummary|null); } - /** Represents a MerchantCenterLinkingConfig. */ - class MerchantCenterLinkingConfig implements IMerchantCenterLinkingConfig { + /** Represents an ImportUserEventsResponse. */ + class ImportUserEventsResponse implements IImportUserEventsResponse { /** - * Constructs a new MerchantCenterLinkingConfig. + * Constructs a new ImportUserEventsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig); + constructor(properties?: google.cloud.retail.v2alpha.IImportUserEventsResponse); - /** MerchantCenterLinkingConfig links. */ - public links: google.cloud.retail.v2alpha.IMerchantCenterLink[]; + /** ImportUserEventsResponse errorSamples. */ + public errorSamples: google.rpc.IStatus[]; + + /** ImportUserEventsResponse errorsConfig. */ + public errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); + + /** ImportUserEventsResponse importSummary. */ + public importSummary?: (google.cloud.retail.v2alpha.IUserEventImportSummary|null); /** - * Creates a new MerchantCenterLinkingConfig instance using the specified properties. + * Creates a new ImportUserEventsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns MerchantCenterLinkingConfig instance + * @returns ImportUserEventsResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig): google.cloud.retail.v2alpha.MerchantCenterLinkingConfig; + public static create(properties?: google.cloud.retail.v2alpha.IImportUserEventsResponse): google.cloud.retail.v2alpha.ImportUserEventsResponse; /** - * Encodes the specified MerchantCenterLinkingConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.verify|verify} messages. - * @param message MerchantCenterLinkingConfig message or plain object to encode + * Encodes the specified ImportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsResponse.verify|verify} messages. + * @param message ImportUserEventsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IImportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MerchantCenterLinkingConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.verify|verify} messages. - * @param message MerchantCenterLinkingConfig message or plain object to encode + * Encodes the specified ImportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsResponse.verify|verify} messages. + * @param message ImportUserEventsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MerchantCenterLinkingConfig message from the specified reader or buffer. + * Decodes an ImportUserEventsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MerchantCenterLinkingConfig + * @returns ImportUserEventsResponse * @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.MerchantCenterLinkingConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportUserEventsResponse; /** - * Decodes a MerchantCenterLinkingConfig message from the specified reader or buffer, length delimited. + * Decodes an ImportUserEventsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MerchantCenterLinkingConfig + * @returns ImportUserEventsResponse * @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.MerchantCenterLinkingConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportUserEventsResponse; /** - * Verifies a MerchantCenterLinkingConfig message. + * Verifies an ImportUserEventsResponse 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 MerchantCenterLinkingConfig message from a plain object. Also converts values to their respective internal types. + * Creates an ImportUserEventsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MerchantCenterLinkingConfig + * @returns ImportUserEventsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.MerchantCenterLinkingConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportUserEventsResponse; /** - * Creates a plain object from a MerchantCenterLinkingConfig message. Also converts values to other types if specified. - * @param message MerchantCenterLinkingConfig + * Creates a plain object from an ImportUserEventsResponse message. Also converts values to other types if specified. + * @param message ImportUserEventsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.MerchantCenterLinkingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ImportUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MerchantCenterLinkingConfig to JSON. + * Converts this ImportUserEventsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Catalog. */ - interface ICatalog { - - /** Catalog name */ - name?: (string|null); - - /** Catalog displayName */ - displayName?: (string|null); + /** Properties of a UserEventImportSummary. */ + interface IUserEventImportSummary { - /** Catalog productLevelConfig */ - productLevelConfig?: (google.cloud.retail.v2alpha.IProductLevelConfig|null); + /** UserEventImportSummary joinedEventsCount */ + joinedEventsCount?: (number|Long|string|null); - /** Catalog merchantCenterLinkingConfig */ - merchantCenterLinkingConfig?: (google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig|null); + /** UserEventImportSummary unjoinedEventsCount */ + unjoinedEventsCount?: (number|Long|string|null); } - /** Represents a Catalog. */ - class Catalog implements ICatalog { + /** Represents a UserEventImportSummary. */ + class UserEventImportSummary implements IUserEventImportSummary { /** - * Constructs a new Catalog. + * Constructs a new UserEventImportSummary. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICatalog); - - /** Catalog name. */ - public name: string; - - /** Catalog displayName. */ - public displayName: string; + constructor(properties?: google.cloud.retail.v2alpha.IUserEventImportSummary); - /** Catalog productLevelConfig. */ - public productLevelConfig?: (google.cloud.retail.v2alpha.IProductLevelConfig|null); + /** UserEventImportSummary joinedEventsCount. */ + public joinedEventsCount: (number|Long|string); - /** Catalog merchantCenterLinkingConfig. */ - public merchantCenterLinkingConfig?: (google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig|null); + /** UserEventImportSummary unjoinedEventsCount. */ + public unjoinedEventsCount: (number|Long|string); /** - * Creates a new Catalog instance using the specified properties. + * Creates a new UserEventImportSummary instance using the specified properties. * @param [properties] Properties to set - * @returns Catalog instance + * @returns UserEventImportSummary instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICatalog): google.cloud.retail.v2alpha.Catalog; + public static create(properties?: google.cloud.retail.v2alpha.IUserEventImportSummary): google.cloud.retail.v2alpha.UserEventImportSummary; /** - * Encodes the specified Catalog message. Does not implicitly {@link google.cloud.retail.v2alpha.Catalog.verify|verify} messages. - * @param message Catalog message or plain object to encode + * Encodes the specified UserEventImportSummary message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventImportSummary.verify|verify} messages. + * @param message UserEventImportSummary message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ICatalog, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IUserEventImportSummary, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Catalog message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Catalog.verify|verify} messages. - * @param message Catalog message or plain object to encode + * Encodes the specified UserEventImportSummary message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventImportSummary.verify|verify} messages. + * @param message UserEventImportSummary message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICatalog, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserEventImportSummary, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Catalog message from the specified reader or buffer. + * Decodes a UserEventImportSummary message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Catalog + * @returns UserEventImportSummary * @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.Catalog; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UserEventImportSummary; /** - * Decodes a Catalog message from the specified reader or buffer, length delimited. + * Decodes a UserEventImportSummary message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Catalog + * @returns UserEventImportSummary * @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.Catalog; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UserEventImportSummary; /** - * Verifies a Catalog message. + * Verifies a UserEventImportSummary 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 Catalog message from a plain object. Also converts values to their respective internal types. + * Creates a UserEventImportSummary message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Catalog + * @returns UserEventImportSummary */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Catalog; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserEventImportSummary; /** - * Creates a plain object from a Catalog message. Also converts values to other types if specified. - * @param message Catalog + * Creates a plain object from a UserEventImportSummary message. Also converts values to other types if specified. + * @param message UserEventImportSummary * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.Catalog, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.UserEventImportSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Catalog to JSON. + * Converts this UserEventImportSummary to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** SolutionType enum. */ - enum SolutionType { - SOLUTION_TYPE_UNSPECIFIED = 0, - SOLUTION_TYPE_RECOMMENDATION = 1, - SOLUTION_TYPE_SEARCH = 2 - } - - /** Properties of a Condition. */ - interface ICondition { - - /** Condition queryTerms */ - queryTerms?: (google.cloud.retail.v2alpha.Condition.IQueryTerm[]|null); + /** Properties of an ImportCompletionDataResponse. */ + interface IImportCompletionDataResponse { - /** Condition activeTimeRange */ - activeTimeRange?: (google.cloud.retail.v2alpha.Condition.ITimeRange[]|null); + /** ImportCompletionDataResponse errorSamples */ + errorSamples?: (google.rpc.IStatus[]|null); } - /** Represents a Condition. */ - class Condition implements ICondition { + /** Represents an ImportCompletionDataResponse. */ + class ImportCompletionDataResponse implements IImportCompletionDataResponse { /** - * Constructs a new Condition. + * Constructs a new ImportCompletionDataResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICondition); - - /** Condition queryTerms. */ - public queryTerms: google.cloud.retail.v2alpha.Condition.IQueryTerm[]; + constructor(properties?: google.cloud.retail.v2alpha.IImportCompletionDataResponse); - /** Condition activeTimeRange. */ - public activeTimeRange: google.cloud.retail.v2alpha.Condition.ITimeRange[]; + /** ImportCompletionDataResponse errorSamples. */ + public errorSamples: google.rpc.IStatus[]; /** - * Creates a new Condition instance using the specified properties. + * Creates a new ImportCompletionDataResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Condition instance + * @returns ImportCompletionDataResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICondition): google.cloud.retail.v2alpha.Condition; + public static create(properties?: google.cloud.retail.v2alpha.IImportCompletionDataResponse): google.cloud.retail.v2alpha.ImportCompletionDataResponse; /** - * Encodes the specified Condition message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.verify|verify} messages. - * @param message Condition message or plain object to encode + * Encodes the specified ImportCompletionDataResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataResponse.verify|verify} messages. + * @param message ImportCompletionDataResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IImportCompletionDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.verify|verify} messages. - * @param message Condition message or plain object to encode + * Encodes the specified ImportCompletionDataResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataResponse.verify|verify} messages. + * @param message ImportCompletionDataResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportCompletionDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Condition message from the specified reader or buffer. + * Decodes an ImportCompletionDataResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Condition + * @returns ImportCompletionDataResponse * @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.Condition; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportCompletionDataResponse; /** - * Decodes a Condition message from the specified reader or buffer, length delimited. + * Decodes an ImportCompletionDataResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Condition + * @returns ImportCompletionDataResponse * @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.Condition; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportCompletionDataResponse; /** - * Verifies a Condition message. + * Verifies an ImportCompletionDataResponse 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 Condition message from a plain object. Also converts values to their respective internal types. + * Creates an ImportCompletionDataResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Condition + * @returns ImportCompletionDataResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Condition; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportCompletionDataResponse; /** - * Creates a plain object from a Condition message. Also converts values to other types if specified. - * @param message Condition + * Creates a plain object from an ImportCompletionDataResponse message. Also converts values to other types if specified. + * @param message ImportCompletionDataResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ImportCompletionDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Condition to JSON. + * Converts this ImportCompletionDataResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Condition { + /** Properties of a Product. */ + interface IProduct { - /** Properties of a QueryTerm. */ - interface IQueryTerm { + /** Product expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); - /** QueryTerm value */ - value?: (string|null); + /** Product ttl */ + ttl?: (google.protobuf.IDuration|null); - /** QueryTerm fullMatch */ - fullMatch?: (boolean|null); - } + /** Product name */ + name?: (string|null); - /** Represents a QueryTerm. */ - class QueryTerm implements IQueryTerm { + /** Product id */ + id?: (string|null); - /** - * Constructs a new QueryTerm. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Condition.IQueryTerm); + /** Product type */ + type?: (google.cloud.retail.v2alpha.Product.Type|keyof typeof google.cloud.retail.v2alpha.Product.Type|null); - /** QueryTerm value. */ - public value: string; + /** Product primaryProductId */ + primaryProductId?: (string|null); - /** QueryTerm fullMatch. */ - public fullMatch: boolean; + /** Product collectionMemberIds */ + collectionMemberIds?: (string[]|null); - /** - * Creates a new QueryTerm instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryTerm instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Condition.IQueryTerm): google.cloud.retail.v2alpha.Condition.QueryTerm; + /** Product gtin */ + gtin?: (string|null); - /** - * Encodes the specified QueryTerm message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.QueryTerm.verify|verify} messages. - * @param message QueryTerm message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Condition.IQueryTerm, writer?: $protobuf.Writer): $protobuf.Writer; + /** Product categories */ + categories?: (string[]|null); - /** - * Encodes the specified QueryTerm message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.QueryTerm.verify|verify} messages. - * @param message QueryTerm message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Condition.IQueryTerm, writer?: $protobuf.Writer): $protobuf.Writer; + /** Product title */ + title?: (string|null); - /** - * Decodes a QueryTerm message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryTerm - * @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.Condition.QueryTerm; + /** Product brands */ + brands?: (string[]|null); - /** - * Decodes a QueryTerm message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryTerm - * @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.Condition.QueryTerm; + /** Product description */ + description?: (string|null); - /** - * Verifies a QueryTerm 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); + /** Product languageCode */ + languageCode?: (string|null); - /** - * Creates a QueryTerm message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryTerm - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Condition.QueryTerm; + /** Product attributes */ + attributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }|null); + + /** Product tags */ + tags?: (string[]|null); + + /** Product priceInfo */ + priceInfo?: (google.cloud.retail.v2alpha.IPriceInfo|null); + + /** Product rating */ + rating?: (google.cloud.retail.v2alpha.IRating|null); + + /** Product availableTime */ + availableTime?: (google.protobuf.ITimestamp|null); + + /** Product availability */ + availability?: (google.cloud.retail.v2alpha.Product.Availability|keyof typeof google.cloud.retail.v2alpha.Product.Availability|null); + + /** Product availableQuantity */ + availableQuantity?: (google.protobuf.IInt32Value|null); + + /** Product fulfillmentInfo */ + fulfillmentInfo?: (google.cloud.retail.v2alpha.IFulfillmentInfo[]|null); + + /** Product uri */ + uri?: (string|null); + + /** Product images */ + images?: (google.cloud.retail.v2alpha.IImage[]|null); + + /** Product audience */ + audience?: (google.cloud.retail.v2alpha.IAudience|null); + + /** Product colorInfo */ + colorInfo?: (google.cloud.retail.v2alpha.IColorInfo|null); + + /** Product sizes */ + sizes?: (string[]|null); + + /** Product materials */ + materials?: (string[]|null); + + /** Product patterns */ + patterns?: (string[]|null); + + /** Product conditions */ + conditions?: (string[]|null); - /** - * Creates a plain object from a QueryTerm message. Also converts values to other types if specified. - * @param message QueryTerm - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Condition.QueryTerm, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Product promotions */ + promotions?: (google.cloud.retail.v2alpha.IPromotion[]|null); - /** - * Converts this QueryTerm to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Product publishTime */ + publishTime?: (google.protobuf.ITimestamp|null); - /** Properties of a TimeRange. */ - interface ITimeRange { + /** Product retrievableFields */ + retrievableFields?: (google.protobuf.IFieldMask|null); - /** TimeRange startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** Product variants */ + variants?: (google.cloud.retail.v2alpha.IProduct[]|null); + } - /** TimeRange endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } + /** Represents a Product. */ + class Product implements IProduct { - /** Represents a TimeRange. */ - class TimeRange implements ITimeRange { + /** + * Constructs a new Product. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IProduct); - /** - * Constructs a new TimeRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Condition.ITimeRange); + /** Product expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); - /** TimeRange startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** Product ttl. */ + public ttl?: (google.protobuf.IDuration|null); - /** TimeRange endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** Product name. */ + public name: string; - /** - * Creates a new TimeRange instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeRange instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Condition.ITimeRange): google.cloud.retail.v2alpha.Condition.TimeRange; + /** Product id. */ + public id: string; - /** - * Encodes the specified TimeRange message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.TimeRange.verify|verify} messages. - * @param message TimeRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Condition.ITimeRange, writer?: $protobuf.Writer): $protobuf.Writer; + /** Product type. */ + public type: (google.cloud.retail.v2alpha.Product.Type|keyof typeof google.cloud.retail.v2alpha.Product.Type); - /** - * Encodes the specified TimeRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.TimeRange.verify|verify} messages. - * @param message TimeRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Condition.ITimeRange, writer?: $protobuf.Writer): $protobuf.Writer; + /** Product primaryProductId. */ + public primaryProductId: string; - /** - * Decodes a TimeRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimeRange - * @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.Condition.TimeRange; + /** Product collectionMemberIds. */ + public collectionMemberIds: string[]; - /** - * Decodes a TimeRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimeRange - * @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.Condition.TimeRange; + /** Product gtin. */ + public gtin: string; - /** - * Verifies a TimeRange 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); + /** Product categories. */ + public categories: string[]; - /** - * Creates a TimeRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimeRange - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Condition.TimeRange; + /** Product title. */ + public title: string; - /** - * Creates a plain object from a TimeRange message. Also converts values to other types if specified. - * @param message TimeRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Condition.TimeRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Product brands. */ + public brands: string[]; - /** - * Converts this TimeRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** Product description. */ + public description: string; - /** Properties of a Rule. */ - interface IRule { + /** Product languageCode. */ + public languageCode: string; - /** Rule boostAction */ - boostAction?: (google.cloud.retail.v2alpha.Rule.IBoostAction|null); + /** Product attributes. */ + public attributes: { [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }; - /** Rule redirectAction */ - redirectAction?: (google.cloud.retail.v2alpha.Rule.IRedirectAction|null); + /** Product tags. */ + public tags: string[]; - /** Rule onewaySynonymsAction */ - onewaySynonymsAction?: (google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction|null); + /** Product priceInfo. */ + public priceInfo?: (google.cloud.retail.v2alpha.IPriceInfo|null); - /** Rule doNotAssociateAction */ - doNotAssociateAction?: (google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction|null); + /** Product rating. */ + public rating?: (google.cloud.retail.v2alpha.IRating|null); - /** Rule replacementAction */ - replacementAction?: (google.cloud.retail.v2alpha.Rule.IReplacementAction|null); + /** Product availableTime. */ + public availableTime?: (google.protobuf.ITimestamp|null); - /** Rule ignoreAction */ - ignoreAction?: (google.cloud.retail.v2alpha.Rule.IIgnoreAction|null); + /** Product availability. */ + public availability: (google.cloud.retail.v2alpha.Product.Availability|keyof typeof google.cloud.retail.v2alpha.Product.Availability); - /** Rule filterAction */ - filterAction?: (google.cloud.retail.v2alpha.Rule.IFilterAction|null); + /** Product availableQuantity. */ + public availableQuantity?: (google.protobuf.IInt32Value|null); - /** Rule twowaySynonymsAction */ - twowaySynonymsAction?: (google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction|null); + /** Product fulfillmentInfo. */ + public fulfillmentInfo: google.cloud.retail.v2alpha.IFulfillmentInfo[]; - /** Rule condition */ - condition?: (google.cloud.retail.v2alpha.ICondition|null); - } + /** Product uri. */ + public uri: string; - /** Represents a Rule. */ - class Rule implements IRule { + /** Product images. */ + public images: google.cloud.retail.v2alpha.IImage[]; - /** - * Constructs a new Rule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IRule); + /** Product audience. */ + public audience?: (google.cloud.retail.v2alpha.IAudience|null); - /** Rule boostAction. */ - public boostAction?: (google.cloud.retail.v2alpha.Rule.IBoostAction|null); + /** Product colorInfo. */ + public colorInfo?: (google.cloud.retail.v2alpha.IColorInfo|null); - /** Rule redirectAction. */ - public redirectAction?: (google.cloud.retail.v2alpha.Rule.IRedirectAction|null); + /** Product sizes. */ + public sizes: string[]; - /** Rule onewaySynonymsAction. */ - public onewaySynonymsAction?: (google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction|null); + /** Product materials. */ + public materials: string[]; - /** Rule doNotAssociateAction. */ - public doNotAssociateAction?: (google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction|null); + /** Product patterns. */ + public patterns: string[]; - /** Rule replacementAction. */ - public replacementAction?: (google.cloud.retail.v2alpha.Rule.IReplacementAction|null); + /** Product conditions. */ + public conditions: string[]; - /** Rule ignoreAction. */ - public ignoreAction?: (google.cloud.retail.v2alpha.Rule.IIgnoreAction|null); + /** Product promotions. */ + public promotions: google.cloud.retail.v2alpha.IPromotion[]; - /** Rule filterAction. */ - public filterAction?: (google.cloud.retail.v2alpha.Rule.IFilterAction|null); + /** Product publishTime. */ + public publishTime?: (google.protobuf.ITimestamp|null); - /** Rule twowaySynonymsAction. */ - public twowaySynonymsAction?: (google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction|null); + /** Product retrievableFields. */ + public retrievableFields?: (google.protobuf.IFieldMask|null); - /** Rule condition. */ - public condition?: (google.cloud.retail.v2alpha.ICondition|null); + /** Product variants. */ + public variants: google.cloud.retail.v2alpha.IProduct[]; - /** Rule action. */ - public action?: ("boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"); + /** Product expiration. */ + public expiration?: ("expireTime"|"ttl"); /** - * Creates a new Rule instance using the specified properties. + * Creates a new Product instance using the specified properties. * @param [properties] Properties to set - * @returns Rule instance + * @returns Product instance */ - public static create(properties?: google.cloud.retail.v2alpha.IRule): google.cloud.retail.v2alpha.Rule; + public static create(properties?: google.cloud.retail.v2alpha.IProduct): google.cloud.retail.v2alpha.Product; /** - * Encodes the specified Rule message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.verify|verify} messages. - * @param message Rule message or plain object to encode + * Encodes the specified Product message. Does not implicitly {@link google.cloud.retail.v2alpha.Product.verify|verify} messages. + * @param message Product message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.verify|verify} messages. - * @param message Rule message or plain object to encode + * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Product.verify|verify} messages. + * @param message Product message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Rule message from the specified reader or buffer. + * Decodes a Product message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Rule + * @returns Product * @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.Rule; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Product; /** - * Decodes a Rule message from the specified reader or buffer, length delimited. + * Decodes a Product message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Rule + * @returns Product * @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.Rule; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Product; /** - * Verifies a Rule message. + * Verifies a Product 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 Rule message from a plain object. Also converts values to their respective internal types. + * Creates a Product message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Rule + * @returns Product */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Product; /** - * Creates a plain object from a Rule message. Also converts values to other types if specified. - * @param message Rule + * Creates a plain object from a Product message. Also converts values to other types if specified. + * @param message Product * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.Rule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.Product, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Rule to JSON. + * Converts this Product to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Rule { - - /** Properties of a BoostAction. */ - interface IBoostAction { + namespace Product { - /** BoostAction boost */ - boost?: (number|null); + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + PRIMARY = 1, + VARIANT = 2, + COLLECTION = 3 + } - /** BoostAction productsFilter */ - productsFilter?: (string|null); + /** Availability enum. */ + enum Availability { + AVAILABILITY_UNSPECIFIED = 0, + IN_STOCK = 1, + OUT_OF_STOCK = 2, + PREORDER = 3, + BACKORDER = 4 } + } - /** Represents a BoostAction. */ - class BoostAction implements IBoostAction { + /** Properties of a UserEvent. */ + interface IUserEvent { - /** - * Constructs a new BoostAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Rule.IBoostAction); + /** UserEvent eventType */ + eventType?: (string|null); - /** BoostAction boost. */ - public boost: number; + /** UserEvent visitorId */ + visitorId?: (string|null); - /** BoostAction productsFilter. */ - public productsFilter: string; + /** UserEvent sessionId */ + sessionId?: (string|null); - /** - * Creates a new BoostAction instance using the specified properties. - * @param [properties] Properties to set - * @returns BoostAction instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Rule.IBoostAction): google.cloud.retail.v2alpha.Rule.BoostAction; + /** UserEvent eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); - /** - * Encodes the specified BoostAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.BoostAction.verify|verify} messages. - * @param message BoostAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Rule.IBoostAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** UserEvent experimentIds */ + experimentIds?: (string[]|null); - /** - * Encodes the specified BoostAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.BoostAction.verify|verify} messages. - * @param message BoostAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IBoostAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** UserEvent attributionToken */ + attributionToken?: (string|null); - /** - * Decodes a BoostAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoostAction - * @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.Rule.BoostAction; + /** UserEvent productDetails */ + productDetails?: (google.cloud.retail.v2alpha.IProductDetail[]|null); - /** - * Decodes a BoostAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoostAction - * @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.Rule.BoostAction; + /** UserEvent completionDetail */ + completionDetail?: (google.cloud.retail.v2alpha.ICompletionDetail|null); - /** - * Verifies a BoostAction 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); + /** UserEvent attributes */ + attributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }|null); - /** - * Creates a BoostAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoostAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.BoostAction; + /** UserEvent cartId */ + cartId?: (string|null); - /** - * Creates a plain object from a BoostAction message. Also converts values to other types if specified. - * @param message BoostAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Rule.BoostAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** UserEvent purchaseTransaction */ + purchaseTransaction?: (google.cloud.retail.v2alpha.IPurchaseTransaction|null); - /** - * Converts this BoostAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** UserEvent searchQuery */ + searchQuery?: (string|null); - /** Properties of a FilterAction. */ - interface IFilterAction { + /** UserEvent filter */ + filter?: (string|null); - /** FilterAction filter */ - filter?: (string|null); - } + /** UserEvent orderBy */ + orderBy?: (string|null); - /** Represents a FilterAction. */ - class FilterAction implements IFilterAction { + /** UserEvent offset */ + offset?: (number|null); - /** - * Constructs a new FilterAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Rule.IFilterAction); + /** UserEvent pageCategories */ + pageCategories?: (string[]|null); - /** FilterAction filter. */ - public filter: string; + /** UserEvent userInfo */ + userInfo?: (google.cloud.retail.v2alpha.IUserInfo|null); - /** - * Creates a new FilterAction instance using the specified properties. - * @param [properties] Properties to set - * @returns FilterAction instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Rule.IFilterAction): google.cloud.retail.v2alpha.Rule.FilterAction; + /** UserEvent uri */ + uri?: (string|null); - /** - * Encodes the specified FilterAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.FilterAction.verify|verify} messages. - * @param message FilterAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Rule.IFilterAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** UserEvent referrerUri */ + referrerUri?: (string|null); - /** - * Encodes the specified FilterAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.FilterAction.verify|verify} messages. - * @param message FilterAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IFilterAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** UserEvent pageViewId */ + pageViewId?: (string|null); + } - /** - * Decodes a FilterAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FilterAction - * @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.Rule.FilterAction; + /** Represents a UserEvent. */ + class UserEvent implements IUserEvent { + + /** + * Constructs a new UserEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IUserEvent); + + /** UserEvent eventType. */ + public eventType: string; + + /** UserEvent visitorId. */ + public visitorId: string; + + /** UserEvent sessionId. */ + public sessionId: string; + + /** UserEvent eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** UserEvent experimentIds. */ + public experimentIds: string[]; + + /** UserEvent attributionToken. */ + public attributionToken: string; + + /** UserEvent productDetails. */ + public productDetails: google.cloud.retail.v2alpha.IProductDetail[]; + + /** UserEvent completionDetail. */ + public completionDetail?: (google.cloud.retail.v2alpha.ICompletionDetail|null); + + /** UserEvent attributes. */ + public attributes: { [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }; + + /** UserEvent cartId. */ + public cartId: string; + + /** UserEvent purchaseTransaction. */ + public purchaseTransaction?: (google.cloud.retail.v2alpha.IPurchaseTransaction|null); + + /** UserEvent searchQuery. */ + public searchQuery: string; + + /** UserEvent filter. */ + public filter: string; + + /** UserEvent orderBy. */ + public orderBy: string; + + /** UserEvent offset. */ + public offset: number; + + /** UserEvent pageCategories. */ + public pageCategories: string[]; - /** - * Decodes a FilterAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FilterAction - * @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.Rule.FilterAction; + /** UserEvent userInfo. */ + public userInfo?: (google.cloud.retail.v2alpha.IUserInfo|null); - /** - * Verifies a FilterAction 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); + /** UserEvent uri. */ + public uri: string; - /** - * Creates a FilterAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FilterAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.FilterAction; + /** UserEvent referrerUri. */ + public referrerUri: string; - /** - * Creates a plain object from a FilterAction message. Also converts values to other types if specified. - * @param message FilterAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Rule.FilterAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** UserEvent pageViewId. */ + public pageViewId: string; - /** - * Converts this FilterAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new UserEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns UserEvent instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IUserEvent): google.cloud.retail.v2alpha.UserEvent; - /** Properties of a RedirectAction. */ - interface IRedirectAction { + /** + * Encodes the specified UserEvent message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEvent.verify|verify} messages. + * @param message UserEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IUserEvent, writer?: $protobuf.Writer): $protobuf.Writer; - /** RedirectAction redirectUri */ - redirectUri?: (string|null); - } + /** + * Encodes the specified UserEvent message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEvent.verify|verify} messages. + * @param message UserEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserEvent, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a RedirectAction. */ - class RedirectAction implements IRedirectAction { + /** + * Decodes a UserEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserEvent + * @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.UserEvent; - /** - * Constructs a new RedirectAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Rule.IRedirectAction); + /** + * Decodes a UserEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserEvent + * @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.UserEvent; - /** RedirectAction redirectUri. */ - public redirectUri: string; + /** + * Verifies a UserEvent 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 new RedirectAction instance using the specified properties. - * @param [properties] Properties to set - * @returns RedirectAction instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Rule.IRedirectAction): google.cloud.retail.v2alpha.Rule.RedirectAction; + /** + * Creates a UserEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserEvent; - /** - * Encodes the specified RedirectAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RedirectAction.verify|verify} messages. - * @param message RedirectAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Rule.IRedirectAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a UserEvent message. Also converts values to other types if specified. + * @param message UserEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.UserEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified RedirectAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RedirectAction.verify|verify} messages. - * @param message RedirectAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IRedirectAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this UserEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a RedirectAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RedirectAction - * @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.Rule.RedirectAction; + /** Properties of a ProductDetail. */ + interface IProductDetail { - /** - * Decodes a RedirectAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RedirectAction - * @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.Rule.RedirectAction; + /** ProductDetail product */ + product?: (google.cloud.retail.v2alpha.IProduct|null); - /** - * Verifies a RedirectAction 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); + /** ProductDetail quantity */ + quantity?: (google.protobuf.IInt32Value|null); + } - /** - * Creates a RedirectAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RedirectAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.RedirectAction; + /** Represents a ProductDetail. */ + class ProductDetail implements IProductDetail { - /** - * Creates a plain object from a RedirectAction message. Also converts values to other types if specified. - * @param message RedirectAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Rule.RedirectAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new ProductDetail. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IProductDetail); - /** - * Converts this RedirectAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ProductDetail product. */ + public product?: (google.cloud.retail.v2alpha.IProduct|null); - /** Properties of a TwowaySynonymsAction. */ - interface ITwowaySynonymsAction { + /** ProductDetail quantity. */ + public quantity?: (google.protobuf.IInt32Value|null); - /** TwowaySynonymsAction synonyms */ - synonyms?: (string[]|null); - } + /** + * Creates a new ProductDetail instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductDetail instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IProductDetail): google.cloud.retail.v2alpha.ProductDetail; - /** Represents a TwowaySynonymsAction. */ - class TwowaySynonymsAction implements ITwowaySynonymsAction { + /** + * Encodes the specified ProductDetail message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductDetail.verify|verify} messages. + * @param message ProductDetail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IProductDetail, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new TwowaySynonymsAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction); + /** + * Encodes the specified ProductDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductDetail.verify|verify} messages. + * @param message ProductDetail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IProductDetail, writer?: $protobuf.Writer): $protobuf.Writer; - /** TwowaySynonymsAction synonyms. */ - public synonyms: string[]; + /** + * Decodes a ProductDetail message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductDetail + * @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.ProductDetail; - /** - * Creates a new TwowaySynonymsAction instance using the specified properties. - * @param [properties] Properties to set - * @returns TwowaySynonymsAction instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction): google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction; + /** + * Decodes a ProductDetail message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductDetail + * @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.ProductDetail; + + /** + * Verifies a ProductDetail 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); - /** - * Encodes the specified TwowaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify|verify} messages. - * @param message TwowaySynonymsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a ProductDetail message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductDetail + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ProductDetail; - /** - * Encodes the specified TwowaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify|verify} messages. - * @param message TwowaySynonymsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a ProductDetail message. Also converts values to other types if specified. + * @param message ProductDetail + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ProductDetail, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a TwowaySynonymsAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TwowaySynonymsAction - * @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.Rule.TwowaySynonymsAction; + /** + * Converts this ProductDetail to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a TwowaySynonymsAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TwowaySynonymsAction - * @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.Rule.TwowaySynonymsAction; + /** Properties of a CompletionDetail. */ + interface ICompletionDetail { - /** - * Verifies a TwowaySynonymsAction 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); + /** CompletionDetail completionAttributionToken */ + completionAttributionToken?: (string|null); - /** - * Creates a TwowaySynonymsAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TwowaySynonymsAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction; + /** CompletionDetail selectedSuggestion */ + selectedSuggestion?: (string|null); - /** - * Creates a plain object from a TwowaySynonymsAction message. Also converts values to other types if specified. - * @param message TwowaySynonymsAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** CompletionDetail selectedPosition */ + selectedPosition?: (number|null); + } - /** - * Converts this TwowaySynonymsAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents a CompletionDetail. */ + class CompletionDetail implements ICompletionDetail { - /** Properties of an OnewaySynonymsAction. */ - interface IOnewaySynonymsAction { + /** + * Constructs a new CompletionDetail. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.ICompletionDetail); - /** OnewaySynonymsAction queryTerms */ - queryTerms?: (string[]|null); + /** CompletionDetail completionAttributionToken. */ + public completionAttributionToken: string; - /** OnewaySynonymsAction synonyms */ - synonyms?: (string[]|null); + /** CompletionDetail selectedSuggestion. */ + public selectedSuggestion: string; - /** OnewaySynonymsAction onewayTerms */ - onewayTerms?: (string[]|null); - } + /** CompletionDetail selectedPosition. */ + public selectedPosition: number; - /** Represents an OnewaySynonymsAction. */ - class OnewaySynonymsAction implements IOnewaySynonymsAction { + /** + * Creates a new CompletionDetail instance using the specified properties. + * @param [properties] Properties to set + * @returns CompletionDetail instance + */ + public static create(properties?: google.cloud.retail.v2alpha.ICompletionDetail): google.cloud.retail.v2alpha.CompletionDetail; - /** - * Constructs a new OnewaySynonymsAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction); + /** + * Encodes the specified CompletionDetail message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDetail.verify|verify} messages. + * @param message CompletionDetail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.ICompletionDetail, writer?: $protobuf.Writer): $protobuf.Writer; - /** OnewaySynonymsAction queryTerms. */ - public queryTerms: string[]; + /** + * Encodes the specified CompletionDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDetail.verify|verify} messages. + * @param message CompletionDetail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompletionDetail, writer?: $protobuf.Writer): $protobuf.Writer; - /** OnewaySynonymsAction synonyms. */ - public synonyms: string[]; + /** + * Decodes a CompletionDetail message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompletionDetail + * @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.CompletionDetail; - /** OnewaySynonymsAction onewayTerms. */ - public onewayTerms: string[]; + /** + * Decodes a CompletionDetail message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompletionDetail + * @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.CompletionDetail; - /** - * Creates a new OnewaySynonymsAction instance using the specified properties. - * @param [properties] Properties to set - * @returns OnewaySynonymsAction instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction): google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction; + /** + * Verifies a CompletionDetail 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); - /** - * Encodes the specified OnewaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify|verify} messages. - * @param message OnewaySynonymsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a CompletionDetail message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompletionDetail + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompletionDetail; - /** - * Encodes the specified OnewaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify|verify} messages. - * @param message OnewaySynonymsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a CompletionDetail message. Also converts values to other types if specified. + * @param message CompletionDetail + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CompletionDetail, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes an OnewaySynonymsAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OnewaySynonymsAction - * @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.Rule.OnewaySynonymsAction; + /** + * Converts this CompletionDetail to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes an OnewaySynonymsAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OnewaySynonymsAction - * @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.Rule.OnewaySynonymsAction; + /** Properties of a PurchaseTransaction. */ + interface IPurchaseTransaction { - /** - * Verifies an OnewaySynonymsAction 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); + /** PurchaseTransaction id */ + id?: (string|null); - /** - * Creates an OnewaySynonymsAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OnewaySynonymsAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction; + /** PurchaseTransaction revenue */ + revenue?: (number|null); - /** - * Creates a plain object from an OnewaySynonymsAction message. Also converts values to other types if specified. - * @param message OnewaySynonymsAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** PurchaseTransaction tax */ + tax?: (number|null); - /** - * Converts this OnewaySynonymsAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** PurchaseTransaction cost */ + cost?: (number|null); - /** Properties of a DoNotAssociateAction. */ - interface IDoNotAssociateAction { + /** PurchaseTransaction currencyCode */ + currencyCode?: (string|null); + } - /** DoNotAssociateAction queryTerms */ - queryTerms?: (string[]|null); + /** Represents a PurchaseTransaction. */ + class PurchaseTransaction implements IPurchaseTransaction { - /** DoNotAssociateAction doNotAssociateTerms */ - doNotAssociateTerms?: (string[]|null); + /** + * Constructs a new PurchaseTransaction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IPurchaseTransaction); - /** DoNotAssociateAction terms */ - terms?: (string[]|null); - } + /** PurchaseTransaction id. */ + public id: string; - /** Represents a DoNotAssociateAction. */ - class DoNotAssociateAction implements IDoNotAssociateAction { + /** PurchaseTransaction revenue. */ + public revenue: number; - /** - * Constructs a new DoNotAssociateAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction); + /** PurchaseTransaction tax. */ + public tax: number; - /** DoNotAssociateAction queryTerms. */ - public queryTerms: string[]; + /** PurchaseTransaction cost. */ + public cost: number; - /** DoNotAssociateAction doNotAssociateTerms. */ - public doNotAssociateTerms: string[]; + /** PurchaseTransaction currencyCode. */ + public currencyCode: string; - /** DoNotAssociateAction terms. */ - public terms: string[]; + /** + * Creates a new PurchaseTransaction instance using the specified properties. + * @param [properties] Properties to set + * @returns PurchaseTransaction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IPurchaseTransaction): google.cloud.retail.v2alpha.PurchaseTransaction; - /** - * Creates a new DoNotAssociateAction instance using the specified properties. - * @param [properties] Properties to set - * @returns DoNotAssociateAction instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction): google.cloud.retail.v2alpha.Rule.DoNotAssociateAction; + /** + * Encodes the specified PurchaseTransaction message. Does not implicitly {@link google.cloud.retail.v2alpha.PurchaseTransaction.verify|verify} messages. + * @param message PurchaseTransaction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IPurchaseTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified DoNotAssociateAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify|verify} messages. - * @param message DoNotAssociateAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified PurchaseTransaction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurchaseTransaction.verify|verify} messages. + * @param message PurchaseTransaction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurchaseTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified DoNotAssociateAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify|verify} messages. - * @param message DoNotAssociateAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a PurchaseTransaction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurchaseTransaction + * @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.PurchaseTransaction; - /** - * Decodes a DoNotAssociateAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DoNotAssociateAction - * @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.Rule.DoNotAssociateAction; + /** + * Decodes a PurchaseTransaction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurchaseTransaction + * @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.PurchaseTransaction; - /** - * Decodes a DoNotAssociateAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DoNotAssociateAction - * @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.Rule.DoNotAssociateAction; + /** + * Verifies a PurchaseTransaction 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); - /** - * Verifies a DoNotAssociateAction 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 PurchaseTransaction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurchaseTransaction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurchaseTransaction; - /** - * Creates a DoNotAssociateAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DoNotAssociateAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.DoNotAssociateAction; + /** + * Creates a plain object from a PurchaseTransaction message. Also converts values to other types if specified. + * @param message PurchaseTransaction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.PurchaseTransaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a DoNotAssociateAction message. Also converts values to other types if specified. - * @param message DoNotAssociateAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Rule.DoNotAssociateAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this PurchaseTransaction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this DoNotAssociateAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents a CatalogService */ + class CatalogService extends $protobuf.rpc.Service { - /** Properties of a ReplacementAction. */ - interface IReplacementAction { + /** + * Constructs a new CatalogService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** ReplacementAction queryTerms */ - queryTerms?: (string[]|null); + /** + * Creates new CatalogService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): CatalogService; - /** ReplacementAction replacementTerm */ - replacementTerm?: (string|null); + /** + * Calls ListCatalogs. + * @param request ListCatalogsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCatalogsResponse + */ + public listCatalogs(request: google.cloud.retail.v2alpha.IListCatalogsRequest, callback: google.cloud.retail.v2alpha.CatalogService.ListCatalogsCallback): void; - /** ReplacementAction term */ - term?: (string|null); - } + /** + * Calls ListCatalogs. + * @param request ListCatalogsRequest message or plain object + * @returns Promise + */ + public listCatalogs(request: google.cloud.retail.v2alpha.IListCatalogsRequest): Promise; - /** Represents a ReplacementAction. */ - class ReplacementAction implements IReplacementAction { + /** + * Calls UpdateCatalog. + * @param request UpdateCatalogRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Catalog + */ + public updateCatalog(request: google.cloud.retail.v2alpha.IUpdateCatalogRequest, callback: google.cloud.retail.v2alpha.CatalogService.UpdateCatalogCallback): void; - /** - * Constructs a new ReplacementAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Rule.IReplacementAction); + /** + * Calls UpdateCatalog. + * @param request UpdateCatalogRequest message or plain object + * @returns Promise + */ + public updateCatalog(request: google.cloud.retail.v2alpha.IUpdateCatalogRequest): Promise; - /** ReplacementAction queryTerms. */ - public queryTerms: string[]; + /** + * Calls SetDefaultBranch. + * @param request SetDefaultBranchRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public setDefaultBranch(request: google.cloud.retail.v2alpha.ISetDefaultBranchRequest, callback: google.cloud.retail.v2alpha.CatalogService.SetDefaultBranchCallback): void; - /** ReplacementAction replacementTerm. */ - public replacementTerm: string; + /** + * Calls SetDefaultBranch. + * @param request SetDefaultBranchRequest message or plain object + * @returns Promise + */ + public setDefaultBranch(request: google.cloud.retail.v2alpha.ISetDefaultBranchRequest): Promise; - /** ReplacementAction term. */ - public term: string; + /** + * Calls GetDefaultBranch. + * @param request GetDefaultBranchRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GetDefaultBranchResponse + */ + public getDefaultBranch(request: google.cloud.retail.v2alpha.IGetDefaultBranchRequest, callback: google.cloud.retail.v2alpha.CatalogService.GetDefaultBranchCallback): void; + + /** + * Calls GetDefaultBranch. + * @param request GetDefaultBranchRequest message or plain object + * @returns Promise + */ + public getDefaultBranch(request: google.cloud.retail.v2alpha.IGetDefaultBranchRequest): Promise; + } - /** - * Creates a new ReplacementAction instance using the specified properties. - * @param [properties] Properties to set - * @returns ReplacementAction instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Rule.IReplacementAction): google.cloud.retail.v2alpha.Rule.ReplacementAction; + namespace CatalogService { - /** - * Encodes the specified ReplacementAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ReplacementAction.verify|verify} messages. - * @param message ReplacementAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Rule.IReplacementAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService#listCatalogs}. + * @param error Error, if any + * @param [response] ListCatalogsResponse + */ + type ListCatalogsCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.ListCatalogsResponse) => void; - /** - * Encodes the specified ReplacementAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ReplacementAction.verify|verify} messages. - * @param message ReplacementAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IReplacementAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService#updateCatalog}. + * @param error Error, if any + * @param [response] Catalog + */ + type UpdateCatalogCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Catalog) => void; - /** - * Decodes a ReplacementAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReplacementAction - * @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.Rule.ReplacementAction; + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService#setDefaultBranch}. + * @param error Error, if any + * @param [response] Empty + */ + type SetDefaultBranchCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - /** - * Decodes a ReplacementAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReplacementAction - * @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.Rule.ReplacementAction; + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService#getDefaultBranch}. + * @param error Error, if any + * @param [response] GetDefaultBranchResponse + */ + type GetDefaultBranchCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.GetDefaultBranchResponse) => void; + } - /** - * Verifies a ReplacementAction 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); + /** Properties of a ListCatalogsRequest. */ + interface IListCatalogsRequest { - /** - * Creates a ReplacementAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReplacementAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.ReplacementAction; + /** ListCatalogsRequest parent */ + parent?: (string|null); - /** - * Creates a plain object from a ReplacementAction message. Also converts values to other types if specified. - * @param message ReplacementAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Rule.ReplacementAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ListCatalogsRequest pageSize */ + pageSize?: (number|null); - /** - * Converts this ReplacementAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ListCatalogsRequest pageToken */ + pageToken?: (string|null); + } - /** Properties of an IgnoreAction. */ - interface IIgnoreAction { + /** Represents a ListCatalogsRequest. */ + class ListCatalogsRequest implements IListCatalogsRequest { - /** IgnoreAction ignoreTerms */ - ignoreTerms?: (string[]|null); - } + /** + * Constructs a new ListCatalogsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IListCatalogsRequest); - /** Represents an IgnoreAction. */ - class IgnoreAction implements IIgnoreAction { + /** ListCatalogsRequest parent. */ + public parent: string; - /** - * Constructs a new IgnoreAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Rule.IIgnoreAction); + /** ListCatalogsRequest pageSize. */ + public pageSize: number; - /** IgnoreAction ignoreTerms. */ - public ignoreTerms: string[]; + /** ListCatalogsRequest pageToken. */ + public pageToken: string; - /** - * Creates a new IgnoreAction instance using the specified properties. - * @param [properties] Properties to set - * @returns IgnoreAction instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Rule.IIgnoreAction): google.cloud.retail.v2alpha.Rule.IgnoreAction; + /** + * Creates a new ListCatalogsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCatalogsRequest instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IListCatalogsRequest): google.cloud.retail.v2alpha.ListCatalogsRequest; - /** - * Encodes the specified IgnoreAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.IgnoreAction.verify|verify} messages. - * @param message IgnoreAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Rule.IIgnoreAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified ListCatalogsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsRequest.verify|verify} messages. + * @param message ListCatalogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IListCatalogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified IgnoreAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.IgnoreAction.verify|verify} messages. - * @param message IgnoreAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IIgnoreAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified ListCatalogsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsRequest.verify|verify} messages. + * @param message ListCatalogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IListCatalogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an IgnoreAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IgnoreAction - * @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.Rule.IgnoreAction; + /** + * Decodes a ListCatalogsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCatalogsRequest + * @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.ListCatalogsRequest; - /** - * Decodes an IgnoreAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IgnoreAction - * @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.Rule.IgnoreAction; + /** + * Decodes a ListCatalogsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCatalogsRequest + * @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.ListCatalogsRequest; - /** - * Verifies an IgnoreAction 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); + /** + * Verifies a ListCatalogsRequest 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 IgnoreAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IgnoreAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.IgnoreAction; + /** + * Creates a ListCatalogsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCatalogsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListCatalogsRequest; - /** - * Creates a plain object from an IgnoreAction message. Also converts values to other types if specified. - * @param message IgnoreAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Rule.IgnoreAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a ListCatalogsRequest message. Also converts values to other types if specified. + * @param message ListCatalogsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ListCatalogsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this IgnoreAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this ListCatalogsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } - /** Properties of an Audience. */ - interface IAudience { + /** Properties of a ListCatalogsResponse. */ + interface IListCatalogsResponse { - /** Audience genders */ - genders?: (string[]|null); + /** ListCatalogsResponse catalogs */ + catalogs?: (google.cloud.retail.v2alpha.ICatalog[]|null); - /** Audience ageGroups */ - ageGroups?: (string[]|null); + /** ListCatalogsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents an Audience. */ - class Audience implements IAudience { + /** Represents a ListCatalogsResponse. */ + class ListCatalogsResponse implements IListCatalogsResponse { /** - * Constructs a new Audience. + * Constructs a new ListCatalogsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IAudience); + constructor(properties?: google.cloud.retail.v2alpha.IListCatalogsResponse); - /** Audience genders. */ - public genders: string[]; + /** ListCatalogsResponse catalogs. */ + public catalogs: google.cloud.retail.v2alpha.ICatalog[]; - /** Audience ageGroups. */ - public ageGroups: string[]; + /** ListCatalogsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new Audience instance using the specified properties. + * Creates a new ListCatalogsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Audience instance + * @returns ListCatalogsResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IAudience): google.cloud.retail.v2alpha.Audience; + public static create(properties?: google.cloud.retail.v2alpha.IListCatalogsResponse): google.cloud.retail.v2alpha.ListCatalogsResponse; /** - * Encodes the specified Audience message. Does not implicitly {@link google.cloud.retail.v2alpha.Audience.verify|verify} messages. - * @param message Audience message or plain object to encode + * Encodes the specified ListCatalogsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsResponse.verify|verify} messages. + * @param message ListCatalogsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IAudience, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IListCatalogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Audience message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Audience.verify|verify} messages. - * @param message Audience message or plain object to encode + * Encodes the specified ListCatalogsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsResponse.verify|verify} messages. + * @param message ListCatalogsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IAudience, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IListCatalogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Audience message from the specified reader or buffer. + * Decodes a ListCatalogsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Audience + * @returns ListCatalogsResponse * @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.Audience; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListCatalogsResponse; /** - * Decodes an Audience message from the specified reader or buffer, length delimited. + * Decodes a ListCatalogsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Audience + * @returns ListCatalogsResponse * @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.Audience; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListCatalogsResponse; /** - * Verifies an Audience message. + * Verifies a ListCatalogsResponse 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 Audience message from a plain object. Also converts values to their respective internal types. + * Creates a ListCatalogsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Audience + * @returns ListCatalogsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Audience; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListCatalogsResponse; /** - * Creates a plain object from an Audience message. Also converts values to other types if specified. - * @param message Audience + * Creates a plain object from a ListCatalogsResponse message. Also converts values to other types if specified. + * @param message ListCatalogsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.Audience, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ListCatalogsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Audience to JSON. + * Converts this ListCatalogsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ColorInfo. */ - interface IColorInfo { + /** Properties of an UpdateCatalogRequest. */ + interface IUpdateCatalogRequest { - /** ColorInfo colorFamilies */ - colorFamilies?: (string[]|null); + /** UpdateCatalogRequest catalog */ + catalog?: (google.cloud.retail.v2alpha.ICatalog|null); - /** ColorInfo colors */ - colors?: (string[]|null); + /** UpdateCatalogRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a ColorInfo. */ - class ColorInfo implements IColorInfo { + /** Represents an UpdateCatalogRequest. */ + class UpdateCatalogRequest implements IUpdateCatalogRequest { /** - * Constructs a new ColorInfo. + * Constructs a new UpdateCatalogRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IColorInfo); + constructor(properties?: google.cloud.retail.v2alpha.IUpdateCatalogRequest); - /** ColorInfo colorFamilies. */ - public colorFamilies: string[]; + /** UpdateCatalogRequest catalog. */ + public catalog?: (google.cloud.retail.v2alpha.ICatalog|null); - /** ColorInfo colors. */ - public colors: string[]; + /** UpdateCatalogRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new ColorInfo instance using the specified properties. + * Creates a new UpdateCatalogRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ColorInfo instance + * @returns UpdateCatalogRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IColorInfo): google.cloud.retail.v2alpha.ColorInfo; + public static create(properties?: google.cloud.retail.v2alpha.IUpdateCatalogRequest): google.cloud.retail.v2alpha.UpdateCatalogRequest; /** - * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.ColorInfo.verify|verify} messages. - * @param message ColorInfo message or plain object to encode + * Encodes the specified UpdateCatalogRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCatalogRequest.verify|verify} messages. + * @param message UpdateCatalogRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IUpdateCatalogRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ColorInfo.verify|verify} messages. - * @param message ColorInfo message or plain object to encode + * Encodes the specified UpdateCatalogRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCatalogRequest.verify|verify} messages. + * @param message UpdateCatalogRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateCatalogRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ColorInfo message from the specified reader or buffer. + * Decodes an UpdateCatalogRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ColorInfo + * @returns UpdateCatalogRequest * @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.ColorInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UpdateCatalogRequest; /** - * Decodes a ColorInfo message from the specified reader or buffer, length delimited. + * Decodes an UpdateCatalogRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ColorInfo + * @returns UpdateCatalogRequest * @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.ColorInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UpdateCatalogRequest; /** - * Verifies a ColorInfo message. + * Verifies an UpdateCatalogRequest 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 ColorInfo message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateCatalogRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ColorInfo + * @returns UpdateCatalogRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ColorInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateCatalogRequest; /** - * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. - * @param message ColorInfo + * Creates a plain object from an UpdateCatalogRequest message. Also converts values to other types if specified. + * @param message UpdateCatalogRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ColorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.UpdateCatalogRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ColorInfo to JSON. + * Converts this UpdateCatalogRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CustomAttribute. */ - interface ICustomAttribute { - - /** CustomAttribute text */ - text?: (string[]|null); + /** Properties of a SetDefaultBranchRequest. */ + interface ISetDefaultBranchRequest { - /** CustomAttribute numbers */ - numbers?: (number[]|null); + /** SetDefaultBranchRequest catalog */ + catalog?: (string|null); - /** CustomAttribute searchable */ - searchable?: (boolean|null); + /** SetDefaultBranchRequest branchId */ + branchId?: (string|null); - /** CustomAttribute indexable */ - indexable?: (boolean|null); + /** SetDefaultBranchRequest note */ + note?: (string|null); } - /** Represents a CustomAttribute. */ - class CustomAttribute implements ICustomAttribute { + /** Represents a SetDefaultBranchRequest. */ + class SetDefaultBranchRequest implements ISetDefaultBranchRequest { /** - * Constructs a new CustomAttribute. + * Constructs a new SetDefaultBranchRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICustomAttribute); - - /** CustomAttribute text. */ - public text: string[]; - - /** CustomAttribute numbers. */ - public numbers: number[]; - - /** CustomAttribute searchable. */ - public searchable?: (boolean|null); + constructor(properties?: google.cloud.retail.v2alpha.ISetDefaultBranchRequest); - /** CustomAttribute indexable. */ - public indexable?: (boolean|null); + /** SetDefaultBranchRequest catalog. */ + public catalog: string; - /** CustomAttribute _searchable. */ - public _searchable?: "searchable"; + /** SetDefaultBranchRequest branchId. */ + public branchId: string; - /** CustomAttribute _indexable. */ - public _indexable?: "indexable"; + /** SetDefaultBranchRequest note. */ + public note: string; /** - * Creates a new CustomAttribute instance using the specified properties. + * Creates a new SetDefaultBranchRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CustomAttribute instance + * @returns SetDefaultBranchRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICustomAttribute): google.cloud.retail.v2alpha.CustomAttribute; + public static create(properties?: google.cloud.retail.v2alpha.ISetDefaultBranchRequest): google.cloud.retail.v2alpha.SetDefaultBranchRequest; /** - * Encodes the specified CustomAttribute message. Does not implicitly {@link google.cloud.retail.v2alpha.CustomAttribute.verify|verify} messages. - * @param message CustomAttribute message or plain object to encode + * Encodes the specified SetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SetDefaultBranchRequest.verify|verify} messages. + * @param message SetDefaultBranchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ISetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CustomAttribute.verify|verify} messages. - * @param message CustomAttribute message or plain object to encode + * Encodes the specified SetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetDefaultBranchRequest.verify|verify} messages. + * @param message SetDefaultBranchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ISetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CustomAttribute message from the specified reader or buffer. + * Decodes a SetDefaultBranchRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CustomAttribute + * @returns SetDefaultBranchRequest * @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.CustomAttribute; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SetDefaultBranchRequest; /** - * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. + * Decodes a SetDefaultBranchRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CustomAttribute + * @returns SetDefaultBranchRequest * @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.CustomAttribute; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SetDefaultBranchRequest; /** - * Verifies a CustomAttribute message. + * Verifies a SetDefaultBranchRequest 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 CustomAttribute message from a plain object. Also converts values to their respective internal types. + * Creates a SetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CustomAttribute + * @returns SetDefaultBranchRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CustomAttribute; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SetDefaultBranchRequest; /** - * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. - * @param message CustomAttribute + * Creates a plain object from a SetDefaultBranchRequest message. Also converts values to other types if specified. + * @param message SetDefaultBranchRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.CustomAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.SetDefaultBranchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CustomAttribute to JSON. + * Converts this SetDefaultBranchRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a FulfillmentInfo. */ - interface IFulfillmentInfo { - - /** FulfillmentInfo type */ - type?: (string|null); + /** Properties of a GetDefaultBranchRequest. */ + interface IGetDefaultBranchRequest { - /** FulfillmentInfo placeIds */ - placeIds?: (string[]|null); + /** GetDefaultBranchRequest catalog */ + catalog?: (string|null); } - /** Represents a FulfillmentInfo. */ - class FulfillmentInfo implements IFulfillmentInfo { + /** Represents a GetDefaultBranchRequest. */ + class GetDefaultBranchRequest implements IGetDefaultBranchRequest { /** - * Constructs a new FulfillmentInfo. + * Constructs a new GetDefaultBranchRequest. * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IFulfillmentInfo); - - /** FulfillmentInfo type. */ - public type: string; + */ + constructor(properties?: google.cloud.retail.v2alpha.IGetDefaultBranchRequest); - /** FulfillmentInfo placeIds. */ - public placeIds: string[]; + /** GetDefaultBranchRequest catalog. */ + public catalog: string; /** - * Creates a new FulfillmentInfo instance using the specified properties. + * Creates a new GetDefaultBranchRequest instance using the specified properties. * @param [properties] Properties to set - * @returns FulfillmentInfo instance + * @returns GetDefaultBranchRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IFulfillmentInfo): google.cloud.retail.v2alpha.FulfillmentInfo; + public static create(properties?: google.cloud.retail.v2alpha.IGetDefaultBranchRequest): google.cloud.retail.v2alpha.GetDefaultBranchRequest; /** - * Encodes the specified FulfillmentInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.FulfillmentInfo.verify|verify} messages. - * @param message FulfillmentInfo message or plain object to encode + * Encodes the specified GetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchRequest.verify|verify} messages. + * @param message GetDefaultBranchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IFulfillmentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IGetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FulfillmentInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.FulfillmentInfo.verify|verify} messages. - * @param message FulfillmentInfo message or plain object to encode + * Encodes the specified GetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchRequest.verify|verify} messages. + * @param message GetDefaultBranchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IFulfillmentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FulfillmentInfo message from the specified reader or buffer. + * Decodes a GetDefaultBranchRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FulfillmentInfo + * @returns GetDefaultBranchRequest * @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.FulfillmentInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetDefaultBranchRequest; /** - * Decodes a FulfillmentInfo message from the specified reader or buffer, length delimited. + * Decodes a GetDefaultBranchRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FulfillmentInfo + * @returns GetDefaultBranchRequest * @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.FulfillmentInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetDefaultBranchRequest; /** - * Verifies a FulfillmentInfo message. + * Verifies a GetDefaultBranchRequest 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 FulfillmentInfo message from a plain object. Also converts values to their respective internal types. + * Creates a GetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FulfillmentInfo + * @returns GetDefaultBranchRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.FulfillmentInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetDefaultBranchRequest; /** - * Creates a plain object from a FulfillmentInfo message. Also converts values to other types if specified. - * @param message FulfillmentInfo + * Creates a plain object from a GetDefaultBranchRequest message. Also converts values to other types if specified. + * @param message GetDefaultBranchRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.FulfillmentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.GetDefaultBranchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FulfillmentInfo to JSON. + * Converts this GetDefaultBranchRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Image. */ - interface IImage { + /** Properties of a GetDefaultBranchResponse. */ + interface IGetDefaultBranchResponse { - /** Image uri */ - uri?: (string|null); + /** GetDefaultBranchResponse branch */ + branch?: (string|null); - /** Image height */ - height?: (number|null); + /** GetDefaultBranchResponse setTime */ + setTime?: (google.protobuf.ITimestamp|null); - /** Image width */ - width?: (number|null); + /** GetDefaultBranchResponse note */ + note?: (string|null); } - /** Represents an Image. */ - class Image implements IImage { + /** Represents a GetDefaultBranchResponse. */ + class GetDefaultBranchResponse implements IGetDefaultBranchResponse { /** - * Constructs a new Image. + * Constructs a new GetDefaultBranchResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IImage); + constructor(properties?: google.cloud.retail.v2alpha.IGetDefaultBranchResponse); - /** Image uri. */ - public uri: string; + /** GetDefaultBranchResponse branch. */ + public branch: string; - /** Image height. */ - public height: number; + /** GetDefaultBranchResponse setTime. */ + public setTime?: (google.protobuf.ITimestamp|null); - /** Image width. */ - public width: number; + /** GetDefaultBranchResponse note. */ + public note: string; /** - * Creates a new Image instance using the specified properties. + * Creates a new GetDefaultBranchResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Image instance + * @returns GetDefaultBranchResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IImage): google.cloud.retail.v2alpha.Image; + public static create(properties?: google.cloud.retail.v2alpha.IGetDefaultBranchResponse): google.cloud.retail.v2alpha.GetDefaultBranchResponse; /** - * Encodes the specified Image message. Does not implicitly {@link google.cloud.retail.v2alpha.Image.verify|verify} messages. - * @param message Image message or plain object to encode + * Encodes the specified GetDefaultBranchResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchResponse.verify|verify} messages. + * @param message GetDefaultBranchResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IGetDefaultBranchResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Image.verify|verify} messages. - * @param message Image message or plain object to encode + * Encodes the specified GetDefaultBranchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchResponse.verify|verify} messages. + * @param message GetDefaultBranchResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetDefaultBranchResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Image message from the specified reader or buffer. + * Decodes a GetDefaultBranchResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Image + * @returns GetDefaultBranchResponse * @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.Image; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetDefaultBranchResponse; /** - * Decodes an Image message from the specified reader or buffer, length delimited. + * Decodes a GetDefaultBranchResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Image + * @returns GetDefaultBranchResponse * @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.Image; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetDefaultBranchResponse; /** - * Verifies an Image message. + * Verifies a GetDefaultBranchResponse 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 Image message from a plain object. Also converts values to their respective internal types. + * Creates a GetDefaultBranchResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Image + * @returns GetDefaultBranchResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Image; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetDefaultBranchResponse; /** - * Creates a plain object from an Image message. Also converts values to other types if specified. - * @param message Image + * Creates a plain object from a GetDefaultBranchResponse message. Also converts values to other types if specified. + * @param message GetDefaultBranchResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.GetDefaultBranchResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Image to JSON. + * Converts this GetDefaultBranchResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Interval. */ - interface IInterval { + /** Represents a CompletionService */ + class CompletionService extends $protobuf.rpc.Service { - /** Interval minimum */ - minimum?: (number|null); + /** + * Constructs a new CompletionService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** Interval exclusiveMinimum */ - exclusiveMinimum?: (number|null); + /** + * Creates new CompletionService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): CompletionService; - /** Interval maximum */ - maximum?: (number|null); + /** + * Calls CompleteQuery. + * @param request CompleteQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CompleteQueryResponse + */ + public completeQuery(request: google.cloud.retail.v2alpha.ICompleteQueryRequest, callback: google.cloud.retail.v2alpha.CompletionService.CompleteQueryCallback): void; - /** Interval exclusiveMaximum */ - exclusiveMaximum?: (number|null); + /** + * Calls CompleteQuery. + * @param request CompleteQueryRequest message or plain object + * @returns Promise + */ + public completeQuery(request: google.cloud.retail.v2alpha.ICompleteQueryRequest): Promise; + + /** + * Calls ImportCompletionData. + * @param request ImportCompletionDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importCompletionData(request: google.cloud.retail.v2alpha.IImportCompletionDataRequest, callback: google.cloud.retail.v2alpha.CompletionService.ImportCompletionDataCallback): void; + + /** + * Calls ImportCompletionData. + * @param request ImportCompletionDataRequest message or plain object + * @returns Promise + */ + public importCompletionData(request: google.cloud.retail.v2alpha.IImportCompletionDataRequest): Promise; } - /** Represents an Interval. */ - class Interval implements IInterval { + namespace CompletionService { /** - * Constructs a new Interval. + * Callback as used by {@link google.cloud.retail.v2alpha.CompletionService#completeQuery}. + * @param error Error, if any + * @param [response] CompleteQueryResponse + */ + type CompleteQueryCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.CompleteQueryResponse) => void; + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CompletionService#importCompletionData}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportCompletionDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a CompleteQueryRequest. */ + interface ICompleteQueryRequest { + + /** CompleteQueryRequest catalog */ + catalog?: (string|null); + + /** CompleteQueryRequest query */ + query?: (string|null); + + /** CompleteQueryRequest visitorId */ + visitorId?: (string|null); + + /** CompleteQueryRequest languageCodes */ + languageCodes?: (string[]|null); + + /** CompleteQueryRequest deviceType */ + deviceType?: (string|null); + + /** CompleteQueryRequest dataset */ + dataset?: (string|null); + + /** CompleteQueryRequest maxSuggestions */ + maxSuggestions?: (number|null); + } + + /** Represents a CompleteQueryRequest. */ + class CompleteQueryRequest implements ICompleteQueryRequest { + + /** + * Constructs a new CompleteQueryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IInterval); + constructor(properties?: google.cloud.retail.v2alpha.ICompleteQueryRequest); - /** Interval minimum. */ - public minimum?: (number|null); + /** CompleteQueryRequest catalog. */ + public catalog: string; - /** Interval exclusiveMinimum. */ - public exclusiveMinimum?: (number|null); + /** CompleteQueryRequest query. */ + public query: string; - /** Interval maximum. */ - public maximum?: (number|null); + /** CompleteQueryRequest visitorId. */ + public visitorId: string; - /** Interval exclusiveMaximum. */ - public exclusiveMaximum?: (number|null); + /** CompleteQueryRequest languageCodes. */ + public languageCodes: string[]; + + /** CompleteQueryRequest deviceType. */ + public deviceType: string; - /** Interval min. */ - public min?: ("minimum"|"exclusiveMinimum"); + /** CompleteQueryRequest dataset. */ + public dataset: string; - /** Interval max. */ - public max?: ("maximum"|"exclusiveMaximum"); + /** CompleteQueryRequest maxSuggestions. */ + public maxSuggestions: number; /** - * Creates a new Interval instance using the specified properties. + * Creates a new CompleteQueryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Interval instance + * @returns CompleteQueryRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IInterval): google.cloud.retail.v2alpha.Interval; + public static create(properties?: google.cloud.retail.v2alpha.ICompleteQueryRequest): google.cloud.retail.v2alpha.CompleteQueryRequest; /** - * Encodes the specified Interval message. Does not implicitly {@link google.cloud.retail.v2alpha.Interval.verify|verify} messages. - * @param message Interval message or plain object to encode + * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryRequest.verify|verify} messages. + * @param message CompleteQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Interval.verify|verify} messages. - * @param message Interval message or plain object to encode + * Encodes the specified CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryRequest.verify|verify} messages. + * @param message CompleteQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Interval message from the specified reader or buffer. + * Decodes a CompleteQueryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Interval + * @returns CompleteQueryRequest * @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.Interval; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompleteQueryRequest; /** - * Decodes an Interval message from the specified reader or buffer, length delimited. + * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Interval + * @returns CompleteQueryRequest * @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.Interval; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompleteQueryRequest; /** - * Verifies an Interval message. + * Verifies a CompleteQueryRequest 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 Interval message from a plain object. Also converts values to their respective internal types. + * Creates a CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Interval + * @returns CompleteQueryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Interval; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryRequest; /** - * Creates a plain object from an Interval message. Also converts values to other types if specified. - * @param message Interval + * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. + * @param message CompleteQueryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.Interval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Interval to JSON. + * Converts this CompleteQueryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PriceInfo. */ - interface IPriceInfo { - - /** PriceInfo currencyCode */ - currencyCode?: (string|null); - - /** PriceInfo price */ - price?: (number|null); - - /** PriceInfo originalPrice */ - originalPrice?: (number|null); - - /** PriceInfo cost */ - cost?: (number|null); + /** Properties of a CompleteQueryResponse. */ + interface ICompleteQueryResponse { - /** PriceInfo priceEffectiveTime */ - priceEffectiveTime?: (google.protobuf.ITimestamp|null); + /** CompleteQueryResponse completionResults */ + completionResults?: (google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult[]|null); - /** PriceInfo priceExpireTime */ - priceExpireTime?: (google.protobuf.ITimestamp|null); + /** CompleteQueryResponse attributionToken */ + attributionToken?: (string|null); - /** PriceInfo priceRange */ - priceRange?: (google.cloud.retail.v2alpha.PriceInfo.IPriceRange|null); + /** CompleteQueryResponse recentSearchResults */ + recentSearchResults?: (google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult[]|null); } - /** Represents a PriceInfo. */ - class PriceInfo implements IPriceInfo { + /** Represents a CompleteQueryResponse. */ + class CompleteQueryResponse implements ICompleteQueryResponse { /** - * Constructs a new PriceInfo. + * Constructs a new CompleteQueryResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IPriceInfo); - - /** PriceInfo currencyCode. */ - public currencyCode: string; - - /** PriceInfo price. */ - public price: number; - - /** PriceInfo originalPrice. */ - public originalPrice: number; - - /** PriceInfo cost. */ - public cost: number; + constructor(properties?: google.cloud.retail.v2alpha.ICompleteQueryResponse); - /** PriceInfo priceEffectiveTime. */ - public priceEffectiveTime?: (google.protobuf.ITimestamp|null); + /** CompleteQueryResponse completionResults. */ + public completionResults: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult[]; - /** PriceInfo priceExpireTime. */ - public priceExpireTime?: (google.protobuf.ITimestamp|null); + /** CompleteQueryResponse attributionToken. */ + public attributionToken: string; - /** PriceInfo priceRange. */ - public priceRange?: (google.cloud.retail.v2alpha.PriceInfo.IPriceRange|null); + /** CompleteQueryResponse recentSearchResults. */ + public recentSearchResults: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult[]; /** - * Creates a new PriceInfo instance using the specified properties. + * Creates a new CompleteQueryResponse instance using the specified properties. * @param [properties] Properties to set - * @returns PriceInfo instance + * @returns CompleteQueryResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IPriceInfo): google.cloud.retail.v2alpha.PriceInfo; + public static create(properties?: google.cloud.retail.v2alpha.ICompleteQueryResponse): google.cloud.retail.v2alpha.CompleteQueryResponse; /** - * Encodes the specified PriceInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.verify|verify} messages. - * @param message PriceInfo message or plain object to encode + * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.verify|verify} messages. + * @param message CompleteQueryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IPriceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PriceInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.verify|verify} messages. - * @param message PriceInfo message or plain object to encode + * Encodes the specified CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.verify|verify} messages. + * @param message CompleteQueryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPriceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PriceInfo message from the specified reader or buffer. + * Decodes a CompleteQueryResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PriceInfo + * @returns CompleteQueryResponse * @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.PriceInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompleteQueryResponse; /** - * Decodes a PriceInfo message from the specified reader or buffer, length delimited. + * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PriceInfo + * @returns CompleteQueryResponse * @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.PriceInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompleteQueryResponse; /** - * Verifies a PriceInfo message. + * Verifies a CompleteQueryResponse 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 PriceInfo message from a plain object. Also converts values to their respective internal types. + * Creates a CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PriceInfo + * @returns CompleteQueryResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PriceInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryResponse; /** - * Creates a plain object from a PriceInfo message. Also converts values to other types if specified. - * @param message PriceInfo + * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. + * @param message CompleteQueryResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.PriceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PriceInfo to JSON. + * Converts this CompleteQueryResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace PriceInfo { + namespace CompleteQueryResponse { - /** Properties of a PriceRange. */ - interface IPriceRange { + /** Properties of a CompletionResult. */ + interface ICompletionResult { + + /** CompletionResult suggestion */ + suggestion?: (string|null); + + /** CompletionResult attributes */ + attributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }|null); + } + + /** Represents a CompletionResult. */ + class CompletionResult implements ICompletionResult { + + /** + * Constructs a new CompletionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult); + + /** CompletionResult suggestion. */ + public suggestion: string; + + /** CompletionResult attributes. */ + public attributes: { [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }; + + /** + * Creates a new CompletionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns CompletionResult instance + */ + public static create(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult): google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult; + + /** + * Encodes the specified CompletionResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @param message CompletionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompletionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @param message CompletionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompletionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompletionResult + * @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.CompletionResult; + + /** + * Decodes a CompletionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompletionResult + * @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.CompletionResult; + + /** + * Verifies a CompletionResult 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 CompletionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompletionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult; + + /** + * Creates a plain object from a CompletionResult message. Also converts values to other types if specified. + * @param message CompletionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompletionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** PriceRange price */ - price?: (google.cloud.retail.v2alpha.IInterval|null); + /** Properties of a RecentSearchResult. */ + interface IRecentSearchResult { - /** PriceRange originalPrice */ - originalPrice?: (google.cloud.retail.v2alpha.IInterval|null); + /** RecentSearchResult recentSearch */ + recentSearch?: (string|null); } - /** Represents a PriceRange. */ - class PriceRange implements IPriceRange { + /** Represents a RecentSearchResult. */ + class RecentSearchResult implements IRecentSearchResult { /** - * Constructs a new PriceRange. + * Constructs a new RecentSearchResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.PriceInfo.IPriceRange); - - /** PriceRange price. */ - public price?: (google.cloud.retail.v2alpha.IInterval|null); + constructor(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult); - /** PriceRange originalPrice. */ - public originalPrice?: (google.cloud.retail.v2alpha.IInterval|null); + /** RecentSearchResult recentSearch. */ + public recentSearch: string; /** - * Creates a new PriceRange instance using the specified properties. + * Creates a new RecentSearchResult instance using the specified properties. * @param [properties] Properties to set - * @returns PriceRange instance + * @returns RecentSearchResult instance */ - public static create(properties?: google.cloud.retail.v2alpha.PriceInfo.IPriceRange): google.cloud.retail.v2alpha.PriceInfo.PriceRange; + public static create(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult): google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult; /** - * Encodes the specified PriceRange message. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.PriceRange.verify|verify} messages. - * @param message PriceRange message or plain object to encode + * Encodes the specified RecentSearchResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. + * @param message RecentSearchResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.PriceInfo.IPriceRange, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PriceRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.PriceRange.verify|verify} messages. - * @param message PriceRange message or plain object to encode + * Encodes the specified RecentSearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. + * @param message RecentSearchResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.PriceInfo.IPriceRange, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PriceRange message from the specified reader or buffer. + * Decodes a RecentSearchResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PriceRange + * @returns RecentSearchResult * @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.PriceInfo.PriceRange; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult; /** - * Decodes a PriceRange message from the specified reader or buffer, length delimited. + * Decodes a RecentSearchResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PriceRange + * @returns RecentSearchResult * @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.PriceInfo.PriceRange; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult; /** - * Verifies a PriceRange message. + * Verifies a RecentSearchResult 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 PriceRange message from a plain object. Also converts values to their respective internal types. + * Creates a RecentSearchResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PriceRange + * @returns RecentSearchResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PriceInfo.PriceRange; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult; /** - * Creates a plain object from a PriceRange message. Also converts values to other types if specified. - * @param message PriceRange + * Creates a plain object from a RecentSearchResult message. Also converts values to other types if specified. + * @param message RecentSearchResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.PriceInfo.PriceRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PriceRange to JSON. + * Converts this RecentSearchResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } } - /** Properties of a Rating. */ - interface IRating { - - /** Rating ratingCount */ - ratingCount?: (number|null); - - /** Rating averageRating */ - averageRating?: (number|null); + /** Properties of an ExportErrorsConfig. */ + interface IExportErrorsConfig { - /** Rating ratingHistogram */ - ratingHistogram?: (number[]|null); + /** ExportErrorsConfig gcsPrefix */ + gcsPrefix?: (string|null); } - /** Represents a Rating. */ - class Rating implements IRating { + /** Represents an ExportErrorsConfig. */ + class ExportErrorsConfig implements IExportErrorsConfig { /** - * Constructs a new Rating. + * Constructs a new ExportErrorsConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IRating); - - /** Rating ratingCount. */ - public ratingCount: number; + constructor(properties?: google.cloud.retail.v2alpha.IExportErrorsConfig); - /** Rating averageRating. */ - public averageRating: number; + /** ExportErrorsConfig gcsPrefix. */ + public gcsPrefix?: (string|null); - /** Rating ratingHistogram. */ - public ratingHistogram: number[]; + /** ExportErrorsConfig destination. */ + public destination?: "gcsPrefix"; /** - * Creates a new Rating instance using the specified properties. + * Creates a new ExportErrorsConfig instance using the specified properties. * @param [properties] Properties to set - * @returns Rating instance + * @returns ExportErrorsConfig instance */ - public static create(properties?: google.cloud.retail.v2alpha.IRating): google.cloud.retail.v2alpha.Rating; + public static create(properties?: google.cloud.retail.v2alpha.IExportErrorsConfig): google.cloud.retail.v2alpha.ExportErrorsConfig; /** - * Encodes the specified Rating message. Does not implicitly {@link google.cloud.retail.v2alpha.Rating.verify|verify} messages. - * @param message Rating message or plain object to encode + * Encodes the specified ExportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ExportErrorsConfig.verify|verify} messages. + * @param message ExportErrorsConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IRating, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IExportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Rating message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rating.verify|verify} messages. - * @param message Rating message or plain object to encode + * Encodes the specified ExportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExportErrorsConfig.verify|verify} messages. + * @param message ExportErrorsConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRating, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IExportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Rating message from the specified reader or buffer. + * Decodes an ExportErrorsConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Rating + * @returns ExportErrorsConfig * @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.Rating; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ExportErrorsConfig; /** - * Decodes a Rating message from the specified reader or buffer, length delimited. + * Decodes an ExportErrorsConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Rating + * @returns ExportErrorsConfig * @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.Rating; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ExportErrorsConfig; /** - * Verifies a Rating message. + * Verifies an ExportErrorsConfig 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 Rating message from a plain object. Also converts values to their respective internal types. + * Creates an ExportErrorsConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Rating + * @returns ExportErrorsConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rating; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ExportErrorsConfig; /** - * Creates a plain object from a Rating message. Also converts values to other types if specified. - * @param message Rating + * Creates a plain object from an ExportErrorsConfig message. Also converts values to other types if specified. + * @param message ExportErrorsConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.Rating, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ExportErrorsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Rating to JSON. + * Converts this ExportErrorsConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a UserInfo. */ - interface IUserInfo { + /** Properties of an ExportMetadata. */ + interface IExportMetadata { - /** UserInfo userId */ - userId?: (string|null); + /** ExportMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** UserInfo ipAddress */ - ipAddress?: (string|null); + /** ExportMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } - /** UserInfo userAgent */ - userAgent?: (string|null); + /** Represents an ExportMetadata. */ + class ExportMetadata implements IExportMetadata { + + /** + * Constructs a new ExportMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IExportMetadata); + + /** ExportMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ExportMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ExportMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportMetadata instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IExportMetadata): google.cloud.retail.v2alpha.ExportMetadata; + + /** + * Encodes the specified ExportMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.ExportMetadata.verify|verify} messages. + * @param message ExportMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IExportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExportMetadata.verify|verify} messages. + * @param message ExportMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IExportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportMetadata + * @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.ExportMetadata; + + /** + * Decodes an ExportMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportMetadata + * @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.ExportMetadata; + + /** + * Verifies an ExportMetadata 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 ExportMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ExportMetadata; + + /** + * Creates a plain object from an ExportMetadata message. Also converts values to other types if specified. + * @param message ExportMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ExportMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ExportProductsResponse. */ + interface IExportProductsResponse { + + /** ExportProductsResponse errorSamples */ + errorSamples?: (google.rpc.IStatus[]|null); - /** UserInfo directUserRequest */ - directUserRequest?: (boolean|null); + /** ExportProductsResponse errorsConfig */ + errorsConfig?: (google.cloud.retail.v2alpha.IExportErrorsConfig|null); } - /** Represents a UserInfo. */ - class UserInfo implements IUserInfo { + /** Represents an ExportProductsResponse. */ + class ExportProductsResponse implements IExportProductsResponse { /** - * Constructs a new UserInfo. + * Constructs a new ExportProductsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IUserInfo); - - /** UserInfo userId. */ - public userId: string; - - /** UserInfo ipAddress. */ - public ipAddress: string; + constructor(properties?: google.cloud.retail.v2alpha.IExportProductsResponse); - /** UserInfo userAgent. */ - public userAgent: string; + /** ExportProductsResponse errorSamples. */ + public errorSamples: google.rpc.IStatus[]; - /** UserInfo directUserRequest. */ - public directUserRequest: boolean; + /** ExportProductsResponse errorsConfig. */ + public errorsConfig?: (google.cloud.retail.v2alpha.IExportErrorsConfig|null); /** - * Creates a new UserInfo instance using the specified properties. + * Creates a new ExportProductsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns UserInfo instance + * @returns ExportProductsResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IUserInfo): google.cloud.retail.v2alpha.UserInfo; + public static create(properties?: google.cloud.retail.v2alpha.IExportProductsResponse): google.cloud.retail.v2alpha.ExportProductsResponse; /** - * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.UserInfo.verify|verify} messages. - * @param message UserInfo message or plain object to encode + * Encodes the specified ExportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ExportProductsResponse.verify|verify} messages. + * @param message ExportProductsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IExportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserInfo.verify|verify} messages. - * @param message UserInfo message or plain object to encode + * Encodes the specified ExportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExportProductsResponse.verify|verify} messages. + * @param message ExportProductsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IExportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a UserInfo message from the specified reader or buffer. + * Decodes an ExportProductsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UserInfo + * @returns ExportProductsResponse * @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.UserInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ExportProductsResponse; /** - * Decodes a UserInfo message from the specified reader or buffer, length delimited. + * Decodes an ExportProductsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UserInfo + * @returns ExportProductsResponse * @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.UserInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ExportProductsResponse; /** - * Verifies a UserInfo message. + * Verifies an ExportProductsResponse 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 UserInfo message from a plain object. Also converts values to their respective internal types. + * Creates an ExportProductsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UserInfo + * @returns ExportProductsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ExportProductsResponse; /** - * Creates a plain object from a UserInfo message. Also converts values to other types if specified. - * @param message UserInfo + * Creates a plain object from an ExportProductsResponse message. Also converts values to other types if specified. + * @param message ExportProductsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.UserInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ExportProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UserInfo to JSON. + * Converts this ExportProductsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Promotion. */ - interface IPromotion { + /** Properties of an ExportUserEventsResponse. */ + interface IExportUserEventsResponse { - /** Promotion promotionId */ - promotionId?: (string|null); + /** ExportUserEventsResponse errorSamples */ + errorSamples?: (google.rpc.IStatus[]|null); + + /** ExportUserEventsResponse errorsConfig */ + errorsConfig?: (google.cloud.retail.v2alpha.IExportErrorsConfig|null); } - /** Represents a Promotion. */ - class Promotion implements IPromotion { + /** Represents an ExportUserEventsResponse. */ + class ExportUserEventsResponse implements IExportUserEventsResponse { /** - * Constructs a new Promotion. + * Constructs a new ExportUserEventsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IPromotion); + constructor(properties?: google.cloud.retail.v2alpha.IExportUserEventsResponse); - /** Promotion promotionId. */ - public promotionId: string; + /** ExportUserEventsResponse errorSamples. */ + public errorSamples: google.rpc.IStatus[]; + + /** ExportUserEventsResponse errorsConfig. */ + public errorsConfig?: (google.cloud.retail.v2alpha.IExportErrorsConfig|null); /** - * Creates a new Promotion instance using the specified properties. + * Creates a new ExportUserEventsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Promotion instance + * @returns ExportUserEventsResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IPromotion): google.cloud.retail.v2alpha.Promotion; + public static create(properties?: google.cloud.retail.v2alpha.IExportUserEventsResponse): google.cloud.retail.v2alpha.ExportUserEventsResponse; /** - * Encodes the specified Promotion message. Does not implicitly {@link google.cloud.retail.v2alpha.Promotion.verify|verify} messages. - * @param message Promotion message or plain object to encode + * Encodes the specified ExportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ExportUserEventsResponse.verify|verify} messages. + * @param message ExportUserEventsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IPromotion, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IExportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Promotion message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Promotion.verify|verify} messages. - * @param message Promotion message or plain object to encode + * Encodes the specified ExportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExportUserEventsResponse.verify|verify} messages. + * @param message ExportUserEventsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPromotion, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IExportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Promotion message from the specified reader or buffer. + * Decodes an ExportUserEventsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Promotion + * @returns ExportUserEventsResponse * @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.Promotion; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ExportUserEventsResponse; /** - * Decodes a Promotion message from the specified reader or buffer, length delimited. + * Decodes an ExportUserEventsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Promotion + * @returns ExportUserEventsResponse * @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.Promotion; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ExportUserEventsResponse; /** - * Verifies a Promotion message. + * Verifies an ExportUserEventsResponse 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 Promotion message from a plain object. Also converts values to their respective internal types. + * Creates an ExportUserEventsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Promotion + * @returns ExportUserEventsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Promotion; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ExportUserEventsResponse; /** - * Creates a plain object from a Promotion message. Also converts values to other types if specified. - * @param message Promotion + * Creates a plain object from an ExportUserEventsResponse message. Also converts values to other types if specified. + * @param message ExportUserEventsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.Promotion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ExportUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Promotion to JSON. + * Converts this ExportUserEventsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a LocalInventory. */ - interface ILocalInventory { + /** Represents a PredictionService */ + class PredictionService extends $protobuf.rpc.Service { - /** LocalInventory placeId */ - placeId?: (string|null); + /** + * Constructs a new PredictionService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** LocalInventory priceInfo */ - priceInfo?: (google.cloud.retail.v2alpha.IPriceInfo|null); + /** + * Creates new PredictionService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): PredictionService; - /** LocalInventory attributes */ - attributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }|null); + /** + * Calls Predict. + * @param request PredictRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PredictResponse + */ + public predict(request: google.cloud.retail.v2alpha.IPredictRequest, callback: google.cloud.retail.v2alpha.PredictionService.PredictCallback): void; + + /** + * Calls Predict. + * @param request PredictRequest message or plain object + * @returns Promise + */ + public predict(request: google.cloud.retail.v2alpha.IPredictRequest): Promise; } - /** Represents a LocalInventory. */ - class LocalInventory implements ILocalInventory { + namespace PredictionService { /** - * Constructs a new LocalInventory. + * Callback as used by {@link google.cloud.retail.v2alpha.PredictionService#predict}. + * @param error Error, if any + * @param [response] PredictResponse + */ + type PredictCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.PredictResponse) => void; + } + + /** Properties of a PredictRequest. */ + interface IPredictRequest { + + /** PredictRequest placement */ + placement?: (string|null); + + /** PredictRequest userEvent */ + userEvent?: (google.cloud.retail.v2alpha.IUserEvent|null); + + /** PredictRequest pageSize */ + pageSize?: (number|null); + + /** PredictRequest pageToken */ + pageToken?: (string|null); + + /** PredictRequest filter */ + filter?: (string|null); + + /** PredictRequest validateOnly */ + validateOnly?: (boolean|null); + + /** PredictRequest params */ + params?: ({ [k: string]: google.protobuf.IValue }|null); + + /** PredictRequest labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a PredictRequest. */ + class PredictRequest implements IPredictRequest { + + /** + * Constructs a new PredictRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ILocalInventory); + constructor(properties?: google.cloud.retail.v2alpha.IPredictRequest); - /** LocalInventory placeId. */ - public placeId: string; + /** PredictRequest placement. */ + public placement: string; - /** LocalInventory priceInfo. */ - public priceInfo?: (google.cloud.retail.v2alpha.IPriceInfo|null); + /** PredictRequest userEvent. */ + public userEvent?: (google.cloud.retail.v2alpha.IUserEvent|null); - /** LocalInventory attributes. */ - public attributes: { [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }; + /** PredictRequest pageSize. */ + public pageSize: number; + + /** PredictRequest pageToken. */ + public pageToken: string; + + /** PredictRequest filter. */ + public filter: string; + + /** PredictRequest validateOnly. */ + public validateOnly: boolean; + + /** PredictRequest params. */ + public params: { [k: string]: google.protobuf.IValue }; + + /** PredictRequest labels. */ + public labels: { [k: string]: string }; /** - * Creates a new LocalInventory instance using the specified properties. + * Creates a new PredictRequest instance using the specified properties. * @param [properties] Properties to set - * @returns LocalInventory instance + * @returns PredictRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.ILocalInventory): google.cloud.retail.v2alpha.LocalInventory; + public static create(properties?: google.cloud.retail.v2alpha.IPredictRequest): google.cloud.retail.v2alpha.PredictRequest; /** - * Encodes the specified LocalInventory message. Does not implicitly {@link google.cloud.retail.v2alpha.LocalInventory.verify|verify} messages. - * @param message LocalInventory message or plain object to encode + * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictRequest.verify|verify} messages. + * @param message PredictRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ILocalInventory, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LocalInventory message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.LocalInventory.verify|verify} messages. - * @param message LocalInventory message or plain object to encode + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictRequest.verify|verify} messages. + * @param message PredictRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ILocalInventory, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LocalInventory message from the specified reader or buffer. + * Decodes a PredictRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns LocalInventory + * @returns PredictRequest * @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.LocalInventory; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PredictRequest; /** - * Decodes a LocalInventory message from the specified reader or buffer, length delimited. + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LocalInventory + * @returns PredictRequest * @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.LocalInventory; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PredictRequest; /** - * Verifies a LocalInventory message. + * Verifies a PredictRequest 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 LocalInventory message from a plain object. Also converts values to their respective internal types. + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LocalInventory + * @returns PredictRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.LocalInventory; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PredictRequest; /** - * Creates a plain object from a LocalInventory message. Also converts values to other types if specified. - * @param message LocalInventory + * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. + * @param message PredictRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.LocalInventory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.PredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LocalInventory to JSON. + * Converts this PredictRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GcsSource. */ - interface IGcsSource { + /** Properties of a PredictResponse. */ + interface IPredictResponse { - /** GcsSource inputUris */ - inputUris?: (string[]|null); + /** PredictResponse results */ + results?: (google.cloud.retail.v2alpha.PredictResponse.IPredictionResult[]|null); - /** GcsSource dataSchema */ - dataSchema?: (string|null); + /** PredictResponse attributionToken */ + attributionToken?: (string|null); + + /** PredictResponse missingIds */ + missingIds?: (string[]|null); + + /** PredictResponse validateOnly */ + validateOnly?: (boolean|null); } - /** Represents a GcsSource. */ - class GcsSource implements IGcsSource { + /** Represents a PredictResponse. */ + class PredictResponse implements IPredictResponse { /** - * Constructs a new GcsSource. + * Constructs a new PredictResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IGcsSource); + constructor(properties?: google.cloud.retail.v2alpha.IPredictResponse); - /** GcsSource inputUris. */ - public inputUris: string[]; + /** PredictResponse results. */ + public results: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult[]; - /** GcsSource dataSchema. */ - public dataSchema: string; + /** PredictResponse attributionToken. */ + public attributionToken: string; + + /** PredictResponse missingIds. */ + public missingIds: string[]; + + /** PredictResponse validateOnly. */ + public validateOnly: boolean; /** - * Creates a new GcsSource instance using the specified properties. + * Creates a new PredictResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GcsSource instance + * @returns PredictResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IGcsSource): google.cloud.retail.v2alpha.GcsSource; + public static create(properties?: google.cloud.retail.v2alpha.IPredictResponse): google.cloud.retail.v2alpha.PredictResponse; /** - * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.retail.v2alpha.GcsSource.verify|verify} messages. - * @param message GcsSource message or plain object to encode + * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.verify|verify} messages. + * @param message PredictResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GcsSource.verify|verify} messages. - * @param message GcsSource message or plain object to encode + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.verify|verify} messages. + * @param message PredictResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GcsSource message from the specified reader or buffer. + * Decodes a PredictResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GcsSource + * @returns PredictResponse * @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.GcsSource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PredictResponse; /** - * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * Decodes a PredictResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GcsSource + * @returns PredictResponse * @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.GcsSource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PredictResponse; /** - * Verifies a GcsSource message. + * Verifies a PredictResponse 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 GcsSource message from a plain object. Also converts values to their respective internal types. + * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GcsSource + * @returns PredictResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GcsSource; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PredictResponse; /** - * Creates a plain object from a GcsSource message. Also converts values to other types if specified. - * @param message GcsSource + * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * @param message PredictResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.PredictResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GcsSource to JSON. + * Converts this PredictResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BigQuerySource. */ - interface IBigQuerySource { - - /** BigQuerySource partitionDate */ - partitionDate?: (google.type.IDate|null); - - /** BigQuerySource projectId */ - projectId?: (string|null); - - /** BigQuerySource datasetId */ - datasetId?: (string|null); - - /** BigQuerySource tableId */ - tableId?: (string|null); + namespace PredictResponse { - /** BigQuerySource gcsStagingDir */ - gcsStagingDir?: (string|null); + /** Properties of a PredictionResult. */ + interface IPredictionResult { - /** BigQuerySource dataSchema */ - dataSchema?: (string|null); - } + /** PredictionResult id */ + id?: (string|null); - /** Represents a BigQuerySource. */ - class BigQuerySource implements IBigQuerySource { + /** PredictionResult metadata */ + metadata?: ({ [k: string]: google.protobuf.IValue }|null); + } - /** - * Constructs a new BigQuerySource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IBigQuerySource); + /** Represents a PredictionResult. */ + class PredictionResult implements IPredictionResult { - /** BigQuerySource partitionDate. */ - public partitionDate?: (google.type.IDate|null); + /** + * Constructs a new PredictionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult); - /** BigQuerySource projectId. */ - public projectId: string; + /** PredictionResult id. */ + public id: string; - /** BigQuerySource datasetId. */ - public datasetId: string; + /** PredictionResult metadata. */ + public metadata: { [k: string]: google.protobuf.IValue }; - /** BigQuerySource tableId. */ - public tableId: string; + /** + * Creates a new PredictionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns PredictionResult instance + */ + public static create(properties?: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult): google.cloud.retail.v2alpha.PredictResponse.PredictionResult; - /** BigQuerySource gcsStagingDir. */ - public gcsStagingDir: string; + /** + * Encodes the specified PredictionResult message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify|verify} messages. + * @param message PredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** BigQuerySource dataSchema. */ - public dataSchema: string; + /** + * Encodes the specified PredictionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify|verify} messages. + * @param message PredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** BigQuerySource partition. */ - public partition?: "partitionDate"; + /** + * Decodes a PredictionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PredictionResult + * @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.PredictResponse.PredictionResult; - /** - * Creates a new BigQuerySource instance using the specified properties. - * @param [properties] Properties to set - * @returns BigQuerySource instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IBigQuerySource): google.cloud.retail.v2alpha.BigQuerySource; + /** + * Decodes a PredictionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PredictionResult + * @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.PredictResponse.PredictionResult; - /** - * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.retail.v2alpha.BigQuerySource.verify|verify} messages. - * @param message BigQuerySource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a PredictionResult 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); - /** - * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BigQuerySource.verify|verify} messages. - * @param message BigQuerySource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a PredictionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PredictionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PredictResponse.PredictionResult; - /** - * Decodes a BigQuerySource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BigQuerySource - * @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.BigQuerySource; + /** + * Creates a plain object from a PredictionResult message. Also converts values to other types if specified. + * @param message PredictionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.PredictResponse.PredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BigQuerySource - * @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.BigQuerySource; + /** + * Converts this PredictionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Represents a ProductService */ + class ProductService extends $protobuf.rpc.Service { /** - * Verifies a BigQuerySource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Constructs a new ProductService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - public static verify(message: { [k: string]: any }): (string|null); + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates a BigQuerySource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BigQuerySource + * Creates new ProductService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.BigQuerySource; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ProductService; /** - * Creates a plain object from a BigQuerySource message. Also converts values to other types if specified. - * @param message BigQuerySource - * @param [options] Conversion options - * @returns Plain object + * Calls CreateProduct. + * @param request CreateProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product */ - public static toObject(message: google.cloud.retail.v2alpha.BigQuerySource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public createProduct(request: google.cloud.retail.v2alpha.ICreateProductRequest, callback: google.cloud.retail.v2alpha.ProductService.CreateProductCallback): void; /** - * Converts this BigQuerySource to JSON. - * @returns JSON object + * Calls CreateProduct. + * @param request CreateProductRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ProductInlineSource. */ - interface IProductInlineSource { - - /** ProductInlineSource products */ - products?: (google.cloud.retail.v2alpha.IProduct[]|null); - } - - /** Represents a ProductInlineSource. */ - class ProductInlineSource implements IProductInlineSource { + public createProduct(request: google.cloud.retail.v2alpha.ICreateProductRequest): Promise; /** - * Constructs a new ProductInlineSource. - * @param [properties] Properties to set + * Calls GetProduct. + * @param request GetProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product */ - constructor(properties?: google.cloud.retail.v2alpha.IProductInlineSource); - - /** ProductInlineSource products. */ - public products: google.cloud.retail.v2alpha.IProduct[]; + public getProduct(request: google.cloud.retail.v2alpha.IGetProductRequest, callback: google.cloud.retail.v2alpha.ProductService.GetProductCallback): void; /** - * Creates a new ProductInlineSource instance using the specified properties. - * @param [properties] Properties to set - * @returns ProductInlineSource instance + * Calls GetProduct. + * @param request GetProductRequest message or plain object + * @returns Promise */ - public static create(properties?: google.cloud.retail.v2alpha.IProductInlineSource): google.cloud.retail.v2alpha.ProductInlineSource; + public getProduct(request: google.cloud.retail.v2alpha.IGetProductRequest): Promise; /** - * Encodes the specified ProductInlineSource message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInlineSource.verify|verify} messages. - * @param message ProductInlineSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListProducts. + * @param request ListProductsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProductsResponse */ - public static encode(message: google.cloud.retail.v2alpha.IProductInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + public listProducts(request: google.cloud.retail.v2alpha.IListProductsRequest, callback: google.cloud.retail.v2alpha.ProductService.ListProductsCallback): void; /** - * Encodes the specified ProductInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInlineSource.verify|verify} messages. - * @param message ProductInlineSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListProducts. + * @param request ListProductsRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IProductInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + public listProducts(request: google.cloud.retail.v2alpha.IListProductsRequest): Promise; /** - * Decodes a ProductInlineSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProductInlineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls UpdateProduct. + * @param request UpdateProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ProductInlineSource; + public updateProduct(request: google.cloud.retail.v2alpha.IUpdateProductRequest, callback: google.cloud.retail.v2alpha.ProductService.UpdateProductCallback): void; /** - * Decodes a ProductInlineSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProductInlineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls UpdateProduct. + * @param request UpdateProductRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ProductInlineSource; + public updateProduct(request: google.cloud.retail.v2alpha.IUpdateProductRequest): Promise; /** - * Verifies a ProductInlineSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls DeleteProduct. + * @param request DeleteProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static verify(message: { [k: string]: any }): (string|null); + public deleteProduct(request: google.cloud.retail.v2alpha.IDeleteProductRequest, callback: google.cloud.retail.v2alpha.ProductService.DeleteProductCallback): void; /** - * Creates a ProductInlineSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProductInlineSource + * Calls DeleteProduct. + * @param request DeleteProductRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ProductInlineSource; + public deleteProduct(request: google.cloud.retail.v2alpha.IDeleteProductRequest): Promise; /** - * Creates a plain object from a ProductInlineSource message. Also converts values to other types if specified. - * @param message ProductInlineSource - * @param [options] Conversion options - * @returns Plain object + * Calls ImportProducts. + * @param request ImportProductsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static toObject(message: google.cloud.retail.v2alpha.ProductInlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public importProducts(request: google.cloud.retail.v2alpha.IImportProductsRequest, callback: google.cloud.retail.v2alpha.ProductService.ImportProductsCallback): void; /** - * Converts this ProductInlineSource to JSON. - * @returns JSON object + * Calls ImportProducts. + * @param request ImportProductsRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a UserEventInlineSource. */ - interface IUserEventInlineSource { - - /** UserEventInlineSource userEvents */ - userEvents?: (google.cloud.retail.v2alpha.IUserEvent[]|null); - } - - /** Represents a UserEventInlineSource. */ - class UserEventInlineSource implements IUserEventInlineSource { + public importProducts(request: google.cloud.retail.v2alpha.IImportProductsRequest): Promise; /** - * Constructs a new UserEventInlineSource. - * @param [properties] Properties to set + * Calls SetInventory. + * @param request SetInventoryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - constructor(properties?: google.cloud.retail.v2alpha.IUserEventInlineSource); - - /** UserEventInlineSource userEvents. */ - public userEvents: google.cloud.retail.v2alpha.IUserEvent[]; + public setInventory(request: google.cloud.retail.v2alpha.ISetInventoryRequest, callback: google.cloud.retail.v2alpha.ProductService.SetInventoryCallback): void; /** - * Creates a new UserEventInlineSource instance using the specified properties. - * @param [properties] Properties to set - * @returns UserEventInlineSource instance + * Calls SetInventory. + * @param request SetInventoryRequest message or plain object + * @returns Promise */ - public static create(properties?: google.cloud.retail.v2alpha.IUserEventInlineSource): google.cloud.retail.v2alpha.UserEventInlineSource; + public setInventory(request: google.cloud.retail.v2alpha.ISetInventoryRequest): Promise; /** - * Encodes the specified UserEventInlineSource message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInlineSource.verify|verify} messages. - * @param message UserEventInlineSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls AddFulfillmentPlaces. + * @param request AddFulfillmentPlacesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static encode(message: google.cloud.retail.v2alpha.IUserEventInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + public addFulfillmentPlaces(request: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest, callback: google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlacesCallback): void; /** - * Encodes the specified UserEventInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInlineSource.verify|verify} messages. - * @param message UserEventInlineSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls AddFulfillmentPlaces. + * @param request AddFulfillmentPlacesRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserEventInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + public addFulfillmentPlaces(request: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest): Promise; /** - * Decodes a UserEventInlineSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UserEventInlineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls RemoveFulfillmentPlaces. + * @param request RemoveFulfillmentPlacesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UserEventInlineSource; + public removeFulfillmentPlaces(request: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest, callback: google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlacesCallback): void; /** - * Decodes a UserEventInlineSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UserEventInlineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls RemoveFulfillmentPlaces. + * @param request RemoveFulfillmentPlacesRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UserEventInlineSource; + public removeFulfillmentPlaces(request: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest): Promise; /** - * Verifies a UserEventInlineSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls AddLocalInventories. + * @param request AddLocalInventoriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static verify(message: { [k: string]: any }): (string|null); + public addLocalInventories(request: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest, callback: google.cloud.retail.v2alpha.ProductService.AddLocalInventoriesCallback): void; /** - * Creates a UserEventInlineSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UserEventInlineSource + * Calls AddLocalInventories. + * @param request AddLocalInventoriesRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserEventInlineSource; + public addLocalInventories(request: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest): Promise; /** - * Creates a plain object from a UserEventInlineSource message. Also converts values to other types if specified. - * @param message UserEventInlineSource - * @param [options] Conversion options - * @returns Plain object + * Calls RemoveLocalInventories. + * @param request RemoveLocalInventoriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static toObject(message: google.cloud.retail.v2alpha.UserEventInlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public removeLocalInventories(request: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest, callback: google.cloud.retail.v2alpha.ProductService.RemoveLocalInventoriesCallback): void; /** - * Converts this UserEventInlineSource to JSON. - * @returns JSON object + * Calls RemoveLocalInventories. + * @param request RemoveLocalInventoriesRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ImportErrorsConfig. */ - interface IImportErrorsConfig { - - /** ImportErrorsConfig gcsPrefix */ - gcsPrefix?: (string|null); + public removeLocalInventories(request: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest): Promise; } - /** Represents an ImportErrorsConfig. */ - class ImportErrorsConfig implements IImportErrorsConfig { + namespace ProductService { /** - * Constructs a new ImportErrorsConfig. - * @param [properties] Properties to set + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#createProduct}. + * @param error Error, if any + * @param [response] Product */ - constructor(properties?: google.cloud.retail.v2alpha.IImportErrorsConfig); - - /** ImportErrorsConfig gcsPrefix. */ - public gcsPrefix?: (string|null); + type CreateProductCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Product) => void; - /** ImportErrorsConfig destination. */ - public destination?: "gcsPrefix"; + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#getProduct}. + * @param error Error, if any + * @param [response] Product + */ + type GetProductCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Product) => void; /** - * Creates a new ImportErrorsConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportErrorsConfig instance + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#listProducts}. + * @param error Error, if any + * @param [response] ListProductsResponse */ - public static create(properties?: google.cloud.retail.v2alpha.IImportErrorsConfig): google.cloud.retail.v2alpha.ImportErrorsConfig; + type ListProductsCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.ListProductsResponse) => void; /** - * Encodes the specified ImportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportErrorsConfig.verify|verify} messages. - * @param message ImportErrorsConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#updateProduct}. + * @param error Error, if any + * @param [response] Product */ - public static encode(message: google.cloud.retail.v2alpha.IImportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + type UpdateProductCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Product) => void; /** - * Encodes the specified ImportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportErrorsConfig.verify|verify} messages. - * @param message ImportErrorsConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#deleteProduct}. + * @param error Error, if any + * @param [response] Empty */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + type DeleteProductCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Decodes an ImportErrorsConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportErrorsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#importProducts}. + * @param error Error, if any + * @param [response] Operation */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportErrorsConfig; + type ImportProductsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Decodes an ImportErrorsConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportErrorsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#setInventory}. + * @param error Error, if any + * @param [response] Operation */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportErrorsConfig; + type SetInventoryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Verifies an ImportErrorsConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#addFulfillmentPlaces}. + * @param error Error, if any + * @param [response] Operation */ - public static verify(message: { [k: string]: any }): (string|null); + type AddFulfillmentPlacesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates an ImportErrorsConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportErrorsConfig + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#removeFulfillmentPlaces}. + * @param error Error, if any + * @param [response] Operation */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportErrorsConfig; + type RemoveFulfillmentPlacesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates a plain object from an ImportErrorsConfig message. Also converts values to other types if specified. - * @param message ImportErrorsConfig - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#addLocalInventories}. + * @param error Error, if any + * @param [response] Operation */ - public static toObject(message: google.cloud.retail.v2alpha.ImportErrorsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type AddLocalInventoriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Converts this ImportErrorsConfig to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#removeLocalInventories}. + * @param error Error, if any + * @param [response] Operation */ - public toJSON(): { [k: string]: any }; + type RemoveLocalInventoriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } - /** Properties of an ImportProductsRequest. */ - interface IImportProductsRequest { + /** Properties of a CreateProductRequest. */ + interface ICreateProductRequest { - /** ImportProductsRequest parent */ + /** CreateProductRequest parent */ parent?: (string|null); - /** ImportProductsRequest requestId */ - requestId?: (string|null); - - /** ImportProductsRequest inputConfig */ - inputConfig?: (google.cloud.retail.v2alpha.IProductInputConfig|null); - - /** ImportProductsRequest errorsConfig */ - errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); - - /** ImportProductsRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** ImportProductsRequest reconciliationMode */ - reconciliationMode?: (google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode|keyof typeof google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode|null); + /** CreateProductRequest product */ + product?: (google.cloud.retail.v2alpha.IProduct|null); - /** ImportProductsRequest notificationPubsubTopic */ - notificationPubsubTopic?: (string|null); + /** CreateProductRequest productId */ + productId?: (string|null); } - /** Represents an ImportProductsRequest. */ - class ImportProductsRequest implements IImportProductsRequest { + /** Represents a CreateProductRequest. */ + class CreateProductRequest implements ICreateProductRequest { /** - * Constructs a new ImportProductsRequest. + * Constructs a new CreateProductRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IImportProductsRequest); + constructor(properties?: google.cloud.retail.v2alpha.ICreateProductRequest); - /** ImportProductsRequest parent. */ + /** CreateProductRequest parent. */ public parent: string; - /** ImportProductsRequest requestId. */ - public requestId: string; - - /** ImportProductsRequest inputConfig. */ - public inputConfig?: (google.cloud.retail.v2alpha.IProductInputConfig|null); - - /** ImportProductsRequest errorsConfig. */ - public errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); - - /** ImportProductsRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** ImportProductsRequest reconciliationMode. */ - public reconciliationMode: (google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode|keyof typeof google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode); + /** CreateProductRequest product. */ + public product?: (google.cloud.retail.v2alpha.IProduct|null); - /** ImportProductsRequest notificationPubsubTopic. */ - public notificationPubsubTopic: string; + /** CreateProductRequest productId. */ + public productId: string; /** - * Creates a new ImportProductsRequest instance using the specified properties. + * Creates a new CreateProductRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ImportProductsRequest instance + * @returns CreateProductRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IImportProductsRequest): google.cloud.retail.v2alpha.ImportProductsRequest; + public static create(properties?: google.cloud.retail.v2alpha.ICreateProductRequest): google.cloud.retail.v2alpha.CreateProductRequest; /** - * Encodes the specified ImportProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsRequest.verify|verify} messages. - * @param message ImportProductsRequest message or plain object to encode + * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateProductRequest.verify|verify} messages. + * @param message CreateProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IImportProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsRequest.verify|verify} messages. - * @param message ImportProductsRequest message or plain object to encode + * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateProductRequest.verify|verify} messages. + * @param message CreateProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportProductsRequest message from the specified reader or buffer. + * Decodes a CreateProductRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportProductsRequest + * @returns CreateProductRequest * @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.ImportProductsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CreateProductRequest; /** - * Decodes an ImportProductsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportProductsRequest + * @returns CreateProductRequest * @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.ImportProductsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CreateProductRequest; /** - * Verifies an ImportProductsRequest message. + * Verifies a CreateProductRequest 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 ImportProductsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateProductRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportProductsRequest + * @returns CreateProductRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportProductsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CreateProductRequest; /** - * Creates a plain object from an ImportProductsRequest message. Also converts values to other types if specified. - * @param message ImportProductsRequest + * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. + * @param message CreateProductRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ImportProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.CreateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportProductsRequest to JSON. + * Converts this CreateProductRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ImportProductsRequest { - - /** ReconciliationMode enum. */ - enum ReconciliationMode { - RECONCILIATION_MODE_UNSPECIFIED = 0, - INCREMENTAL = 1, - FULL = 2 - } - } - - /** Properties of an ImportUserEventsRequest. */ - interface IImportUserEventsRequest { - - /** ImportUserEventsRequest parent */ - parent?: (string|null); - - /** ImportUserEventsRequest inputConfig */ - inputConfig?: (google.cloud.retail.v2alpha.IUserEventInputConfig|null); + /** Properties of a GetProductRequest. */ + interface IGetProductRequest { - /** ImportUserEventsRequest errorsConfig */ - errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); + /** GetProductRequest name */ + name?: (string|null); } - /** Represents an ImportUserEventsRequest. */ - class ImportUserEventsRequest implements IImportUserEventsRequest { + /** Represents a GetProductRequest. */ + class GetProductRequest implements IGetProductRequest { /** - * Constructs a new ImportUserEventsRequest. + * Constructs a new GetProductRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IImportUserEventsRequest); - - /** ImportUserEventsRequest parent. */ - public parent: string; - - /** ImportUserEventsRequest inputConfig. */ - public inputConfig?: (google.cloud.retail.v2alpha.IUserEventInputConfig|null); + constructor(properties?: google.cloud.retail.v2alpha.IGetProductRequest); - /** ImportUserEventsRequest errorsConfig. */ - public errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); + /** GetProductRequest name. */ + public name: string; /** - * Creates a new ImportUserEventsRequest instance using the specified properties. + * Creates a new GetProductRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ImportUserEventsRequest instance + * @returns GetProductRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IImportUserEventsRequest): google.cloud.retail.v2alpha.ImportUserEventsRequest; + public static create(properties?: google.cloud.retail.v2alpha.IGetProductRequest): google.cloud.retail.v2alpha.GetProductRequest; /** - * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsRequest.verify|verify} messages. - * @param message ImportUserEventsRequest message or plain object to encode + * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetProductRequest.verify|verify} messages. + * @param message GetProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsRequest.verify|verify} messages. - * @param message ImportUserEventsRequest message or plain object to encode + * Encodes the specified GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetProductRequest.verify|verify} messages. + * @param message GetProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportUserEventsRequest message from the specified reader or buffer. + * Decodes a GetProductRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportUserEventsRequest + * @returns GetProductRequest * @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.ImportUserEventsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetProductRequest; /** - * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a GetProductRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportUserEventsRequest + * @returns GetProductRequest * @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.ImportUserEventsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetProductRequest; /** - * Verifies an ImportUserEventsRequest message. + * Verifies a GetProductRequest 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 ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetProductRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportUserEventsRequest + * @returns GetProductRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportUserEventsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetProductRequest; /** - * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. - * @param message ImportUserEventsRequest + * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. + * @param message GetProductRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ImportUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.GetProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportUserEventsRequest to JSON. + * Converts this GetProductRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ImportCompletionDataRequest. */ - interface IImportCompletionDataRequest { + /** Properties of an UpdateProductRequest. */ + interface IUpdateProductRequest { - /** ImportCompletionDataRequest parent */ - parent?: (string|null); + /** UpdateProductRequest product */ + product?: (google.cloud.retail.v2alpha.IProduct|null); - /** ImportCompletionDataRequest inputConfig */ - inputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + /** UpdateProductRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** ImportCompletionDataRequest notificationPubsubTopic */ - notificationPubsubTopic?: (string|null); + /** UpdateProductRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents an ImportCompletionDataRequest. */ - class ImportCompletionDataRequest implements IImportCompletionDataRequest { + /** Represents an UpdateProductRequest. */ + class UpdateProductRequest implements IUpdateProductRequest { /** - * Constructs a new ImportCompletionDataRequest. + * Constructs a new UpdateProductRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IImportCompletionDataRequest); + constructor(properties?: google.cloud.retail.v2alpha.IUpdateProductRequest); - /** ImportCompletionDataRequest parent. */ - public parent: string; + /** UpdateProductRequest product. */ + public product?: (google.cloud.retail.v2alpha.IProduct|null); - /** ImportCompletionDataRequest inputConfig. */ - public inputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + /** UpdateProductRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** ImportCompletionDataRequest notificationPubsubTopic. */ - public notificationPubsubTopic: string; + /** UpdateProductRequest allowMissing. */ + public allowMissing: boolean; /** - * Creates a new ImportCompletionDataRequest instance using the specified properties. + * Creates a new UpdateProductRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ImportCompletionDataRequest instance + * @returns UpdateProductRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IImportCompletionDataRequest): google.cloud.retail.v2alpha.ImportCompletionDataRequest; + public static create(properties?: google.cloud.retail.v2alpha.IUpdateProductRequest): google.cloud.retail.v2alpha.UpdateProductRequest; /** - * Encodes the specified ImportCompletionDataRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataRequest.verify|verify} messages. - * @param message ImportCompletionDataRequest message or plain object to encode + * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateProductRequest.verify|verify} messages. + * @param message UpdateProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IImportCompletionDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportCompletionDataRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataRequest.verify|verify} messages. - * @param message ImportCompletionDataRequest message or plain object to encode + * Encodes the specified UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateProductRequest.verify|verify} messages. + * @param message UpdateProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportCompletionDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportCompletionDataRequest message from the specified reader or buffer. + * Decodes an UpdateProductRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportCompletionDataRequest + * @returns UpdateProductRequest * @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.ImportCompletionDataRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UpdateProductRequest; /** - * Decodes an ImportCompletionDataRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportCompletionDataRequest + * @returns UpdateProductRequest * @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.ImportCompletionDataRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UpdateProductRequest; /** - * Verifies an ImportCompletionDataRequest message. + * Verifies an UpdateProductRequest 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 ImportCompletionDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateProductRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportCompletionDataRequest + * @returns UpdateProductRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportCompletionDataRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateProductRequest; /** - * Creates a plain object from an ImportCompletionDataRequest message. Also converts values to other types if specified. - * @param message ImportCompletionDataRequest + * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. + * @param message UpdateProductRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ImportCompletionDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.UpdateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportCompletionDataRequest to JSON. + * Converts this UpdateProductRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ProductInputConfig. */ - interface IProductInputConfig { - - /** ProductInputConfig productInlineSource */ - productInlineSource?: (google.cloud.retail.v2alpha.IProductInlineSource|null); - - /** ProductInputConfig gcsSource */ - gcsSource?: (google.cloud.retail.v2alpha.IGcsSource|null); + /** Properties of a DeleteProductRequest. */ + interface IDeleteProductRequest { - /** ProductInputConfig bigQuerySource */ - bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); + /** DeleteProductRequest name */ + name?: (string|null); } - /** Represents a ProductInputConfig. */ - class ProductInputConfig implements IProductInputConfig { + /** Represents a DeleteProductRequest. */ + class DeleteProductRequest implements IDeleteProductRequest { /** - * Constructs a new ProductInputConfig. + * Constructs a new DeleteProductRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IProductInputConfig); - - /** ProductInputConfig productInlineSource. */ - public productInlineSource?: (google.cloud.retail.v2alpha.IProductInlineSource|null); - - /** ProductInputConfig gcsSource. */ - public gcsSource?: (google.cloud.retail.v2alpha.IGcsSource|null); - - /** ProductInputConfig bigQuerySource. */ - public bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); + constructor(properties?: google.cloud.retail.v2alpha.IDeleteProductRequest); - /** ProductInputConfig source. */ - public source?: ("productInlineSource"|"gcsSource"|"bigQuerySource"); + /** DeleteProductRequest name. */ + public name: string; /** - * Creates a new ProductInputConfig instance using the specified properties. + * Creates a new DeleteProductRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ProductInputConfig instance + * @returns DeleteProductRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IProductInputConfig): google.cloud.retail.v2alpha.ProductInputConfig; + public static create(properties?: google.cloud.retail.v2alpha.IDeleteProductRequest): google.cloud.retail.v2alpha.DeleteProductRequest; /** - * Encodes the specified ProductInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInputConfig.verify|verify} messages. - * @param message ProductInputConfig message or plain object to encode + * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteProductRequest.verify|verify} messages. + * @param message DeleteProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IProductInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ProductInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInputConfig.verify|verify} messages. - * @param message ProductInputConfig message or plain object to encode + * Encodes the specified DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteProductRequest.verify|verify} messages. + * @param message DeleteProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IProductInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ProductInputConfig message from the specified reader or buffer. + * Decodes a DeleteProductRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ProductInputConfig + * @returns DeleteProductRequest * @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.ProductInputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.DeleteProductRequest; /** - * Decodes a ProductInputConfig message from the specified reader or buffer, length delimited. + * Decodes a DeleteProductRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ProductInputConfig + * @returns DeleteProductRequest * @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.ProductInputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.DeleteProductRequest; /** - * Verifies a ProductInputConfig message. + * Verifies a DeleteProductRequest 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 ProductInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteProductRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ProductInputConfig + * @returns DeleteProductRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ProductInputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.DeleteProductRequest; /** - * Creates a plain object from a ProductInputConfig message. Also converts values to other types if specified. - * @param message ProductInputConfig + * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. + * @param message DeleteProductRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ProductInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.DeleteProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ProductInputConfig to JSON. + * Converts this DeleteProductRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a UserEventInputConfig. */ - interface IUserEventInputConfig { + /** Properties of a ListProductsRequest. */ + interface IListProductsRequest { - /** UserEventInputConfig userEventInlineSource */ - userEventInlineSource?: (google.cloud.retail.v2alpha.IUserEventInlineSource|null); + /** ListProductsRequest parent */ + parent?: (string|null); - /** UserEventInputConfig gcsSource */ - gcsSource?: (google.cloud.retail.v2alpha.IGcsSource|null); + /** ListProductsRequest pageSize */ + pageSize?: (number|null); - /** UserEventInputConfig bigQuerySource */ - bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); + /** ListProductsRequest pageToken */ + pageToken?: (string|null); + + /** ListProductsRequest filter */ + filter?: (string|null); + + /** ListProductsRequest readMask */ + readMask?: (google.protobuf.IFieldMask|null); + + /** ListProductsRequest requireTotalSize */ + requireTotalSize?: (boolean|null); } - /** Represents a UserEventInputConfig. */ - class UserEventInputConfig implements IUserEventInputConfig { + /** Represents a ListProductsRequest. */ + class ListProductsRequest implements IListProductsRequest { /** - * Constructs a new UserEventInputConfig. + * Constructs a new ListProductsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IUserEventInputConfig); + constructor(properties?: google.cloud.retail.v2alpha.IListProductsRequest); + + /** ListProductsRequest parent. */ + public parent: string; - /** UserEventInputConfig userEventInlineSource. */ - public userEventInlineSource?: (google.cloud.retail.v2alpha.IUserEventInlineSource|null); + /** ListProductsRequest pageSize. */ + public pageSize: number; - /** UserEventInputConfig gcsSource. */ - public gcsSource?: (google.cloud.retail.v2alpha.IGcsSource|null); + /** ListProductsRequest pageToken. */ + public pageToken: string; - /** UserEventInputConfig bigQuerySource. */ - public bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); + /** ListProductsRequest filter. */ + public filter: string; - /** UserEventInputConfig source. */ - public source?: ("userEventInlineSource"|"gcsSource"|"bigQuerySource"); + /** ListProductsRequest readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); + + /** ListProductsRequest requireTotalSize. */ + public requireTotalSize: boolean; /** - * Creates a new UserEventInputConfig instance using the specified properties. + * Creates a new ListProductsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UserEventInputConfig instance + * @returns ListProductsRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IUserEventInputConfig): google.cloud.retail.v2alpha.UserEventInputConfig; + public static create(properties?: google.cloud.retail.v2alpha.IListProductsRequest): google.cloud.retail.v2alpha.ListProductsRequest; /** - * Encodes the specified UserEventInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInputConfig.verify|verify} messages. - * @param message UserEventInputConfig message or plain object to encode + * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsRequest.verify|verify} messages. + * @param message ListProductsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IUserEventInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UserEventInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInputConfig.verify|verify} messages. - * @param message UserEventInputConfig message or plain object to encode + * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsRequest.verify|verify} messages. + * @param message ListProductsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserEventInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a UserEventInputConfig message from the specified reader or buffer. + * Decodes a ListProductsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UserEventInputConfig + * @returns ListProductsRequest * @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.UserEventInputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListProductsRequest; /** - * Decodes a UserEventInputConfig message from the specified reader or buffer, length delimited. + * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UserEventInputConfig + * @returns ListProductsRequest * @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.UserEventInputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListProductsRequest; /** - * Verifies a UserEventInputConfig message. + * Verifies a ListProductsRequest 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 UserEventInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListProductsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UserEventInputConfig + * @returns ListProductsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserEventInputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListProductsRequest; /** - * Creates a plain object from a UserEventInputConfig message. Also converts values to other types if specified. - * @param message UserEventInputConfig + * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. + * @param message ListProductsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.UserEventInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ListProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UserEventInputConfig to JSON. + * Converts this ListProductsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CompletionDataInputConfig. */ - interface ICompletionDataInputConfig { + /** Properties of a ListProductsResponse. */ + interface IListProductsResponse { - /** CompletionDataInputConfig bigQuerySource */ - bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); + /** ListProductsResponse products */ + products?: (google.cloud.retail.v2alpha.IProduct[]|null); + + /** ListProductsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListProductsResponse totalSize */ + totalSize?: (number|null); } - /** Represents a CompletionDataInputConfig. */ - class CompletionDataInputConfig implements ICompletionDataInputConfig { + /** Represents a ListProductsResponse. */ + class ListProductsResponse implements IListProductsResponse { /** - * Constructs a new CompletionDataInputConfig. + * Constructs a new ListProductsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICompletionDataInputConfig); + constructor(properties?: google.cloud.retail.v2alpha.IListProductsResponse); - /** CompletionDataInputConfig bigQuerySource. */ - public bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); + /** ListProductsResponse products. */ + public products: google.cloud.retail.v2alpha.IProduct[]; - /** CompletionDataInputConfig source. */ - public source?: "bigQuerySource"; + /** ListProductsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListProductsResponse totalSize. */ + public totalSize: number; /** - * Creates a new CompletionDataInputConfig instance using the specified properties. + * Creates a new ListProductsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns CompletionDataInputConfig instance + * @returns ListProductsResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICompletionDataInputConfig): google.cloud.retail.v2alpha.CompletionDataInputConfig; + public static create(properties?: google.cloud.retail.v2alpha.IListProductsResponse): google.cloud.retail.v2alpha.ListProductsResponse; /** - * Encodes the specified CompletionDataInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDataInputConfig.verify|verify} messages. - * @param message CompletionDataInputConfig message or plain object to encode + * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsResponse.verify|verify} messages. + * @param message ListProductsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ICompletionDataInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CompletionDataInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDataInputConfig.verify|verify} messages. - * @param message CompletionDataInputConfig message or plain object to encode + * Encodes the specified ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsResponse.verify|verify} messages. + * @param message ListProductsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompletionDataInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CompletionDataInputConfig message from the specified reader or buffer. + * Decodes a ListProductsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CompletionDataInputConfig + * @returns ListProductsResponse * @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.CompletionDataInputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListProductsResponse; /** - * Decodes a CompletionDataInputConfig message from the specified reader or buffer, length delimited. + * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CompletionDataInputConfig + * @returns ListProductsResponse * @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.CompletionDataInputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListProductsResponse; /** - * Verifies a CompletionDataInputConfig message. + * Verifies a ListProductsResponse 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 CompletionDataInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CompletionDataInputConfig + * @returns ListProductsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompletionDataInputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListProductsResponse; /** - * Creates a plain object from a CompletionDataInputConfig message. Also converts values to other types if specified. - * @param message CompletionDataInputConfig + * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. + * @param message ListProductsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.CompletionDataInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ListProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CompletionDataInputConfig to JSON. + * Converts this ListProductsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ImportMetadata. */ - interface IImportMetadata { - - /** ImportMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ImportMetadata updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** Properties of a SetInventoryRequest. */ + interface ISetInventoryRequest { - /** ImportMetadata successCount */ - successCount?: (number|Long|string|null); + /** SetInventoryRequest inventory */ + inventory?: (google.cloud.retail.v2alpha.IProduct|null); - /** ImportMetadata failureCount */ - failureCount?: (number|Long|string|null); + /** SetInventoryRequest setMask */ + setMask?: (google.protobuf.IFieldMask|null); - /** ImportMetadata requestId */ - requestId?: (string|null); + /** SetInventoryRequest setTime */ + setTime?: (google.protobuf.ITimestamp|null); - /** ImportMetadata notificationPubsubTopic */ - notificationPubsubTopic?: (string|null); + /** SetInventoryRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents an ImportMetadata. */ - class ImportMetadata implements IImportMetadata { + /** Represents a SetInventoryRequest. */ + class SetInventoryRequest implements ISetInventoryRequest { /** - * Constructs a new ImportMetadata. + * Constructs a new SetInventoryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IImportMetadata); - - /** ImportMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ImportMetadata updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.cloud.retail.v2alpha.ISetInventoryRequest); - /** ImportMetadata successCount. */ - public successCount: (number|Long|string); + /** SetInventoryRequest inventory. */ + public inventory?: (google.cloud.retail.v2alpha.IProduct|null); - /** ImportMetadata failureCount. */ - public failureCount: (number|Long|string); + /** SetInventoryRequest setMask. */ + public setMask?: (google.protobuf.IFieldMask|null); - /** ImportMetadata requestId. */ - public requestId: string; + /** SetInventoryRequest setTime. */ + public setTime?: (google.protobuf.ITimestamp|null); - /** ImportMetadata notificationPubsubTopic. */ - public notificationPubsubTopic: string; + /** SetInventoryRequest allowMissing. */ + public allowMissing: boolean; /** - * Creates a new ImportMetadata instance using the specified properties. + * Creates a new SetInventoryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ImportMetadata instance + * @returns SetInventoryRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IImportMetadata): google.cloud.retail.v2alpha.ImportMetadata; + public static create(properties?: google.cloud.retail.v2alpha.ISetInventoryRequest): google.cloud.retail.v2alpha.SetInventoryRequest; /** - * Encodes the specified ImportMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportMetadata.verify|verify} messages. - * @param message ImportMetadata message or plain object to encode + * Encodes the specified SetInventoryRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryRequest.verify|verify} messages. + * @param message SetInventoryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IImportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ISetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportMetadata.verify|verify} messages. - * @param message ImportMetadata message or plain object to encode + * Encodes the specified SetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryRequest.verify|verify} messages. + * @param message SetInventoryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ISetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportMetadata message from the specified reader or buffer. + * Decodes a SetInventoryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportMetadata + * @returns SetInventoryRequest * @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.ImportMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SetInventoryRequest; /** - * Decodes an ImportMetadata message from the specified reader or buffer, length delimited. + * Decodes a SetInventoryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportMetadata + * @returns SetInventoryRequest * @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.ImportMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SetInventoryRequest; /** - * Verifies an ImportMetadata message. + * Verifies a SetInventoryRequest 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 ImportMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a SetInventoryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportMetadata + * @returns SetInventoryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SetInventoryRequest; /** - * Creates a plain object from an ImportMetadata message. Also converts values to other types if specified. - * @param message ImportMetadata + * Creates a plain object from a SetInventoryRequest message. Also converts values to other types if specified. + * @param message SetInventoryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ImportMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.SetInventoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportMetadata to JSON. + * Converts this SetInventoryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ImportProductsResponse. */ - interface IImportProductsResponse { - - /** ImportProductsResponse errorSamples */ - errorSamples?: (google.rpc.IStatus[]|null); - - /** ImportProductsResponse errorsConfig */ - errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); + /** Properties of a SetInventoryMetadata. */ + interface ISetInventoryMetadata { } - /** Represents an ImportProductsResponse. */ - class ImportProductsResponse implements IImportProductsResponse { + /** Represents a SetInventoryMetadata. */ + class SetInventoryMetadata implements ISetInventoryMetadata { /** - * Constructs a new ImportProductsResponse. + * Constructs a new SetInventoryMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IImportProductsResponse); - - /** ImportProductsResponse errorSamples. */ - public errorSamples: google.rpc.IStatus[]; - - /** ImportProductsResponse errorsConfig. */ - public errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); + constructor(properties?: google.cloud.retail.v2alpha.ISetInventoryMetadata); /** - * Creates a new ImportProductsResponse instance using the specified properties. + * Creates a new SetInventoryMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns ImportProductsResponse instance + * @returns SetInventoryMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.IImportProductsResponse): google.cloud.retail.v2alpha.ImportProductsResponse; + public static create(properties?: google.cloud.retail.v2alpha.ISetInventoryMetadata): google.cloud.retail.v2alpha.SetInventoryMetadata; /** - * Encodes the specified ImportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsResponse.verify|verify} messages. - * @param message ImportProductsResponse message or plain object to encode + * Encodes the specified SetInventoryMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryMetadata.verify|verify} messages. + * @param message SetInventoryMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IImportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ISetInventoryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsResponse.verify|verify} messages. - * @param message ImportProductsResponse message or plain object to encode + * Encodes the specified SetInventoryMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryMetadata.verify|verify} messages. + * @param message SetInventoryMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ISetInventoryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportProductsResponse message from the specified reader or buffer. + * Decodes a SetInventoryMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportProductsResponse + * @returns SetInventoryMetadata * @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.ImportProductsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SetInventoryMetadata; /** - * Decodes an ImportProductsResponse message from the specified reader or buffer, length delimited. + * Decodes a SetInventoryMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportProductsResponse + * @returns SetInventoryMetadata * @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.ImportProductsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SetInventoryMetadata; /** - * Verifies an ImportProductsResponse message. + * Verifies a SetInventoryMetadata 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 ImportProductsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SetInventoryMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportProductsResponse + * @returns SetInventoryMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportProductsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SetInventoryMetadata; /** - * Creates a plain object from an ImportProductsResponse message. Also converts values to other types if specified. - * @param message ImportProductsResponse + * Creates a plain object from a SetInventoryMetadata message. Also converts values to other types if specified. + * @param message SetInventoryMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ImportProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.SetInventoryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportProductsResponse to JSON. + * Converts this SetInventoryMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ImportUserEventsResponse. */ - interface IImportUserEventsResponse { - - /** ImportUserEventsResponse errorSamples */ - errorSamples?: (google.rpc.IStatus[]|null); - - /** ImportUserEventsResponse errorsConfig */ - errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); - - /** ImportUserEventsResponse importSummary */ - importSummary?: (google.cloud.retail.v2alpha.IUserEventImportSummary|null); + /** Properties of a SetInventoryResponse. */ + interface ISetInventoryResponse { } - /** Represents an ImportUserEventsResponse. */ - class ImportUserEventsResponse implements IImportUserEventsResponse { + /** Represents a SetInventoryResponse. */ + class SetInventoryResponse implements ISetInventoryResponse { /** - * Constructs a new ImportUserEventsResponse. + * Constructs a new SetInventoryResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IImportUserEventsResponse); - - /** ImportUserEventsResponse errorSamples. */ - public errorSamples: google.rpc.IStatus[]; - - /** ImportUserEventsResponse errorsConfig. */ - public errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); - - /** ImportUserEventsResponse importSummary. */ - public importSummary?: (google.cloud.retail.v2alpha.IUserEventImportSummary|null); + constructor(properties?: google.cloud.retail.v2alpha.ISetInventoryResponse); /** - * Creates a new ImportUserEventsResponse instance using the specified properties. + * Creates a new SetInventoryResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ImportUserEventsResponse instance + * @returns SetInventoryResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IImportUserEventsResponse): google.cloud.retail.v2alpha.ImportUserEventsResponse; + public static create(properties?: google.cloud.retail.v2alpha.ISetInventoryResponse): google.cloud.retail.v2alpha.SetInventoryResponse; /** - * Encodes the specified ImportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsResponse.verify|verify} messages. - * @param message ImportUserEventsResponse message or plain object to encode + * Encodes the specified SetInventoryResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryResponse.verify|verify} messages. + * @param message SetInventoryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IImportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ISetInventoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsResponse.verify|verify} messages. - * @param message ImportUserEventsResponse message or plain object to encode + * Encodes the specified SetInventoryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryResponse.verify|verify} messages. + * @param message SetInventoryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ISetInventoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportUserEventsResponse message from the specified reader or buffer. + * Decodes a SetInventoryResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportUserEventsResponse + * @returns SetInventoryResponse * @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.ImportUserEventsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SetInventoryResponse; /** - * Decodes an ImportUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes a SetInventoryResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportUserEventsResponse + * @returns SetInventoryResponse * @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.ImportUserEventsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SetInventoryResponse; /** - * Verifies an ImportUserEventsResponse message. + * Verifies a SetInventoryResponse 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 ImportUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SetInventoryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportUserEventsResponse + * @returns SetInventoryResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportUserEventsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SetInventoryResponse; /** - * Creates a plain object from an ImportUserEventsResponse message. Also converts values to other types if specified. - * @param message ImportUserEventsResponse + * Creates a plain object from a SetInventoryResponse message. Also converts values to other types if specified. + * @param message SetInventoryResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ImportUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.SetInventoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportUserEventsResponse to JSON. + * Converts this SetInventoryResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a UserEventImportSummary. */ - interface IUserEventImportSummary { + /** Properties of an AddFulfillmentPlacesRequest. */ + interface IAddFulfillmentPlacesRequest { - /** UserEventImportSummary joinedEventsCount */ - joinedEventsCount?: (number|Long|string|null); + /** AddFulfillmentPlacesRequest product */ + product?: (string|null); - /** UserEventImportSummary unjoinedEventsCount */ - unjoinedEventsCount?: (number|Long|string|null); + /** AddFulfillmentPlacesRequest type */ + type?: (string|null); + + /** AddFulfillmentPlacesRequest placeIds */ + placeIds?: (string[]|null); + + /** AddFulfillmentPlacesRequest addTime */ + addTime?: (google.protobuf.ITimestamp|null); + + /** AddFulfillmentPlacesRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a UserEventImportSummary. */ - class UserEventImportSummary implements IUserEventImportSummary { + /** Represents an AddFulfillmentPlacesRequest. */ + class AddFulfillmentPlacesRequest implements IAddFulfillmentPlacesRequest { /** - * Constructs a new UserEventImportSummary. + * Constructs a new AddFulfillmentPlacesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IUserEventImportSummary); + constructor(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest); - /** UserEventImportSummary joinedEventsCount. */ - public joinedEventsCount: (number|Long|string); + /** AddFulfillmentPlacesRequest product. */ + public product: string; - /** UserEventImportSummary unjoinedEventsCount. */ - public unjoinedEventsCount: (number|Long|string); + /** AddFulfillmentPlacesRequest type. */ + public type: string; + + /** AddFulfillmentPlacesRequest placeIds. */ + public placeIds: string[]; + + /** AddFulfillmentPlacesRequest addTime. */ + public addTime?: (google.protobuf.ITimestamp|null); + + /** AddFulfillmentPlacesRequest allowMissing. */ + public allowMissing: boolean; /** - * Creates a new UserEventImportSummary instance using the specified properties. + * Creates a new AddFulfillmentPlacesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UserEventImportSummary instance + * @returns AddFulfillmentPlacesRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IUserEventImportSummary): google.cloud.retail.v2alpha.UserEventImportSummary; + public static create(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest): google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest; /** - * Encodes the specified UserEventImportSummary message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventImportSummary.verify|verify} messages. - * @param message UserEventImportSummary message or plain object to encode + * Encodes the specified AddFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.verify|verify} messages. + * @param message AddFulfillmentPlacesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IUserEventImportSummary, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UserEventImportSummary message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventImportSummary.verify|verify} messages. - * @param message UserEventImportSummary message or plain object to encode + * Encodes the specified AddFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.verify|verify} messages. + * @param message AddFulfillmentPlacesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserEventImportSummary, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a UserEventImportSummary message from the specified reader or buffer. + * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UserEventImportSummary + * @returns AddFulfillmentPlacesRequest * @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.UserEventImportSummary; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest; /** - * Decodes a UserEventImportSummary message from the specified reader or buffer, length delimited. + * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UserEventImportSummary + * @returns AddFulfillmentPlacesRequest * @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.UserEventImportSummary; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest; /** - * Verifies a UserEventImportSummary message. + * Verifies an AddFulfillmentPlacesRequest 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 UserEventImportSummary message from a plain object. Also converts values to their respective internal types. + * Creates an AddFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UserEventImportSummary + * @returns AddFulfillmentPlacesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserEventImportSummary; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest; /** - * Creates a plain object from a UserEventImportSummary message. Also converts values to other types if specified. - * @param message UserEventImportSummary + * Creates a plain object from an AddFulfillmentPlacesRequest message. Also converts values to other types if specified. + * @param message AddFulfillmentPlacesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.UserEventImportSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UserEventImportSummary to JSON. + * Converts this AddFulfillmentPlacesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ImportCompletionDataResponse. */ - interface IImportCompletionDataResponse { - - /** ImportCompletionDataResponse errorSamples */ - errorSamples?: (google.rpc.IStatus[]|null); + /** Properties of an AddFulfillmentPlacesMetadata. */ + interface IAddFulfillmentPlacesMetadata { } - /** Represents an ImportCompletionDataResponse. */ - class ImportCompletionDataResponse implements IImportCompletionDataResponse { + /** Represents an AddFulfillmentPlacesMetadata. */ + class AddFulfillmentPlacesMetadata implements IAddFulfillmentPlacesMetadata { /** - * Constructs a new ImportCompletionDataResponse. + * Constructs a new AddFulfillmentPlacesMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IImportCompletionDataResponse); - - /** ImportCompletionDataResponse errorSamples. */ - public errorSamples: google.rpc.IStatus[]; + constructor(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata); /** - * Creates a new ImportCompletionDataResponse instance using the specified properties. + * Creates a new AddFulfillmentPlacesMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns ImportCompletionDataResponse instance + * @returns AddFulfillmentPlacesMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.IImportCompletionDataResponse): google.cloud.retail.v2alpha.ImportCompletionDataResponse; + public static create(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata): google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata; - /** - * Encodes the specified ImportCompletionDataResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataResponse.verify|verify} messages. - * @param message ImportCompletionDataResponse message or plain object to encode + /** + * Encodes the specified AddFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.verify|verify} messages. + * @param message AddFulfillmentPlacesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IImportCompletionDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportCompletionDataResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataResponse.verify|verify} messages. - * @param message ImportCompletionDataResponse message or plain object to encode + * Encodes the specified AddFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.verify|verify} messages. + * @param message AddFulfillmentPlacesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportCompletionDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportCompletionDataResponse message from the specified reader or buffer. + * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportCompletionDataResponse + * @returns AddFulfillmentPlacesMetadata * @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.ImportCompletionDataResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata; /** - * Decodes an ImportCompletionDataResponse message from the specified reader or buffer, length delimited. + * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportCompletionDataResponse + * @returns AddFulfillmentPlacesMetadata * @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.ImportCompletionDataResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata; /** - * Verifies an ImportCompletionDataResponse message. + * Verifies an AddFulfillmentPlacesMetadata 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 ImportCompletionDataResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AddFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportCompletionDataResponse + * @returns AddFulfillmentPlacesMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportCompletionDataResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata; /** - * Creates a plain object from an ImportCompletionDataResponse message. Also converts values to other types if specified. - * @param message ImportCompletionDataResponse + * Creates a plain object from an AddFulfillmentPlacesMetadata message. Also converts values to other types if specified. + * @param message AddFulfillmentPlacesMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ImportCompletionDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportCompletionDataResponse to JSON. + * Converts this AddFulfillmentPlacesMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Product. */ - interface IProduct { - - /** Product expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Product ttl */ - ttl?: (google.protobuf.IDuration|null); - - /** Product name */ - name?: (string|null); - - /** Product id */ - id?: (string|null); - - /** Product type */ - type?: (google.cloud.retail.v2alpha.Product.Type|keyof typeof google.cloud.retail.v2alpha.Product.Type|null); - - /** Product primaryProductId */ - primaryProductId?: (string|null); - - /** Product collectionMemberIds */ - collectionMemberIds?: (string[]|null); - - /** Product gtin */ - gtin?: (string|null); - - /** Product categories */ - categories?: (string[]|null); - - /** Product title */ - title?: (string|null); - - /** Product brands */ - brands?: (string[]|null); - - /** Product description */ - description?: (string|null); - - /** Product languageCode */ - languageCode?: (string|null); - - /** Product attributes */ - attributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }|null); - - /** Product tags */ - tags?: (string[]|null); - - /** Product priceInfo */ - priceInfo?: (google.cloud.retail.v2alpha.IPriceInfo|null); - - /** Product rating */ - rating?: (google.cloud.retail.v2alpha.IRating|null); - - /** Product availableTime */ - availableTime?: (google.protobuf.ITimestamp|null); - - /** Product availability */ - availability?: (google.cloud.retail.v2alpha.Product.Availability|keyof typeof google.cloud.retail.v2alpha.Product.Availability|null); - - /** Product availableQuantity */ - availableQuantity?: (google.protobuf.IInt32Value|null); - - /** Product fulfillmentInfo */ - fulfillmentInfo?: (google.cloud.retail.v2alpha.IFulfillmentInfo[]|null); - - /** Product uri */ - uri?: (string|null); - - /** Product images */ - images?: (google.cloud.retail.v2alpha.IImage[]|null); - - /** Product audience */ - audience?: (google.cloud.retail.v2alpha.IAudience|null); - - /** Product colorInfo */ - colorInfo?: (google.cloud.retail.v2alpha.IColorInfo|null); - - /** Product sizes */ - sizes?: (string[]|null); - - /** Product materials */ - materials?: (string[]|null); - - /** Product patterns */ - patterns?: (string[]|null); - - /** Product conditions */ - conditions?: (string[]|null); - - /** Product promotions */ - promotions?: (google.cloud.retail.v2alpha.IPromotion[]|null); - - /** Product publishTime */ - publishTime?: (google.protobuf.ITimestamp|null); - - /** Product retrievableFields */ - retrievableFields?: (google.protobuf.IFieldMask|null); - - /** Product variants */ - variants?: (google.cloud.retail.v2alpha.IProduct[]|null); + /** Properties of an AddFulfillmentPlacesResponse. */ + interface IAddFulfillmentPlacesResponse { } - /** Represents a Product. */ - class Product implements IProduct { + /** Represents an AddFulfillmentPlacesResponse. */ + class AddFulfillmentPlacesResponse implements IAddFulfillmentPlacesResponse { /** - * Constructs a new Product. + * Constructs a new AddFulfillmentPlacesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IProduct); - - /** Product expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Product ttl. */ - public ttl?: (google.protobuf.IDuration|null); - - /** Product name. */ - public name: string; - - /** Product id. */ - public id: string; - - /** Product type. */ - public type: (google.cloud.retail.v2alpha.Product.Type|keyof typeof google.cloud.retail.v2alpha.Product.Type); - - /** Product primaryProductId. */ - public primaryProductId: string; - - /** Product collectionMemberIds. */ - public collectionMemberIds: string[]; - - /** Product gtin. */ - public gtin: string; - - /** Product categories. */ - public categories: string[]; - - /** Product title. */ - public title: string; - - /** Product brands. */ - public brands: string[]; - - /** Product description. */ - public description: string; - - /** Product languageCode. */ - public languageCode: string; - - /** Product attributes. */ - public attributes: { [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }; - - /** Product tags. */ - public tags: string[]; - - /** Product priceInfo. */ - public priceInfo?: (google.cloud.retail.v2alpha.IPriceInfo|null); - - /** Product rating. */ - public rating?: (google.cloud.retail.v2alpha.IRating|null); - - /** Product availableTime. */ - public availableTime?: (google.protobuf.ITimestamp|null); - - /** Product availability. */ - public availability: (google.cloud.retail.v2alpha.Product.Availability|keyof typeof google.cloud.retail.v2alpha.Product.Availability); - - /** Product availableQuantity. */ - public availableQuantity?: (google.protobuf.IInt32Value|null); - - /** Product fulfillmentInfo. */ - public fulfillmentInfo: google.cloud.retail.v2alpha.IFulfillmentInfo[]; - - /** Product uri. */ - public uri: string; - - /** Product images. */ - public images: google.cloud.retail.v2alpha.IImage[]; - - /** Product audience. */ - public audience?: (google.cloud.retail.v2alpha.IAudience|null); - - /** Product colorInfo. */ - public colorInfo?: (google.cloud.retail.v2alpha.IColorInfo|null); - - /** Product sizes. */ - public sizes: string[]; - - /** Product materials. */ - public materials: string[]; - - /** Product patterns. */ - public patterns: string[]; - - /** Product conditions. */ - public conditions: string[]; - - /** Product promotions. */ - public promotions: google.cloud.retail.v2alpha.IPromotion[]; - - /** Product publishTime. */ - public publishTime?: (google.protobuf.ITimestamp|null); - - /** Product retrievableFields. */ - public retrievableFields?: (google.protobuf.IFieldMask|null); - - /** Product variants. */ - public variants: google.cloud.retail.v2alpha.IProduct[]; - - /** Product expiration. */ - public expiration?: ("expireTime"|"ttl"); + constructor(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse); /** - * Creates a new Product instance using the specified properties. + * Creates a new AddFulfillmentPlacesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Product instance + * @returns AddFulfillmentPlacesResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IProduct): google.cloud.retail.v2alpha.Product; + public static create(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse): google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse; /** - * Encodes the specified Product message. Does not implicitly {@link google.cloud.retail.v2alpha.Product.verify|verify} messages. - * @param message Product message or plain object to encode + * Encodes the specified AddFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.verify|verify} messages. + * @param message AddFulfillmentPlacesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Product.verify|verify} messages. - * @param message Product message or plain object to encode + * Encodes the specified AddFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.verify|verify} messages. + * @param message AddFulfillmentPlacesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Product message from the specified reader or buffer. + * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Product + * @returns AddFulfillmentPlacesResponse * @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.Product; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse; /** - * Decodes a Product message from the specified reader or buffer, length delimited. + * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Product + * @returns AddFulfillmentPlacesResponse * @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.Product; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse; /** - * Verifies a Product message. + * Verifies an AddFulfillmentPlacesResponse 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 Product message from a plain object. Also converts values to their respective internal types. + * Creates an AddFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Product + * @returns AddFulfillmentPlacesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Product; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse; /** - * Creates a plain object from a Product message. Also converts values to other types if specified. - * @param message Product + * Creates a plain object from an AddFulfillmentPlacesResponse message. Also converts values to other types if specified. + * @param message AddFulfillmentPlacesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.Product, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Product to JSON. + * Converts this AddFulfillmentPlacesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Product { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - PRIMARY = 1, - VARIANT = 2, - COLLECTION = 3 - } + /** Properties of an AddLocalInventoriesRequest. */ + interface IAddLocalInventoriesRequest { - /** Availability enum. */ - enum Availability { - AVAILABILITY_UNSPECIFIED = 0, - IN_STOCK = 1, - OUT_OF_STOCK = 2, - PREORDER = 3, - BACKORDER = 4 - } - } + /** AddLocalInventoriesRequest product */ + product?: (string|null); - /** Properties of a UserEvent. */ - interface IUserEvent { + /** AddLocalInventoriesRequest localInventories */ + localInventories?: (google.cloud.retail.v2alpha.ILocalInventory[]|null); - /** UserEvent eventType */ - eventType?: (string|null); + /** AddLocalInventoriesRequest addMask */ + addMask?: (google.protobuf.IFieldMask|null); - /** UserEvent visitorId */ - visitorId?: (string|null); + /** AddLocalInventoriesRequest addTime */ + addTime?: (google.protobuf.ITimestamp|null); - /** UserEvent sessionId */ - sessionId?: (string|null); + /** AddLocalInventoriesRequest allowMissing */ + allowMissing?: (boolean|null); + } - /** UserEvent eventTime */ - eventTime?: (google.protobuf.ITimestamp|null); + /** Represents an AddLocalInventoriesRequest. */ + class AddLocalInventoriesRequest implements IAddLocalInventoriesRequest { - /** UserEvent experimentIds */ - experimentIds?: (string[]|null); + /** + * Constructs a new AddLocalInventoriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest); - /** UserEvent attributionToken */ - attributionToken?: (string|null); + /** AddLocalInventoriesRequest product. */ + public product: string; - /** UserEvent productDetails */ - productDetails?: (google.cloud.retail.v2alpha.IProductDetail[]|null); + /** AddLocalInventoriesRequest localInventories. */ + public localInventories: google.cloud.retail.v2alpha.ILocalInventory[]; - /** UserEvent completionDetail */ - completionDetail?: (google.cloud.retail.v2alpha.ICompletionDetail|null); + /** AddLocalInventoriesRequest addMask. */ + public addMask?: (google.protobuf.IFieldMask|null); - /** UserEvent attributes */ - attributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }|null); + /** AddLocalInventoriesRequest addTime. */ + public addTime?: (google.protobuf.ITimestamp|null); - /** UserEvent cartId */ - cartId?: (string|null); + /** AddLocalInventoriesRequest allowMissing. */ + public allowMissing: boolean; - /** UserEvent purchaseTransaction */ - purchaseTransaction?: (google.cloud.retail.v2alpha.IPurchaseTransaction|null); + /** + * Creates a new AddLocalInventoriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddLocalInventoriesRequest instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest): google.cloud.retail.v2alpha.AddLocalInventoriesRequest; - /** UserEvent searchQuery */ - searchQuery?: (string|null); + /** + * Encodes the specified AddLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesRequest.verify|verify} messages. + * @param message AddLocalInventoriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** UserEvent filter */ - filter?: (string|null); + /** + * Encodes the specified AddLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesRequest.verify|verify} messages. + * @param message AddLocalInventoriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** UserEvent orderBy */ - orderBy?: (string|null); + /** + * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddLocalInventoriesRequest + * @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.AddLocalInventoriesRequest; - /** UserEvent offset */ - offset?: (number|null); + /** + * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddLocalInventoriesRequest + * @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.AddLocalInventoriesRequest; - /** UserEvent pageCategories */ - pageCategories?: (string[]|null); + /** + * Verifies an AddLocalInventoriesRequest 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); - /** UserEvent userInfo */ - userInfo?: (google.cloud.retail.v2alpha.IUserInfo|null); + /** + * Creates an AddLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddLocalInventoriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddLocalInventoriesRequest; - /** UserEvent uri */ - uri?: (string|null); + /** + * Creates a plain object from an AddLocalInventoriesRequest message. Also converts values to other types if specified. + * @param message AddLocalInventoriesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.AddLocalInventoriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** UserEvent referrerUri */ - referrerUri?: (string|null); + /** + * Converts this AddLocalInventoriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** UserEvent pageViewId */ - pageViewId?: (string|null); + /** Properties of an AddLocalInventoriesMetadata. */ + interface IAddLocalInventoriesMetadata { } - /** Represents a UserEvent. */ - class UserEvent implements IUserEvent { + /** Represents an AddLocalInventoriesMetadata. */ + class AddLocalInventoriesMetadata implements IAddLocalInventoriesMetadata { /** - * Constructs a new UserEvent. + * Constructs a new AddLocalInventoriesMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IUserEvent); - - /** UserEvent eventType. */ - public eventType: string; - - /** UserEvent visitorId. */ - public visitorId: string; - - /** UserEvent sessionId. */ - public sessionId: string; - - /** UserEvent eventTime. */ - public eventTime?: (google.protobuf.ITimestamp|null); - - /** UserEvent experimentIds. */ - public experimentIds: string[]; - - /** UserEvent attributionToken. */ - public attributionToken: string; - - /** UserEvent productDetails. */ - public productDetails: google.cloud.retail.v2alpha.IProductDetail[]; - - /** UserEvent completionDetail. */ - public completionDetail?: (google.cloud.retail.v2alpha.ICompletionDetail|null); + constructor(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata); - /** UserEvent attributes. */ - public attributes: { [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }; + /** + * Creates a new AddLocalInventoriesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns AddLocalInventoriesMetadata instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata): google.cloud.retail.v2alpha.AddLocalInventoriesMetadata; - /** UserEvent cartId. */ - public cartId: string; + /** + * Encodes the specified AddLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.verify|verify} messages. + * @param message AddLocalInventoriesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** UserEvent purchaseTransaction. */ - public purchaseTransaction?: (google.cloud.retail.v2alpha.IPurchaseTransaction|null); + /** + * Encodes the specified AddLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.verify|verify} messages. + * @param message AddLocalInventoriesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** UserEvent searchQuery. */ - public searchQuery: string; + /** + * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddLocalInventoriesMetadata + * @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.AddLocalInventoriesMetadata; - /** UserEvent filter. */ - public filter: string; + /** + * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddLocalInventoriesMetadata + * @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.AddLocalInventoriesMetadata; - /** UserEvent orderBy. */ - public orderBy: string; + /** + * Verifies an AddLocalInventoriesMetadata 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); - /** UserEvent offset. */ - public offset: number; + /** + * Creates an AddLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddLocalInventoriesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddLocalInventoriesMetadata; - /** UserEvent pageCategories. */ - public pageCategories: string[]; + /** + * Creates a plain object from an AddLocalInventoriesMetadata message. Also converts values to other types if specified. + * @param message AddLocalInventoriesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.AddLocalInventoriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** UserEvent userInfo. */ - public userInfo?: (google.cloud.retail.v2alpha.IUserInfo|null); + /** + * Converts this AddLocalInventoriesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** UserEvent uri. */ - public uri: string; + /** Properties of an AddLocalInventoriesResponse. */ + interface IAddLocalInventoriesResponse { + } - /** UserEvent referrerUri. */ - public referrerUri: string; + /** Represents an AddLocalInventoriesResponse. */ + class AddLocalInventoriesResponse implements IAddLocalInventoriesResponse { - /** UserEvent pageViewId. */ - public pageViewId: string; + /** + * Constructs a new AddLocalInventoriesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesResponse); /** - * Creates a new UserEvent instance using the specified properties. + * Creates a new AddLocalInventoriesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns UserEvent instance + * @returns AddLocalInventoriesResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IUserEvent): google.cloud.retail.v2alpha.UserEvent; + public static create(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesResponse): google.cloud.retail.v2alpha.AddLocalInventoriesResponse; /** - * Encodes the specified UserEvent message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEvent.verify|verify} messages. - * @param message UserEvent message or plain object to encode + * Encodes the specified AddLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesResponse.verify|verify} messages. + * @param message AddLocalInventoriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IUserEvent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IAddLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UserEvent message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEvent.verify|verify} messages. - * @param message UserEvent message or plain object to encode + * Encodes the specified AddLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesResponse.verify|verify} messages. + * @param message AddLocalInventoriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserEvent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a UserEvent message from the specified reader or buffer. + * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UserEvent + * @returns AddLocalInventoriesResponse * @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.UserEvent; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddLocalInventoriesResponse; /** - * Decodes a UserEvent message from the specified reader or buffer, length delimited. + * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UserEvent + * @returns AddLocalInventoriesResponse * @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.UserEvent; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddLocalInventoriesResponse; /** - * Verifies a UserEvent message. + * Verifies an AddLocalInventoriesResponse 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 UserEvent message from a plain object. Also converts values to their respective internal types. + * Creates an AddLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UserEvent + * @returns AddLocalInventoriesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserEvent; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddLocalInventoriesResponse; /** - * Creates a plain object from a UserEvent message. Also converts values to other types if specified. - * @param message UserEvent + * Creates a plain object from an AddLocalInventoriesResponse message. Also converts values to other types if specified. + * @param message AddLocalInventoriesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.UserEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.AddLocalInventoriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UserEvent to JSON. + * Converts this AddLocalInventoriesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ProductDetail. */ - interface IProductDetail { + /** Properties of a RemoveLocalInventoriesRequest. */ + interface IRemoveLocalInventoriesRequest { - /** ProductDetail product */ - product?: (google.cloud.retail.v2alpha.IProduct|null); + /** RemoveLocalInventoriesRequest product */ + product?: (string|null); - /** ProductDetail quantity */ - quantity?: (google.protobuf.IInt32Value|null); + /** RemoveLocalInventoriesRequest placeIds */ + placeIds?: (string[]|null); + + /** RemoveLocalInventoriesRequest removeTime */ + removeTime?: (google.protobuf.ITimestamp|null); + + /** RemoveLocalInventoriesRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a ProductDetail. */ - class ProductDetail implements IProductDetail { + /** Represents a RemoveLocalInventoriesRequest. */ + class RemoveLocalInventoriesRequest implements IRemoveLocalInventoriesRequest { /** - * Constructs a new ProductDetail. + * Constructs a new RemoveLocalInventoriesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IProductDetail); + constructor(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest); - /** ProductDetail product. */ - public product?: (google.cloud.retail.v2alpha.IProduct|null); + /** RemoveLocalInventoriesRequest product. */ + public product: string; - /** ProductDetail quantity. */ - public quantity?: (google.protobuf.IInt32Value|null); + /** RemoveLocalInventoriesRequest placeIds. */ + public placeIds: string[]; + + /** RemoveLocalInventoriesRequest removeTime. */ + public removeTime?: (google.protobuf.ITimestamp|null); + + /** RemoveLocalInventoriesRequest allowMissing. */ + public allowMissing: boolean; /** - * Creates a new ProductDetail instance using the specified properties. + * Creates a new RemoveLocalInventoriesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ProductDetail instance + * @returns RemoveLocalInventoriesRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IProductDetail): google.cloud.retail.v2alpha.ProductDetail; + public static create(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest): google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest; /** - * Encodes the specified ProductDetail message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductDetail.verify|verify} messages. - * @param message ProductDetail message or plain object to encode + * Encodes the specified RemoveLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.verify|verify} messages. + * @param message RemoveLocalInventoriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IProductDetail, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ProductDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductDetail.verify|verify} messages. - * @param message ProductDetail message or plain object to encode + * Encodes the specified RemoveLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.verify|verify} messages. + * @param message RemoveLocalInventoriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IProductDetail, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ProductDetail message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ProductDetail + * @returns RemoveLocalInventoriesRequest * @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.ProductDetail; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest; /** - * Decodes a ProductDetail message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ProductDetail + * @returns RemoveLocalInventoriesRequest * @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.ProductDetail; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest; /** - * Verifies a ProductDetail message. + * Verifies a RemoveLocalInventoriesRequest 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 ProductDetail message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ProductDetail + * @returns RemoveLocalInventoriesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ProductDetail; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest; /** - * Creates a plain object from a ProductDetail message. Also converts values to other types if specified. - * @param message ProductDetail + * Creates a plain object from a RemoveLocalInventoriesRequest message. Also converts values to other types if specified. + * @param message RemoveLocalInventoriesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ProductDetail, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ProductDetail to JSON. + * Converts this RemoveLocalInventoriesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CompletionDetail. */ - interface ICompletionDetail { - - /** CompletionDetail completionAttributionToken */ - completionAttributionToken?: (string|null); - - /** CompletionDetail selectedSuggestion */ - selectedSuggestion?: (string|null); - - /** CompletionDetail selectedPosition */ - selectedPosition?: (number|null); + /** Properties of a RemoveLocalInventoriesMetadata. */ + interface IRemoveLocalInventoriesMetadata { } - /** Represents a CompletionDetail. */ - class CompletionDetail implements ICompletionDetail { + /** Represents a RemoveLocalInventoriesMetadata. */ + class RemoveLocalInventoriesMetadata implements IRemoveLocalInventoriesMetadata { /** - * Constructs a new CompletionDetail. + * Constructs a new RemoveLocalInventoriesMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICompletionDetail); - - /** CompletionDetail completionAttributionToken. */ - public completionAttributionToken: string; - - /** CompletionDetail selectedSuggestion. */ - public selectedSuggestion: string; - - /** CompletionDetail selectedPosition. */ - public selectedPosition: number; + constructor(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata); /** - * Creates a new CompletionDetail instance using the specified properties. + * Creates a new RemoveLocalInventoriesMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns CompletionDetail instance + * @returns RemoveLocalInventoriesMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICompletionDetail): google.cloud.retail.v2alpha.CompletionDetail; + public static create(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata): google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata; /** - * Encodes the specified CompletionDetail message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDetail.verify|verify} messages. - * @param message CompletionDetail message or plain object to encode + * Encodes the specified RemoveLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.verify|verify} messages. + * @param message RemoveLocalInventoriesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ICompletionDetail, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CompletionDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDetail.verify|verify} messages. - * @param message CompletionDetail message or plain object to encode + * Encodes the specified RemoveLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.verify|verify} messages. + * @param message RemoveLocalInventoriesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompletionDetail, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CompletionDetail message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CompletionDetail + * @returns RemoveLocalInventoriesMetadata * @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.CompletionDetail; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata; /** - * Decodes a CompletionDetail message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CompletionDetail + * @returns RemoveLocalInventoriesMetadata * @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.CompletionDetail; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata; /** - * Verifies a CompletionDetail message. + * Verifies a RemoveLocalInventoriesMetadata 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 CompletionDetail message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CompletionDetail + * @returns RemoveLocalInventoriesMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompletionDetail; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata; /** - * Creates a plain object from a CompletionDetail message. Also converts values to other types if specified. - * @param message CompletionDetail + * Creates a plain object from a RemoveLocalInventoriesMetadata message. Also converts values to other types if specified. + * @param message RemoveLocalInventoriesMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.CompletionDetail, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CompletionDetail to JSON. + * Converts this RemoveLocalInventoriesMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PurchaseTransaction. */ - interface IPurchaseTransaction { - - /** PurchaseTransaction id */ - id?: (string|null); - - /** PurchaseTransaction revenue */ - revenue?: (number|null); - - /** PurchaseTransaction tax */ - tax?: (number|null); - - /** PurchaseTransaction cost */ - cost?: (number|null); - - /** PurchaseTransaction currencyCode */ - currencyCode?: (string|null); + /** Properties of a RemoveLocalInventoriesResponse. */ + interface IRemoveLocalInventoriesResponse { } - /** Represents a PurchaseTransaction. */ - class PurchaseTransaction implements IPurchaseTransaction { + /** Represents a RemoveLocalInventoriesResponse. */ + class RemoveLocalInventoriesResponse implements IRemoveLocalInventoriesResponse { /** - * Constructs a new PurchaseTransaction. + * Constructs a new RemoveLocalInventoriesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IPurchaseTransaction); - - /** PurchaseTransaction id. */ - public id: string; - - /** PurchaseTransaction revenue. */ - public revenue: number; - - /** PurchaseTransaction tax. */ - public tax: number; - - /** PurchaseTransaction cost. */ - public cost: number; - - /** PurchaseTransaction currencyCode. */ - public currencyCode: string; + constructor(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse); /** - * Creates a new PurchaseTransaction instance using the specified properties. + * Creates a new RemoveLocalInventoriesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns PurchaseTransaction instance + * @returns RemoveLocalInventoriesResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IPurchaseTransaction): google.cloud.retail.v2alpha.PurchaseTransaction; + public static create(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse): google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse; /** - * Encodes the specified PurchaseTransaction message. Does not implicitly {@link google.cloud.retail.v2alpha.PurchaseTransaction.verify|verify} messages. - * @param message PurchaseTransaction message or plain object to encode + * Encodes the specified RemoveLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.verify|verify} messages. + * @param message RemoveLocalInventoriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IPurchaseTransaction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PurchaseTransaction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurchaseTransaction.verify|verify} messages. - * @param message PurchaseTransaction message or plain object to encode + * Encodes the specified RemoveLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.verify|verify} messages. + * @param message RemoveLocalInventoriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurchaseTransaction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PurchaseTransaction message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PurchaseTransaction + * @returns RemoveLocalInventoriesResponse * @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.PurchaseTransaction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse; /** - * Decodes a PurchaseTransaction message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PurchaseTransaction + * @returns RemoveLocalInventoriesResponse * @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.PurchaseTransaction; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse; /** - * Verifies a PurchaseTransaction message. + * Verifies a RemoveLocalInventoriesResponse 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 PurchaseTransaction message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PurchaseTransaction + * @returns RemoveLocalInventoriesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurchaseTransaction; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse; /** - * Creates a plain object from a PurchaseTransaction message. Also converts values to other types if specified. - * @param message PurchaseTransaction + * Creates a plain object from a RemoveLocalInventoriesResponse message. Also converts values to other types if specified. + * @param message RemoveLocalInventoriesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.PurchaseTransaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PurchaseTransaction to JSON. + * Converts this RemoveLocalInventoriesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents a CatalogService */ - class CatalogService extends $protobuf.rpc.Service { + /** Properties of a RemoveFulfillmentPlacesRequest. */ + interface IRemoveFulfillmentPlacesRequest { - /** - * Constructs a new CatalogService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + /** RemoveFulfillmentPlacesRequest product */ + product?: (string|null); - /** - * Creates new CatalogService service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): CatalogService; + /** RemoveFulfillmentPlacesRequest type */ + type?: (string|null); - /** - * Calls ListCatalogs. - * @param request ListCatalogsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCatalogsResponse - */ - public listCatalogs(request: google.cloud.retail.v2alpha.IListCatalogsRequest, callback: google.cloud.retail.v2alpha.CatalogService.ListCatalogsCallback): void; + /** RemoveFulfillmentPlacesRequest placeIds */ + placeIds?: (string[]|null); - /** - * Calls ListCatalogs. - * @param request ListCatalogsRequest message or plain object - * @returns Promise - */ - public listCatalogs(request: google.cloud.retail.v2alpha.IListCatalogsRequest): Promise; + /** RemoveFulfillmentPlacesRequest removeTime */ + removeTime?: (google.protobuf.ITimestamp|null); + + /** RemoveFulfillmentPlacesRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents a RemoveFulfillmentPlacesRequest. */ + class RemoveFulfillmentPlacesRequest implements IRemoveFulfillmentPlacesRequest { /** - * Calls UpdateCatalog. - * @param request UpdateCatalogRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Catalog + * Constructs a new RemoveFulfillmentPlacesRequest. + * @param [properties] Properties to set */ - public updateCatalog(request: google.cloud.retail.v2alpha.IUpdateCatalogRequest, callback: google.cloud.retail.v2alpha.CatalogService.UpdateCatalogCallback): void; + constructor(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest); + + /** RemoveFulfillmentPlacesRequest product. */ + public product: string; + + /** RemoveFulfillmentPlacesRequest type. */ + public type: string; + + /** RemoveFulfillmentPlacesRequest placeIds. */ + public placeIds: string[]; + + /** RemoveFulfillmentPlacesRequest removeTime. */ + public removeTime?: (google.protobuf.ITimestamp|null); + + /** RemoveFulfillmentPlacesRequest allowMissing. */ + public allowMissing: boolean; /** - * Calls UpdateCatalog. - * @param request UpdateCatalogRequest message or plain object - * @returns Promise + * Creates a new RemoveFulfillmentPlacesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveFulfillmentPlacesRequest instance */ - public updateCatalog(request: google.cloud.retail.v2alpha.IUpdateCatalogRequest): Promise; + public static create(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest; /** - * Calls SetDefaultBranch. - * @param request SetDefaultBranchRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Encodes the specified RemoveFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.verify|verify} messages. + * @param message RemoveFulfillmentPlacesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public setDefaultBranch(request: google.cloud.retail.v2alpha.ISetDefaultBranchRequest, callback: google.cloud.retail.v2alpha.CatalogService.SetDefaultBranchCallback): void; + public static encode(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls SetDefaultBranch. - * @param request SetDefaultBranchRequest message or plain object - * @returns Promise + * Encodes the specified RemoveFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.verify|verify} messages. + * @param message RemoveFulfillmentPlacesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public setDefaultBranch(request: google.cloud.retail.v2alpha.ISetDefaultBranchRequest): Promise; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetDefaultBranch. - * @param request GetDefaultBranchRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GetDefaultBranchResponse + * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveFulfillmentPlacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getDefaultBranch(request: google.cloud.retail.v2alpha.IGetDefaultBranchRequest, callback: google.cloud.retail.v2alpha.CatalogService.GetDefaultBranchCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest; /** - * Calls GetDefaultBranch. - * @param request GetDefaultBranchRequest message or plain object - * @returns Promise + * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveFulfillmentPlacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getDefaultBranch(request: google.cloud.retail.v2alpha.IGetDefaultBranchRequest): Promise; - } - - namespace CatalogService { + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest; /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService#listCatalogs}. - * @param error Error, if any - * @param [response] ListCatalogsResponse + * Verifies a RemoveFulfillmentPlacesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type ListCatalogsCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.ListCatalogsResponse) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService#updateCatalog}. - * @param error Error, if any - * @param [response] Catalog + * Creates a RemoveFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveFulfillmentPlacesRequest */ - type UpdateCatalogCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Catalog) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest; /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService#setDefaultBranch}. - * @param error Error, if any - * @param [response] Empty + * Creates a plain object from a RemoveFulfillmentPlacesRequest message. Also converts values to other types if specified. + * @param message RemoveFulfillmentPlacesRequest + * @param [options] Conversion options + * @returns Plain object */ - type SetDefaultBranchCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static toObject(message: google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService#getDefaultBranch}. - * @param error Error, if any - * @param [response] GetDefaultBranchResponse + * Converts this RemoveFulfillmentPlacesRequest to JSON. + * @returns JSON object */ - type GetDefaultBranchCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.GetDefaultBranchResponse) => void; + public toJSON(): { [k: string]: any }; } - /** Properties of a ListCatalogsRequest. */ - interface IListCatalogsRequest { - - /** ListCatalogsRequest parent */ - parent?: (string|null); - - /** ListCatalogsRequest pageSize */ - pageSize?: (number|null); - - /** ListCatalogsRequest pageToken */ - pageToken?: (string|null); + /** Properties of a RemoveFulfillmentPlacesMetadata. */ + interface IRemoveFulfillmentPlacesMetadata { } - /** Represents a ListCatalogsRequest. */ - class ListCatalogsRequest implements IListCatalogsRequest { + /** Represents a RemoveFulfillmentPlacesMetadata. */ + class RemoveFulfillmentPlacesMetadata implements IRemoveFulfillmentPlacesMetadata { /** - * Constructs a new ListCatalogsRequest. + * Constructs a new RemoveFulfillmentPlacesMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IListCatalogsRequest); - - /** ListCatalogsRequest parent. */ - public parent: string; - - /** ListCatalogsRequest pageSize. */ - public pageSize: number; - - /** ListCatalogsRequest pageToken. */ - public pageToken: string; + constructor(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata); /** - * Creates a new ListCatalogsRequest instance using the specified properties. + * Creates a new RemoveFulfillmentPlacesMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns ListCatalogsRequest instance + * @returns RemoveFulfillmentPlacesMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.IListCatalogsRequest): google.cloud.retail.v2alpha.ListCatalogsRequest; + public static create(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata; /** - * Encodes the specified ListCatalogsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsRequest.verify|verify} messages. - * @param message ListCatalogsRequest message or plain object to encode + * Encodes the specified RemoveFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.verify|verify} messages. + * @param message RemoveFulfillmentPlacesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IListCatalogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListCatalogsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsRequest.verify|verify} messages. - * @param message ListCatalogsRequest message or plain object to encode + * Encodes the specified RemoveFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.verify|verify} messages. + * @param message RemoveFulfillmentPlacesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IListCatalogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListCatalogsRequest message from the specified reader or buffer. + * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListCatalogsRequest + * @returns RemoveFulfillmentPlacesMetadata * @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.ListCatalogsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata; /** - * Decodes a ListCatalogsRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListCatalogsRequest + * @returns RemoveFulfillmentPlacesMetadata * @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.ListCatalogsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata; /** - * Verifies a ListCatalogsRequest message. + * Verifies a RemoveFulfillmentPlacesMetadata 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 ListCatalogsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListCatalogsRequest + * @returns RemoveFulfillmentPlacesMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListCatalogsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata; /** - * Creates a plain object from a ListCatalogsRequest message. Also converts values to other types if specified. - * @param message ListCatalogsRequest + * Creates a plain object from a RemoveFulfillmentPlacesMetadata message. Also converts values to other types if specified. + * @param message RemoveFulfillmentPlacesMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ListCatalogsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListCatalogsRequest to JSON. + * Converts this RemoveFulfillmentPlacesMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListCatalogsResponse. */ - interface IListCatalogsResponse { - - /** ListCatalogsResponse catalogs */ - catalogs?: (google.cloud.retail.v2alpha.ICatalog[]|null); - - /** ListCatalogsResponse nextPageToken */ - nextPageToken?: (string|null); + /** Properties of a RemoveFulfillmentPlacesResponse. */ + interface IRemoveFulfillmentPlacesResponse { } - /** Represents a ListCatalogsResponse. */ - class ListCatalogsResponse implements IListCatalogsResponse { + /** Represents a RemoveFulfillmentPlacesResponse. */ + class RemoveFulfillmentPlacesResponse implements IRemoveFulfillmentPlacesResponse { /** - * Constructs a new ListCatalogsResponse. + * Constructs a new RemoveFulfillmentPlacesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IListCatalogsResponse); - - /** ListCatalogsResponse catalogs. */ - public catalogs: google.cloud.retail.v2alpha.ICatalog[]; - - /** ListCatalogsResponse nextPageToken. */ - public nextPageToken: string; + constructor(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse); /** - * Creates a new ListCatalogsResponse instance using the specified properties. + * Creates a new RemoveFulfillmentPlacesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListCatalogsResponse instance + * @returns RemoveFulfillmentPlacesResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IListCatalogsResponse): google.cloud.retail.v2alpha.ListCatalogsResponse; + public static create(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse; /** - * Encodes the specified ListCatalogsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsResponse.verify|verify} messages. - * @param message ListCatalogsResponse message or plain object to encode + * Encodes the specified RemoveFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * @param message RemoveFulfillmentPlacesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IListCatalogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListCatalogsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsResponse.verify|verify} messages. - * @param message ListCatalogsResponse message or plain object to encode + * Encodes the specified RemoveFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * @param message RemoveFulfillmentPlacesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IListCatalogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListCatalogsResponse message from the specified reader or buffer. + * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListCatalogsResponse + * @returns RemoveFulfillmentPlacesResponse * @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.ListCatalogsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse; /** - * Decodes a ListCatalogsResponse message from the specified reader or buffer, length delimited. + * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListCatalogsResponse + * @returns RemoveFulfillmentPlacesResponse * @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.ListCatalogsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse; /** - * Verifies a ListCatalogsResponse message. + * Verifies a RemoveFulfillmentPlacesResponse 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 ListCatalogsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListCatalogsResponse + * @returns RemoveFulfillmentPlacesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListCatalogsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse; /** - * Creates a plain object from a ListCatalogsResponse message. Also converts values to other types if specified. - * @param message ListCatalogsResponse + * Creates a plain object from a RemoveFulfillmentPlacesResponse message. Also converts values to other types if specified. + * @param message RemoveFulfillmentPlacesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ListCatalogsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListCatalogsResponse to JSON. + * Converts this RemoveFulfillmentPlacesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateCatalogRequest. */ - interface IUpdateCatalogRequest { - - /** UpdateCatalogRequest catalog */ - catalog?: (google.cloud.retail.v2alpha.ICatalog|null); - - /** UpdateCatalogRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** Properties of a PurgeMetadata. */ + interface IPurgeMetadata { } - /** Represents an UpdateCatalogRequest. */ - class UpdateCatalogRequest implements IUpdateCatalogRequest { + /** Represents a PurgeMetadata. */ + class PurgeMetadata implements IPurgeMetadata { /** - * Constructs a new UpdateCatalogRequest. + * Constructs a new PurgeMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IUpdateCatalogRequest); - - /** UpdateCatalogRequest catalog. */ - public catalog?: (google.cloud.retail.v2alpha.ICatalog|null); - - /** UpdateCatalogRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + constructor(properties?: google.cloud.retail.v2alpha.IPurgeMetadata); /** - * Creates a new UpdateCatalogRequest instance using the specified properties. + * Creates a new PurgeMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateCatalogRequest instance + * @returns PurgeMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.IUpdateCatalogRequest): google.cloud.retail.v2alpha.UpdateCatalogRequest; + public static create(properties?: google.cloud.retail.v2alpha.IPurgeMetadata): google.cloud.retail.v2alpha.PurgeMetadata; /** - * Encodes the specified UpdateCatalogRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCatalogRequest.verify|verify} messages. - * @param message UpdateCatalogRequest message or plain object to encode + * Encodes the specified PurgeMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeMetadata.verify|verify} messages. + * @param message PurgeMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IUpdateCatalogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IPurgeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateCatalogRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCatalogRequest.verify|verify} messages. - * @param message UpdateCatalogRequest message or plain object to encode + * Encodes the specified PurgeMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeMetadata.verify|verify} messages. + * @param message PurgeMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateCatalogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateCatalogRequest message from the specified reader or buffer. + * Decodes a PurgeMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateCatalogRequest + * @returns PurgeMetadata * @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.UpdateCatalogRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PurgeMetadata; /** - * Decodes an UpdateCatalogRequest message from the specified reader or buffer, length delimited. + * Decodes a PurgeMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateCatalogRequest + * @returns PurgeMetadata * @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.UpdateCatalogRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PurgeMetadata; /** - * Verifies an UpdateCatalogRequest message. + * Verifies a PurgeMetadata 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 UpdateCatalogRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateCatalogRequest + * @returns PurgeMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateCatalogRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeMetadata; /** - * Creates a plain object from an UpdateCatalogRequest message. Also converts values to other types if specified. - * @param message UpdateCatalogRequest + * Creates a plain object from a PurgeMetadata message. Also converts values to other types if specified. + * @param message PurgeMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.UpdateCatalogRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.PurgeMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateCatalogRequest to JSON. + * Converts this PurgeMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SetDefaultBranchRequest. */ - interface ISetDefaultBranchRequest { + /** Properties of a PurgeUserEventsRequest. */ + interface IPurgeUserEventsRequest { - /** SetDefaultBranchRequest catalog */ - catalog?: (string|null); + /** PurgeUserEventsRequest parent */ + parent?: (string|null); - /** SetDefaultBranchRequest branchId */ - branchId?: (string|null); + /** PurgeUserEventsRequest filter */ + filter?: (string|null); - /** SetDefaultBranchRequest note */ - note?: (string|null); + /** PurgeUserEventsRequest force */ + force?: (boolean|null); } - /** Represents a SetDefaultBranchRequest. */ - class SetDefaultBranchRequest implements ISetDefaultBranchRequest { + /** Represents a PurgeUserEventsRequest. */ + class PurgeUserEventsRequest implements IPurgeUserEventsRequest { /** - * Constructs a new SetDefaultBranchRequest. + * Constructs a new PurgeUserEventsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ISetDefaultBranchRequest); + constructor(properties?: google.cloud.retail.v2alpha.IPurgeUserEventsRequest); - /** SetDefaultBranchRequest catalog. */ - public catalog: string; + /** PurgeUserEventsRequest parent. */ + public parent: string; - /** SetDefaultBranchRequest branchId. */ - public branchId: string; + /** PurgeUserEventsRequest filter. */ + public filter: string; - /** SetDefaultBranchRequest note. */ - public note: string; + /** PurgeUserEventsRequest force. */ + public force: boolean; /** - * Creates a new SetDefaultBranchRequest instance using the specified properties. + * Creates a new PurgeUserEventsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SetDefaultBranchRequest instance + * @returns PurgeUserEventsRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.ISetDefaultBranchRequest): google.cloud.retail.v2alpha.SetDefaultBranchRequest; + public static create(properties?: google.cloud.retail.v2alpha.IPurgeUserEventsRequest): google.cloud.retail.v2alpha.PurgeUserEventsRequest; /** - * Encodes the specified SetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SetDefaultBranchRequest.verify|verify} messages. - * @param message SetDefaultBranchRequest message or plain object to encode + * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsRequest.verify|verify} messages. + * @param message PurgeUserEventsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ISetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IPurgeUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetDefaultBranchRequest.verify|verify} messages. - * @param message SetDefaultBranchRequest message or plain object to encode + * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsRequest.verify|verify} messages. + * @param message PurgeUserEventsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ISetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SetDefaultBranchRequest message from the specified reader or buffer. + * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SetDefaultBranchRequest + * @returns PurgeUserEventsRequest * @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.SetDefaultBranchRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PurgeUserEventsRequest; /** - * Decodes a SetDefaultBranchRequest message from the specified reader or buffer, length delimited. + * Decodes a PurgeUserEventsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SetDefaultBranchRequest + * @returns PurgeUserEventsRequest * @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.SetDefaultBranchRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PurgeUserEventsRequest; /** - * Verifies a SetDefaultBranchRequest message. + * Verifies a PurgeUserEventsRequest 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 SetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeUserEventsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SetDefaultBranchRequest + * @returns PurgeUserEventsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SetDefaultBranchRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeUserEventsRequest; /** - * Creates a plain object from a SetDefaultBranchRequest message. Also converts values to other types if specified. - * @param message SetDefaultBranchRequest + * Creates a plain object from a PurgeUserEventsRequest message. Also converts values to other types if specified. + * @param message PurgeUserEventsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.SetDefaultBranchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.PurgeUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SetDefaultBranchRequest to JSON. + * Converts this PurgeUserEventsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetDefaultBranchRequest. */ - interface IGetDefaultBranchRequest { + /** Properties of a PurgeUserEventsResponse. */ + interface IPurgeUserEventsResponse { - /** GetDefaultBranchRequest catalog */ - catalog?: (string|null); + /** PurgeUserEventsResponse purgedEventsCount */ + purgedEventsCount?: (number|Long|string|null); } - /** Represents a GetDefaultBranchRequest. */ - class GetDefaultBranchRequest implements IGetDefaultBranchRequest { + /** Represents a PurgeUserEventsResponse. */ + class PurgeUserEventsResponse implements IPurgeUserEventsResponse { /** - * Constructs a new GetDefaultBranchRequest. + * Constructs a new PurgeUserEventsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IGetDefaultBranchRequest); + constructor(properties?: google.cloud.retail.v2alpha.IPurgeUserEventsResponse); - /** GetDefaultBranchRequest catalog. */ - public catalog: string; + /** PurgeUserEventsResponse purgedEventsCount. */ + public purgedEventsCount: (number|Long|string); /** - * Creates a new GetDefaultBranchRequest instance using the specified properties. + * Creates a new PurgeUserEventsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetDefaultBranchRequest instance + * @returns PurgeUserEventsResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IGetDefaultBranchRequest): google.cloud.retail.v2alpha.GetDefaultBranchRequest; + public static create(properties?: google.cloud.retail.v2alpha.IPurgeUserEventsResponse): google.cloud.retail.v2alpha.PurgeUserEventsResponse; /** - * Encodes the specified GetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchRequest.verify|verify} messages. - * @param message GetDefaultBranchRequest message or plain object to encode + * Encodes the specified PurgeUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsResponse.verify|verify} messages. + * @param message PurgeUserEventsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IGetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IPurgeUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchRequest.verify|verify} messages. - * @param message GetDefaultBranchRequest message or plain object to encode + * Encodes the specified PurgeUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsResponse.verify|verify} messages. + * @param message PurgeUserEventsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetDefaultBranchRequest message from the specified reader or buffer. + * Decodes a PurgeUserEventsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetDefaultBranchRequest + * @returns PurgeUserEventsResponse * @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.GetDefaultBranchRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PurgeUserEventsResponse; /** - * Decodes a GetDefaultBranchRequest message from the specified reader or buffer, length delimited. + * Decodes a PurgeUserEventsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetDefaultBranchRequest + * @returns PurgeUserEventsResponse * @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.GetDefaultBranchRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PurgeUserEventsResponse; /** - * Verifies a GetDefaultBranchRequest message. + * Verifies a PurgeUserEventsResponse 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 GetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeUserEventsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetDefaultBranchRequest + * @returns PurgeUserEventsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetDefaultBranchRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeUserEventsResponse; /** - * Creates a plain object from a GetDefaultBranchRequest message. Also converts values to other types if specified. - * @param message GetDefaultBranchRequest + * Creates a plain object from a PurgeUserEventsResponse message. Also converts values to other types if specified. + * @param message PurgeUserEventsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.GetDefaultBranchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.PurgeUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PurgeUserEventsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Represents a SearchService */ + class SearchService extends $protobuf.rpc.Service { + + /** + * Constructs a new SearchService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new SearchService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SearchService; + + /** + * Calls Search. + * @param request SearchRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchResponse + */ + public search(request: google.cloud.retail.v2alpha.ISearchRequest, callback: google.cloud.retail.v2alpha.SearchService.SearchCallback): void; + + /** + * Calls Search. + * @param request SearchRequest message or plain object + * @returns Promise + */ + public search(request: google.cloud.retail.v2alpha.ISearchRequest): Promise; + } + + namespace SearchService { + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.SearchService#search}. + * @param error Error, if any + * @param [response] SearchResponse + */ + type SearchCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.SearchResponse) => void; + } + + /** Properties of a SearchRequest. */ + interface ISearchRequest { + + /** SearchRequest placement */ + placement?: (string|null); + + /** SearchRequest branch */ + branch?: (string|null); + + /** SearchRequest query */ + query?: (string|null); + + /** SearchRequest visitorId */ + visitorId?: (string|null); + + /** SearchRequest userInfo */ + userInfo?: (google.cloud.retail.v2alpha.IUserInfo|null); + + /** SearchRequest pageSize */ + pageSize?: (number|null); + + /** SearchRequest pageToken */ + pageToken?: (string|null); + + /** SearchRequest offset */ + offset?: (number|null); + + /** SearchRequest filter */ + filter?: (string|null); + + /** SearchRequest canonicalFilter */ + canonicalFilter?: (string|null); + + /** SearchRequest orderBy */ + orderBy?: (string|null); + + /** SearchRequest facetSpecs */ + facetSpecs?: (google.cloud.retail.v2alpha.SearchRequest.IFacetSpec[]|null); + + /** SearchRequest dynamicFacetSpec */ + dynamicFacetSpec?: (google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec|null); + + /** SearchRequest boostSpec */ + boostSpec?: (google.cloud.retail.v2alpha.SearchRequest.IBoostSpec|null); + + /** SearchRequest queryExpansionSpec */ + queryExpansionSpec?: (google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec|null); + + /** SearchRequest relevanceThreshold */ + relevanceThreshold?: (google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold|keyof typeof google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold|null); + + /** SearchRequest variantRollupKeys */ + variantRollupKeys?: (string[]|null); + + /** SearchRequest pageCategories */ + pageCategories?: (string[]|null); + + /** SearchRequest searchMode */ + searchMode?: (google.cloud.retail.v2alpha.SearchRequest.SearchMode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.SearchMode|null); + } + + /** Represents a SearchRequest. */ + class SearchRequest implements ISearchRequest { + + /** + * Constructs a new SearchRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.ISearchRequest); + + /** SearchRequest placement. */ + public placement: string; + + /** SearchRequest branch. */ + public branch: string; + + /** SearchRequest query. */ + public query: string; + + /** SearchRequest visitorId. */ + public visitorId: string; + + /** SearchRequest userInfo. */ + public userInfo?: (google.cloud.retail.v2alpha.IUserInfo|null); + + /** SearchRequest pageSize. */ + public pageSize: number; + + /** SearchRequest pageToken. */ + public pageToken: string; + + /** SearchRequest offset. */ + public offset: number; + + /** SearchRequest filter. */ + public filter: string; - /** - * Converts this GetDefaultBranchRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** SearchRequest canonicalFilter. */ + public canonicalFilter: string; - /** Properties of a GetDefaultBranchResponse. */ - interface IGetDefaultBranchResponse { + /** SearchRequest orderBy. */ + public orderBy: string; - /** GetDefaultBranchResponse branch */ - branch?: (string|null); + /** SearchRequest facetSpecs. */ + public facetSpecs: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec[]; - /** GetDefaultBranchResponse setTime */ - setTime?: (google.protobuf.ITimestamp|null); + /** SearchRequest dynamicFacetSpec. */ + public dynamicFacetSpec?: (google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec|null); - /** GetDefaultBranchResponse note */ - note?: (string|null); - } + /** SearchRequest boostSpec. */ + public boostSpec?: (google.cloud.retail.v2alpha.SearchRequest.IBoostSpec|null); - /** Represents a GetDefaultBranchResponse. */ - class GetDefaultBranchResponse implements IGetDefaultBranchResponse { + /** SearchRequest queryExpansionSpec. */ + public queryExpansionSpec?: (google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec|null); - /** - * Constructs a new GetDefaultBranchResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IGetDefaultBranchResponse); + /** SearchRequest relevanceThreshold. */ + public relevanceThreshold: (google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold|keyof typeof google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold); - /** GetDefaultBranchResponse branch. */ - public branch: string; + /** SearchRequest variantRollupKeys. */ + public variantRollupKeys: string[]; - /** GetDefaultBranchResponse setTime. */ - public setTime?: (google.protobuf.ITimestamp|null); + /** SearchRequest pageCategories. */ + public pageCategories: string[]; - /** GetDefaultBranchResponse note. */ - public note: string; + /** SearchRequest searchMode. */ + public searchMode: (google.cloud.retail.v2alpha.SearchRequest.SearchMode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.SearchMode); /** - * Creates a new GetDefaultBranchResponse instance using the specified properties. + * Creates a new SearchRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetDefaultBranchResponse instance + * @returns SearchRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IGetDefaultBranchResponse): google.cloud.retail.v2alpha.GetDefaultBranchResponse; + public static create(properties?: google.cloud.retail.v2alpha.ISearchRequest): google.cloud.retail.v2alpha.SearchRequest; /** - * Encodes the specified GetDefaultBranchResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchResponse.verify|verify} messages. - * @param message GetDefaultBranchResponse message or plain object to encode + * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.verify|verify} messages. + * @param message SearchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IGetDefaultBranchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetDefaultBranchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchResponse.verify|verify} messages. - * @param message GetDefaultBranchResponse message or plain object to encode + * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.verify|verify} messages. + * @param message SearchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetDefaultBranchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetDefaultBranchResponse message from the specified reader or buffer. + * Decodes a SearchRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetDefaultBranchResponse + * @returns SearchRequest * @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.GetDefaultBranchResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest; /** - * Decodes a GetDefaultBranchResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetDefaultBranchResponse + * @returns SearchRequest * @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.GetDefaultBranchResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest; /** - * Verifies a GetDefaultBranchResponse message. + * Verifies a SearchRequest 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 GetDefaultBranchResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetDefaultBranchResponse + * @returns SearchRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetDefaultBranchResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest; /** - * Creates a plain object from a GetDefaultBranchResponse message. Also converts values to other types if specified. - * @param message GetDefaultBranchResponse + * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. + * @param message SearchRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.GetDefaultBranchResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.SearchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetDefaultBranchResponse to JSON. + * Converts this SearchRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents a CompletionService */ - class CompletionService extends $protobuf.rpc.Service { + namespace SearchRequest { + + /** Properties of a FacetSpec. */ + interface IFacetSpec { + + /** FacetSpec facetKey */ + facetKey?: (google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey|null); + + /** FacetSpec limit */ + limit?: (number|null); + + /** FacetSpec excludedFilterKeys */ + excludedFilterKeys?: (string[]|null); + + /** FacetSpec enableDynamicPosition */ + enableDynamicPosition?: (boolean|null); + } + + /** Represents a FacetSpec. */ + class FacetSpec implements IFacetSpec { + + /** + * Constructs a new FacetSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec); + + /** FacetSpec facetKey. */ + public facetKey?: (google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey|null); + + /** FacetSpec limit. */ + public limit: number; + + /** FacetSpec excludedFilterKeys. */ + public excludedFilterKeys: string[]; + + /** FacetSpec enableDynamicPosition. */ + public enableDynamicPosition: boolean; + + /** + * Creates a new FacetSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetSpec instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec): google.cloud.retail.v2alpha.SearchRequest.FacetSpec; + + /** + * Encodes the specified FacetSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify|verify} messages. + * @param message FacetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify|verify} messages. + * @param message FacetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FacetSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetSpec + * @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.SearchRequest.FacetSpec; + + /** + * Decodes a FacetSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetSpec + * @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.SearchRequest.FacetSpec; + + /** + * Verifies a FacetSpec 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 FacetSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.FacetSpec; + + /** + * Creates a plain object from a FacetSpec message. Also converts values to other types if specified. + * @param message FacetSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.FacetSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FacetSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FacetSpec { + + /** Properties of a FacetKey. */ + interface IFacetKey { + + /** FacetKey key */ + key?: (string|null); + + /** FacetKey intervals */ + intervals?: (google.cloud.retail.v2alpha.IInterval[]|null); + + /** FacetKey restrictedValues */ + restrictedValues?: (string[]|null); + + /** FacetKey prefixes */ + prefixes?: (string[]|null); + + /** FacetKey contains */ + contains?: (string[]|null); + + /** FacetKey orderBy */ + orderBy?: (string|null); + + /** FacetKey query */ + query?: (string|null); + } + + /** Represents a FacetKey. */ + class FacetKey implements IFacetKey { + + /** + * Constructs a new FacetKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey); + + /** FacetKey key. */ + public key: string; + + /** FacetKey intervals. */ + public intervals: google.cloud.retail.v2alpha.IInterval[]; + + /** FacetKey restrictedValues. */ + public restrictedValues: string[]; + + /** FacetKey prefixes. */ + public prefixes: string[]; + + /** FacetKey contains. */ + public contains: string[]; + + /** FacetKey orderBy. */ + public orderBy: string; - /** - * Constructs a new CompletionService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + /** FacetKey query. */ + public query: string; - /** - * Creates new CompletionService service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): CompletionService; + /** + * Creates a new FacetKey instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetKey instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey): google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey; - /** - * Calls CompleteQuery. - * @param request CompleteQueryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CompleteQueryResponse - */ - public completeQuery(request: google.cloud.retail.v2alpha.ICompleteQueryRequest, callback: google.cloud.retail.v2alpha.CompletionService.CompleteQueryCallback): void; + /** + * Encodes the specified FacetKey message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. + * @param message FacetKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Calls CompleteQuery. - * @param request CompleteQueryRequest message or plain object - * @returns Promise - */ - public completeQuery(request: google.cloud.retail.v2alpha.ICompleteQueryRequest): Promise; + /** + * Encodes the specified FacetKey message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. + * @param message FacetKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Calls ImportCompletionData. - * @param request ImportCompletionDataRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public importCompletionData(request: google.cloud.retail.v2alpha.IImportCompletionDataRequest, callback: google.cloud.retail.v2alpha.CompletionService.ImportCompletionDataCallback): void; + /** + * Decodes a FacetKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetKey + * @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.SearchRequest.FacetSpec.FacetKey; - /** - * Calls ImportCompletionData. - * @param request ImportCompletionDataRequest message or plain object - * @returns Promise - */ - public importCompletionData(request: google.cloud.retail.v2alpha.IImportCompletionDataRequest): Promise; - } + /** + * Decodes a FacetKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetKey + * @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.SearchRequest.FacetSpec.FacetKey; - namespace CompletionService { + /** + * Verifies a FacetKey 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); - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CompletionService#completeQuery}. - * @param error Error, if any - * @param [response] CompleteQueryResponse - */ - type CompleteQueryCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.CompleteQueryResponse) => void; + /** + * Creates a FacetKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey; - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CompletionService#importCompletionData}. - * @param error Error, if any - * @param [response] Operation - */ - type ImportCompletionDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } + /** + * Creates a plain object from a FacetKey message. Also converts values to other types if specified. + * @param message FacetKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a CompleteQueryRequest. */ - interface ICompleteQueryRequest { + /** + * Converts this FacetKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** CompleteQueryRequest catalog */ - catalog?: (string|null); + /** Properties of a DynamicFacetSpec. */ + interface IDynamicFacetSpec { - /** CompleteQueryRequest query */ - query?: (string|null); + /** DynamicFacetSpec mode */ + mode?: (google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode|null); + } - /** CompleteQueryRequest visitorId */ - visitorId?: (string|null); + /** Represents a DynamicFacetSpec. */ + class DynamicFacetSpec implements IDynamicFacetSpec { - /** CompleteQueryRequest languageCodes */ - languageCodes?: (string[]|null); + /** + * Constructs a new DynamicFacetSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec); - /** CompleteQueryRequest deviceType */ - deviceType?: (string|null); + /** DynamicFacetSpec mode. */ + public mode: (google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode); - /** CompleteQueryRequest dataset */ - dataset?: (string|null); + /** + * Creates a new DynamicFacetSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns DynamicFacetSpec instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec): google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec; - /** CompleteQueryRequest maxSuggestions */ - maxSuggestions?: (number|null); - } + /** + * Encodes the specified DynamicFacetSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify|verify} messages. + * @param message DynamicFacetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a CompleteQueryRequest. */ - class CompleteQueryRequest implements ICompleteQueryRequest { + /** + * Encodes the specified DynamicFacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify|verify} messages. + * @param message DynamicFacetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new CompleteQueryRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.ICompleteQueryRequest); + /** + * Decodes a DynamicFacetSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DynamicFacetSpec + * @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.SearchRequest.DynamicFacetSpec; - /** CompleteQueryRequest catalog. */ - public catalog: string; + /** + * Decodes a DynamicFacetSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DynamicFacetSpec + * @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.SearchRequest.DynamicFacetSpec; - /** CompleteQueryRequest query. */ - public query: string; + /** + * Verifies a DynamicFacetSpec 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); - /** CompleteQueryRequest visitorId. */ - public visitorId: string; + /** + * Creates a DynamicFacetSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DynamicFacetSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec; - /** CompleteQueryRequest languageCodes. */ - public languageCodes: string[]; + /** + * Creates a plain object from a DynamicFacetSpec message. Also converts values to other types if specified. + * @param message DynamicFacetSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** CompleteQueryRequest deviceType. */ - public deviceType: string; + /** + * Converts this DynamicFacetSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** CompleteQueryRequest dataset. */ - public dataset: string; + namespace DynamicFacetSpec { - /** CompleteQueryRequest maxSuggestions. */ - public maxSuggestions: number; + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + DISABLED = 1, + ENABLED = 2 + } + } - /** - * Creates a new CompleteQueryRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CompleteQueryRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.ICompleteQueryRequest): google.cloud.retail.v2alpha.CompleteQueryRequest; + /** Properties of a BoostSpec. */ + interface IBoostSpec { + + /** BoostSpec conditionBoostSpecs */ + conditionBoostSpecs?: (google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec[]|null); + } - /** - * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryRequest.verify|verify} messages. - * @param message CompleteQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a BoostSpec. */ + class BoostSpec implements IBoostSpec { - /** - * Encodes the specified CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryRequest.verify|verify} messages. - * @param message CompleteQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new BoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IBoostSpec); - /** - * Decodes a CompleteQueryRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CompleteQueryRequest - * @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.CompleteQueryRequest; + /** BoostSpec conditionBoostSpecs. */ + public conditionBoostSpecs: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec[]; - /** - * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CompleteQueryRequest - * @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.CompleteQueryRequest; + /** + * Creates a new BoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostSpec instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IBoostSpec): google.cloud.retail.v2alpha.SearchRequest.BoostSpec; - /** - * Verifies a CompleteQueryRequest 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); + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CompleteQueryRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryRequest; + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. - * @param message CompleteQueryRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostSpec + * @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.SearchRequest.BoostSpec; - /** - * Converts this CompleteQueryRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostSpec + * @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.SearchRequest.BoostSpec; - /** Properties of a CompleteQueryResponse. */ - interface ICompleteQueryResponse { + /** + * Verifies a BoostSpec 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); - /** CompleteQueryResponse completionResults */ - completionResults?: (google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult[]|null); + /** + * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.BoostSpec; - /** CompleteQueryResponse attributionToken */ - attributionToken?: (string|null); + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @param message BoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.BoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** CompleteQueryResponse recentSearchResults */ - recentSearchResults?: (google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult[]|null); - } + /** + * Converts this BoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents a CompleteQueryResponse. */ - class CompleteQueryResponse implements ICompleteQueryResponse { + namespace BoostSpec { - /** - * Constructs a new CompleteQueryResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.ICompleteQueryResponse); + /** Properties of a ConditionBoostSpec. */ + interface IConditionBoostSpec { - /** CompleteQueryResponse completionResults. */ - public completionResults: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult[]; + /** ConditionBoostSpec condition */ + condition?: (string|null); - /** CompleteQueryResponse attributionToken. */ - public attributionToken: string; + /** ConditionBoostSpec boost */ + boost?: (number|null); + } - /** CompleteQueryResponse recentSearchResults. */ - public recentSearchResults: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult[]; + /** Represents a ConditionBoostSpec. */ + class ConditionBoostSpec implements IConditionBoostSpec { - /** - * Creates a new CompleteQueryResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns CompleteQueryResponse instance - */ - public static create(properties?: google.cloud.retail.v2alpha.ICompleteQueryResponse): google.cloud.retail.v2alpha.CompleteQueryResponse; + /** + * Constructs a new ConditionBoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec); - /** - * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.verify|verify} messages. - * @param message CompleteQueryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** ConditionBoostSpec condition. */ + public condition: string; - /** - * Encodes the specified CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.verify|verify} messages. - * @param message CompleteQueryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** ConditionBoostSpec boost. */ + public boost: number; - /** - * Decodes a CompleteQueryResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CompleteQueryResponse - * @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; + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionBoostSpec instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec): google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec; - /** - * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CompleteQueryResponse - * @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; + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a CompleteQueryResponse 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); + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CompleteQueryResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryResponse; + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionBoostSpec + * @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.SearchRequest.BoostSpec.ConditionBoostSpec; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionBoostSpec + * @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.SearchRequest.BoostSpec.ConditionBoostSpec; - /** - * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. - * @param message CompleteQueryResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a ConditionBoostSpec 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); - /** - * Converts this CompleteQueryResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionBoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec; - namespace CompleteQueryResponse { + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @param message ConditionBoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a CompletionResult. */ - interface ICompletionResult { + /** + * Converts this ConditionBoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** CompletionResult suggestion */ - suggestion?: (string|null); + /** Properties of a QueryExpansionSpec. */ + interface IQueryExpansionSpec { - /** CompletionResult attributes */ - attributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }|null); + /** QueryExpansionSpec condition */ + condition?: (google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition|null); + + /** QueryExpansionSpec pinUnexpandedResults */ + pinUnexpandedResults?: (boolean|null); } - /** Represents a CompletionResult. */ - class CompletionResult implements ICompletionResult { + /** Represents a QueryExpansionSpec. */ + class QueryExpansionSpec implements IQueryExpansionSpec { /** - * Constructs a new CompletionResult. + * Constructs a new QueryExpansionSpec. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult); + constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec); - /** CompletionResult suggestion. */ - public suggestion: string; + /** QueryExpansionSpec condition. */ + public condition: (google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition); - /** CompletionResult attributes. */ - public attributes: { [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }; + /** QueryExpansionSpec pinUnexpandedResults. */ + public pinUnexpandedResults: boolean; /** - * Creates a new CompletionResult instance using the specified properties. + * Creates a new QueryExpansionSpec instance using the specified properties. * @param [properties] Properties to set - * @returns CompletionResult instance + * @returns QueryExpansionSpec instance */ - public static create(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult): google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult; + public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec): google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec; /** - * Encodes the specified CompletionResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify|verify} messages. - * @param message CompletionResult message or plain object to encode + * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * @param message QueryExpansionSpec message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CompletionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify|verify} messages. - * @param message CompletionResult message or plain object to encode + * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * @param message QueryExpansionSpec message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CompletionResult message from the specified reader or buffer. + * Decodes a QueryExpansionSpec message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CompletionResult + * @returns QueryExpansionSpec * @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.CompletionResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec; /** - * Decodes a CompletionResult message from the specified reader or buffer, length delimited. + * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CompletionResult + * @returns QueryExpansionSpec * @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.CompletionResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec; /** - * Verifies a CompletionResult message. + * Verifies a QueryExpansionSpec 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 CompletionResult message from a plain object. Also converts values to their respective internal types. + * Creates a QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CompletionResult + * @returns QueryExpansionSpec */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec; /** - * Creates a plain object from a CompletionResult message. Also converts values to other types if specified. - * @param message CompletionResult + * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. + * @param message QueryExpansionSpec * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CompletionResult to JSON. + * Converts this QueryExpansionSpec to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RecentSearchResult. */ - interface IRecentSearchResult { + namespace QueryExpansionSpec { - /** RecentSearchResult recentSearch */ - recentSearch?: (string|null); + /** Condition enum. */ + enum Condition { + CONDITION_UNSPECIFIED = 0, + DISABLED = 1, + AUTO = 3 + } } - /** Represents a RecentSearchResult. */ - class RecentSearchResult implements IRecentSearchResult { + /** RelevanceThreshold enum. */ + enum RelevanceThreshold { + RELEVANCE_THRESHOLD_UNSPECIFIED = 0, + HIGH = 1, + MEDIUM = 2, + LOW = 3, + LOWEST = 4 + } - /** - * Constructs a new RecentSearchResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult); + /** SearchMode enum. */ + enum SearchMode { + SEARCH_MODE_UNSPECIFIED = 0, + PRODUCT_SEARCH_ONLY = 1, + FACETED_SEARCH_ONLY = 2 + } + } - /** RecentSearchResult recentSearch. */ - public recentSearch: string; + /** Properties of a SearchResponse. */ + interface ISearchResponse { - /** - * Creates a new RecentSearchResult instance using the specified properties. - * @param [properties] Properties to set - * @returns RecentSearchResult instance - */ - public static create(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult): google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult; + /** SearchResponse results */ + results?: (google.cloud.retail.v2alpha.SearchResponse.ISearchResult[]|null); - /** - * Encodes the specified RecentSearchResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. - * @param message RecentSearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** SearchResponse facets */ + facets?: (google.cloud.retail.v2alpha.SearchResponse.IFacet[]|null); - /** - * Encodes the specified RecentSearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. - * @param message RecentSearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** SearchResponse totalSize */ + totalSize?: (number|null); - /** - * Decodes a RecentSearchResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RecentSearchResult - * @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.RecentSearchResult; + /** SearchResponse correctedQuery */ + correctedQuery?: (string|null); - /** - * Decodes a RecentSearchResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RecentSearchResult - * @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.RecentSearchResult; + /** SearchResponse attributionToken */ + attributionToken?: (string|null); - /** - * Verifies a RecentSearchResult 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); + /** SearchResponse nextPageToken */ + nextPageToken?: (string|null); - /** - * Creates a RecentSearchResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RecentSearchResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult; + /** SearchResponse queryExpansionInfo */ + queryExpansionInfo?: (google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo|null); - /** - * Creates a plain object from a RecentSearchResult message. Also converts values to other types if specified. - * @param message RecentSearchResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** SearchResponse redirectUri */ + redirectUri?: (string|null); - /** - * Converts this RecentSearchResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** SearchResponse appliedControls */ + appliedControls?: (string[]|null); } - /** Properties of an ExportErrorsConfig. */ - interface IExportErrorsConfig { + /** Represents a SearchResponse. */ + class SearchResponse implements ISearchResponse { - /** ExportErrorsConfig gcsPrefix */ - gcsPrefix?: (string|null); - } + /** + * Constructs a new SearchResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.ISearchResponse); + + /** SearchResponse results. */ + public results: google.cloud.retail.v2alpha.SearchResponse.ISearchResult[]; + + /** SearchResponse facets. */ + public facets: google.cloud.retail.v2alpha.SearchResponse.IFacet[]; + + /** SearchResponse totalSize. */ + public totalSize: number; + + /** SearchResponse correctedQuery. */ + public correctedQuery: string; - /** Represents an ExportErrorsConfig. */ - class ExportErrorsConfig implements IExportErrorsConfig { + /** SearchResponse attributionToken. */ + public attributionToken: string; - /** - * Constructs a new ExportErrorsConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IExportErrorsConfig); + /** SearchResponse nextPageToken. */ + public nextPageToken: string; - /** ExportErrorsConfig gcsPrefix. */ - public gcsPrefix?: (string|null); + /** SearchResponse queryExpansionInfo. */ + public queryExpansionInfo?: (google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo|null); - /** ExportErrorsConfig destination. */ - public destination?: "gcsPrefix"; + /** SearchResponse redirectUri. */ + public redirectUri: string; + + /** SearchResponse appliedControls. */ + public appliedControls: string[]; /** - * Creates a new ExportErrorsConfig instance using the specified properties. + * Creates a new SearchResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ExportErrorsConfig instance + * @returns SearchResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IExportErrorsConfig): google.cloud.retail.v2alpha.ExportErrorsConfig; + public static create(properties?: google.cloud.retail.v2alpha.ISearchResponse): google.cloud.retail.v2alpha.SearchResponse; /** - * Encodes the specified ExportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ExportErrorsConfig.verify|verify} messages. - * @param message ExportErrorsConfig message or plain object to encode + * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.verify|verify} messages. + * @param message SearchResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IExportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExportErrorsConfig.verify|verify} messages. - * @param message ExportErrorsConfig message or plain object to encode + * Encodes the specified SearchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.verify|verify} messages. + * @param message SearchResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IExportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportErrorsConfig message from the specified reader or buffer. + * Decodes a SearchResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportErrorsConfig + * @returns SearchResponse * @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.ExportErrorsConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchResponse; /** - * Decodes an ExportErrorsConfig message from the specified reader or buffer, length delimited. + * Decodes a SearchResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportErrorsConfig + * @returns SearchResponse * @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.ExportErrorsConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchResponse; /** - * Verifies an ExportErrorsConfig message. + * Verifies a SearchResponse 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 ExportErrorsConfig message from a plain object. Also converts values to their respective internal types. + * Creates a SearchResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportErrorsConfig + * @returns SearchResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ExportErrorsConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse; /** - * Creates a plain object from an ExportErrorsConfig message. Also converts values to other types if specified. - * @param message ExportErrorsConfig + * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. + * @param message SearchResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ExportErrorsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.SearchResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportErrorsConfig to JSON. + * Converts this SearchResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ExportMetadata. */ - interface IExportMetadata { + namespace SearchResponse { - /** ExportMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** Properties of a SearchResult. */ + interface ISearchResult { - /** ExportMetadata updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - } + /** SearchResult id */ + id?: (string|null); - /** Represents an ExportMetadata. */ - class ExportMetadata implements IExportMetadata { + /** SearchResult product */ + product?: (google.cloud.retail.v2alpha.IProduct|null); - /** - * Constructs a new ExportMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IExportMetadata); + /** SearchResult matchingVariantCount */ + matchingVariantCount?: (number|null); - /** ExportMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** SearchResult matchingVariantFields */ + matchingVariantFields?: ({ [k: string]: google.protobuf.IFieldMask }|null); - /** ExportMetadata updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** SearchResult variantRollupValues */ + variantRollupValues?: ({ [k: string]: google.protobuf.IValue }|null); + } - /** - * Creates a new ExportMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportMetadata instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IExportMetadata): google.cloud.retail.v2alpha.ExportMetadata; + /** Represents a SearchResult. */ + class SearchResult implements ISearchResult { - /** - * Encodes the specified ExportMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.ExportMetadata.verify|verify} messages. - * @param message ExportMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IExportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new SearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchResponse.ISearchResult); - /** - * Encodes the specified ExportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExportMetadata.verify|verify} messages. - * @param message ExportMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IExportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** SearchResult id. */ + public id: string; - /** - * Decodes an ExportMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportMetadata - * @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.ExportMetadata; + /** SearchResult product. */ + public product?: (google.cloud.retail.v2alpha.IProduct|null); - /** - * Decodes an ExportMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportMetadata - * @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.ExportMetadata; + /** SearchResult matchingVariantCount. */ + public matchingVariantCount: number; - /** - * Verifies an ExportMetadata 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); + /** SearchResult matchingVariantFields. */ + public matchingVariantFields: { [k: string]: google.protobuf.IFieldMask }; - /** - * Creates an ExportMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ExportMetadata; + /** SearchResult variantRollupValues. */ + public variantRollupValues: { [k: string]: google.protobuf.IValue }; - /** - * Creates a plain object from an ExportMetadata message. Also converts values to other types if specified. - * @param message ExportMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.ExportMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a new SearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchResult instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchResponse.ISearchResult): google.cloud.retail.v2alpha.SearchResponse.SearchResult; - /** - * Converts this ExportMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify|verify} messages. + * @param message SearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of an ExportProductsResponse. */ - interface IExportProductsResponse { + /** + * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify|verify} messages. + * @param message SearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** ExportProductsResponse errorSamples */ - errorSamples?: (google.rpc.IStatus[]|null); + /** + * Decodes a SearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchResult + * @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.SearchResponse.SearchResult; - /** ExportProductsResponse errorsConfig */ - errorsConfig?: (google.cloud.retail.v2alpha.IExportErrorsConfig|null); - } + /** + * Decodes a SearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchResult + * @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.SearchResponse.SearchResult; - /** Represents an ExportProductsResponse. */ - class ExportProductsResponse implements IExportProductsResponse { + /** + * Verifies a SearchResult 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); - /** - * Constructs a new ExportProductsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IExportProductsResponse); + /** + * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse.SearchResult; + + /** + * Creates a plain object from a SearchResult message. Also converts values to other types if specified. + * @param message SearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchResponse.SearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ExportProductsResponse errorSamples. */ - public errorSamples: google.rpc.IStatus[]; + /** Properties of a Facet. */ + interface IFacet { - /** ExportProductsResponse errorsConfig. */ - public errorsConfig?: (google.cloud.retail.v2alpha.IExportErrorsConfig|null); + /** Facet key */ + key?: (string|null); - /** - * Creates a new ExportProductsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportProductsResponse instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IExportProductsResponse): google.cloud.retail.v2alpha.ExportProductsResponse; + /** Facet values */ + values?: (google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue[]|null); - /** - * Encodes the specified ExportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ExportProductsResponse.verify|verify} messages. - * @param message ExportProductsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IExportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Facet dynamicFacet */ + dynamicFacet?: (boolean|null); + } - /** - * Encodes the specified ExportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExportProductsResponse.verify|verify} messages. - * @param message ExportProductsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IExportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a Facet. */ + class Facet implements IFacet { - /** - * Decodes an ExportProductsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportProductsResponse - * @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.ExportProductsResponse; + /** + * Constructs a new Facet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchResponse.IFacet); - /** - * Decodes an ExportProductsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportProductsResponse - * @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.ExportProductsResponse; + /** Facet key. */ + public key: string; - /** - * Verifies an ExportProductsResponse 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); + /** Facet values. */ + public values: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue[]; - /** - * Creates an ExportProductsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportProductsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ExportProductsResponse; + /** Facet dynamicFacet. */ + public dynamicFacet: boolean; - /** - * Creates a plain object from an ExportProductsResponse message. Also converts values to other types if specified. - * @param message ExportProductsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.ExportProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a new Facet instance using the specified properties. + * @param [properties] Properties to set + * @returns Facet instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchResponse.IFacet): google.cloud.retail.v2alpha.SearchResponse.Facet; - /** - * Converts this ExportProductsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified Facet message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.verify|verify} messages. + * @param message Facet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchResponse.IFacet, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of an ExportUserEventsResponse. */ - interface IExportUserEventsResponse { + /** + * Encodes the specified Facet message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.verify|verify} messages. + * @param message Facet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchResponse.IFacet, writer?: $protobuf.Writer): $protobuf.Writer; - /** ExportUserEventsResponse errorSamples */ - errorSamples?: (google.rpc.IStatus[]|null); + /** + * Decodes a Facet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Facet + * @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.SearchResponse.Facet; - /** ExportUserEventsResponse errorsConfig */ - errorsConfig?: (google.cloud.retail.v2alpha.IExportErrorsConfig|null); - } + /** + * Decodes a Facet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Facet + * @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.SearchResponse.Facet; - /** Represents an ExportUserEventsResponse. */ - class ExportUserEventsResponse implements IExportUserEventsResponse { + /** + * Verifies a Facet 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); - /** - * Constructs a new ExportUserEventsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IExportUserEventsResponse); + /** + * Creates a Facet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Facet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse.Facet; - /** ExportUserEventsResponse errorSamples. */ - public errorSamples: google.rpc.IStatus[]; + /** + * Creates a plain object from a Facet message. Also converts values to other types if specified. + * @param message Facet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchResponse.Facet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ExportUserEventsResponse errorsConfig. */ - public errorsConfig?: (google.cloud.retail.v2alpha.IExportErrorsConfig|null); + /** + * Converts this Facet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new ExportUserEventsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportUserEventsResponse instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IExportUserEventsResponse): google.cloud.retail.v2alpha.ExportUserEventsResponse; + namespace Facet { - /** - * Encodes the specified ExportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ExportUserEventsResponse.verify|verify} messages. - * @param message ExportUserEventsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IExportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a FacetValue. */ + interface IFacetValue { - /** - * Encodes the specified ExportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExportUserEventsResponse.verify|verify} messages. - * @param message ExportUserEventsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IExportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** FacetValue value */ + value?: (string|null); - /** - * Decodes an ExportUserEventsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportUserEventsResponse - * @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.ExportUserEventsResponse; + /** FacetValue interval */ + interval?: (google.cloud.retail.v2alpha.IInterval|null); - /** - * Decodes an ExportUserEventsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportUserEventsResponse - * @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.ExportUserEventsResponse; + /** FacetValue count */ + count?: (number|Long|string|null); + } - /** - * Verifies an ExportUserEventsResponse 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); + /** Represents a FacetValue. */ + class FacetValue implements IFacetValue { - /** - * Creates an ExportUserEventsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportUserEventsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ExportUserEventsResponse; + /** + * Constructs a new FacetValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue); - /** - * Creates a plain object from an ExportUserEventsResponse message. Also converts values to other types if specified. - * @param message ExportUserEventsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.ExportUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FacetValue value. */ + public value?: (string|null); - /** - * Converts this ExportUserEventsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FacetValue interval. */ + public interval?: (google.cloud.retail.v2alpha.IInterval|null); - /** Represents a PredictionService */ - class PredictionService extends $protobuf.rpc.Service { + /** FacetValue count. */ + public count: (number|Long|string); - /** - * Constructs a new PredictionService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + /** FacetValue facetValue. */ + public facetValue?: ("value"|"interval"); - /** - * Creates new PredictionService service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): PredictionService; + /** + * Creates a new FacetValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetValue instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue): google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue; - /** - * Calls Predict. - * @param request PredictRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PredictResponse - */ - public predict(request: google.cloud.retail.v2alpha.IPredictRequest, callback: google.cloud.retail.v2alpha.PredictionService.PredictCallback): void; + /** + * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify|verify} messages. + * @param message FacetValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Calls Predict. - * @param request PredictRequest message or plain object - * @returns Promise - */ - public predict(request: google.cloud.retail.v2alpha.IPredictRequest): Promise; - } + /** + * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify|verify} messages. + * @param message FacetValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; - namespace PredictionService { + /** + * Decodes a FacetValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetValue + * @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.SearchResponse.Facet.FacetValue; - /** - * Callback as used by {@link google.cloud.retail.v2alpha.PredictionService#predict}. - * @param error Error, if any - * @param [response] PredictResponse - */ - type PredictCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.PredictResponse) => void; - } + /** + * Decodes a FacetValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetValue + * @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.SearchResponse.Facet.FacetValue; - /** Properties of a PredictRequest. */ - interface IPredictRequest { + /** + * Verifies a FacetValue 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); - /** PredictRequest placement */ - placement?: (string|null); + /** + * Creates a FacetValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue; - /** PredictRequest userEvent */ - userEvent?: (google.cloud.retail.v2alpha.IUserEvent|null); + /** + * Creates a plain object from a FacetValue message. Also converts values to other types if specified. + * @param message FacetValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** PredictRequest pageSize */ - pageSize?: (number|null); + /** + * Converts this FacetValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** PredictRequest pageToken */ - pageToken?: (string|null); + /** Properties of a QueryExpansionInfo. */ + interface IQueryExpansionInfo { - /** PredictRequest filter */ - filter?: (string|null); + /** QueryExpansionInfo expandedQuery */ + expandedQuery?: (boolean|null); - /** PredictRequest validateOnly */ - validateOnly?: (boolean|null); + /** QueryExpansionInfo pinnedResultCount */ + pinnedResultCount?: (number|Long|string|null); + } - /** PredictRequest params */ - params?: ({ [k: string]: google.protobuf.IValue }|null); + /** Represents a QueryExpansionInfo. */ + class QueryExpansionInfo implements IQueryExpansionInfo { - /** PredictRequest labels */ - labels?: ({ [k: string]: string }|null); - } + /** + * Constructs a new QueryExpansionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo); - /** Represents a PredictRequest. */ - class PredictRequest implements IPredictRequest { + /** QueryExpansionInfo expandedQuery. */ + public expandedQuery: boolean; - /** - * Constructs a new PredictRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IPredictRequest); + /** QueryExpansionInfo pinnedResultCount. */ + public pinnedResultCount: (number|Long|string); - /** PredictRequest placement. */ - public placement: string; + /** + * Creates a new QueryExpansionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryExpansionInfo instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo): google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo; - /** PredictRequest userEvent. */ - public userEvent?: (google.cloud.retail.v2alpha.IUserEvent|null); + /** + * Encodes the specified QueryExpansionInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify|verify} messages. + * @param message QueryExpansionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - /** PredictRequest pageSize. */ - public pageSize: number; + /** + * Encodes the specified QueryExpansionInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify|verify} messages. + * @param message QueryExpansionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - /** PredictRequest pageToken. */ - public pageToken: string; + /** + * Decodes a QueryExpansionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryExpansionInfo + * @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.SearchResponse.QueryExpansionInfo; - /** PredictRequest filter. */ - public filter: string; + /** + * Decodes a QueryExpansionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryExpansionInfo + * @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.SearchResponse.QueryExpansionInfo; - /** PredictRequest validateOnly. */ - public validateOnly: boolean; + /** + * Verifies a QueryExpansionInfo 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); - /** PredictRequest params. */ - public params: { [k: string]: google.protobuf.IValue }; + /** + * Creates a QueryExpansionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryExpansionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo; - /** PredictRequest labels. */ - public labels: { [k: string]: string }; + /** + * Creates a plain object from a QueryExpansionInfo message. Also converts values to other types if specified. + * @param message QueryExpansionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new PredictRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PredictRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IPredictRequest): google.cloud.retail.v2alpha.PredictRequest; + /** + * Converts this QueryExpansionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictRequest.verify|verify} messages. - * @param message PredictRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a UserEventService */ + class UserEventService extends $protobuf.rpc.Service { /** - * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictRequest.verify|verify} messages. - * @param message PredictRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Constructs a new UserEventService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Decodes a PredictRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PredictRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Creates new UserEventService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PredictRequest; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): UserEventService; /** - * Decodes a PredictRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PredictRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls WriteUserEvent. + * @param request WriteUserEventRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UserEvent */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PredictRequest; + public writeUserEvent(request: google.cloud.retail.v2alpha.IWriteUserEventRequest, callback: google.cloud.retail.v2alpha.UserEventService.WriteUserEventCallback): void; /** - * Verifies a PredictRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls WriteUserEvent. + * @param request WriteUserEventRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public writeUserEvent(request: google.cloud.retail.v2alpha.IWriteUserEventRequest): Promise; /** - * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PredictRequest + * Calls CollectUserEvent. + * @param request CollectUserEventRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HttpBody */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PredictRequest; + public collectUserEvent(request: google.cloud.retail.v2alpha.ICollectUserEventRequest, callback: google.cloud.retail.v2alpha.UserEventService.CollectUserEventCallback): void; /** - * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. - * @param message PredictRequest - * @param [options] Conversion options - * @returns Plain object + * Calls CollectUserEvent. + * @param request CollectUserEventRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.retail.v2alpha.PredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public collectUserEvent(request: google.cloud.retail.v2alpha.ICollectUserEventRequest): Promise; /** - * Converts this PredictRequest to JSON. - * @returns JSON object + * Calls PurgeUserEvents. + * @param request PurgeUserEventsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PredictResponse. */ - interface IPredictResponse { - - /** PredictResponse results */ - results?: (google.cloud.retail.v2alpha.PredictResponse.IPredictionResult[]|null); - - /** PredictResponse attributionToken */ - attributionToken?: (string|null); - - /** PredictResponse missingIds */ - missingIds?: (string[]|null); - - /** PredictResponse validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a PredictResponse. */ - class PredictResponse implements IPredictResponse { + public purgeUserEvents(request: google.cloud.retail.v2alpha.IPurgeUserEventsRequest, callback: google.cloud.retail.v2alpha.UserEventService.PurgeUserEventsCallback): void; /** - * Constructs a new PredictResponse. - * @param [properties] Properties to set + * Calls PurgeUserEvents. + * @param request PurgeUserEventsRequest message or plain object + * @returns Promise */ - constructor(properties?: google.cloud.retail.v2alpha.IPredictResponse); - - /** PredictResponse results. */ - public results: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult[]; - - /** PredictResponse attributionToken. */ - public attributionToken: string; - - /** PredictResponse missingIds. */ - public missingIds: string[]; - - /** PredictResponse validateOnly. */ - public validateOnly: boolean; + public purgeUserEvents(request: google.cloud.retail.v2alpha.IPurgeUserEventsRequest): Promise; /** - * Creates a new PredictResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns PredictResponse instance + * Calls ImportUserEvents. + * @param request ImportUserEventsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static create(properties?: google.cloud.retail.v2alpha.IPredictResponse): google.cloud.retail.v2alpha.PredictResponse; + public importUserEvents(request: google.cloud.retail.v2alpha.IImportUserEventsRequest, callback: google.cloud.retail.v2alpha.UserEventService.ImportUserEventsCallback): void; /** - * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.verify|verify} messages. - * @param message PredictResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ImportUserEvents. + * @param request ImportUserEventsRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.retail.v2alpha.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public importUserEvents(request: google.cloud.retail.v2alpha.IImportUserEventsRequest): Promise; /** - * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.verify|verify} messages. - * @param message PredictResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls RejoinUserEvents. + * @param request RejoinUserEventsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public rejoinUserEvents(request: google.cloud.retail.v2alpha.IRejoinUserEventsRequest, callback: google.cloud.retail.v2alpha.UserEventService.RejoinUserEventsCallback): void; /** - * Decodes a PredictResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PredictResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls RejoinUserEvents. + * @param request RejoinUserEventsRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PredictResponse; + public rejoinUserEvents(request: google.cloud.retail.v2alpha.IRejoinUserEventsRequest): Promise; + } + + namespace UserEventService { /** - * Decodes a PredictResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PredictResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#writeUserEvent}. + * @param error Error, if any + * @param [response] UserEvent */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PredictResponse; + type WriteUserEventCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.UserEvent) => void; /** - * Verifies a PredictResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#collectUserEvent}. + * @param error Error, if any + * @param [response] HttpBody */ - public static verify(message: { [k: string]: any }): (string|null); + type CollectUserEventCallback = (error: (Error|null), response?: google.api.HttpBody) => void; /** - * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PredictResponse + * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#purgeUserEvents}. + * @param error Error, if any + * @param [response] Operation */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PredictResponse; + type PurgeUserEventsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. - * @param message PredictResponse - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#importUserEvents}. + * @param error Error, if any + * @param [response] Operation */ - public static toObject(message: google.cloud.retail.v2alpha.PredictResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type ImportUserEventsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Converts this PredictResponse to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#rejoinUserEvents}. + * @param error Error, if any + * @param [response] Operation */ - public toJSON(): { [k: string]: any }; + type RejoinUserEventsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } - namespace PredictResponse { - - /** Properties of a PredictionResult. */ - interface IPredictionResult { - - /** PredictionResult id */ - id?: (string|null); - - /** PredictionResult metadata */ - metadata?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a PredictionResult. */ - class PredictionResult implements IPredictionResult { - - /** - * Constructs a new PredictionResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult); - - /** PredictionResult id. */ - public id: string; - - /** PredictionResult metadata. */ - public metadata: { [k: string]: google.protobuf.IValue }; + /** Properties of a WriteUserEventRequest. */ + interface IWriteUserEventRequest { - /** - * Creates a new PredictionResult instance using the specified properties. - * @param [properties] Properties to set - * @returns PredictionResult instance - */ - public static create(properties?: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult): google.cloud.retail.v2alpha.PredictResponse.PredictionResult; + /** WriteUserEventRequest parent */ + parent?: (string|null); - /** - * Encodes the specified PredictionResult message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify|verify} messages. - * @param message PredictionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** WriteUserEventRequest userEvent */ + userEvent?: (google.cloud.retail.v2alpha.IUserEvent|null); + } - /** - * Encodes the specified PredictionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify|verify} messages. - * @param message PredictionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a WriteUserEventRequest. */ + class WriteUserEventRequest implements IWriteUserEventRequest { - /** - * Decodes a PredictionResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PredictionResult - * @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.PredictResponse.PredictionResult; + /** + * Constructs a new WriteUserEventRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IWriteUserEventRequest); - /** - * Decodes a PredictionResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PredictionResult - * @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.PredictResponse.PredictionResult; + /** WriteUserEventRequest parent. */ + public parent: string; - /** - * Verifies a PredictionResult 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); + /** WriteUserEventRequest userEvent. */ + public userEvent?: (google.cloud.retail.v2alpha.IUserEvent|null); - /** - * Creates a PredictionResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PredictionResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PredictResponse.PredictionResult; + /** + * Creates a new WriteUserEventRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WriteUserEventRequest instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IWriteUserEventRequest): google.cloud.retail.v2alpha.WriteUserEventRequest; - /** - * Creates a plain object from a PredictionResult message. Also converts values to other types if specified. - * @param message PredictionResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.PredictResponse.PredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified WriteUserEventRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.WriteUserEventRequest.verify|verify} messages. + * @param message WriteUserEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IWriteUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this PredictionResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Encodes the specified WriteUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.WriteUserEventRequest.verify|verify} messages. + * @param message WriteUserEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IWriteUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a ProductService */ - class ProductService extends $protobuf.rpc.Service { + /** + * Decodes a WriteUserEventRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WriteUserEventRequest + * @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.WriteUserEventRequest; /** - * Constructs a new ProductService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Decodes a WriteUserEventRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WriteUserEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.WriteUserEventRequest; /** - * Creates new ProductService service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. + * Verifies a WriteUserEventRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ProductService; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls CreateProduct. - * @param request CreateProductRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Product + * Creates a WriteUserEventRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WriteUserEventRequest */ - public createProduct(request: google.cloud.retail.v2alpha.ICreateProductRequest, callback: google.cloud.retail.v2alpha.ProductService.CreateProductCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.WriteUserEventRequest; /** - * Calls CreateProduct. - * @param request CreateProductRequest message or plain object - * @returns Promise + * Creates a plain object from a WriteUserEventRequest message. Also converts values to other types if specified. + * @param message WriteUserEventRequest + * @param [options] Conversion options + * @returns Plain object */ - public createProduct(request: google.cloud.retail.v2alpha.ICreateProductRequest): Promise; + public static toObject(message: google.cloud.retail.v2alpha.WriteUserEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls GetProduct. - * @param request GetProductRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Product + * Converts this WriteUserEventRequest to JSON. + * @returns JSON object */ - public getProduct(request: google.cloud.retail.v2alpha.IGetProductRequest, callback: google.cloud.retail.v2alpha.ProductService.GetProductCallback): void; + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CollectUserEventRequest. */ + interface ICollectUserEventRequest { + + /** CollectUserEventRequest parent */ + parent?: (string|null); + + /** CollectUserEventRequest userEvent */ + userEvent?: (string|null); + + /** CollectUserEventRequest uri */ + uri?: (string|null); + + /** CollectUserEventRequest ets */ + ets?: (number|Long|string|null); + } + + /** Represents a CollectUserEventRequest. */ + class CollectUserEventRequest implements ICollectUserEventRequest { /** - * Calls GetProduct. - * @param request GetProductRequest message or plain object - * @returns Promise + * Constructs a new CollectUserEventRequest. + * @param [properties] Properties to set */ - public getProduct(request: google.cloud.retail.v2alpha.IGetProductRequest): Promise; + constructor(properties?: google.cloud.retail.v2alpha.ICollectUserEventRequest); + + /** CollectUserEventRequest parent. */ + public parent: string; + + /** CollectUserEventRequest userEvent. */ + public userEvent: string; + + /** CollectUserEventRequest uri. */ + public uri: string; + + /** CollectUserEventRequest ets. */ + public ets: (number|Long|string); /** - * Calls ListProducts. - * @param request ListProductsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListProductsResponse + * Creates a new CollectUserEventRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CollectUserEventRequest instance */ - public listProducts(request: google.cloud.retail.v2alpha.IListProductsRequest, callback: google.cloud.retail.v2alpha.ProductService.ListProductsCallback): void; + public static create(properties?: google.cloud.retail.v2alpha.ICollectUserEventRequest): google.cloud.retail.v2alpha.CollectUserEventRequest; /** - * Calls ListProducts. - * @param request ListProductsRequest message or plain object - * @returns Promise + * Encodes the specified CollectUserEventRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CollectUserEventRequest.verify|verify} messages. + * @param message CollectUserEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listProducts(request: google.cloud.retail.v2alpha.IListProductsRequest): Promise; + public static encode(message: google.cloud.retail.v2alpha.ICollectUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateProduct. - * @param request UpdateProductRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Product + * Encodes the specified CollectUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CollectUserEventRequest.verify|verify} messages. + * @param message CollectUserEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public updateProduct(request: google.cloud.retail.v2alpha.IUpdateProductRequest, callback: google.cloud.retail.v2alpha.ProductService.UpdateProductCallback): void; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICollectUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateProduct. - * @param request UpdateProductRequest message or plain object - * @returns Promise + * Decodes a CollectUserEventRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CollectUserEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public updateProduct(request: google.cloud.retail.v2alpha.IUpdateProductRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CollectUserEventRequest; /** - * Calls DeleteProduct. - * @param request DeleteProductRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Decodes a CollectUserEventRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CollectUserEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public deleteProduct(request: google.cloud.retail.v2alpha.IDeleteProductRequest, callback: google.cloud.retail.v2alpha.ProductService.DeleteProductCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CollectUserEventRequest; /** - * Calls DeleteProduct. - * @param request DeleteProductRequest message or plain object - * @returns Promise + * Verifies a CollectUserEventRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public deleteProduct(request: google.cloud.retail.v2alpha.IDeleteProductRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls ImportProducts. - * @param request ImportProductsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a CollectUserEventRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CollectUserEventRequest */ - public importProducts(request: google.cloud.retail.v2alpha.IImportProductsRequest, callback: google.cloud.retail.v2alpha.ProductService.ImportProductsCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CollectUserEventRequest; /** - * Calls ImportProducts. - * @param request ImportProductsRequest message or plain object - * @returns Promise + * Creates a plain object from a CollectUserEventRequest message. Also converts values to other types if specified. + * @param message CollectUserEventRequest + * @param [options] Conversion options + * @returns Plain object */ - public importProducts(request: google.cloud.retail.v2alpha.IImportProductsRequest): Promise; + public static toObject(message: google.cloud.retail.v2alpha.CollectUserEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls SetInventory. - * @param request SetInventoryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Converts this CollectUserEventRequest to JSON. + * @returns JSON object */ - public setInventory(request: google.cloud.retail.v2alpha.ISetInventoryRequest, callback: google.cloud.retail.v2alpha.ProductService.SetInventoryCallback): void; + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RejoinUserEventsRequest. */ + interface IRejoinUserEventsRequest { + + /** RejoinUserEventsRequest parent */ + parent?: (string|null); + + /** RejoinUserEventsRequest userEventRejoinScope */ + userEventRejoinScope?: (google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope|keyof typeof google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope|null); + } + + /** Represents a RejoinUserEventsRequest. */ + class RejoinUserEventsRequest implements IRejoinUserEventsRequest { /** - * Calls SetInventory. - * @param request SetInventoryRequest message or plain object - * @returns Promise + * Constructs a new RejoinUserEventsRequest. + * @param [properties] Properties to set */ - public setInventory(request: google.cloud.retail.v2alpha.ISetInventoryRequest): Promise; + constructor(properties?: google.cloud.retail.v2alpha.IRejoinUserEventsRequest); + + /** RejoinUserEventsRequest parent. */ + public parent: string; + + /** RejoinUserEventsRequest userEventRejoinScope. */ + public userEventRejoinScope: (google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope|keyof typeof google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope); /** - * Calls AddFulfillmentPlaces. - * @param request AddFulfillmentPlacesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a new RejoinUserEventsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RejoinUserEventsRequest instance */ - public addFulfillmentPlaces(request: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest, callback: google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlacesCallback): void; + public static create(properties?: google.cloud.retail.v2alpha.IRejoinUserEventsRequest): google.cloud.retail.v2alpha.RejoinUserEventsRequest; + + /** + * Encodes the specified RejoinUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsRequest.verify|verify} messages. + * @param message RejoinUserEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IRejoinUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls AddFulfillmentPlaces. - * @param request AddFulfillmentPlacesRequest message or plain object - * @returns Promise + * Encodes the specified RejoinUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsRequest.verify|verify} messages. + * @param message RejoinUserEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public addFulfillmentPlaces(request: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest): Promise; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRejoinUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls RemoveFulfillmentPlaces. - * @param request RemoveFulfillmentPlacesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Decodes a RejoinUserEventsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RejoinUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public removeFulfillmentPlaces(request: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest, callback: google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlacesCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RejoinUserEventsRequest; /** - * Calls RemoveFulfillmentPlaces. - * @param request RemoveFulfillmentPlacesRequest message or plain object - * @returns Promise + * Decodes a RejoinUserEventsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RejoinUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public removeFulfillmentPlaces(request: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RejoinUserEventsRequest; /** - * Calls AddLocalInventories. - * @param request AddLocalInventoriesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Verifies a RejoinUserEventsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public addLocalInventories(request: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest, callback: google.cloud.retail.v2alpha.ProductService.AddLocalInventoriesCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls AddLocalInventories. - * @param request AddLocalInventoriesRequest message or plain object - * @returns Promise + * Creates a RejoinUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RejoinUserEventsRequest */ - public addLocalInventories(request: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RejoinUserEventsRequest; /** - * Calls RemoveLocalInventories. - * @param request RemoveLocalInventoriesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a plain object from a RejoinUserEventsRequest message. Also converts values to other types if specified. + * @param message RejoinUserEventsRequest + * @param [options] Conversion options + * @returns Plain object */ - public removeLocalInventories(request: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest, callback: google.cloud.retail.v2alpha.ProductService.RemoveLocalInventoriesCallback): void; + public static toObject(message: google.cloud.retail.v2alpha.RejoinUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls RemoveLocalInventories. - * @param request RemoveLocalInventoriesRequest message or plain object - * @returns Promise + * Converts this RejoinUserEventsRequest to JSON. + * @returns JSON object */ - public removeLocalInventories(request: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest): Promise; + public toJSON(): { [k: string]: any }; } - namespace ProductService { + namespace RejoinUserEventsRequest { - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#createProduct}. - * @param error Error, if any - * @param [response] Product - */ - type CreateProductCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Product) => void; + /** UserEventRejoinScope enum. */ + enum UserEventRejoinScope { + USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0, + JOINED_EVENTS = 1, + UNJOINED_EVENTS = 2 + } + } + + /** Properties of a RejoinUserEventsResponse. */ + interface IRejoinUserEventsResponse { + + /** RejoinUserEventsResponse rejoinedUserEventsCount */ + rejoinedUserEventsCount?: (number|Long|string|null); + } + + /** Represents a RejoinUserEventsResponse. */ + class RejoinUserEventsResponse implements IRejoinUserEventsResponse { /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#getProduct}. - * @param error Error, if any - * @param [response] Product + * Constructs a new RejoinUserEventsResponse. + * @param [properties] Properties to set */ - type GetProductCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Product) => void; + constructor(properties?: google.cloud.retail.v2alpha.IRejoinUserEventsResponse); + + /** RejoinUserEventsResponse rejoinedUserEventsCount. */ + public rejoinedUserEventsCount: (number|Long|string); /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#listProducts}. - * @param error Error, if any - * @param [response] ListProductsResponse + * Creates a new RejoinUserEventsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RejoinUserEventsResponse instance */ - type ListProductsCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.ListProductsResponse) => void; + public static create(properties?: google.cloud.retail.v2alpha.IRejoinUserEventsResponse): google.cloud.retail.v2alpha.RejoinUserEventsResponse; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#updateProduct}. - * @param error Error, if any - * @param [response] Product + * Encodes the specified RejoinUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsResponse.verify|verify} messages. + * @param message RejoinUserEventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type UpdateProductCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Product) => void; + public static encode(message: google.cloud.retail.v2alpha.IRejoinUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#deleteProduct}. - * @param error Error, if any - * @param [response] Empty + * Encodes the specified RejoinUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsResponse.verify|verify} messages. + * @param message RejoinUserEventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type DeleteProductCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRejoinUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#importProducts}. - * @param error Error, if any - * @param [response] Operation + * Decodes a RejoinUserEventsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RejoinUserEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type ImportProductsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RejoinUserEventsResponse; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#setInventory}. - * @param error Error, if any - * @param [response] Operation + * Decodes a RejoinUserEventsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RejoinUserEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type SetInventoryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RejoinUserEventsResponse; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#addFulfillmentPlaces}. - * @param error Error, if any - * @param [response] Operation + * Verifies a RejoinUserEventsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type AddFulfillmentPlacesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#removeFulfillmentPlaces}. - * @param error Error, if any - * @param [response] Operation + * Creates a RejoinUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RejoinUserEventsResponse */ - type RemoveFulfillmentPlacesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RejoinUserEventsResponse; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#addLocalInventories}. - * @param error Error, if any - * @param [response] Operation + * Creates a plain object from a RejoinUserEventsResponse message. Also converts values to other types if specified. + * @param message RejoinUserEventsResponse + * @param [options] Conversion options + * @returns Plain object */ - type AddLocalInventoriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static toObject(message: google.cloud.retail.v2alpha.RejoinUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#removeLocalInventories}. - * @param error Error, if any - * @param [response] Operation + * Converts this RejoinUserEventsResponse to JSON. + * @returns JSON object */ - type RemoveLocalInventoriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public toJSON(): { [k: string]: any }; } - /** Properties of a CreateProductRequest. */ - interface ICreateProductRequest { - - /** CreateProductRequest parent */ - parent?: (string|null); - - /** CreateProductRequest product */ - product?: (google.cloud.retail.v2alpha.IProduct|null); - - /** CreateProductRequest productId */ - productId?: (string|null); + /** Properties of a RejoinUserEventsMetadata. */ + interface IRejoinUserEventsMetadata { } - /** Represents a CreateProductRequest. */ - class CreateProductRequest implements ICreateProductRequest { + /** Represents a RejoinUserEventsMetadata. */ + class RejoinUserEventsMetadata implements IRejoinUserEventsMetadata { /** - * Constructs a new CreateProductRequest. + * Constructs a new RejoinUserEventsMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICreateProductRequest); - - /** CreateProductRequest parent. */ - public parent: string; - - /** CreateProductRequest product. */ - public product?: (google.cloud.retail.v2alpha.IProduct|null); - - /** CreateProductRequest productId. */ - public productId: string; + constructor(properties?: google.cloud.retail.v2alpha.IRejoinUserEventsMetadata); /** - * Creates a new CreateProductRequest instance using the specified properties. + * Creates a new RejoinUserEventsMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns CreateProductRequest instance + * @returns RejoinUserEventsMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICreateProductRequest): google.cloud.retail.v2alpha.CreateProductRequest; + public static create(properties?: google.cloud.retail.v2alpha.IRejoinUserEventsMetadata): google.cloud.retail.v2alpha.RejoinUserEventsMetadata; /** - * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateProductRequest.verify|verify} messages. - * @param message CreateProductRequest message or plain object to encode + * Encodes the specified RejoinUserEventsMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsMetadata.verify|verify} messages. + * @param message RejoinUserEventsMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IRejoinUserEventsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateProductRequest.verify|verify} messages. - * @param message CreateProductRequest message or plain object to encode + * Encodes the specified RejoinUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsMetadata.verify|verify} messages. + * @param message RejoinUserEventsMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRejoinUserEventsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateProductRequest message from the specified reader or buffer. + * Decodes a RejoinUserEventsMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateProductRequest + * @returns RejoinUserEventsMetadata * @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.CreateProductRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RejoinUserEventsMetadata; /** - * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. + * Decodes a RejoinUserEventsMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateProductRequest + * @returns RejoinUserEventsMetadata * @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.CreateProductRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RejoinUserEventsMetadata; /** - * Verifies a CreateProductRequest message. + * Verifies a RejoinUserEventsMetadata 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 CreateProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RejoinUserEventsMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateProductRequest + * @returns RejoinUserEventsMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CreateProductRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RejoinUserEventsMetadata; /** - * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. - * @param message CreateProductRequest + * Creates a plain object from a RejoinUserEventsMetadata message. Also converts values to other types if specified. + * @param message RejoinUserEventsMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.CreateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.RejoinUserEventsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateProductRequest to JSON. + * Converts this RejoinUserEventsMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } + + /** Namespace v2beta. */ + namespace v2beta { - /** Properties of a GetProductRequest. */ - interface IGetProductRequest { + /** Properties of a ProductLevelConfig. */ + interface IProductLevelConfig { - /** GetProductRequest name */ - name?: (string|null); + /** ProductLevelConfig ingestionProductType */ + ingestionProductType?: (string|null); + + /** ProductLevelConfig merchantCenterProductIdField */ + merchantCenterProductIdField?: (string|null); } - /** Represents a GetProductRequest. */ - class GetProductRequest implements IGetProductRequest { + /** Represents a ProductLevelConfig. */ + class ProductLevelConfig implements IProductLevelConfig { /** - * Constructs a new GetProductRequest. + * Constructs a new ProductLevelConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IGetProductRequest); + constructor(properties?: google.cloud.retail.v2beta.IProductLevelConfig); - /** GetProductRequest name. */ - public name: string; + /** ProductLevelConfig ingestionProductType. */ + public ingestionProductType: string; + + /** ProductLevelConfig merchantCenterProductIdField. */ + public merchantCenterProductIdField: string; /** - * Creates a new GetProductRequest instance using the specified properties. + * Creates a new ProductLevelConfig instance using the specified properties. * @param [properties] Properties to set - * @returns GetProductRequest instance + * @returns ProductLevelConfig instance */ - public static create(properties?: google.cloud.retail.v2alpha.IGetProductRequest): google.cloud.retail.v2alpha.GetProductRequest; + public static create(properties?: google.cloud.retail.v2beta.IProductLevelConfig): google.cloud.retail.v2beta.ProductLevelConfig; /** - * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetProductRequest.verify|verify} messages. - * @param message GetProductRequest message or plain object to encode + * Encodes the specified ProductLevelConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ProductLevelConfig.verify|verify} messages. + * @param message ProductLevelConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IProductLevelConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetProductRequest.verify|verify} messages. - * @param message GetProductRequest message or plain object to encode + * Encodes the specified ProductLevelConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ProductLevelConfig.verify|verify} messages. + * @param message ProductLevelConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IProductLevelConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetProductRequest message from the specified reader or buffer. + * Decodes a ProductLevelConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetProductRequest + * @returns ProductLevelConfig * @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.GetProductRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ProductLevelConfig; /** - * Decodes a GetProductRequest message from the specified reader or buffer, length delimited. + * Decodes a ProductLevelConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetProductRequest + * @returns ProductLevelConfig * @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.GetProductRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ProductLevelConfig; /** - * Verifies a GetProductRequest message. + * Verifies a ProductLevelConfig 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 GetProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ProductLevelConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetProductRequest + * @returns ProductLevelConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetProductRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ProductLevelConfig; /** - * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. - * @param message GetProductRequest + * Creates a plain object from a ProductLevelConfig message. Also converts values to other types if specified. + * @param message ProductLevelConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.GetProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.ProductLevelConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetProductRequest to JSON. + * Converts this ProductLevelConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateProductRequest. */ - interface IUpdateProductRequest { + /** Properties of a CatalogAttribute. */ + interface ICatalogAttribute { - /** UpdateProductRequest product */ - product?: (google.cloud.retail.v2alpha.IProduct|null); + /** CatalogAttribute key */ + key?: (string|null); - /** UpdateProductRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** CatalogAttribute inUse */ + inUse?: (boolean|null); - /** UpdateProductRequest allowMissing */ - allowMissing?: (boolean|null); + /** CatalogAttribute type */ + type?: (google.cloud.retail.v2beta.CatalogAttribute.AttributeType|keyof typeof google.cloud.retail.v2beta.CatalogAttribute.AttributeType|null); + + /** CatalogAttribute indexableOption */ + indexableOption?: (google.cloud.retail.v2beta.CatalogAttribute.IndexableOption|keyof typeof google.cloud.retail.v2beta.CatalogAttribute.IndexableOption|null); + + /** CatalogAttribute dynamicFacetableOption */ + dynamicFacetableOption?: (google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption|keyof typeof google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption|null); + + /** CatalogAttribute searchableOption */ + searchableOption?: (google.cloud.retail.v2beta.CatalogAttribute.SearchableOption|keyof typeof google.cloud.retail.v2beta.CatalogAttribute.SearchableOption|null); } - /** Represents an UpdateProductRequest. */ - class UpdateProductRequest implements IUpdateProductRequest { + /** Represents a CatalogAttribute. */ + class CatalogAttribute implements ICatalogAttribute { /** - * Constructs a new UpdateProductRequest. + * Constructs a new CatalogAttribute. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IUpdateProductRequest); + constructor(properties?: google.cloud.retail.v2beta.ICatalogAttribute); - /** UpdateProductRequest product. */ - public product?: (google.cloud.retail.v2alpha.IProduct|null); + /** CatalogAttribute key. */ + public key: string; - /** UpdateProductRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** CatalogAttribute inUse. */ + public inUse: boolean; - /** UpdateProductRequest allowMissing. */ - public allowMissing: boolean; + /** CatalogAttribute type. */ + public type: (google.cloud.retail.v2beta.CatalogAttribute.AttributeType|keyof typeof google.cloud.retail.v2beta.CatalogAttribute.AttributeType); + + /** CatalogAttribute indexableOption. */ + public indexableOption: (google.cloud.retail.v2beta.CatalogAttribute.IndexableOption|keyof typeof google.cloud.retail.v2beta.CatalogAttribute.IndexableOption); + + /** CatalogAttribute dynamicFacetableOption. */ + public dynamicFacetableOption: (google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption|keyof typeof google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption); + + /** CatalogAttribute searchableOption. */ + public searchableOption: (google.cloud.retail.v2beta.CatalogAttribute.SearchableOption|keyof typeof google.cloud.retail.v2beta.CatalogAttribute.SearchableOption); /** - * Creates a new UpdateProductRequest instance using the specified properties. + * Creates a new CatalogAttribute instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateProductRequest instance + * @returns CatalogAttribute instance */ - public static create(properties?: google.cloud.retail.v2alpha.IUpdateProductRequest): google.cloud.retail.v2alpha.UpdateProductRequest; + public static create(properties?: google.cloud.retail.v2beta.ICatalogAttribute): google.cloud.retail.v2beta.CatalogAttribute; /** - * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateProductRequest.verify|verify} messages. - * @param message UpdateProductRequest message or plain object to encode + * Encodes the specified CatalogAttribute message. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.verify|verify} messages. + * @param message CatalogAttribute message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.ICatalogAttribute, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateProductRequest.verify|verify} messages. - * @param message UpdateProductRequest message or plain object to encode + * Encodes the specified CatalogAttribute message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.verify|verify} messages. + * @param message CatalogAttribute message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.ICatalogAttribute, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateProductRequest message from the specified reader or buffer. + * Decodes a CatalogAttribute message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateProductRequest + * @returns CatalogAttribute * @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.UpdateProductRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.CatalogAttribute; /** - * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. + * Decodes a CatalogAttribute message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateProductRequest + * @returns CatalogAttribute * @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.UpdateProductRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.CatalogAttribute; /** - * Verifies an UpdateProductRequest message. + * Verifies a CatalogAttribute 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 UpdateProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CatalogAttribute message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateProductRequest + * @returns CatalogAttribute */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateProductRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CatalogAttribute; /** - * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. - * @param message UpdateProductRequest + * Creates a plain object from a CatalogAttribute message. Also converts values to other types if specified. + * @param message CatalogAttribute * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.UpdateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.CatalogAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateProductRequest to JSON. + * Converts this CatalogAttribute to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteProductRequest. */ - interface IDeleteProductRequest { + namespace CatalogAttribute { - /** DeleteProductRequest name */ + /** AttributeType enum. */ + enum AttributeType { + UNKNOWN = 0, + TEXTUAL = 1, + NUMERICAL = 2 + } + + /** IndexableOption enum. */ + enum IndexableOption { + INDEXABLE_OPTION_UNSPECIFIED = 0, + INDEXABLE_ENABLED = 1, + INDEXABLE_DISABLED = 2 + } + + /** DynamicFacetableOption enum. */ + enum DynamicFacetableOption { + DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0, + DYNAMIC_FACETABLE_ENABLED = 1, + DYNAMIC_FACETABLE_DISABLED = 2 + } + + /** SearchableOption enum. */ + enum SearchableOption { + SEARCHABLE_OPTION_UNSPECIFIED = 0, + SEARCHABLE_ENABLED = 1, + SEARCHABLE_DISABLED = 2 + } + } + + /** Properties of an AttributesConfig. */ + interface IAttributesConfig { + + /** AttributesConfig name */ name?: (string|null); + + /** AttributesConfig catalogAttributes */ + catalogAttributes?: ({ [k: string]: google.cloud.retail.v2beta.ICatalogAttribute }|null); + + /** AttributesConfig attributeConfigLevel */ + attributeConfigLevel?: (google.cloud.retail.v2beta.AttributeConfigLevel|keyof typeof google.cloud.retail.v2beta.AttributeConfigLevel|null); } - /** Represents a DeleteProductRequest. */ - class DeleteProductRequest implements IDeleteProductRequest { + /** Represents an AttributesConfig. */ + class AttributesConfig implements IAttributesConfig { /** - * Constructs a new DeleteProductRequest. + * Constructs a new AttributesConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IDeleteProductRequest); + constructor(properties?: google.cloud.retail.v2beta.IAttributesConfig); - /** DeleteProductRequest name. */ + /** AttributesConfig name. */ public name: string; + /** AttributesConfig catalogAttributes. */ + public catalogAttributes: { [k: string]: google.cloud.retail.v2beta.ICatalogAttribute }; + + /** AttributesConfig attributeConfigLevel. */ + public attributeConfigLevel: (google.cloud.retail.v2beta.AttributeConfigLevel|keyof typeof google.cloud.retail.v2beta.AttributeConfigLevel); + /** - * Creates a new DeleteProductRequest instance using the specified properties. + * Creates a new AttributesConfig instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteProductRequest instance + * @returns AttributesConfig instance */ - public static create(properties?: google.cloud.retail.v2alpha.IDeleteProductRequest): google.cloud.retail.v2alpha.DeleteProductRequest; + public static create(properties?: google.cloud.retail.v2beta.IAttributesConfig): google.cloud.retail.v2beta.AttributesConfig; /** - * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteProductRequest.verify|verify} messages. - * @param message DeleteProductRequest message or plain object to encode + * Encodes the specified AttributesConfig message. Does not implicitly {@link google.cloud.retail.v2beta.AttributesConfig.verify|verify} messages. + * @param message AttributesConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IAttributesConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteProductRequest.verify|verify} messages. - * @param message DeleteProductRequest message or plain object to encode + * Encodes the specified AttributesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AttributesConfig.verify|verify} messages. + * @param message AttributesConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IAttributesConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteProductRequest message from the specified reader or buffer. + * Decodes an AttributesConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteProductRequest + * @returns AttributesConfig * @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.DeleteProductRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.AttributesConfig; /** - * Decodes a DeleteProductRequest message from the specified reader or buffer, length delimited. + * Decodes an AttributesConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteProductRequest + * @returns AttributesConfig * @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.DeleteProductRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.AttributesConfig; /** - * Verifies a DeleteProductRequest message. + * Verifies an AttributesConfig 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 DeleteProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AttributesConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteProductRequest + * @returns AttributesConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.DeleteProductRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.AttributesConfig; /** - * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. - * @param message DeleteProductRequest + * Creates a plain object from an AttributesConfig message. Also converts values to other types if specified. + * @param message AttributesConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.DeleteProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.AttributesConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteProductRequest to JSON. + * Converts this AttributesConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListProductsRequest. */ - interface IListProductsRequest { + /** Properties of a CompletionConfig. */ + interface ICompletionConfig { - /** ListProductsRequest parent */ - parent?: (string|null); + /** CompletionConfig name */ + name?: (string|null); - /** ListProductsRequest pageSize */ - pageSize?: (number|null); + /** CompletionConfig matchingOrder */ + matchingOrder?: (string|null); - /** ListProductsRequest pageToken */ - pageToken?: (string|null); + /** CompletionConfig maxSuggestions */ + maxSuggestions?: (number|null); - /** ListProductsRequest filter */ - filter?: (string|null); + /** CompletionConfig minPrefixLength */ + minPrefixLength?: (number|null); - /** ListProductsRequest readMask */ - readMask?: (google.protobuf.IFieldMask|null); + /** CompletionConfig autoLearning */ + autoLearning?: (boolean|null); - /** ListProductsRequest requireTotalSize */ - requireTotalSize?: (boolean|null); + /** CompletionConfig suggestionsInputConfig */ + suggestionsInputConfig?: (google.cloud.retail.v2beta.ICompletionDataInputConfig|null); + + /** CompletionConfig lastSuggestionsImportOperation */ + lastSuggestionsImportOperation?: (string|null); + + /** CompletionConfig denylistInputConfig */ + denylistInputConfig?: (google.cloud.retail.v2beta.ICompletionDataInputConfig|null); + + /** CompletionConfig lastDenylistImportOperation */ + lastDenylistImportOperation?: (string|null); + + /** CompletionConfig allowlistInputConfig */ + allowlistInputConfig?: (google.cloud.retail.v2beta.ICompletionDataInputConfig|null); + + /** CompletionConfig lastAllowlistImportOperation */ + lastAllowlistImportOperation?: (string|null); } - /** Represents a ListProductsRequest. */ - class ListProductsRequest implements IListProductsRequest { + /** Represents a CompletionConfig. */ + class CompletionConfig implements ICompletionConfig { /** - * Constructs a new ListProductsRequest. + * Constructs a new CompletionConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IListProductsRequest); + constructor(properties?: google.cloud.retail.v2beta.ICompletionConfig); - /** ListProductsRequest parent. */ - public parent: string; + /** CompletionConfig name. */ + public name: string; - /** ListProductsRequest pageSize. */ - public pageSize: number; + /** CompletionConfig matchingOrder. */ + public matchingOrder: string; - /** ListProductsRequest pageToken. */ - public pageToken: string; + /** CompletionConfig maxSuggestions. */ + public maxSuggestions: number; - /** ListProductsRequest filter. */ - public filter: string; + /** CompletionConfig minPrefixLength. */ + public minPrefixLength: number; - /** ListProductsRequest readMask. */ - public readMask?: (google.protobuf.IFieldMask|null); + /** CompletionConfig autoLearning. */ + public autoLearning: boolean; - /** ListProductsRequest requireTotalSize. */ - public requireTotalSize: boolean; + /** CompletionConfig suggestionsInputConfig. */ + public suggestionsInputConfig?: (google.cloud.retail.v2beta.ICompletionDataInputConfig|null); + + /** CompletionConfig lastSuggestionsImportOperation. */ + public lastSuggestionsImportOperation: string; + + /** CompletionConfig denylistInputConfig. */ + public denylistInputConfig?: (google.cloud.retail.v2beta.ICompletionDataInputConfig|null); + + /** CompletionConfig lastDenylistImportOperation. */ + public lastDenylistImportOperation: string; + + /** CompletionConfig allowlistInputConfig. */ + public allowlistInputConfig?: (google.cloud.retail.v2beta.ICompletionDataInputConfig|null); + + /** CompletionConfig lastAllowlistImportOperation. */ + public lastAllowlistImportOperation: string; /** - * Creates a new ListProductsRequest instance using the specified properties. + * Creates a new CompletionConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ListProductsRequest instance + * @returns CompletionConfig instance */ - public static create(properties?: google.cloud.retail.v2alpha.IListProductsRequest): google.cloud.retail.v2alpha.ListProductsRequest; + public static create(properties?: google.cloud.retail.v2beta.ICompletionConfig): google.cloud.retail.v2beta.CompletionConfig; /** - * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsRequest.verify|verify} messages. - * @param message ListProductsRequest message or plain object to encode + * Encodes the specified CompletionConfig message. Does not implicitly {@link google.cloud.retail.v2beta.CompletionConfig.verify|verify} messages. + * @param message CompletionConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.ICompletionConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsRequest.verify|verify} messages. - * @param message ListProductsRequest message or plain object to encode + * Encodes the specified CompletionConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompletionConfig.verify|verify} messages. + * @param message CompletionConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.ICompletionConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListProductsRequest message from the specified reader or buffer. + * Decodes a CompletionConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListProductsRequest + * @returns CompletionConfig * @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.ListProductsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.CompletionConfig; /** - * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. + * Decodes a CompletionConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListProductsRequest + * @returns CompletionConfig * @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.ListProductsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.CompletionConfig; /** - * Verifies a ListProductsRequest message. + * Verifies a CompletionConfig 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 ListProductsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CompletionConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListProductsRequest + * @returns CompletionConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListProductsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CompletionConfig; /** - * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. - * @param message ListProductsRequest + * Creates a plain object from a CompletionConfig message. Also converts values to other types if specified. + * @param message CompletionConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ListProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.CompletionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListProductsRequest to JSON. + * Converts this CompletionConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListProductsResponse. */ - interface IListProductsResponse { + /** Properties of a MerchantCenterLink. */ + interface IMerchantCenterLink { - /** ListProductsResponse products */ - products?: (google.cloud.retail.v2alpha.IProduct[]|null); + /** MerchantCenterLink merchantCenterAccountId */ + merchantCenterAccountId?: (number|Long|string|null); - /** ListProductsResponse nextPageToken */ - nextPageToken?: (string|null); + /** MerchantCenterLink branchId */ + branchId?: (string|null); - /** ListProductsResponse totalSize */ - totalSize?: (number|null); + /** MerchantCenterLink destinations */ + destinations?: (string[]|null); + + /** MerchantCenterLink regionCode */ + regionCode?: (string|null); + + /** MerchantCenterLink languageCode */ + languageCode?: (string|null); } - /** Represents a ListProductsResponse. */ - class ListProductsResponse implements IListProductsResponse { + /** Represents a MerchantCenterLink. */ + class MerchantCenterLink implements IMerchantCenterLink { /** - * Constructs a new ListProductsResponse. + * Constructs a new MerchantCenterLink. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IListProductsResponse); + constructor(properties?: google.cloud.retail.v2beta.IMerchantCenterLink); - /** ListProductsResponse products. */ - public products: google.cloud.retail.v2alpha.IProduct[]; + /** MerchantCenterLink merchantCenterAccountId. */ + public merchantCenterAccountId: (number|Long|string); - /** ListProductsResponse nextPageToken. */ - public nextPageToken: string; + /** MerchantCenterLink branchId. */ + public branchId: string; - /** ListProductsResponse totalSize. */ - public totalSize: number; + /** MerchantCenterLink destinations. */ + public destinations: string[]; + + /** MerchantCenterLink regionCode. */ + public regionCode: string; + + /** MerchantCenterLink languageCode. */ + public languageCode: string; /** - * Creates a new ListProductsResponse instance using the specified properties. + * Creates a new MerchantCenterLink instance using the specified properties. * @param [properties] Properties to set - * @returns ListProductsResponse instance + * @returns MerchantCenterLink instance */ - public static create(properties?: google.cloud.retail.v2alpha.IListProductsResponse): google.cloud.retail.v2alpha.ListProductsResponse; + public static create(properties?: google.cloud.retail.v2beta.IMerchantCenterLink): google.cloud.retail.v2beta.MerchantCenterLink; /** - * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsResponse.verify|verify} messages. - * @param message ListProductsResponse message or plain object to encode + * Encodes the specified MerchantCenterLink message. Does not implicitly {@link google.cloud.retail.v2beta.MerchantCenterLink.verify|verify} messages. + * @param message MerchantCenterLink message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IMerchantCenterLink, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsResponse.verify|verify} messages. - * @param message ListProductsResponse message or plain object to encode + * Encodes the specified MerchantCenterLink message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.MerchantCenterLink.verify|verify} messages. + * @param message MerchantCenterLink message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IMerchantCenterLink, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListProductsResponse message from the specified reader or buffer. + * Decodes a MerchantCenterLink message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListProductsResponse + * @returns MerchantCenterLink * @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.ListProductsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.MerchantCenterLink; /** - * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. + * Decodes a MerchantCenterLink message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListProductsResponse + * @returns MerchantCenterLink * @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.ListProductsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.MerchantCenterLink; /** - * Verifies a ListProductsResponse message. + * Verifies a MerchantCenterLink 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 ListProductsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a MerchantCenterLink message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListProductsResponse + * @returns MerchantCenterLink */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListProductsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.MerchantCenterLink; /** - * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. - * @param message ListProductsResponse + * Creates a plain object from a MerchantCenterLink message. Also converts values to other types if specified. + * @param message MerchantCenterLink * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ListProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.MerchantCenterLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListProductsResponse to JSON. + * Converts this MerchantCenterLink to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SetInventoryRequest. */ - interface ISetInventoryRequest { - - /** SetInventoryRequest inventory */ - inventory?: (google.cloud.retail.v2alpha.IProduct|null); - - /** SetInventoryRequest setMask */ - setMask?: (google.protobuf.IFieldMask|null); - - /** SetInventoryRequest setTime */ - setTime?: (google.protobuf.ITimestamp|null); + /** Properties of a MerchantCenterLinkingConfig. */ + interface IMerchantCenterLinkingConfig { - /** SetInventoryRequest allowMissing */ - allowMissing?: (boolean|null); + /** MerchantCenterLinkingConfig links */ + links?: (google.cloud.retail.v2beta.IMerchantCenterLink[]|null); } - /** Represents a SetInventoryRequest. */ - class SetInventoryRequest implements ISetInventoryRequest { + /** Represents a MerchantCenterLinkingConfig. */ + class MerchantCenterLinkingConfig implements IMerchantCenterLinkingConfig { /** - * Constructs a new SetInventoryRequest. + * Constructs a new MerchantCenterLinkingConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ISetInventoryRequest); - - /** SetInventoryRequest inventory. */ - public inventory?: (google.cloud.retail.v2alpha.IProduct|null); - - /** SetInventoryRequest setMask. */ - public setMask?: (google.protobuf.IFieldMask|null); - - /** SetInventoryRequest setTime. */ - public setTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.cloud.retail.v2beta.IMerchantCenterLinkingConfig); - /** SetInventoryRequest allowMissing. */ - public allowMissing: boolean; + /** MerchantCenterLinkingConfig links. */ + public links: google.cloud.retail.v2beta.IMerchantCenterLink[]; /** - * Creates a new SetInventoryRequest instance using the specified properties. + * Creates a new MerchantCenterLinkingConfig instance using the specified properties. * @param [properties] Properties to set - * @returns SetInventoryRequest instance + * @returns MerchantCenterLinkingConfig instance */ - public static create(properties?: google.cloud.retail.v2alpha.ISetInventoryRequest): google.cloud.retail.v2alpha.SetInventoryRequest; + public static create(properties?: google.cloud.retail.v2beta.IMerchantCenterLinkingConfig): google.cloud.retail.v2beta.MerchantCenterLinkingConfig; /** - * Encodes the specified SetInventoryRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryRequest.verify|verify} messages. - * @param message SetInventoryRequest message or plain object to encode + * Encodes the specified MerchantCenterLinkingConfig message. Does not implicitly {@link google.cloud.retail.v2beta.MerchantCenterLinkingConfig.verify|verify} messages. + * @param message MerchantCenterLinkingConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ISetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IMerchantCenterLinkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryRequest.verify|verify} messages. - * @param message SetInventoryRequest message or plain object to encode + * Encodes the specified MerchantCenterLinkingConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.MerchantCenterLinkingConfig.verify|verify} messages. + * @param message MerchantCenterLinkingConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ISetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IMerchantCenterLinkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SetInventoryRequest message from the specified reader or buffer. + * Decodes a MerchantCenterLinkingConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SetInventoryRequest + * @returns MerchantCenterLinkingConfig * @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.SetInventoryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.MerchantCenterLinkingConfig; /** - * Decodes a SetInventoryRequest message from the specified reader or buffer, length delimited. + * Decodes a MerchantCenterLinkingConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SetInventoryRequest + * @returns MerchantCenterLinkingConfig * @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.SetInventoryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.MerchantCenterLinkingConfig; /** - * Verifies a SetInventoryRequest message. + * Verifies a MerchantCenterLinkingConfig 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 SetInventoryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a MerchantCenterLinkingConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SetInventoryRequest + * @returns MerchantCenterLinkingConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SetInventoryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.MerchantCenterLinkingConfig; /** - * Creates a plain object from a SetInventoryRequest message. Also converts values to other types if specified. - * @param message SetInventoryRequest + * Creates a plain object from a MerchantCenterLinkingConfig message. Also converts values to other types if specified. + * @param message MerchantCenterLinkingConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.SetInventoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.MerchantCenterLinkingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SetInventoryRequest to JSON. + * Converts this MerchantCenterLinkingConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SetInventoryMetadata. */ - interface ISetInventoryMetadata { + /** Properties of a Catalog. */ + interface ICatalog { + + /** Catalog name */ + name?: (string|null); + + /** Catalog displayName */ + displayName?: (string|null); + + /** Catalog productLevelConfig */ + productLevelConfig?: (google.cloud.retail.v2beta.IProductLevelConfig|null); + + /** Catalog merchantCenterLinkingConfig */ + merchantCenterLinkingConfig?: (google.cloud.retail.v2beta.IMerchantCenterLinkingConfig|null); } - /** Represents a SetInventoryMetadata. */ - class SetInventoryMetadata implements ISetInventoryMetadata { + /** Represents a Catalog. */ + class Catalog implements ICatalog { /** - * Constructs a new SetInventoryMetadata. + * Constructs a new Catalog. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ISetInventoryMetadata); + constructor(properties?: google.cloud.retail.v2beta.ICatalog); + + /** Catalog name. */ + public name: string; + + /** Catalog displayName. */ + public displayName: string; + + /** Catalog productLevelConfig. */ + public productLevelConfig?: (google.cloud.retail.v2beta.IProductLevelConfig|null); + + /** Catalog merchantCenterLinkingConfig. */ + public merchantCenterLinkingConfig?: (google.cloud.retail.v2beta.IMerchantCenterLinkingConfig|null); /** - * Creates a new SetInventoryMetadata instance using the specified properties. + * Creates a new Catalog instance using the specified properties. * @param [properties] Properties to set - * @returns SetInventoryMetadata instance + * @returns Catalog instance */ - public static create(properties?: google.cloud.retail.v2alpha.ISetInventoryMetadata): google.cloud.retail.v2alpha.SetInventoryMetadata; + public static create(properties?: google.cloud.retail.v2beta.ICatalog): google.cloud.retail.v2beta.Catalog; /** - * Encodes the specified SetInventoryMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryMetadata.verify|verify} messages. - * @param message SetInventoryMetadata message or plain object to encode + * Encodes the specified Catalog message. Does not implicitly {@link google.cloud.retail.v2beta.Catalog.verify|verify} messages. + * @param message Catalog message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ISetInventoryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.ICatalog, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SetInventoryMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryMetadata.verify|verify} messages. - * @param message SetInventoryMetadata message or plain object to encode + * Encodes the specified Catalog message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Catalog.verify|verify} messages. + * @param message Catalog message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ISetInventoryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.ICatalog, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SetInventoryMetadata message from the specified reader or buffer. + * Decodes a Catalog message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SetInventoryMetadata + * @returns Catalog * @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.SetInventoryMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.Catalog; /** - * Decodes a SetInventoryMetadata message from the specified reader or buffer, length delimited. + * Decodes a Catalog message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SetInventoryMetadata + * @returns Catalog * @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.SetInventoryMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.Catalog; /** - * Verifies a SetInventoryMetadata message. + * Verifies a Catalog 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 SetInventoryMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a Catalog message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SetInventoryMetadata + * @returns Catalog */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SetInventoryMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Catalog; /** - * Creates a plain object from a SetInventoryMetadata message. Also converts values to other types if specified. - * @param message SetInventoryMetadata + * Creates a plain object from a Catalog message. Also converts values to other types if specified. + * @param message Catalog * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.SetInventoryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.Catalog, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SetInventoryMetadata to JSON. + * Converts this Catalog to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SetInventoryResponse. */ - interface ISetInventoryResponse { + /** AttributeConfigLevel enum. */ + enum AttributeConfigLevel { + ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0, + PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1, + CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2 } - /** Represents a SetInventoryResponse. */ - class SetInventoryResponse implements ISetInventoryResponse { + /** SolutionType enum. */ + enum SolutionType { + SOLUTION_TYPE_UNSPECIFIED = 0, + SOLUTION_TYPE_RECOMMENDATION = 1, + SOLUTION_TYPE_SEARCH = 2 + } + + /** SearchSolutionUseCase enum. */ + enum SearchSolutionUseCase { + SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0, + SEARCH_SOLUTION_USE_CASE_SEARCH = 1, + SEARCH_SOLUTION_USE_CASE_BROWSE = 2 + } + + /** Properties of a Condition. */ + interface ICondition { + + /** Condition queryTerms */ + queryTerms?: (google.cloud.retail.v2beta.Condition.IQueryTerm[]|null); + + /** Condition activeTimeRange */ + activeTimeRange?: (google.cloud.retail.v2beta.Condition.ITimeRange[]|null); + } + + /** Represents a Condition. */ + class Condition implements ICondition { /** - * Constructs a new SetInventoryResponse. + * Constructs a new Condition. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ISetInventoryResponse); + constructor(properties?: google.cloud.retail.v2beta.ICondition); + + /** Condition queryTerms. */ + public queryTerms: google.cloud.retail.v2beta.Condition.IQueryTerm[]; + + /** Condition activeTimeRange. */ + public activeTimeRange: google.cloud.retail.v2beta.Condition.ITimeRange[]; /** - * Creates a new SetInventoryResponse instance using the specified properties. + * Creates a new Condition instance using the specified properties. * @param [properties] Properties to set - * @returns SetInventoryResponse instance + * @returns Condition instance */ - public static create(properties?: google.cloud.retail.v2alpha.ISetInventoryResponse): google.cloud.retail.v2alpha.SetInventoryResponse; + public static create(properties?: google.cloud.retail.v2beta.ICondition): google.cloud.retail.v2beta.Condition; /** - * Encodes the specified SetInventoryResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryResponse.verify|verify} messages. - * @param message SetInventoryResponse message or plain object to encode + * Encodes the specified Condition message. Does not implicitly {@link google.cloud.retail.v2beta.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ISetInventoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SetInventoryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryResponse.verify|verify} messages. - * @param message SetInventoryResponse message or plain object to encode + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ISetInventoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SetInventoryResponse message from the specified reader or buffer. + * Decodes a Condition message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SetInventoryResponse + * @returns Condition * @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.SetInventoryResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.Condition; /** - * Decodes a SetInventoryResponse message from the specified reader or buffer, length delimited. + * Decodes a Condition message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SetInventoryResponse + * @returns Condition * @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.SetInventoryResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.Condition; /** - * Verifies a SetInventoryResponse message. + * Verifies a Condition 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 SetInventoryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a Condition message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SetInventoryResponse + * @returns Condition */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SetInventoryResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Condition; /** - * Creates a plain object from a SetInventoryResponse message. Also converts values to other types if specified. - * @param message SetInventoryResponse + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @param message Condition * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.SetInventoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SetInventoryResponse to JSON. + * Converts this Condition to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AddFulfillmentPlacesRequest. */ - interface IAddFulfillmentPlacesRequest { + namespace Condition { - /** AddFulfillmentPlacesRequest product */ - product?: (string|null); + /** Properties of a QueryTerm. */ + interface IQueryTerm { - /** AddFulfillmentPlacesRequest type */ - type?: (string|null); + /** QueryTerm value */ + value?: (string|null); + + /** QueryTerm fullMatch */ + fullMatch?: (boolean|null); + } + + /** Represents a QueryTerm. */ + class QueryTerm implements IQueryTerm { + + /** + * Constructs a new QueryTerm. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.Condition.IQueryTerm); + + /** QueryTerm value. */ + public value: string; + + /** QueryTerm fullMatch. */ + public fullMatch: boolean; + + /** + * Creates a new QueryTerm instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryTerm instance + */ + public static create(properties?: google.cloud.retail.v2beta.Condition.IQueryTerm): google.cloud.retail.v2beta.Condition.QueryTerm; + + /** + * Encodes the specified QueryTerm message. Does not implicitly {@link google.cloud.retail.v2beta.Condition.QueryTerm.verify|verify} messages. + * @param message QueryTerm message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.Condition.IQueryTerm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryTerm message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Condition.QueryTerm.verify|verify} messages. + * @param message QueryTerm message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.Condition.IQueryTerm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryTerm message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryTerm + * @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.v2beta.Condition.QueryTerm; + + /** + * Decodes a QueryTerm message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryTerm + * @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.v2beta.Condition.QueryTerm; + + /** + * Verifies a QueryTerm 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 QueryTerm message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryTerm + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Condition.QueryTerm; + + /** + * Creates a plain object from a QueryTerm message. Also converts values to other types if specified. + * @param message QueryTerm + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.Condition.QueryTerm, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryTerm to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TimeRange. */ + interface ITimeRange { + + /** TimeRange startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeRange endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TimeRange. */ + class TimeRange implements ITimeRange { + + /** + * Constructs a new TimeRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.Condition.ITimeRange); + + /** TimeRange startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimeRange endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TimeRange instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeRange instance + */ + public static create(properties?: google.cloud.retail.v2beta.Condition.ITimeRange): google.cloud.retail.v2beta.Condition.TimeRange; + + /** + * Encodes the specified TimeRange message. Does not implicitly {@link google.cloud.retail.v2beta.Condition.TimeRange.verify|verify} messages. + * @param message TimeRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.Condition.ITimeRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Condition.TimeRange.verify|verify} messages. + * @param message TimeRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.Condition.ITimeRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeRange + * @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.v2beta.Condition.TimeRange; + + /** + * Decodes a TimeRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeRange + * @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.v2beta.Condition.TimeRange; + + /** + * Verifies a TimeRange 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 TimeRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Condition.TimeRange; + + /** + * Creates a plain object from a TimeRange message. Also converts values to other types if specified. + * @param message TimeRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.Condition.TimeRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a Rule. */ + interface IRule { + + /** Rule boostAction */ + boostAction?: (google.cloud.retail.v2beta.Rule.IBoostAction|null); + + /** Rule redirectAction */ + redirectAction?: (google.cloud.retail.v2beta.Rule.IRedirectAction|null); + + /** Rule onewaySynonymsAction */ + onewaySynonymsAction?: (google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction|null); + + /** Rule doNotAssociateAction */ + doNotAssociateAction?: (google.cloud.retail.v2beta.Rule.IDoNotAssociateAction|null); + + /** Rule replacementAction */ + replacementAction?: (google.cloud.retail.v2beta.Rule.IReplacementAction|null); + + /** Rule ignoreAction */ + ignoreAction?: (google.cloud.retail.v2beta.Rule.IIgnoreAction|null); - /** AddFulfillmentPlacesRequest placeIds */ - placeIds?: (string[]|null); + /** Rule filterAction */ + filterAction?: (google.cloud.retail.v2beta.Rule.IFilterAction|null); - /** AddFulfillmentPlacesRequest addTime */ - addTime?: (google.protobuf.ITimestamp|null); + /** Rule twowaySynonymsAction */ + twowaySynonymsAction?: (google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction|null); - /** AddFulfillmentPlacesRequest allowMissing */ - allowMissing?: (boolean|null); + /** Rule condition */ + condition?: (google.cloud.retail.v2beta.ICondition|null); } - /** Represents an AddFulfillmentPlacesRequest. */ - class AddFulfillmentPlacesRequest implements IAddFulfillmentPlacesRequest { + /** Represents a Rule. */ + class Rule implements IRule { /** - * Constructs a new AddFulfillmentPlacesRequest. + * Constructs a new Rule. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest); + constructor(properties?: google.cloud.retail.v2beta.IRule); - /** AddFulfillmentPlacesRequest product. */ - public product: string; + /** Rule boostAction. */ + public boostAction?: (google.cloud.retail.v2beta.Rule.IBoostAction|null); - /** AddFulfillmentPlacesRequest type. */ - public type: string; + /** Rule redirectAction. */ + public redirectAction?: (google.cloud.retail.v2beta.Rule.IRedirectAction|null); - /** AddFulfillmentPlacesRequest placeIds. */ - public placeIds: string[]; + /** Rule onewaySynonymsAction. */ + public onewaySynonymsAction?: (google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction|null); - /** AddFulfillmentPlacesRequest addTime. */ - public addTime?: (google.protobuf.ITimestamp|null); + /** Rule doNotAssociateAction. */ + public doNotAssociateAction?: (google.cloud.retail.v2beta.Rule.IDoNotAssociateAction|null); - /** AddFulfillmentPlacesRequest allowMissing. */ - public allowMissing: boolean; + /** Rule replacementAction. */ + public replacementAction?: (google.cloud.retail.v2beta.Rule.IReplacementAction|null); + + /** Rule ignoreAction. */ + public ignoreAction?: (google.cloud.retail.v2beta.Rule.IIgnoreAction|null); + + /** Rule filterAction. */ + public filterAction?: (google.cloud.retail.v2beta.Rule.IFilterAction|null); + + /** Rule twowaySynonymsAction. */ + public twowaySynonymsAction?: (google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction|null); + + /** Rule condition. */ + public condition?: (google.cloud.retail.v2beta.ICondition|null); + + /** Rule action. */ + public action?: ("boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"); /** - * Creates a new AddFulfillmentPlacesRequest instance using the specified properties. + * Creates a new Rule instance using the specified properties. * @param [properties] Properties to set - * @returns AddFulfillmentPlacesRequest instance + * @returns Rule instance */ - public static create(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest): google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest; + public static create(properties?: google.cloud.retail.v2beta.IRule): google.cloud.retail.v2beta.Rule; /** - * Encodes the specified AddFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.verify|verify} messages. - * @param message AddFulfillmentPlacesRequest message or plain object to encode + * Encodes the specified Rule message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.verify|verify} messages. + * @param message Rule message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IRule, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AddFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.verify|verify} messages. - * @param message AddFulfillmentPlacesRequest message or plain object to encode + * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.verify|verify} messages. + * @param message Rule message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IRule, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer. + * Decodes a Rule message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AddFulfillmentPlacesRequest + * @returns Rule * @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.AddFulfillmentPlacesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.Rule; /** - * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. + * Decodes a Rule message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AddFulfillmentPlacesRequest + * @returns Rule * @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.AddFulfillmentPlacesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.Rule; /** - * Verifies an AddFulfillmentPlacesRequest message. + * Verifies a Rule 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 AddFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Rule message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AddFulfillmentPlacesRequest + * @returns Rule */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule; /** - * Creates a plain object from an AddFulfillmentPlacesRequest message. Also converts values to other types if specified. - * @param message AddFulfillmentPlacesRequest + * Creates a plain object from a Rule message. Also converts values to other types if specified. + * @param message Rule * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.Rule, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AddFulfillmentPlacesRequest to JSON. + * Converts this Rule to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AddFulfillmentPlacesMetadata. */ - interface IAddFulfillmentPlacesMetadata { - } + namespace Rule { - /** Represents an AddFulfillmentPlacesMetadata. */ - class AddFulfillmentPlacesMetadata implements IAddFulfillmentPlacesMetadata { + /** Properties of a BoostAction. */ + interface IBoostAction { - /** - * Constructs a new AddFulfillmentPlacesMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata); + /** BoostAction boost */ + boost?: (number|null); - /** - * Creates a new AddFulfillmentPlacesMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns AddFulfillmentPlacesMetadata instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata): google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata; + /** BoostAction productsFilter */ + productsFilter?: (string|null); + } - /** - * Encodes the specified AddFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.verify|verify} messages. - * @param message AddFulfillmentPlacesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a BoostAction. */ + class BoostAction implements IBoostAction { - /** - * Encodes the specified AddFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.verify|verify} messages. - * @param message AddFulfillmentPlacesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new BoostAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.Rule.IBoostAction); - /** - * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AddFulfillmentPlacesMetadata - * @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.AddFulfillmentPlacesMetadata; + /** BoostAction boost. */ + public boost: number; - /** - * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AddFulfillmentPlacesMetadata - * @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.AddFulfillmentPlacesMetadata; + /** BoostAction productsFilter. */ + public productsFilter: string; - /** - * Verifies an AddFulfillmentPlacesMetadata 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 new BoostAction instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostAction instance + */ + public static create(properties?: google.cloud.retail.v2beta.Rule.IBoostAction): google.cloud.retail.v2beta.Rule.BoostAction; - /** - * Creates an AddFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AddFulfillmentPlacesMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata; + /** + * Encodes the specified BoostAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.BoostAction.verify|verify} messages. + * @param message BoostAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.Rule.IBoostAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from an AddFulfillmentPlacesMetadata message. Also converts values to other types if specified. - * @param message AddFulfillmentPlacesMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified BoostAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.BoostAction.verify|verify} messages. + * @param message BoostAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.IBoostAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostAction + * @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.v2beta.Rule.BoostAction; + + /** + * Decodes a BoostAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostAction + * @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.v2beta.Rule.BoostAction; + + /** + * Verifies a BoostAction 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 BoostAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.BoostAction; + + /** + * Creates a plain object from a BoostAction message. Also converts values to other types if specified. + * @param message BoostAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.Rule.BoostAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FilterAction. */ + interface IFilterAction { - /** - * Converts this AddFulfillmentPlacesMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FilterAction filter */ + filter?: (string|null); + } - /** Properties of an AddFulfillmentPlacesResponse. */ - interface IAddFulfillmentPlacesResponse { - } + /** Represents a FilterAction. */ + class FilterAction implements IFilterAction { - /** Represents an AddFulfillmentPlacesResponse. */ - class AddFulfillmentPlacesResponse implements IAddFulfillmentPlacesResponse { + /** + * Constructs a new FilterAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.Rule.IFilterAction); - /** - * Constructs a new AddFulfillmentPlacesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse); + /** FilterAction filter. */ + public filter: string; - /** - * Creates a new AddFulfillmentPlacesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns AddFulfillmentPlacesResponse instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse): google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse; + /** + * Creates a new FilterAction instance using the specified properties. + * @param [properties] Properties to set + * @returns FilterAction instance + */ + public static create(properties?: google.cloud.retail.v2beta.Rule.IFilterAction): google.cloud.retail.v2beta.Rule.FilterAction; - /** - * Encodes the specified AddFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.verify|verify} messages. - * @param message AddFulfillmentPlacesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified FilterAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.FilterAction.verify|verify} messages. + * @param message FilterAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.Rule.IFilterAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified AddFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.verify|verify} messages. - * @param message AddFulfillmentPlacesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified FilterAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.FilterAction.verify|verify} messages. + * @param message FilterAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.IFilterAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AddFulfillmentPlacesResponse - * @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.AddFulfillmentPlacesResponse; + /** + * Decodes a FilterAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FilterAction + * @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.v2beta.Rule.FilterAction; - /** - * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AddFulfillmentPlacesResponse - * @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.AddFulfillmentPlacesResponse; + /** + * Decodes a FilterAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FilterAction + * @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.v2beta.Rule.FilterAction; - /** - * Verifies an AddFulfillmentPlacesResponse 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); + /** + * Verifies a FilterAction 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 AddFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AddFulfillmentPlacesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse; + /** + * Creates a FilterAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FilterAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.FilterAction; - /** - * Creates a plain object from an AddFulfillmentPlacesResponse message. Also converts values to other types if specified. - * @param message AddFulfillmentPlacesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a FilterAction message. Also converts values to other types if specified. + * @param message FilterAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.Rule.FilterAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this AddFulfillmentPlacesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this FilterAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of an AddLocalInventoriesRequest. */ - interface IAddLocalInventoriesRequest { + /** Properties of a RedirectAction. */ + interface IRedirectAction { - /** AddLocalInventoriesRequest product */ - product?: (string|null); + /** RedirectAction redirectUri */ + redirectUri?: (string|null); + } - /** AddLocalInventoriesRequest localInventories */ - localInventories?: (google.cloud.retail.v2alpha.ILocalInventory[]|null); + /** Represents a RedirectAction. */ + class RedirectAction implements IRedirectAction { - /** AddLocalInventoriesRequest addMask */ - addMask?: (google.protobuf.IFieldMask|null); + /** + * Constructs a new RedirectAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.Rule.IRedirectAction); - /** AddLocalInventoriesRequest addTime */ - addTime?: (google.protobuf.ITimestamp|null); + /** RedirectAction redirectUri. */ + public redirectUri: string; - /** AddLocalInventoriesRequest allowMissing */ - allowMissing?: (boolean|null); - } + /** + * Creates a new RedirectAction instance using the specified properties. + * @param [properties] Properties to set + * @returns RedirectAction instance + */ + public static create(properties?: google.cloud.retail.v2beta.Rule.IRedirectAction): google.cloud.retail.v2beta.Rule.RedirectAction; - /** Represents an AddLocalInventoriesRequest. */ - class AddLocalInventoriesRequest implements IAddLocalInventoriesRequest { + /** + * Encodes the specified RedirectAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.RedirectAction.verify|verify} messages. + * @param message RedirectAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.Rule.IRedirectAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new AddLocalInventoriesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest); + /** + * Encodes the specified RedirectAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.RedirectAction.verify|verify} messages. + * @param message RedirectAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.IRedirectAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** AddLocalInventoriesRequest product. */ - public product: string; + /** + * Decodes a RedirectAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RedirectAction + * @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.v2beta.Rule.RedirectAction; - /** AddLocalInventoriesRequest localInventories. */ - public localInventories: google.cloud.retail.v2alpha.ILocalInventory[]; + /** + * Decodes a RedirectAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RedirectAction + * @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.v2beta.Rule.RedirectAction; - /** AddLocalInventoriesRequest addMask. */ - public addMask?: (google.protobuf.IFieldMask|null); + /** + * Verifies a RedirectAction 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); - /** AddLocalInventoriesRequest addTime. */ - public addTime?: (google.protobuf.ITimestamp|null); + /** + * Creates a RedirectAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RedirectAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.RedirectAction; + + /** + * Creates a plain object from a RedirectAction message. Also converts values to other types if specified. + * @param message RedirectAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.Rule.RedirectAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RedirectAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** AddLocalInventoriesRequest allowMissing. */ - public allowMissing: boolean; + /** Properties of a TwowaySynonymsAction. */ + interface ITwowaySynonymsAction { - /** - * Creates a new AddLocalInventoriesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns AddLocalInventoriesRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest): google.cloud.retail.v2alpha.AddLocalInventoriesRequest; + /** TwowaySynonymsAction synonyms */ + synonyms?: (string[]|null); + } - /** - * Encodes the specified AddLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesRequest.verify|verify} messages. - * @param message AddLocalInventoriesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a TwowaySynonymsAction. */ + class TwowaySynonymsAction implements ITwowaySynonymsAction { - /** - * Encodes the specified AddLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesRequest.verify|verify} messages. - * @param message AddLocalInventoriesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new TwowaySynonymsAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction); - /** - * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AddLocalInventoriesRequest - * @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.AddLocalInventoriesRequest; + /** TwowaySynonymsAction synonyms. */ + public synonyms: string[]; - /** - * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AddLocalInventoriesRequest - * @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.AddLocalInventoriesRequest; + /** + * Creates a new TwowaySynonymsAction instance using the specified properties. + * @param [properties] Properties to set + * @returns TwowaySynonymsAction instance + */ + public static create(properties?: google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction): google.cloud.retail.v2beta.Rule.TwowaySynonymsAction; - /** - * Verifies an AddLocalInventoriesRequest 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); + /** + * Encodes the specified TwowaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.verify|verify} messages. + * @param message TwowaySynonymsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates an AddLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AddLocalInventoriesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddLocalInventoriesRequest; + /** + * Encodes the specified TwowaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.verify|verify} messages. + * @param message TwowaySynonymsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from an AddLocalInventoriesRequest message. Also converts values to other types if specified. - * @param message AddLocalInventoriesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.AddLocalInventoriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a TwowaySynonymsAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TwowaySynonymsAction + * @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.v2beta.Rule.TwowaySynonymsAction; - /** - * Converts this AddLocalInventoriesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a TwowaySynonymsAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TwowaySynonymsAction + * @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.v2beta.Rule.TwowaySynonymsAction; - /** Properties of an AddLocalInventoriesMetadata. */ - interface IAddLocalInventoriesMetadata { - } + /** + * Verifies a TwowaySynonymsAction 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); - /** Represents an AddLocalInventoriesMetadata. */ - class AddLocalInventoriesMetadata implements IAddLocalInventoriesMetadata { + /** + * Creates a TwowaySynonymsAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TwowaySynonymsAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.TwowaySynonymsAction; - /** - * Constructs a new AddLocalInventoriesMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata); + /** + * Creates a plain object from a TwowaySynonymsAction message. Also converts values to other types if specified. + * @param message TwowaySynonymsAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.Rule.TwowaySynonymsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new AddLocalInventoriesMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns AddLocalInventoriesMetadata instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata): google.cloud.retail.v2alpha.AddLocalInventoriesMetadata; + /** + * Converts this TwowaySynonymsAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified AddLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.verify|verify} messages. - * @param message AddLocalInventoriesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of an OnewaySynonymsAction. */ + interface IOnewaySynonymsAction { - /** - * Encodes the specified AddLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.verify|verify} messages. - * @param message AddLocalInventoriesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** OnewaySynonymsAction queryTerms */ + queryTerms?: (string[]|null); - /** - * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AddLocalInventoriesMetadata - * @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.AddLocalInventoriesMetadata; + /** OnewaySynonymsAction synonyms */ + synonyms?: (string[]|null); - /** - * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AddLocalInventoriesMetadata - * @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.AddLocalInventoriesMetadata; + /** OnewaySynonymsAction onewayTerms */ + onewayTerms?: (string[]|null); + } - /** - * Verifies an AddLocalInventoriesMetadata 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); + /** Represents an OnewaySynonymsAction. */ + class OnewaySynonymsAction implements IOnewaySynonymsAction { - /** - * Creates an AddLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AddLocalInventoriesMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddLocalInventoriesMetadata; + /** + * Constructs a new OnewaySynonymsAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction); - /** - * Creates a plain object from an AddLocalInventoriesMetadata message. Also converts values to other types if specified. - * @param message AddLocalInventoriesMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.AddLocalInventoriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** OnewaySynonymsAction queryTerms. */ + public queryTerms: string[]; - /** - * Converts this AddLocalInventoriesMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** OnewaySynonymsAction synonyms. */ + public synonyms: string[]; - /** Properties of an AddLocalInventoriesResponse. */ - interface IAddLocalInventoriesResponse { - } + /** OnewaySynonymsAction onewayTerms. */ + public onewayTerms: string[]; - /** Represents an AddLocalInventoriesResponse. */ - class AddLocalInventoriesResponse implements IAddLocalInventoriesResponse { + /** + * Creates a new OnewaySynonymsAction instance using the specified properties. + * @param [properties] Properties to set + * @returns OnewaySynonymsAction instance + */ + public static create(properties?: google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction): google.cloud.retail.v2beta.Rule.OnewaySynonymsAction; - /** - * Constructs a new AddLocalInventoriesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesResponse); + /** + * Encodes the specified OnewaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.verify|verify} messages. + * @param message OnewaySynonymsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new AddLocalInventoriesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns AddLocalInventoriesResponse instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesResponse): google.cloud.retail.v2alpha.AddLocalInventoriesResponse; + /** + * Encodes the specified OnewaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.verify|verify} messages. + * @param message OnewaySynonymsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified AddLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesResponse.verify|verify} messages. - * @param message AddLocalInventoriesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IAddLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an OnewaySynonymsAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OnewaySynonymsAction + * @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.v2beta.Rule.OnewaySynonymsAction; - /** - * Encodes the specified AddLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesResponse.verify|verify} messages. - * @param message AddLocalInventoriesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an OnewaySynonymsAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OnewaySynonymsAction + * @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.v2beta.Rule.OnewaySynonymsAction; - /** - * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AddLocalInventoriesResponse - * @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.AddLocalInventoriesResponse; + /** + * Verifies an OnewaySynonymsAction 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); - /** - * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AddLocalInventoriesResponse - * @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.AddLocalInventoriesResponse; + /** + * Creates an OnewaySynonymsAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OnewaySynonymsAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.OnewaySynonymsAction; - /** - * Verifies an AddLocalInventoriesResponse 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 plain object from an OnewaySynonymsAction message. Also converts values to other types if specified. + * @param message OnewaySynonymsAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.Rule.OnewaySynonymsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates an AddLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AddLocalInventoriesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddLocalInventoriesResponse; + /** + * Converts this OnewaySynonymsAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a plain object from an AddLocalInventoriesResponse message. Also converts values to other types if specified. - * @param message AddLocalInventoriesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.AddLocalInventoriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of a DoNotAssociateAction. */ + interface IDoNotAssociateAction { - /** - * Converts this AddLocalInventoriesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** DoNotAssociateAction queryTerms */ + queryTerms?: (string[]|null); - /** Properties of a RemoveLocalInventoriesRequest. */ - interface IRemoveLocalInventoriesRequest { + /** DoNotAssociateAction doNotAssociateTerms */ + doNotAssociateTerms?: (string[]|null); - /** RemoveLocalInventoriesRequest product */ - product?: (string|null); + /** DoNotAssociateAction terms */ + terms?: (string[]|null); + } - /** RemoveLocalInventoriesRequest placeIds */ - placeIds?: (string[]|null); + /** Represents a DoNotAssociateAction. */ + class DoNotAssociateAction implements IDoNotAssociateAction { - /** RemoveLocalInventoriesRequest removeTime */ - removeTime?: (google.protobuf.ITimestamp|null); + /** + * Constructs a new DoNotAssociateAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.Rule.IDoNotAssociateAction); - /** RemoveLocalInventoriesRequest allowMissing */ - allowMissing?: (boolean|null); - } + /** DoNotAssociateAction queryTerms. */ + public queryTerms: string[]; - /** Represents a RemoveLocalInventoriesRequest. */ - class RemoveLocalInventoriesRequest implements IRemoveLocalInventoriesRequest { + /** DoNotAssociateAction doNotAssociateTerms. */ + public doNotAssociateTerms: string[]; - /** - * Constructs a new RemoveLocalInventoriesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest); + /** DoNotAssociateAction terms. */ + public terms: string[]; - /** RemoveLocalInventoriesRequest product. */ - public product: string; + /** + * Creates a new DoNotAssociateAction instance using the specified properties. + * @param [properties] Properties to set + * @returns DoNotAssociateAction instance + */ + public static create(properties?: google.cloud.retail.v2beta.Rule.IDoNotAssociateAction): google.cloud.retail.v2beta.Rule.DoNotAssociateAction; - /** RemoveLocalInventoriesRequest placeIds. */ - public placeIds: string[]; + /** + * Encodes the specified DoNotAssociateAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.DoNotAssociateAction.verify|verify} messages. + * @param message DoNotAssociateAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.Rule.IDoNotAssociateAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** RemoveLocalInventoriesRequest removeTime. */ - public removeTime?: (google.protobuf.ITimestamp|null); + /** + * Encodes the specified DoNotAssociateAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.DoNotAssociateAction.verify|verify} messages. + * @param message DoNotAssociateAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.IDoNotAssociateAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** RemoveLocalInventoriesRequest allowMissing. */ - public allowMissing: boolean; + /** + * Decodes a DoNotAssociateAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoNotAssociateAction + * @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.v2beta.Rule.DoNotAssociateAction; - /** - * Creates a new RemoveLocalInventoriesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RemoveLocalInventoriesRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest): google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest; + /** + * Decodes a DoNotAssociateAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoNotAssociateAction + * @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.v2beta.Rule.DoNotAssociateAction; - /** - * Encodes the specified RemoveLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.verify|verify} messages. - * @param message RemoveLocalInventoriesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a DoNotAssociateAction 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); - /** - * Encodes the specified RemoveLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.verify|verify} messages. - * @param message RemoveLocalInventoriesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a DoNotAssociateAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoNotAssociateAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.DoNotAssociateAction; - /** - * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RemoveLocalInventoriesRequest - * @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.RemoveLocalInventoriesRequest; + /** + * Creates a plain object from a DoNotAssociateAction message. Also converts values to other types if specified. + * @param message DoNotAssociateAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.Rule.DoNotAssociateAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RemoveLocalInventoriesRequest - * @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.RemoveLocalInventoriesRequest; + /** + * Converts this DoNotAssociateAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies a RemoveLocalInventoriesRequest 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); + /** Properties of a ReplacementAction. */ + interface IReplacementAction { - /** - * Creates a RemoveLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RemoveLocalInventoriesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest; + /** ReplacementAction queryTerms */ + queryTerms?: (string[]|null); - /** - * Creates a plain object from a RemoveLocalInventoriesRequest message. Also converts values to other types if specified. - * @param message RemoveLocalInventoriesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ReplacementAction replacementTerm */ + replacementTerm?: (string|null); - /** - * Converts this RemoveLocalInventoriesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ReplacementAction term */ + term?: (string|null); + } - /** Properties of a RemoveLocalInventoriesMetadata. */ - interface IRemoveLocalInventoriesMetadata { - } + /** Represents a ReplacementAction. */ + class ReplacementAction implements IReplacementAction { - /** Represents a RemoveLocalInventoriesMetadata. */ - class RemoveLocalInventoriesMetadata implements IRemoveLocalInventoriesMetadata { + /** + * Constructs a new ReplacementAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.Rule.IReplacementAction); - /** - * Constructs a new RemoveLocalInventoriesMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata); + /** ReplacementAction queryTerms. */ + public queryTerms: string[]; - /** - * Creates a new RemoveLocalInventoriesMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns RemoveLocalInventoriesMetadata instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata): google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata; + /** ReplacementAction replacementTerm. */ + public replacementTerm: string; - /** - * Encodes the specified RemoveLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.verify|verify} messages. - * @param message RemoveLocalInventoriesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** ReplacementAction term. */ + public term: string; - /** - * Encodes the specified RemoveLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.verify|verify} messages. - * @param message RemoveLocalInventoriesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new ReplacementAction instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplacementAction instance + */ + public static create(properties?: google.cloud.retail.v2beta.Rule.IReplacementAction): google.cloud.retail.v2beta.Rule.ReplacementAction; - /** - * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RemoveLocalInventoriesMetadata - * @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.RemoveLocalInventoriesMetadata; + /** + * Encodes the specified ReplacementAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.ReplacementAction.verify|verify} messages. + * @param message ReplacementAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.Rule.IReplacementAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RemoveLocalInventoriesMetadata - * @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.RemoveLocalInventoriesMetadata; + /** + * Encodes the specified ReplacementAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.ReplacementAction.verify|verify} messages. + * @param message ReplacementAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.IReplacementAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a RemoveLocalInventoriesMetadata 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); + /** + * Decodes a ReplacementAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplacementAction + * @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.v2beta.Rule.ReplacementAction; - /** - * Creates a RemoveLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RemoveLocalInventoriesMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata; + /** + * Decodes a ReplacementAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplacementAction + * @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.v2beta.Rule.ReplacementAction; - /** - * Creates a plain object from a RemoveLocalInventoriesMetadata message. Also converts values to other types if specified. - * @param message RemoveLocalInventoriesMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a ReplacementAction 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); - /** - * Converts this RemoveLocalInventoriesMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a ReplacementAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplacementAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.ReplacementAction; - /** Properties of a RemoveLocalInventoriesResponse. */ - interface IRemoveLocalInventoriesResponse { - } + /** + * Creates a plain object from a ReplacementAction message. Also converts values to other types if specified. + * @param message ReplacementAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.Rule.ReplacementAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents a RemoveLocalInventoriesResponse. */ - class RemoveLocalInventoriesResponse implements IRemoveLocalInventoriesResponse { + /** + * Converts this ReplacementAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new RemoveLocalInventoriesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse); + /** Properties of an IgnoreAction. */ + interface IIgnoreAction { - /** - * Creates a new RemoveLocalInventoriesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RemoveLocalInventoriesResponse instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse): google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse; + /** IgnoreAction ignoreTerms */ + ignoreTerms?: (string[]|null); + } - /** - * Encodes the specified RemoveLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.verify|verify} messages. - * @param message RemoveLocalInventoriesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents an IgnoreAction. */ + class IgnoreAction implements IIgnoreAction { - /** - * Encodes the specified RemoveLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.verify|verify} messages. - * @param message RemoveLocalInventoriesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new IgnoreAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.Rule.IIgnoreAction); - /** - * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RemoveLocalInventoriesResponse - * @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.RemoveLocalInventoriesResponse; + /** IgnoreAction ignoreTerms. */ + public ignoreTerms: string[]; - /** - * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RemoveLocalInventoriesResponse - * @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.RemoveLocalInventoriesResponse; + /** + * Creates a new IgnoreAction instance using the specified properties. + * @param [properties] Properties to set + * @returns IgnoreAction instance + */ + public static create(properties?: google.cloud.retail.v2beta.Rule.IIgnoreAction): google.cloud.retail.v2beta.Rule.IgnoreAction; + + /** + * Encodes the specified IgnoreAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.IgnoreAction.verify|verify} messages. + * @param message IgnoreAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.Rule.IIgnoreAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a RemoveLocalInventoriesResponse 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); + /** + * Encodes the specified IgnoreAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.IgnoreAction.verify|verify} messages. + * @param message IgnoreAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.IIgnoreAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a RemoveLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RemoveLocalInventoriesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse; + /** + * Decodes an IgnoreAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IgnoreAction + * @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.v2beta.Rule.IgnoreAction; - /** - * Creates a plain object from a RemoveLocalInventoriesResponse message. Also converts values to other types if specified. - * @param message RemoveLocalInventoriesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes an IgnoreAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IgnoreAction + * @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.v2beta.Rule.IgnoreAction; - /** - * Converts this RemoveLocalInventoriesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies an IgnoreAction 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); - /** Properties of a RemoveFulfillmentPlacesRequest. */ - interface IRemoveFulfillmentPlacesRequest { + /** + * Creates an IgnoreAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IgnoreAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.IgnoreAction; - /** RemoveFulfillmentPlacesRequest product */ - product?: (string|null); + /** + * Creates a plain object from an IgnoreAction message. Also converts values to other types if specified. + * @param message IgnoreAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.Rule.IgnoreAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** RemoveFulfillmentPlacesRequest type */ - type?: (string|null); + /** + * Converts this IgnoreAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** RemoveFulfillmentPlacesRequest placeIds */ - placeIds?: (string[]|null); + /** Properties of an Audience. */ + interface IAudience { - /** RemoveFulfillmentPlacesRequest removeTime */ - removeTime?: (google.protobuf.ITimestamp|null); + /** Audience genders */ + genders?: (string[]|null); - /** RemoveFulfillmentPlacesRequest allowMissing */ - allowMissing?: (boolean|null); + /** Audience ageGroups */ + ageGroups?: (string[]|null); } - /** Represents a RemoveFulfillmentPlacesRequest. */ - class RemoveFulfillmentPlacesRequest implements IRemoveFulfillmentPlacesRequest { + /** Represents an Audience. */ + class Audience implements IAudience { /** - * Constructs a new RemoveFulfillmentPlacesRequest. + * Constructs a new Audience. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest); - - /** RemoveFulfillmentPlacesRequest product. */ - public product: string; - - /** RemoveFulfillmentPlacesRequest type. */ - public type: string; - - /** RemoveFulfillmentPlacesRequest placeIds. */ - public placeIds: string[]; + constructor(properties?: google.cloud.retail.v2beta.IAudience); - /** RemoveFulfillmentPlacesRequest removeTime. */ - public removeTime?: (google.protobuf.ITimestamp|null); + /** Audience genders. */ + public genders: string[]; - /** RemoveFulfillmentPlacesRequest allowMissing. */ - public allowMissing: boolean; + /** Audience ageGroups. */ + public ageGroups: string[]; /** - * Creates a new RemoveFulfillmentPlacesRequest instance using the specified properties. + * Creates a new Audience instance using the specified properties. * @param [properties] Properties to set - * @returns RemoveFulfillmentPlacesRequest instance + * @returns Audience instance */ - public static create(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest; + public static create(properties?: google.cloud.retail.v2beta.IAudience): google.cloud.retail.v2beta.Audience; /** - * Encodes the specified RemoveFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.verify|verify} messages. - * @param message RemoveFulfillmentPlacesRequest message or plain object to encode + * Encodes the specified Audience message. Does not implicitly {@link google.cloud.retail.v2beta.Audience.verify|verify} messages. + * @param message Audience message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IAudience, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RemoveFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.verify|verify} messages. - * @param message RemoveFulfillmentPlacesRequest message or plain object to encode + * Encodes the specified Audience message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Audience.verify|verify} messages. + * @param message Audience message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IAudience, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer. + * Decodes an Audience message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RemoveFulfillmentPlacesRequest + * @returns Audience * @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.RemoveFulfillmentPlacesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.Audience; /** - * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. + * Decodes an Audience message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RemoveFulfillmentPlacesRequest + * @returns Audience * @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.RemoveFulfillmentPlacesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.Audience; /** - * Verifies a RemoveFulfillmentPlacesRequest message. + * Verifies an Audience 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 RemoveFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an Audience message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RemoveFulfillmentPlacesRequest + * @returns Audience */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Audience; /** - * Creates a plain object from a RemoveFulfillmentPlacesRequest message. Also converts values to other types if specified. - * @param message RemoveFulfillmentPlacesRequest + * Creates a plain object from an Audience message. Also converts values to other types if specified. + * @param message Audience * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.Audience, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RemoveFulfillmentPlacesRequest to JSON. + * Converts this Audience to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RemoveFulfillmentPlacesMetadata. */ - interface IRemoveFulfillmentPlacesMetadata { + /** Properties of a ColorInfo. */ + interface IColorInfo { + + /** ColorInfo colorFamilies */ + colorFamilies?: (string[]|null); + + /** ColorInfo colors */ + colors?: (string[]|null); } - /** Represents a RemoveFulfillmentPlacesMetadata. */ - class RemoveFulfillmentPlacesMetadata implements IRemoveFulfillmentPlacesMetadata { + /** Represents a ColorInfo. */ + class ColorInfo implements IColorInfo { /** - * Constructs a new RemoveFulfillmentPlacesMetadata. + * Constructs a new ColorInfo. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata); + constructor(properties?: google.cloud.retail.v2beta.IColorInfo); + + /** ColorInfo colorFamilies. */ + public colorFamilies: string[]; + + /** ColorInfo colors. */ + public colors: string[]; /** - * Creates a new RemoveFulfillmentPlacesMetadata instance using the specified properties. + * Creates a new ColorInfo instance using the specified properties. * @param [properties] Properties to set - * @returns RemoveFulfillmentPlacesMetadata instance + * @returns ColorInfo instance */ - public static create(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata; + public static create(properties?: google.cloud.retail.v2beta.IColorInfo): google.cloud.retail.v2beta.ColorInfo; /** - * Encodes the specified RemoveFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.verify|verify} messages. - * @param message RemoveFulfillmentPlacesMetadata message or plain object to encode + * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.retail.v2beta.ColorInfo.verify|verify} messages. + * @param message ColorInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RemoveFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.verify|verify} messages. - * @param message RemoveFulfillmentPlacesMetadata message or plain object to encode + * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ColorInfo.verify|verify} messages. + * @param message ColorInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer. + * Decodes a ColorInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RemoveFulfillmentPlacesMetadata + * @returns ColorInfo * @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.RemoveFulfillmentPlacesMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ColorInfo; /** - * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. + * Decodes a ColorInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RemoveFulfillmentPlacesMetadata + * @returns ColorInfo * @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.RemoveFulfillmentPlacesMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ColorInfo; /** - * Verifies a RemoveFulfillmentPlacesMetadata message. + * Verifies a ColorInfo 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 RemoveFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RemoveFulfillmentPlacesMetadata + * @returns ColorInfo */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ColorInfo; /** - * Creates a plain object from a RemoveFulfillmentPlacesMetadata message. Also converts values to other types if specified. - * @param message RemoveFulfillmentPlacesMetadata + * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. + * @param message ColorInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.ColorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RemoveFulfillmentPlacesMetadata to JSON. + * Converts this ColorInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RemoveFulfillmentPlacesResponse. */ - interface IRemoveFulfillmentPlacesResponse { + /** Properties of a CustomAttribute. */ + interface ICustomAttribute { + + /** CustomAttribute text */ + text?: (string[]|null); + + /** CustomAttribute numbers */ + numbers?: (number[]|null); + + /** CustomAttribute searchable */ + searchable?: (boolean|null); + + /** CustomAttribute indexable */ + indexable?: (boolean|null); } - /** Represents a RemoveFulfillmentPlacesResponse. */ - class RemoveFulfillmentPlacesResponse implements IRemoveFulfillmentPlacesResponse { + /** Represents a CustomAttribute. */ + class CustomAttribute implements ICustomAttribute { /** - * Constructs a new RemoveFulfillmentPlacesResponse. + * Constructs a new CustomAttribute. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse); + constructor(properties?: google.cloud.retail.v2beta.ICustomAttribute); + + /** CustomAttribute text. */ + public text: string[]; + + /** CustomAttribute numbers. */ + public numbers: number[]; + + /** CustomAttribute searchable. */ + public searchable?: (boolean|null); + + /** CustomAttribute indexable. */ + public indexable?: (boolean|null); + + /** CustomAttribute _searchable. */ + public _searchable?: "searchable"; + + /** CustomAttribute _indexable. */ + public _indexable?: "indexable"; /** - * Creates a new RemoveFulfillmentPlacesResponse instance using the specified properties. + * Creates a new CustomAttribute instance using the specified properties. * @param [properties] Properties to set - * @returns RemoveFulfillmentPlacesResponse instance + * @returns CustomAttribute instance */ - public static create(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse; + public static create(properties?: google.cloud.retail.v2beta.ICustomAttribute): google.cloud.retail.v2beta.CustomAttribute; /** - * Encodes the specified RemoveFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.verify|verify} messages. - * @param message RemoveFulfillmentPlacesResponse message or plain object to encode + * Encodes the specified CustomAttribute message. Does not implicitly {@link google.cloud.retail.v2beta.CustomAttribute.verify|verify} messages. + * @param message CustomAttribute message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RemoveFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.verify|verify} messages. - * @param message RemoveFulfillmentPlacesResponse message or plain object to encode + * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CustomAttribute.verify|verify} messages. + * @param message CustomAttribute message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer. + * Decodes a CustomAttribute message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RemoveFulfillmentPlacesResponse + * @returns CustomAttribute * @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.RemoveFulfillmentPlacesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.CustomAttribute; /** - * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. + * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RemoveFulfillmentPlacesResponse + * @returns CustomAttribute * @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.RemoveFulfillmentPlacesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.CustomAttribute; /** - * Verifies a RemoveFulfillmentPlacesResponse message. + * Verifies a CustomAttribute 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 RemoveFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CustomAttribute message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RemoveFulfillmentPlacesResponse + * @returns CustomAttribute */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CustomAttribute; /** - * Creates a plain object from a RemoveFulfillmentPlacesResponse message. Also converts values to other types if specified. - * @param message RemoveFulfillmentPlacesResponse + * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. + * @param message CustomAttribute * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.CustomAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RemoveFulfillmentPlacesResponse to JSON. + * Converts this CustomAttribute to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PurgeMetadata. */ - interface IPurgeMetadata { + /** Properties of a FulfillmentInfo. */ + interface IFulfillmentInfo { + + /** FulfillmentInfo type */ + type?: (string|null); + + /** FulfillmentInfo placeIds */ + placeIds?: (string[]|null); } - /** Represents a PurgeMetadata. */ - class PurgeMetadata implements IPurgeMetadata { + /** Represents a FulfillmentInfo. */ + class FulfillmentInfo implements IFulfillmentInfo { /** - * Constructs a new PurgeMetadata. + * Constructs a new FulfillmentInfo. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IPurgeMetadata); + constructor(properties?: google.cloud.retail.v2beta.IFulfillmentInfo); + + /** FulfillmentInfo type. */ + public type: string; + + /** FulfillmentInfo placeIds. */ + public placeIds: string[]; /** - * Creates a new PurgeMetadata instance using the specified properties. + * Creates a new FulfillmentInfo instance using the specified properties. * @param [properties] Properties to set - * @returns PurgeMetadata instance + * @returns FulfillmentInfo instance */ - public static create(properties?: google.cloud.retail.v2alpha.IPurgeMetadata): google.cloud.retail.v2alpha.PurgeMetadata; + public static create(properties?: google.cloud.retail.v2beta.IFulfillmentInfo): google.cloud.retail.v2beta.FulfillmentInfo; /** - * Encodes the specified PurgeMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeMetadata.verify|verify} messages. - * @param message PurgeMetadata message or plain object to encode + * Encodes the specified FulfillmentInfo message. Does not implicitly {@link google.cloud.retail.v2beta.FulfillmentInfo.verify|verify} messages. + * @param message FulfillmentInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IPurgeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IFulfillmentInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PurgeMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeMetadata.verify|verify} messages. - * @param message PurgeMetadata message or plain object to encode + * Encodes the specified FulfillmentInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.FulfillmentInfo.verify|verify} messages. + * @param message FulfillmentInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IFulfillmentInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PurgeMetadata message from the specified reader or buffer. + * Decodes a FulfillmentInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PurgeMetadata + * @returns FulfillmentInfo * @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.PurgeMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.FulfillmentInfo; /** - * Decodes a PurgeMetadata message from the specified reader or buffer, length delimited. + * Decodes a FulfillmentInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PurgeMetadata + * @returns FulfillmentInfo * @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.PurgeMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.FulfillmentInfo; /** - * Verifies a PurgeMetadata message. + * Verifies a FulfillmentInfo 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 PurgeMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a FulfillmentInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PurgeMetadata + * @returns FulfillmentInfo */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.FulfillmentInfo; /** - * Creates a plain object from a PurgeMetadata message. Also converts values to other types if specified. - * @param message PurgeMetadata + * Creates a plain object from a FulfillmentInfo message. Also converts values to other types if specified. + * @param message FulfillmentInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.PurgeMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.FulfillmentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PurgeMetadata to JSON. + * Converts this FulfillmentInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PurgeUserEventsRequest. */ - interface IPurgeUserEventsRequest { + /** Properties of an Image. */ + interface IImage { - /** PurgeUserEventsRequest parent */ - parent?: (string|null); + /** Image uri */ + uri?: (string|null); - /** PurgeUserEventsRequest filter */ - filter?: (string|null); + /** Image height */ + height?: (number|null); - /** PurgeUserEventsRequest force */ - force?: (boolean|null); + /** Image width */ + width?: (number|null); } - /** Represents a PurgeUserEventsRequest. */ - class PurgeUserEventsRequest implements IPurgeUserEventsRequest { + /** Represents an Image. */ + class Image implements IImage { /** - * Constructs a new PurgeUserEventsRequest. + * Constructs a new Image. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IPurgeUserEventsRequest); + constructor(properties?: google.cloud.retail.v2beta.IImage); - /** PurgeUserEventsRequest parent. */ - public parent: string; + /** Image uri. */ + public uri: string; - /** PurgeUserEventsRequest filter. */ - public filter: string; + /** Image height. */ + public height: number; - /** PurgeUserEventsRequest force. */ - public force: boolean; + /** Image width. */ + public width: number; /** - * Creates a new PurgeUserEventsRequest instance using the specified properties. + * Creates a new Image instance using the specified properties. * @param [properties] Properties to set - * @returns PurgeUserEventsRequest instance + * @returns Image instance */ - public static create(properties?: google.cloud.retail.v2alpha.IPurgeUserEventsRequest): google.cloud.retail.v2alpha.PurgeUserEventsRequest; + public static create(properties?: google.cloud.retail.v2beta.IImage): google.cloud.retail.v2beta.Image; /** - * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsRequest.verify|verify} messages. - * @param message PurgeUserEventsRequest message or plain object to encode + * Encodes the specified Image message. Does not implicitly {@link google.cloud.retail.v2beta.Image.verify|verify} messages. + * @param message Image message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IPurgeUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IImage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsRequest.verify|verify} messages. - * @param message PurgeUserEventsRequest message or plain object to encode + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Image.verify|verify} messages. + * @param message Image message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IImage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. + * Decodes an Image message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PurgeUserEventsRequest + * @returns Image * @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.PurgeUserEventsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.Image; /** - * Decodes a PurgeUserEventsRequest message from the specified reader or buffer, length delimited. + * Decodes an Image message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PurgeUserEventsRequest + * @returns Image * @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.PurgeUserEventsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.Image; /** - * Verifies a PurgeUserEventsRequest message. + * Verifies an Image 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 PurgeUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an Image message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PurgeUserEventsRequest + * @returns Image */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeUserEventsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Image; /** - * Creates a plain object from a PurgeUserEventsRequest message. Also converts values to other types if specified. - * @param message PurgeUserEventsRequest + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @param message Image * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.PurgeUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PurgeUserEventsRequest to JSON. + * Converts this Image to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PurgeUserEventsResponse. */ - interface IPurgeUserEventsResponse { + /** Properties of an Interval. */ + interface IInterval { + + /** Interval minimum */ + minimum?: (number|null); + + /** Interval exclusiveMinimum */ + exclusiveMinimum?: (number|null); + + /** Interval maximum */ + maximum?: (number|null); + + /** Interval exclusiveMaximum */ + exclusiveMaximum?: (number|null); + } + + /** Represents an Interval. */ + class Interval implements IInterval { + + /** + * Constructs a new Interval. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IInterval); + + /** Interval minimum. */ + public minimum?: (number|null); + + /** Interval exclusiveMinimum. */ + public exclusiveMinimum?: (number|null); - /** PurgeUserEventsResponse purgedEventsCount */ - purgedEventsCount?: (number|Long|string|null); - } + /** Interval maximum. */ + public maximum?: (number|null); - /** Represents a PurgeUserEventsResponse. */ - class PurgeUserEventsResponse implements IPurgeUserEventsResponse { + /** Interval exclusiveMaximum. */ + public exclusiveMaximum?: (number|null); - /** - * Constructs a new PurgeUserEventsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IPurgeUserEventsResponse); + /** Interval min. */ + public min?: ("minimum"|"exclusiveMinimum"); - /** PurgeUserEventsResponse purgedEventsCount. */ - public purgedEventsCount: (number|Long|string); + /** Interval max. */ + public max?: ("maximum"|"exclusiveMaximum"); /** - * Creates a new PurgeUserEventsResponse instance using the specified properties. + * Creates a new Interval instance using the specified properties. * @param [properties] Properties to set - * @returns PurgeUserEventsResponse instance + * @returns Interval instance */ - public static create(properties?: google.cloud.retail.v2alpha.IPurgeUserEventsResponse): google.cloud.retail.v2alpha.PurgeUserEventsResponse; + public static create(properties?: google.cloud.retail.v2beta.IInterval): google.cloud.retail.v2beta.Interval; /** - * Encodes the specified PurgeUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsResponse.verify|verify} messages. - * @param message PurgeUserEventsResponse message or plain object to encode + * Encodes the specified Interval message. Does not implicitly {@link google.cloud.retail.v2beta.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IPurgeUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PurgeUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsResponse.verify|verify} messages. - * @param message PurgeUserEventsResponse message or plain object to encode + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PurgeUserEventsResponse message from the specified reader or buffer. + * Decodes an Interval message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PurgeUserEventsResponse + * @returns Interval * @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.PurgeUserEventsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.Interval; /** - * Decodes a PurgeUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes an Interval message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PurgeUserEventsResponse + * @returns Interval * @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.PurgeUserEventsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.Interval; /** - * Verifies a PurgeUserEventsResponse message. + * Verifies an Interval 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 PurgeUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an Interval message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PurgeUserEventsResponse + * @returns Interval */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeUserEventsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Interval; /** - * Creates a plain object from a PurgeUserEventsResponse message. Also converts values to other types if specified. - * @param message PurgeUserEventsResponse + * Creates a plain object from an Interval message. Also converts values to other types if specified. + * @param message Interval * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.PurgeUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.Interval, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PurgeUserEventsResponse to JSON. + * Converts this Interval to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents a SearchService */ - class SearchService extends $protobuf.rpc.Service { - - /** - * Constructs a new SearchService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new SearchService service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SearchService; - - /** - * Calls Search. - * @param request SearchRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SearchResponse - */ - public search(request: google.cloud.retail.v2alpha.ISearchRequest, callback: google.cloud.retail.v2alpha.SearchService.SearchCallback): void; - - /** - * Calls Search. - * @param request SearchRequest message or plain object - * @returns Promise - */ - public search(request: google.cloud.retail.v2alpha.ISearchRequest): Promise; - } - - namespace SearchService { - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.SearchService#search}. - * @param error Error, if any - * @param [response] SearchResponse - */ - type SearchCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.SearchResponse) => void; - } - - /** Properties of a SearchRequest. */ - interface ISearchRequest { - - /** SearchRequest placement */ - placement?: (string|null); - - /** SearchRequest branch */ - branch?: (string|null); - - /** SearchRequest query */ - query?: (string|null); - - /** SearchRequest visitorId */ - visitorId?: (string|null); - - /** SearchRequest userInfo */ - userInfo?: (google.cloud.retail.v2alpha.IUserInfo|null); - - /** SearchRequest pageSize */ - pageSize?: (number|null); - - /** SearchRequest pageToken */ - pageToken?: (string|null); - - /** SearchRequest offset */ - offset?: (number|null); - - /** SearchRequest filter */ - filter?: (string|null); - - /** SearchRequest canonicalFilter */ - canonicalFilter?: (string|null); - - /** SearchRequest orderBy */ - orderBy?: (string|null); - - /** SearchRequest facetSpecs */ - facetSpecs?: (google.cloud.retail.v2alpha.SearchRequest.IFacetSpec[]|null); + /** Properties of a PriceInfo. */ + interface IPriceInfo { - /** SearchRequest dynamicFacetSpec */ - dynamicFacetSpec?: (google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec|null); + /** PriceInfo currencyCode */ + currencyCode?: (string|null); - /** SearchRequest boostSpec */ - boostSpec?: (google.cloud.retail.v2alpha.SearchRequest.IBoostSpec|null); + /** PriceInfo price */ + price?: (number|null); - /** SearchRequest queryExpansionSpec */ - queryExpansionSpec?: (google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec|null); + /** PriceInfo originalPrice */ + originalPrice?: (number|null); - /** SearchRequest relevanceThreshold */ - relevanceThreshold?: (google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold|keyof typeof google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold|null); + /** PriceInfo cost */ + cost?: (number|null); - /** SearchRequest variantRollupKeys */ - variantRollupKeys?: (string[]|null); + /** PriceInfo priceEffectiveTime */ + priceEffectiveTime?: (google.protobuf.ITimestamp|null); - /** SearchRequest pageCategories */ - pageCategories?: (string[]|null); + /** PriceInfo priceExpireTime */ + priceExpireTime?: (google.protobuf.ITimestamp|null); - /** SearchRequest searchMode */ - searchMode?: (google.cloud.retail.v2alpha.SearchRequest.SearchMode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.SearchMode|null); + /** PriceInfo priceRange */ + priceRange?: (google.cloud.retail.v2beta.PriceInfo.IPriceRange|null); } - /** Represents a SearchRequest. */ - class SearchRequest implements ISearchRequest { + /** Represents a PriceInfo. */ + class PriceInfo implements IPriceInfo { /** - * Constructs a new SearchRequest. + * Constructs a new PriceInfo. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ISearchRequest); - - /** SearchRequest placement. */ - public placement: string; - - /** SearchRequest branch. */ - public branch: string; - - /** SearchRequest query. */ - public query: string; - - /** SearchRequest visitorId. */ - public visitorId: string; - - /** SearchRequest userInfo. */ - public userInfo?: (google.cloud.retail.v2alpha.IUserInfo|null); - - /** SearchRequest pageSize. */ - public pageSize: number; - - /** SearchRequest pageToken. */ - public pageToken: string; - - /** SearchRequest offset. */ - public offset: number; - - /** SearchRequest filter. */ - public filter: string; - - /** SearchRequest canonicalFilter. */ - public canonicalFilter: string; - - /** SearchRequest orderBy. */ - public orderBy: string; - - /** SearchRequest facetSpecs. */ - public facetSpecs: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec[]; + constructor(properties?: google.cloud.retail.v2beta.IPriceInfo); - /** SearchRequest dynamicFacetSpec. */ - public dynamicFacetSpec?: (google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec|null); + /** PriceInfo currencyCode. */ + public currencyCode: string; - /** SearchRequest boostSpec. */ - public boostSpec?: (google.cloud.retail.v2alpha.SearchRequest.IBoostSpec|null); + /** PriceInfo price. */ + public price: number; - /** SearchRequest queryExpansionSpec. */ - public queryExpansionSpec?: (google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec|null); + /** PriceInfo originalPrice. */ + public originalPrice: number; - /** SearchRequest relevanceThreshold. */ - public relevanceThreshold: (google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold|keyof typeof google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold); + /** PriceInfo cost. */ + public cost: number; - /** SearchRequest variantRollupKeys. */ - public variantRollupKeys: string[]; + /** PriceInfo priceEffectiveTime. */ + public priceEffectiveTime?: (google.protobuf.ITimestamp|null); - /** SearchRequest pageCategories. */ - public pageCategories: string[]; + /** PriceInfo priceExpireTime. */ + public priceExpireTime?: (google.protobuf.ITimestamp|null); - /** SearchRequest searchMode. */ - public searchMode: (google.cloud.retail.v2alpha.SearchRequest.SearchMode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.SearchMode); + /** PriceInfo priceRange. */ + public priceRange?: (google.cloud.retail.v2beta.PriceInfo.IPriceRange|null); /** - * Creates a new SearchRequest instance using the specified properties. + * Creates a new PriceInfo instance using the specified properties. * @param [properties] Properties to set - * @returns SearchRequest instance + * @returns PriceInfo instance */ - public static create(properties?: google.cloud.retail.v2alpha.ISearchRequest): google.cloud.retail.v2alpha.SearchRequest; + public static create(properties?: google.cloud.retail.v2beta.IPriceInfo): google.cloud.retail.v2beta.PriceInfo; /** - * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.verify|verify} messages. - * @param message SearchRequest message or plain object to encode + * Encodes the specified PriceInfo message. Does not implicitly {@link google.cloud.retail.v2beta.PriceInfo.verify|verify} messages. + * @param message PriceInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IPriceInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.verify|verify} messages. - * @param message SearchRequest message or plain object to encode + * Encodes the specified PriceInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PriceInfo.verify|verify} messages. + * @param message PriceInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IPriceInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SearchRequest message from the specified reader or buffer. + * Decodes a PriceInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SearchRequest + * @returns PriceInfo * @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.SearchRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.PriceInfo; /** - * Decodes a SearchRequest message from the specified reader or buffer, length delimited. + * Decodes a PriceInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SearchRequest + * @returns PriceInfo * @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.SearchRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.PriceInfo; /** - * Verifies a SearchRequest message. + * Verifies a PriceInfo 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 SearchRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PriceInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SearchRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest; - - /** - * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. - * @param message SearchRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace SearchRequest { - - /** Properties of a FacetSpec. */ - interface IFacetSpec { - - /** FacetSpec facetKey */ - facetKey?: (google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey|null); - - /** FacetSpec limit */ - limit?: (number|null); - - /** FacetSpec excludedFilterKeys */ - excludedFilterKeys?: (string[]|null); - - /** FacetSpec enableDynamicPosition */ - enableDynamicPosition?: (boolean|null); - } - - /** Represents a FacetSpec. */ - class FacetSpec implements IFacetSpec { - - /** - * Constructs a new FacetSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec); - - /** FacetSpec facetKey. */ - public facetKey?: (google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey|null); - - /** FacetSpec limit. */ - public limit: number; - - /** FacetSpec excludedFilterKeys. */ - public excludedFilterKeys: string[]; - - /** FacetSpec enableDynamicPosition. */ - public enableDynamicPosition: boolean; - - /** - * Creates a new FacetSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns FacetSpec instance - */ - public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec): google.cloud.retail.v2alpha.SearchRequest.FacetSpec; - - /** - * Encodes the specified FacetSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify|verify} messages. - * @param message FacetSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify|verify} messages. - * @param message FacetSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FacetSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FacetSpec - * @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.SearchRequest.FacetSpec; - - /** - * Decodes a FacetSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FacetSpec - * @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.SearchRequest.FacetSpec; - - /** - * Verifies a FacetSpec 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 FacetSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FacetSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.FacetSpec; - - /** - * Creates a plain object from a FacetSpec message. Also converts values to other types if specified. - * @param message FacetSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.FacetSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FacetSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FacetSpec { - - /** Properties of a FacetKey. */ - interface IFacetKey { - - /** FacetKey key */ - key?: (string|null); - - /** FacetKey intervals */ - intervals?: (google.cloud.retail.v2alpha.IInterval[]|null); - - /** FacetKey restrictedValues */ - restrictedValues?: (string[]|null); - - /** FacetKey prefixes */ - prefixes?: (string[]|null); - - /** FacetKey contains */ - contains?: (string[]|null); - - /** FacetKey orderBy */ - orderBy?: (string|null); - - /** FacetKey query */ - query?: (string|null); - } - - /** Represents a FacetKey. */ - class FacetKey implements IFacetKey { - - /** - * Constructs a new FacetKey. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey); - - /** FacetKey key. */ - public key: string; - - /** FacetKey intervals. */ - public intervals: google.cloud.retail.v2alpha.IInterval[]; - - /** FacetKey restrictedValues. */ - public restrictedValues: string[]; - - /** FacetKey prefixes. */ - public prefixes: string[]; - - /** FacetKey contains. */ - public contains: string[]; - - /** FacetKey orderBy. */ - public orderBy: string; - - /** FacetKey query. */ - public query: string; - - /** - * Creates a new FacetKey instance using the specified properties. - * @param [properties] Properties to set - * @returns FacetKey instance - */ - public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey): google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey; - - /** - * Encodes the specified FacetKey message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. - * @param message FacetKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FacetKey message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. - * @param message FacetKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FacetKey message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FacetKey - * @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.SearchRequest.FacetSpec.FacetKey; - - /** - * Decodes a FacetKey message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FacetKey - * @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.SearchRequest.FacetSpec.FacetKey; + * @returns PriceInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PriceInfo; - /** - * Verifies a FacetKey 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 plain object from a PriceInfo message. Also converts values to other types if specified. + * @param message PriceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.PriceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a FacetKey message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FacetKey - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey; + /** + * Converts this PriceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a plain object from a FacetKey message. Also converts values to other types if specified. - * @param message FacetKey - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + namespace PriceInfo { - /** - * Converts this FacetKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** Properties of a PriceRange. */ + interface IPriceRange { - /** Properties of a DynamicFacetSpec. */ - interface IDynamicFacetSpec { + /** PriceRange price */ + price?: (google.cloud.retail.v2beta.IInterval|null); - /** DynamicFacetSpec mode */ - mode?: (google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode|null); + /** PriceRange originalPrice */ + originalPrice?: (google.cloud.retail.v2beta.IInterval|null); } - /** Represents a DynamicFacetSpec. */ - class DynamicFacetSpec implements IDynamicFacetSpec { + /** Represents a PriceRange. */ + class PriceRange implements IPriceRange { /** - * Constructs a new DynamicFacetSpec. + * Constructs a new PriceRange. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec); + constructor(properties?: google.cloud.retail.v2beta.PriceInfo.IPriceRange); - /** DynamicFacetSpec mode. */ - public mode: (google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode); + /** PriceRange price. */ + public price?: (google.cloud.retail.v2beta.IInterval|null); + + /** PriceRange originalPrice. */ + public originalPrice?: (google.cloud.retail.v2beta.IInterval|null); /** - * Creates a new DynamicFacetSpec instance using the specified properties. + * Creates a new PriceRange instance using the specified properties. * @param [properties] Properties to set - * @returns DynamicFacetSpec instance + * @returns PriceRange instance */ - public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec): google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec; + public static create(properties?: google.cloud.retail.v2beta.PriceInfo.IPriceRange): google.cloud.retail.v2beta.PriceInfo.PriceRange; /** - * Encodes the specified DynamicFacetSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify|verify} messages. - * @param message DynamicFacetSpec message or plain object to encode + * Encodes the specified PriceRange message. Does not implicitly {@link google.cloud.retail.v2beta.PriceInfo.PriceRange.verify|verify} messages. + * @param message PriceRange message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.PriceInfo.IPriceRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DynamicFacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify|verify} messages. - * @param message DynamicFacetSpec message or plain object to encode + * Encodes the specified PriceRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PriceInfo.PriceRange.verify|verify} messages. + * @param message PriceRange message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.PriceInfo.IPriceRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DynamicFacetSpec message from the specified reader or buffer. + * Decodes a PriceRange message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DynamicFacetSpec + * @returns PriceRange * @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.SearchRequest.DynamicFacetSpec; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.PriceInfo.PriceRange; /** - * Decodes a DynamicFacetSpec message from the specified reader or buffer, length delimited. + * Decodes a PriceRange message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DynamicFacetSpec + * @returns PriceRange * @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.SearchRequest.DynamicFacetSpec; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.PriceInfo.PriceRange; /** - * Verifies a DynamicFacetSpec message. + * Verifies a PriceRange 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 DynamicFacetSpec message from a plain object. Also converts values to their respective internal types. + * Creates a PriceRange message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DynamicFacetSpec + * @returns PriceRange */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PriceInfo.PriceRange; /** - * Creates a plain object from a DynamicFacetSpec message. Also converts values to other types if specified. - * @param message DynamicFacetSpec + * Creates a plain object from a PriceRange message. Also converts values to other types if specified. + * @param message PriceRange * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.PriceInfo.PriceRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DynamicFacetSpec to JSON. + * Converts this PriceRange to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - namespace DynamicFacetSpec { + /** Properties of a Rating. */ + interface IRating { - /** Mode enum. */ - enum Mode { - MODE_UNSPECIFIED = 0, - DISABLED = 1, - ENABLED = 2 - } - } + /** Rating ratingCount */ + ratingCount?: (number|null); - /** Properties of a BoostSpec. */ - interface IBoostSpec { + /** Rating averageRating */ + averageRating?: (number|null); - /** BoostSpec conditionBoostSpecs */ - conditionBoostSpecs?: (google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec[]|null); - } + /** Rating ratingHistogram */ + ratingHistogram?: (number[]|null); + } - /** Represents a BoostSpec. */ - class BoostSpec implements IBoostSpec { + /** Represents a Rating. */ + class Rating implements IRating { - /** - * Constructs a new BoostSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IBoostSpec); + /** + * Constructs a new Rating. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IRating); - /** BoostSpec conditionBoostSpecs. */ - public conditionBoostSpecs: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec[]; + /** Rating ratingCount. */ + public ratingCount: number; + + /** Rating averageRating. */ + public averageRating: number; + + /** Rating ratingHistogram. */ + public ratingHistogram: number[]; + + /** + * Creates a new Rating instance using the specified properties. + * @param [properties] Properties to set + * @returns Rating instance + */ + public static create(properties?: google.cloud.retail.v2beta.IRating): google.cloud.retail.v2beta.Rating; + + /** + * Encodes the specified Rating message. Does not implicitly {@link google.cloud.retail.v2beta.Rating.verify|verify} messages. + * @param message Rating message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IRating, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Rating message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rating.verify|verify} messages. + * @param message Rating message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IRating, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Rating message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Rating + * @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.v2beta.Rating; + + /** + * Decodes a Rating message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Rating + * @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.v2beta.Rating; + + /** + * Verifies a Rating 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 Rating message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Rating + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rating; + + /** + * Creates a plain object from a Rating message. Also converts values to other types if specified. + * @param message Rating + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.Rating, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Rating to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a UserInfo. */ + interface IUserInfo { + + /** UserInfo userId */ + userId?: (string|null); + + /** UserInfo ipAddress */ + ipAddress?: (string|null); + + /** UserInfo userAgent */ + userAgent?: (string|null); + + /** UserInfo directUserRequest */ + directUserRequest?: (boolean|null); + } + + /** Represents a UserInfo. */ + class UserInfo implements IUserInfo { + + /** + * Constructs a new UserInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IUserInfo); - /** - * Creates a new BoostSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns BoostSpec instance - */ - public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IBoostSpec): google.cloud.retail.v2alpha.SearchRequest.BoostSpec; + /** UserInfo userId. */ + public userId: string; - /** - * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify|verify} messages. - * @param message BoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** UserInfo ipAddress. */ + public ipAddress: string; - /** - * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify|verify} messages. - * @param message BoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** UserInfo userAgent. */ + public userAgent: string; - /** - * Decodes a BoostSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoostSpec - * @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.SearchRequest.BoostSpec; + /** UserInfo directUserRequest. */ + public directUserRequest: boolean; - /** - * Decodes a BoostSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoostSpec - * @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.SearchRequest.BoostSpec; + /** + * Creates a new UserInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns UserInfo instance + */ + public static create(properties?: google.cloud.retail.v2beta.IUserInfo): google.cloud.retail.v2beta.UserInfo; - /** - * Verifies a BoostSpec 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); + /** + * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.retail.v2beta.UserInfo.verify|verify} messages. + * @param message UserInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoostSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.BoostSpec; + /** + * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserInfo.verify|verify} messages. + * @param message UserInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. - * @param message BoostSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.BoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a UserInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserInfo + * @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.v2beta.UserInfo; - /** - * Converts this BoostSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a UserInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserInfo + * @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.v2beta.UserInfo; - namespace BoostSpec { + /** + * Verifies a UserInfo 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); - /** Properties of a ConditionBoostSpec. */ - interface IConditionBoostSpec { + /** + * Creates a UserInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UserInfo; - /** ConditionBoostSpec condition */ - condition?: (string|null); + /** + * Creates a plain object from a UserInfo message. Also converts values to other types if specified. + * @param message UserInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.UserInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ConditionBoostSpec boost */ - boost?: (number|null); - } + /** + * Converts this UserInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents a ConditionBoostSpec. */ - class ConditionBoostSpec implements IConditionBoostSpec { + /** Properties of a LocalInventory. */ + interface ILocalInventory { - /** - * Constructs a new ConditionBoostSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec); + /** LocalInventory placeId */ + placeId?: (string|null); - /** ConditionBoostSpec condition. */ - public condition: string; + /** LocalInventory priceInfo */ + priceInfo?: (google.cloud.retail.v2beta.IPriceInfo|null); - /** ConditionBoostSpec boost. */ - public boost: number; + /** LocalInventory attributes */ + attributes?: ({ [k: string]: google.cloud.retail.v2beta.ICustomAttribute }|null); - /** - * Creates a new ConditionBoostSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns ConditionBoostSpec instance - */ - public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec): google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec; + /** LocalInventory fulfillmentTypes */ + fulfillmentTypes?: (string[]|null); + } - /** - * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @param message ConditionBoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a LocalInventory. */ + class LocalInventory implements ILocalInventory { - /** - * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @param message ConditionBoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new LocalInventory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.ILocalInventory); - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConditionBoostSpec - * @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.SearchRequest.BoostSpec.ConditionBoostSpec; + /** LocalInventory placeId. */ + public placeId: string; - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConditionBoostSpec - * @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.SearchRequest.BoostSpec.ConditionBoostSpec; + /** LocalInventory priceInfo. */ + public priceInfo?: (google.cloud.retail.v2beta.IPriceInfo|null); - /** - * Verifies a ConditionBoostSpec 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); + /** LocalInventory attributes. */ + public attributes: { [k: string]: google.cloud.retail.v2beta.ICustomAttribute }; - /** - * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConditionBoostSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec; + /** LocalInventory fulfillmentTypes. */ + public fulfillmentTypes: string[]; - /** - * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. - * @param message ConditionBoostSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a new LocalInventory instance using the specified properties. + * @param [properties] Properties to set + * @returns LocalInventory instance + */ + public static create(properties?: google.cloud.retail.v2beta.ILocalInventory): google.cloud.retail.v2beta.LocalInventory; - /** - * Converts this ConditionBoostSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Encodes the specified LocalInventory message. Does not implicitly {@link google.cloud.retail.v2beta.LocalInventory.verify|verify} messages. + * @param message LocalInventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.ILocalInventory, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a QueryExpansionSpec. */ - interface IQueryExpansionSpec { + /** + * Encodes the specified LocalInventory message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.LocalInventory.verify|verify} messages. + * @param message LocalInventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.ILocalInventory, writer?: $protobuf.Writer): $protobuf.Writer; - /** QueryExpansionSpec condition */ - condition?: (google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition|null); + /** + * Decodes a LocalInventory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocalInventory + * @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.v2beta.LocalInventory; - /** QueryExpansionSpec pinUnexpandedResults */ - pinUnexpandedResults?: (boolean|null); - } + /** + * Decodes a LocalInventory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocalInventory + * @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.v2beta.LocalInventory; - /** Represents a QueryExpansionSpec. */ - class QueryExpansionSpec implements IQueryExpansionSpec { + /** + * Verifies a LocalInventory 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); - /** - * Constructs a new QueryExpansionSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec); + /** + * Creates a LocalInventory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocalInventory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.LocalInventory; - /** QueryExpansionSpec condition. */ - public condition: (google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition); + /** + * Creates a plain object from a LocalInventory message. Also converts values to other types if specified. + * @param message LocalInventory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.LocalInventory, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** QueryExpansionSpec pinUnexpandedResults. */ - public pinUnexpandedResults: boolean; + /** + * Converts this LocalInventory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new QueryExpansionSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryExpansionSpec instance - */ - public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec): google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec; + /** Properties of a GcsSource. */ + interface IGcsSource { - /** - * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify|verify} messages. - * @param message QueryExpansionSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** GcsSource inputUris */ + inputUris?: (string[]|null); - /** - * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify|verify} messages. - * @param message QueryExpansionSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** GcsSource dataSchema */ + dataSchema?: (string|null); + } - /** - * Decodes a QueryExpansionSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryExpansionSpec - * @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.SearchRequest.QueryExpansionSpec; + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { - /** - * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryExpansionSpec - * @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.SearchRequest.QueryExpansionSpec; + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IGcsSource); - /** - * Verifies a QueryExpansionSpec 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); + /** GcsSource inputUris. */ + public inputUris: string[]; - /** - * Creates a QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryExpansionSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec; + /** GcsSource dataSchema. */ + public dataSchema: string; - /** - * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. - * @param message QueryExpansionSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.retail.v2beta.IGcsSource): google.cloud.retail.v2beta.GcsSource; - /** - * Converts this QueryExpansionSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.retail.v2beta.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; - namespace QueryExpansionSpec { + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** Condition enum. */ - enum Condition { - CONDITION_UNSPECIFIED = 0, - DISABLED = 1, - AUTO = 3 - } - } + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsSource + * @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.v2beta.GcsSource; - /** RelevanceThreshold enum. */ - enum RelevanceThreshold { - RELEVANCE_THRESHOLD_UNSPECIFIED = 0, - HIGH = 1, - MEDIUM = 2, - LOW = 3, - LOWEST = 4 - } + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsSource + * @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.v2beta.GcsSource; - /** SearchMode enum. */ - enum SearchMode { - SEARCH_MODE_UNSPECIFIED = 0, - PRODUCT_SEARCH_ONLY = 1, - FACETED_SEARCH_ONLY = 2 - } - } + /** + * Verifies a GcsSource 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); - /** Properties of a SearchResponse. */ - interface ISearchResponse { + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.GcsSource; - /** SearchResponse results */ - results?: (google.cloud.retail.v2alpha.SearchResponse.ISearchResult[]|null); + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @param message GcsSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** SearchResponse facets */ - facets?: (google.cloud.retail.v2alpha.SearchResponse.IFacet[]|null); + /** + * Converts this GcsSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** SearchResponse totalSize */ - totalSize?: (number|null); + /** Properties of a BigQuerySource. */ + interface IBigQuerySource { - /** SearchResponse correctedQuery */ - correctedQuery?: (string|null); + /** BigQuerySource partitionDate */ + partitionDate?: (google.type.IDate|null); - /** SearchResponse attributionToken */ - attributionToken?: (string|null); + /** BigQuerySource projectId */ + projectId?: (string|null); - /** SearchResponse nextPageToken */ - nextPageToken?: (string|null); + /** BigQuerySource datasetId */ + datasetId?: (string|null); - /** SearchResponse queryExpansionInfo */ - queryExpansionInfo?: (google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo|null); + /** BigQuerySource tableId */ + tableId?: (string|null); - /** SearchResponse redirectUri */ - redirectUri?: (string|null); + /** BigQuerySource gcsStagingDir */ + gcsStagingDir?: (string|null); - /** SearchResponse appliedControls */ - appliedControls?: (string[]|null); + /** BigQuerySource dataSchema */ + dataSchema?: (string|null); } - /** Represents a SearchResponse. */ - class SearchResponse implements ISearchResponse { + /** Represents a BigQuerySource. */ + class BigQuerySource implements IBigQuerySource { /** - * Constructs a new SearchResponse. + * Constructs a new BigQuerySource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ISearchResponse); - - /** SearchResponse results. */ - public results: google.cloud.retail.v2alpha.SearchResponse.ISearchResult[]; - - /** SearchResponse facets. */ - public facets: google.cloud.retail.v2alpha.SearchResponse.IFacet[]; + constructor(properties?: google.cloud.retail.v2beta.IBigQuerySource); - /** SearchResponse totalSize. */ - public totalSize: number; + /** BigQuerySource partitionDate. */ + public partitionDate?: (google.type.IDate|null); - /** SearchResponse correctedQuery. */ - public correctedQuery: string; + /** BigQuerySource projectId. */ + public projectId: string; - /** SearchResponse attributionToken. */ - public attributionToken: string; + /** BigQuerySource datasetId. */ + public datasetId: string; - /** SearchResponse nextPageToken. */ - public nextPageToken: string; + /** BigQuerySource tableId. */ + public tableId: string; - /** SearchResponse queryExpansionInfo. */ - public queryExpansionInfo?: (google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo|null); + /** BigQuerySource gcsStagingDir. */ + public gcsStagingDir: string; - /** SearchResponse redirectUri. */ - public redirectUri: string; + /** BigQuerySource dataSchema. */ + public dataSchema: string; - /** SearchResponse appliedControls. */ - public appliedControls: string[]; + /** BigQuerySource partition. */ + public partition?: "partitionDate"; /** - * Creates a new SearchResponse instance using the specified properties. + * Creates a new BigQuerySource instance using the specified properties. * @param [properties] Properties to set - * @returns SearchResponse instance + * @returns BigQuerySource instance */ - public static create(properties?: google.cloud.retail.v2alpha.ISearchResponse): google.cloud.retail.v2alpha.SearchResponse; + public static create(properties?: google.cloud.retail.v2beta.IBigQuerySource): google.cloud.retail.v2beta.BigQuerySource; /** - * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.verify|verify} messages. - * @param message SearchResponse message or plain object to encode + * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.retail.v2beta.BigQuerySource.verify|verify} messages. + * @param message BigQuerySource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SearchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.verify|verify} messages. - * @param message SearchResponse message or plain object to encode + * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.BigQuerySource.verify|verify} messages. + * @param message BigQuerySource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SearchResponse message from the specified reader or buffer. + * Decodes a BigQuerySource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SearchResponse + * @returns BigQuerySource * @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.SearchResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.BigQuerySource; /** - * Decodes a SearchResponse message from the specified reader or buffer, length delimited. + * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SearchResponse + * @returns BigQuerySource * @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.SearchResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.BigQuerySource; /** - * Verifies a SearchResponse message. + * Verifies a BigQuerySource 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 SearchResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BigQuerySource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SearchResponse + * @returns BigQuerySource */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.BigQuerySource; /** - * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. - * @param message SearchResponse + * Creates a plain object from a BigQuerySource message. Also converts values to other types if specified. + * @param message BigQuerySource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.SearchResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.BigQuerySource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SearchResponse to JSON. + * Converts this BigQuerySource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace SearchResponse { + /** Properties of a ProductInlineSource. */ + interface IProductInlineSource { - /** Properties of a SearchResult. */ - interface ISearchResult { + /** ProductInlineSource products */ + products?: (google.cloud.retail.v2beta.IProduct[]|null); + } - /** SearchResult id */ - id?: (string|null); + /** Represents a ProductInlineSource. */ + class ProductInlineSource implements IProductInlineSource { - /** SearchResult product */ - product?: (google.cloud.retail.v2alpha.IProduct|null); + /** + * Constructs a new ProductInlineSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IProductInlineSource); - /** SearchResult matchingVariantCount */ - matchingVariantCount?: (number|null); + /** ProductInlineSource products. */ + public products: google.cloud.retail.v2beta.IProduct[]; - /** SearchResult matchingVariantFields */ - matchingVariantFields?: ({ [k: string]: google.protobuf.IFieldMask }|null); + /** + * Creates a new ProductInlineSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductInlineSource instance + */ + public static create(properties?: google.cloud.retail.v2beta.IProductInlineSource): google.cloud.retail.v2beta.ProductInlineSource; - /** SearchResult variantRollupValues */ - variantRollupValues?: ({ [k: string]: google.protobuf.IValue }|null); - } + /** + * Encodes the specified ProductInlineSource message. Does not implicitly {@link google.cloud.retail.v2beta.ProductInlineSource.verify|verify} messages. + * @param message ProductInlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IProductInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a SearchResult. */ - class SearchResult implements ISearchResult { + /** + * Encodes the specified ProductInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ProductInlineSource.verify|verify} messages. + * @param message ProductInlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IProductInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new SearchResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.SearchResponse.ISearchResult); + /** + * Decodes a ProductInlineSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductInlineSource + * @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.v2beta.ProductInlineSource; - /** SearchResult id. */ - public id: string; + /** + * Decodes a ProductInlineSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductInlineSource + * @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.v2beta.ProductInlineSource; - /** SearchResult product. */ - public product?: (google.cloud.retail.v2alpha.IProduct|null); + /** + * Verifies a ProductInlineSource 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); - /** SearchResult matchingVariantCount. */ - public matchingVariantCount: number; + /** + * Creates a ProductInlineSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductInlineSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ProductInlineSource; - /** SearchResult matchingVariantFields. */ - public matchingVariantFields: { [k: string]: google.protobuf.IFieldMask }; + /** + * Creates a plain object from a ProductInlineSource message. Also converts values to other types if specified. + * @param message ProductInlineSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.ProductInlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** SearchResult variantRollupValues. */ - public variantRollupValues: { [k: string]: google.protobuf.IValue }; + /** + * Converts this ProductInlineSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new SearchResult instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchResult instance - */ - public static create(properties?: google.cloud.retail.v2alpha.SearchResponse.ISearchResult): google.cloud.retail.v2alpha.SearchResponse.SearchResult; + /** Properties of a UserEventInlineSource. */ + interface IUserEventInlineSource { - /** - * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify|verify} messages. - * @param message SearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** UserEventInlineSource userEvents */ + userEvents?: (google.cloud.retail.v2beta.IUserEvent[]|null); + } - /** - * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify|verify} messages. - * @param message SearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a UserEventInlineSource. */ + class UserEventInlineSource implements IUserEventInlineSource { - /** - * Decodes a SearchResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchResult - * @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.SearchResponse.SearchResult; + /** + * Constructs a new UserEventInlineSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IUserEventInlineSource); - /** - * Decodes a SearchResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchResult - * @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.SearchResponse.SearchResult; + /** UserEventInlineSource userEvents. */ + public userEvents: google.cloud.retail.v2beta.IUserEvent[]; - /** - * Verifies a SearchResult 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 new UserEventInlineSource instance using the specified properties. + * @param [properties] Properties to set + * @returns UserEventInlineSource instance + */ + public static create(properties?: google.cloud.retail.v2beta.IUserEventInlineSource): google.cloud.retail.v2beta.UserEventInlineSource; + + /** + * Encodes the specified UserEventInlineSource message. Does not implicitly {@link google.cloud.retail.v2beta.UserEventInlineSource.verify|verify} messages. + * @param message UserEventInlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IUserEventInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse.SearchResult; + /** + * Encodes the specified UserEventInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserEventInlineSource.verify|verify} messages. + * @param message UserEventInlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IUserEventInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a SearchResult message. Also converts values to other types if specified. - * @param message SearchResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchResponse.SearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a UserEventInlineSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserEventInlineSource + * @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.v2beta.UserEventInlineSource; - /** - * Converts this SearchResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a UserEventInlineSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserEventInlineSource + * @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.v2beta.UserEventInlineSource; - /** Properties of a Facet. */ - interface IFacet { + /** + * Verifies a UserEventInlineSource 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); - /** Facet key */ - key?: (string|null); + /** + * Creates a UserEventInlineSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserEventInlineSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UserEventInlineSource; - /** Facet values */ - values?: (google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue[]|null); + /** + * Creates a plain object from a UserEventInlineSource message. Also converts values to other types if specified. + * @param message UserEventInlineSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.UserEventInlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Facet dynamicFacet */ - dynamicFacet?: (boolean|null); - } + /** + * Converts this UserEventInlineSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents a Facet. */ - class Facet implements IFacet { + /** Properties of an ImportErrorsConfig. */ + interface IImportErrorsConfig { - /** - * Constructs a new Facet. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.SearchResponse.IFacet); + /** ImportErrorsConfig gcsPrefix */ + gcsPrefix?: (string|null); + } - /** Facet key. */ - public key: string; + /** Represents an ImportErrorsConfig. */ + class ImportErrorsConfig implements IImportErrorsConfig { - /** Facet values. */ - public values: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue[]; + /** + * Constructs a new ImportErrorsConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IImportErrorsConfig); - /** Facet dynamicFacet. */ - public dynamicFacet: boolean; + /** ImportErrorsConfig gcsPrefix. */ + public gcsPrefix?: (string|null); - /** - * Creates a new Facet instance using the specified properties. - * @param [properties] Properties to set - * @returns Facet instance - */ - public static create(properties?: google.cloud.retail.v2alpha.SearchResponse.IFacet): google.cloud.retail.v2alpha.SearchResponse.Facet; + /** ImportErrorsConfig destination. */ + public destination?: "gcsPrefix"; - /** - * Encodes the specified Facet message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.verify|verify} messages. - * @param message Facet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.SearchResponse.IFacet, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new ImportErrorsConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportErrorsConfig instance + */ + public static create(properties?: google.cloud.retail.v2beta.IImportErrorsConfig): google.cloud.retail.v2beta.ImportErrorsConfig; - /** - * Encodes the specified Facet message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.verify|verify} messages. - * @param message Facet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchResponse.IFacet, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified ImportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ImportErrorsConfig.verify|verify} messages. + * @param message ImportErrorsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IImportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Facet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Facet - * @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.SearchResponse.Facet; + /** + * Encodes the specified ImportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportErrorsConfig.verify|verify} messages. + * @param message ImportErrorsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IImportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Facet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Facet - * @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.SearchResponse.Facet; + /** + * Decodes an ImportErrorsConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportErrorsConfig + * @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.v2beta.ImportErrorsConfig; - /** - * Verifies a Facet 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); + /** + * Decodes an ImportErrorsConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportErrorsConfig + * @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.v2beta.ImportErrorsConfig; - /** - * Creates a Facet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Facet - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse.Facet; + /** + * Verifies an ImportErrorsConfig 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 plain object from a Facet message. Also converts values to other types if specified. - * @param message Facet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchResponse.Facet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates an ImportErrorsConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportErrorsConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ImportErrorsConfig; - /** - * Converts this Facet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from an ImportErrorsConfig message. Also converts values to other types if specified. + * @param message ImportErrorsConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.ImportErrorsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - namespace Facet { + /** + * Converts this ImportErrorsConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of a FacetValue. */ - interface IFacetValue { + /** Properties of an ImportProductsRequest. */ + interface IImportProductsRequest { - /** FacetValue value */ - value?: (string|null); + /** ImportProductsRequest parent */ + parent?: (string|null); - /** FacetValue interval */ - interval?: (google.cloud.retail.v2alpha.IInterval|null); + /** ImportProductsRequest requestId */ + requestId?: (string|null); - /** FacetValue count */ - count?: (number|Long|string|null); - } + /** ImportProductsRequest inputConfig */ + inputConfig?: (google.cloud.retail.v2beta.IProductInputConfig|null); - /** Represents a FacetValue. */ - class FacetValue implements IFacetValue { + /** ImportProductsRequest errorsConfig */ + errorsConfig?: (google.cloud.retail.v2beta.IImportErrorsConfig|null); - /** - * Constructs a new FacetValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue); + /** ImportProductsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** FacetValue value. */ - public value?: (string|null); + /** ImportProductsRequest reconciliationMode */ + reconciliationMode?: (google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode|keyof typeof google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode|null); - /** FacetValue interval. */ - public interval?: (google.cloud.retail.v2alpha.IInterval|null); + /** ImportProductsRequest notificationPubsubTopic */ + notificationPubsubTopic?: (string|null); + } - /** FacetValue count. */ - public count: (number|Long|string); + /** Represents an ImportProductsRequest. */ + class ImportProductsRequest implements IImportProductsRequest { - /** FacetValue facetValue. */ - public facetValue?: ("value"|"interval"); + /** + * Constructs a new ImportProductsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IImportProductsRequest); - /** - * Creates a new FacetValue instance using the specified properties. - * @param [properties] Properties to set - * @returns FacetValue instance - */ - public static create(properties?: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue): google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue; + /** ImportProductsRequest parent. */ + public parent: string; - /** - * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify|verify} messages. - * @param message FacetValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** ImportProductsRequest requestId. */ + public requestId: string; - /** - * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify|verify} messages. - * @param message FacetValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** ImportProductsRequest inputConfig. */ + public inputConfig?: (google.cloud.retail.v2beta.IProductInputConfig|null); - /** - * Decodes a FacetValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FacetValue - * @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.SearchResponse.Facet.FacetValue; + /** ImportProductsRequest errorsConfig. */ + public errorsConfig?: (google.cloud.retail.v2beta.IImportErrorsConfig|null); - /** - * Decodes a FacetValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FacetValue - * @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.SearchResponse.Facet.FacetValue; + /** ImportProductsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** - * Verifies a FacetValue 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); + /** ImportProductsRequest reconciliationMode. */ + public reconciliationMode: (google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode|keyof typeof google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode); - /** - * Creates a FacetValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FacetValue - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue; + /** ImportProductsRequest notificationPubsubTopic. */ + public notificationPubsubTopic: string; - /** - * Creates a plain object from a FacetValue message. Also converts values to other types if specified. - * @param message FacetValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a new ImportProductsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProductsRequest instance + */ + public static create(properties?: google.cloud.retail.v2beta.IImportProductsRequest): google.cloud.retail.v2beta.ImportProductsRequest; - /** - * Converts this FacetValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Encodes the specified ImportProductsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ImportProductsRequest.verify|verify} messages. + * @param message ImportProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IImportProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a QueryExpansionInfo. */ - interface IQueryExpansionInfo { + /** + * Encodes the specified ImportProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportProductsRequest.verify|verify} messages. + * @param message ImportProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IImportProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** QueryExpansionInfo expandedQuery */ - expandedQuery?: (boolean|null); + /** + * Decodes an ImportProductsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProductsRequest + * @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.v2beta.ImportProductsRequest; - /** QueryExpansionInfo pinnedResultCount */ - pinnedResultCount?: (number|Long|string|null); - } + /** + * Decodes an ImportProductsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProductsRequest + * @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.v2beta.ImportProductsRequest; - /** Represents a QueryExpansionInfo. */ - class QueryExpansionInfo implements IQueryExpansionInfo { + /** + * Verifies an ImportProductsRequest 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); - /** - * Constructs a new QueryExpansionInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo); + /** + * Creates an ImportProductsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProductsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ImportProductsRequest; - /** QueryExpansionInfo expandedQuery. */ - public expandedQuery: boolean; + /** + * Creates a plain object from an ImportProductsRequest message. Also converts values to other types if specified. + * @param message ImportProductsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.ImportProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** QueryExpansionInfo pinnedResultCount. */ - public pinnedResultCount: (number|Long|string); + /** + * Converts this ImportProductsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new QueryExpansionInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryExpansionInfo instance - */ - public static create(properties?: google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo): google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo; + namespace ImportProductsRequest { - /** - * Encodes the specified QueryExpansionInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify|verify} messages. - * @param message QueryExpansionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** ReconciliationMode enum. */ + enum ReconciliationMode { + RECONCILIATION_MODE_UNSPECIFIED = 0, + INCREMENTAL = 1, + FULL = 2 + } + } - /** - * Encodes the specified QueryExpansionInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify|verify} messages. - * @param message QueryExpansionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of an ImportUserEventsRequest. */ + interface IImportUserEventsRequest { - /** - * Decodes a QueryExpansionInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryExpansionInfo - * @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.SearchResponse.QueryExpansionInfo; + /** ImportUserEventsRequest parent */ + parent?: (string|null); - /** - * Decodes a QueryExpansionInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryExpansionInfo - * @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.SearchResponse.QueryExpansionInfo; + /** ImportUserEventsRequest inputConfig */ + inputConfig?: (google.cloud.retail.v2beta.IUserEventInputConfig|null); - /** - * Verifies a QueryExpansionInfo 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); + /** ImportUserEventsRequest errorsConfig */ + errorsConfig?: (google.cloud.retail.v2beta.IImportErrorsConfig|null); + } - /** - * Creates a QueryExpansionInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryExpansionInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo; + /** Represents an ImportUserEventsRequest. */ + class ImportUserEventsRequest implements IImportUserEventsRequest { + + /** + * Constructs a new ImportUserEventsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IImportUserEventsRequest); - /** - * Creates a plain object from a QueryExpansionInfo message. Also converts values to other types if specified. - * @param message QueryExpansionInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ImportUserEventsRequest parent. */ + public parent: string; - /** - * Converts this QueryExpansionInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** ImportUserEventsRequest inputConfig. */ + public inputConfig?: (google.cloud.retail.v2beta.IUserEventInputConfig|null); - /** Represents a UserEventService */ - class UserEventService extends $protobuf.rpc.Service { + /** ImportUserEventsRequest errorsConfig. */ + public errorsConfig?: (google.cloud.retail.v2beta.IImportErrorsConfig|null); /** - * Constructs a new UserEventService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Creates a new ImportUserEventsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportUserEventsRequest instance */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + public static create(properties?: google.cloud.retail.v2beta.IImportUserEventsRequest): google.cloud.retail.v2beta.ImportUserEventsRequest; /** - * Creates new UserEventService service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. + * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ImportUserEventsRequest.verify|verify} messages. + * @param message ImportUserEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): UserEventService; + public static encode(message: google.cloud.retail.v2beta.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls WriteUserEvent. - * @param request WriteUserEventRequest message or plain object - * @param callback Node-style callback called with the error, if any, and UserEvent + * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportUserEventsRequest.verify|verify} messages. + * @param message ImportUserEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public writeUserEvent(request: google.cloud.retail.v2alpha.IWriteUserEventRequest, callback: google.cloud.retail.v2alpha.UserEventService.WriteUserEventCallback): void; + public static encodeDelimited(message: google.cloud.retail.v2beta.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls WriteUserEvent. - * @param request WriteUserEventRequest message or plain object - * @returns Promise + * Decodes an ImportUserEventsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public writeUserEvent(request: google.cloud.retail.v2alpha.IWriteUserEventRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ImportUserEventsRequest; /** - * Calls CollectUserEvent. - * @param request CollectUserEventRequest message or plain object - * @param callback Node-style callback called with the error, if any, and HttpBody + * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public collectUserEvent(request: google.cloud.retail.v2alpha.ICollectUserEventRequest, callback: google.cloud.retail.v2alpha.UserEventService.CollectUserEventCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ImportUserEventsRequest; /** - * Calls CollectUserEvent. - * @param request CollectUserEventRequest message or plain object - * @returns Promise + * Verifies an ImportUserEventsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public collectUserEvent(request: google.cloud.retail.v2alpha.ICollectUserEventRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls PurgeUserEvents. - * @param request PurgeUserEventsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates an ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportUserEventsRequest */ - public purgeUserEvents(request: google.cloud.retail.v2alpha.IPurgeUserEventsRequest, callback: google.cloud.retail.v2alpha.UserEventService.PurgeUserEventsCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ImportUserEventsRequest; /** - * Calls PurgeUserEvents. - * @param request PurgeUserEventsRequest message or plain object - * @returns Promise + * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. + * @param message ImportUserEventsRequest + * @param [options] Conversion options + * @returns Plain object */ - public purgeUserEvents(request: google.cloud.retail.v2alpha.IPurgeUserEventsRequest): Promise; + public static toObject(message: google.cloud.retail.v2beta.ImportUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls ImportUserEvents. - * @param request ImportUserEventsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Converts this ImportUserEventsRequest to JSON. + * @returns JSON object */ - public importUserEvents(request: google.cloud.retail.v2alpha.IImportUserEventsRequest, callback: google.cloud.retail.v2alpha.UserEventService.ImportUserEventsCallback): void; + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportCompletionDataRequest. */ + interface IImportCompletionDataRequest { + + /** ImportCompletionDataRequest parent */ + parent?: (string|null); + + /** ImportCompletionDataRequest inputConfig */ + inputConfig?: (google.cloud.retail.v2beta.ICompletionDataInputConfig|null); + + /** ImportCompletionDataRequest notificationPubsubTopic */ + notificationPubsubTopic?: (string|null); + } + + /** Represents an ImportCompletionDataRequest. */ + class ImportCompletionDataRequest implements IImportCompletionDataRequest { /** - * Calls ImportUserEvents. - * @param request ImportUserEventsRequest message or plain object - * @returns Promise + * Constructs a new ImportCompletionDataRequest. + * @param [properties] Properties to set */ - public importUserEvents(request: google.cloud.retail.v2alpha.IImportUserEventsRequest): Promise; + constructor(properties?: google.cloud.retail.v2beta.IImportCompletionDataRequest); + + /** ImportCompletionDataRequest parent. */ + public parent: string; + + /** ImportCompletionDataRequest inputConfig. */ + public inputConfig?: (google.cloud.retail.v2beta.ICompletionDataInputConfig|null); + + /** ImportCompletionDataRequest notificationPubsubTopic. */ + public notificationPubsubTopic: string; /** - * Calls RejoinUserEvents. - * @param request RejoinUserEventsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a new ImportCompletionDataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportCompletionDataRequest instance */ - public rejoinUserEvents(request: google.cloud.retail.v2alpha.IRejoinUserEventsRequest, callback: google.cloud.retail.v2alpha.UserEventService.RejoinUserEventsCallback): void; + public static create(properties?: google.cloud.retail.v2beta.IImportCompletionDataRequest): google.cloud.retail.v2beta.ImportCompletionDataRequest; /** - * Calls RejoinUserEvents. - * @param request RejoinUserEventsRequest message or plain object - * @returns Promise + * Encodes the specified ImportCompletionDataRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ImportCompletionDataRequest.verify|verify} messages. + * @param message ImportCompletionDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public rejoinUserEvents(request: google.cloud.retail.v2alpha.IRejoinUserEventsRequest): Promise; - } + public static encode(message: google.cloud.retail.v2beta.IImportCompletionDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; - namespace UserEventService { + /** + * Encodes the specified ImportCompletionDataRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportCompletionDataRequest.verify|verify} messages. + * @param message ImportCompletionDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IImportCompletionDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#writeUserEvent}. - * @param error Error, if any - * @param [response] UserEvent + * Decodes an ImportCompletionDataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportCompletionDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type WriteUserEventCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.UserEvent) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ImportCompletionDataRequest; /** - * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#collectUserEvent}. - * @param error Error, if any - * @param [response] HttpBody + * Decodes an ImportCompletionDataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportCompletionDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type CollectUserEventCallback = (error: (Error|null), response?: google.api.HttpBody) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ImportCompletionDataRequest; /** - * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#purgeUserEvents}. - * @param error Error, if any - * @param [response] Operation + * Verifies an ImportCompletionDataRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type PurgeUserEventsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#importUserEvents}. - * @param error Error, if any - * @param [response] Operation + * Creates an ImportCompletionDataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportCompletionDataRequest */ - type ImportUserEventsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ImportCompletionDataRequest; /** - * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#rejoinUserEvents}. - * @param error Error, if any - * @param [response] Operation + * Creates a plain object from an ImportCompletionDataRequest message. Also converts values to other types if specified. + * @param message ImportCompletionDataRequest + * @param [options] Conversion options + * @returns Plain object */ - type RejoinUserEventsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static toObject(message: google.cloud.retail.v2beta.ImportCompletionDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportCompletionDataRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } - /** Properties of a WriteUserEventRequest. */ - interface IWriteUserEventRequest { + /** Properties of a ProductInputConfig. */ + interface IProductInputConfig { - /** WriteUserEventRequest parent */ - parent?: (string|null); + /** ProductInputConfig productInlineSource */ + productInlineSource?: (google.cloud.retail.v2beta.IProductInlineSource|null); - /** WriteUserEventRequest userEvent */ - userEvent?: (google.cloud.retail.v2alpha.IUserEvent|null); + /** ProductInputConfig gcsSource */ + gcsSource?: (google.cloud.retail.v2beta.IGcsSource|null); + + /** ProductInputConfig bigQuerySource */ + bigQuerySource?: (google.cloud.retail.v2beta.IBigQuerySource|null); } - /** Represents a WriteUserEventRequest. */ - class WriteUserEventRequest implements IWriteUserEventRequest { + /** Represents a ProductInputConfig. */ + class ProductInputConfig implements IProductInputConfig { /** - * Constructs a new WriteUserEventRequest. + * Constructs a new ProductInputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IWriteUserEventRequest); + constructor(properties?: google.cloud.retail.v2beta.IProductInputConfig); - /** WriteUserEventRequest parent. */ - public parent: string; + /** ProductInputConfig productInlineSource. */ + public productInlineSource?: (google.cloud.retail.v2beta.IProductInlineSource|null); - /** WriteUserEventRequest userEvent. */ - public userEvent?: (google.cloud.retail.v2alpha.IUserEvent|null); + /** ProductInputConfig gcsSource. */ + public gcsSource?: (google.cloud.retail.v2beta.IGcsSource|null); + + /** ProductInputConfig bigQuerySource. */ + public bigQuerySource?: (google.cloud.retail.v2beta.IBigQuerySource|null); + + /** ProductInputConfig source. */ + public source?: ("productInlineSource"|"gcsSource"|"bigQuerySource"); /** - * Creates a new WriteUserEventRequest instance using the specified properties. + * Creates a new ProductInputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns WriteUserEventRequest instance + * @returns ProductInputConfig instance */ - public static create(properties?: google.cloud.retail.v2alpha.IWriteUserEventRequest): google.cloud.retail.v2alpha.WriteUserEventRequest; + public static create(properties?: google.cloud.retail.v2beta.IProductInputConfig): google.cloud.retail.v2beta.ProductInputConfig; /** - * Encodes the specified WriteUserEventRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.WriteUserEventRequest.verify|verify} messages. - * @param message WriteUserEventRequest message or plain object to encode + * Encodes the specified ProductInputConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ProductInputConfig.verify|verify} messages. + * @param message ProductInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IWriteUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IProductInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WriteUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.WriteUserEventRequest.verify|verify} messages. - * @param message WriteUserEventRequest message or plain object to encode + * Encodes the specified ProductInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ProductInputConfig.verify|verify} messages. + * @param message ProductInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IWriteUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IProductInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WriteUserEventRequest message from the specified reader or buffer. + * Decodes a ProductInputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WriteUserEventRequest + * @returns ProductInputConfig * @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.WriteUserEventRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ProductInputConfig; /** - * Decodes a WriteUserEventRequest message from the specified reader or buffer, length delimited. + * Decodes a ProductInputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WriteUserEventRequest + * @returns ProductInputConfig * @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.WriteUserEventRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ProductInputConfig; /** - * Verifies a WriteUserEventRequest message. + * Verifies a ProductInputConfig 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 WriteUserEventRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ProductInputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WriteUserEventRequest + * @returns ProductInputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.WriteUserEventRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ProductInputConfig; /** - * Creates a plain object from a WriteUserEventRequest message. Also converts values to other types if specified. - * @param message WriteUserEventRequest + * Creates a plain object from a ProductInputConfig message. Also converts values to other types if specified. + * @param message ProductInputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.WriteUserEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.ProductInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WriteUserEventRequest to JSON. + * Converts this ProductInputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CollectUserEventRequest. */ - interface ICollectUserEventRequest { - - /** CollectUserEventRequest parent */ - parent?: (string|null); + /** Properties of a UserEventInputConfig. */ + interface IUserEventInputConfig { - /** CollectUserEventRequest userEvent */ - userEvent?: (string|null); + /** UserEventInputConfig userEventInlineSource */ + userEventInlineSource?: (google.cloud.retail.v2beta.IUserEventInlineSource|null); - /** CollectUserEventRequest uri */ - uri?: (string|null); + /** UserEventInputConfig gcsSource */ + gcsSource?: (google.cloud.retail.v2beta.IGcsSource|null); - /** CollectUserEventRequest ets */ - ets?: (number|Long|string|null); + /** UserEventInputConfig bigQuerySource */ + bigQuerySource?: (google.cloud.retail.v2beta.IBigQuerySource|null); } - /** Represents a CollectUserEventRequest. */ - class CollectUserEventRequest implements ICollectUserEventRequest { + /** Represents a UserEventInputConfig. */ + class UserEventInputConfig implements IUserEventInputConfig { /** - * Constructs a new CollectUserEventRequest. + * Constructs a new UserEventInputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICollectUserEventRequest); + constructor(properties?: google.cloud.retail.v2beta.IUserEventInputConfig); - /** CollectUserEventRequest parent. */ - public parent: string; + /** UserEventInputConfig userEventInlineSource. */ + public userEventInlineSource?: (google.cloud.retail.v2beta.IUserEventInlineSource|null); - /** CollectUserEventRequest userEvent. */ - public userEvent: string; + /** UserEventInputConfig gcsSource. */ + public gcsSource?: (google.cloud.retail.v2beta.IGcsSource|null); - /** CollectUserEventRequest uri. */ - public uri: string; + /** UserEventInputConfig bigQuerySource. */ + public bigQuerySource?: (google.cloud.retail.v2beta.IBigQuerySource|null); - /** CollectUserEventRequest ets. */ - public ets: (number|Long|string); + /** UserEventInputConfig source. */ + public source?: ("userEventInlineSource"|"gcsSource"|"bigQuerySource"); /** - * Creates a new CollectUserEventRequest instance using the specified properties. + * Creates a new UserEventInputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns CollectUserEventRequest instance + * @returns UserEventInputConfig instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICollectUserEventRequest): google.cloud.retail.v2alpha.CollectUserEventRequest; + public static create(properties?: google.cloud.retail.v2beta.IUserEventInputConfig): google.cloud.retail.v2beta.UserEventInputConfig; /** - * Encodes the specified CollectUserEventRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CollectUserEventRequest.verify|verify} messages. - * @param message CollectUserEventRequest message or plain object to encode + * Encodes the specified UserEventInputConfig message. Does not implicitly {@link google.cloud.retail.v2beta.UserEventInputConfig.verify|verify} messages. + * @param message UserEventInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ICollectUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IUserEventInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CollectUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CollectUserEventRequest.verify|verify} messages. - * @param message CollectUserEventRequest message or plain object to encode + * Encodes the specified UserEventInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserEventInputConfig.verify|verify} messages. + * @param message UserEventInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICollectUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IUserEventInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CollectUserEventRequest message from the specified reader or buffer. + * Decodes a UserEventInputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CollectUserEventRequest + * @returns UserEventInputConfig * @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.CollectUserEventRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.UserEventInputConfig; /** - * Decodes a CollectUserEventRequest message from the specified reader or buffer, length delimited. + * Decodes a UserEventInputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CollectUserEventRequest + * @returns UserEventInputConfig * @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.CollectUserEventRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.UserEventInputConfig; /** - * Verifies a CollectUserEventRequest message. + * Verifies a UserEventInputConfig 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 CollectUserEventRequest message from a plain object. Also converts values to their respective internal types. + * Creates a UserEventInputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CollectUserEventRequest + * @returns UserEventInputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CollectUserEventRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UserEventInputConfig; /** - * Creates a plain object from a CollectUserEventRequest message. Also converts values to other types if specified. - * @param message CollectUserEventRequest + * Creates a plain object from a UserEventInputConfig message. Also converts values to other types if specified. + * @param message UserEventInputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.CollectUserEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.UserEventInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CollectUserEventRequest to JSON. + * Converts this UserEventInputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RejoinUserEventsRequest. */ - interface IRejoinUserEventsRequest { - - /** RejoinUserEventsRequest parent */ - parent?: (string|null); + /** Properties of a CompletionDataInputConfig. */ + interface ICompletionDataInputConfig { - /** RejoinUserEventsRequest userEventRejoinScope */ - userEventRejoinScope?: (google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope|keyof typeof google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope|null); + /** CompletionDataInputConfig bigQuerySource */ + bigQuerySource?: (google.cloud.retail.v2beta.IBigQuerySource|null); } - /** Represents a RejoinUserEventsRequest. */ - class RejoinUserEventsRequest implements IRejoinUserEventsRequest { + /** Represents a CompletionDataInputConfig. */ + class CompletionDataInputConfig implements ICompletionDataInputConfig { /** - * Constructs a new RejoinUserEventsRequest. + * Constructs a new CompletionDataInputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IRejoinUserEventsRequest); + constructor(properties?: google.cloud.retail.v2beta.ICompletionDataInputConfig); - /** RejoinUserEventsRequest parent. */ - public parent: string; + /** CompletionDataInputConfig bigQuerySource. */ + public bigQuerySource?: (google.cloud.retail.v2beta.IBigQuerySource|null); - /** RejoinUserEventsRequest userEventRejoinScope. */ - public userEventRejoinScope: (google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope|keyof typeof google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope); + /** CompletionDataInputConfig source. */ + public source?: "bigQuerySource"; /** - * Creates a new RejoinUserEventsRequest instance using the specified properties. + * Creates a new CompletionDataInputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns RejoinUserEventsRequest instance + * @returns CompletionDataInputConfig instance */ - public static create(properties?: google.cloud.retail.v2alpha.IRejoinUserEventsRequest): google.cloud.retail.v2alpha.RejoinUserEventsRequest; + public static create(properties?: google.cloud.retail.v2beta.ICompletionDataInputConfig): google.cloud.retail.v2beta.CompletionDataInputConfig; /** - * Encodes the specified RejoinUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsRequest.verify|verify} messages. - * @param message RejoinUserEventsRequest message or plain object to encode + * Encodes the specified CompletionDataInputConfig message. Does not implicitly {@link google.cloud.retail.v2beta.CompletionDataInputConfig.verify|verify} messages. + * @param message CompletionDataInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IRejoinUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.ICompletionDataInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RejoinUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsRequest.verify|verify} messages. - * @param message RejoinUserEventsRequest message or plain object to encode + * Encodes the specified CompletionDataInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompletionDataInputConfig.verify|verify} messages. + * @param message CompletionDataInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRejoinUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.ICompletionDataInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RejoinUserEventsRequest message from the specified reader or buffer. + * Decodes a CompletionDataInputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RejoinUserEventsRequest + * @returns CompletionDataInputConfig * @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.RejoinUserEventsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.CompletionDataInputConfig; /** - * Decodes a RejoinUserEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a CompletionDataInputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RejoinUserEventsRequest + * @returns CompletionDataInputConfig * @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.RejoinUserEventsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.CompletionDataInputConfig; /** - * Verifies a RejoinUserEventsRequest message. + * Verifies a CompletionDataInputConfig 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 RejoinUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CompletionDataInputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RejoinUserEventsRequest + * @returns CompletionDataInputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RejoinUserEventsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CompletionDataInputConfig; /** - * Creates a plain object from a RejoinUserEventsRequest message. Also converts values to other types if specified. - * @param message RejoinUserEventsRequest + * Creates a plain object from a CompletionDataInputConfig message. Also converts values to other types if specified. + * @param message CompletionDataInputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.RejoinUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.CompletionDataInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RejoinUserEventsRequest to JSON. + * Converts this CompletionDataInputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace RejoinUserEventsRequest { + /** Properties of an ImportMetadata. */ + interface IImportMetadata { - /** UserEventRejoinScope enum. */ - enum UserEventRejoinScope { - USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0, - JOINED_EVENTS = 1, - UNJOINED_EVENTS = 2 - } - } + /** ImportMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** Properties of a RejoinUserEventsResponse. */ - interface IRejoinUserEventsResponse { + /** ImportMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** RejoinUserEventsResponse rejoinedUserEventsCount */ - rejoinedUserEventsCount?: (number|Long|string|null); + /** ImportMetadata successCount */ + successCount?: (number|Long|string|null); + + /** ImportMetadata failureCount */ + failureCount?: (number|Long|string|null); + + /** ImportMetadata requestId */ + requestId?: (string|null); + + /** ImportMetadata notificationPubsubTopic */ + notificationPubsubTopic?: (string|null); } - /** Represents a RejoinUserEventsResponse. */ - class RejoinUserEventsResponse implements IRejoinUserEventsResponse { + /** Represents an ImportMetadata. */ + class ImportMetadata implements IImportMetadata { /** - * Constructs a new RejoinUserEventsResponse. + * Constructs a new ImportMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IRejoinUserEventsResponse); + constructor(properties?: google.cloud.retail.v2beta.IImportMetadata); + + /** ImportMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ImportMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ImportMetadata successCount. */ + public successCount: (number|Long|string); + + /** ImportMetadata failureCount. */ + public failureCount: (number|Long|string); + + /** ImportMetadata requestId. */ + public requestId: string; - /** RejoinUserEventsResponse rejoinedUserEventsCount. */ - public rejoinedUserEventsCount: (number|Long|string); + /** ImportMetadata notificationPubsubTopic. */ + public notificationPubsubTopic: string; /** - * Creates a new RejoinUserEventsResponse instance using the specified properties. + * Creates a new ImportMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns RejoinUserEventsResponse instance + * @returns ImportMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.IRejoinUserEventsResponse): google.cloud.retail.v2alpha.RejoinUserEventsResponse; + public static create(properties?: google.cloud.retail.v2beta.IImportMetadata): google.cloud.retail.v2beta.ImportMetadata; /** - * Encodes the specified RejoinUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsResponse.verify|verify} messages. - * @param message RejoinUserEventsResponse message or plain object to encode + * Encodes the specified ImportMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.ImportMetadata.verify|verify} messages. + * @param message ImportMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IRejoinUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IImportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RejoinUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsResponse.verify|verify} messages. - * @param message RejoinUserEventsResponse message or plain object to encode + * Encodes the specified ImportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportMetadata.verify|verify} messages. + * @param message ImportMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRejoinUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IImportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RejoinUserEventsResponse message from the specified reader or buffer. + * Decodes an ImportMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RejoinUserEventsResponse + * @returns ImportMetadata * @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.RejoinUserEventsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ImportMetadata; /** - * Decodes a RejoinUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes an ImportMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RejoinUserEventsResponse + * @returns ImportMetadata * @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.RejoinUserEventsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ImportMetadata; /** - * Verifies a RejoinUserEventsResponse message. + * Verifies an ImportMetadata 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 RejoinUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ImportMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RejoinUserEventsResponse + * @returns ImportMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RejoinUserEventsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ImportMetadata; /** - * Creates a plain object from a RejoinUserEventsResponse message. Also converts values to other types if specified. - * @param message RejoinUserEventsResponse + * Creates a plain object from an ImportMetadata message. Also converts values to other types if specified. + * @param message ImportMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.RejoinUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.ImportMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RejoinUserEventsResponse to JSON. + * Converts this ImportMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RejoinUserEventsMetadata. */ - interface IRejoinUserEventsMetadata { + /** Properties of an ImportProductsResponse. */ + interface IImportProductsResponse { + + /** ImportProductsResponse errorSamples */ + errorSamples?: (google.rpc.IStatus[]|null); + + /** ImportProductsResponse errorsConfig */ + errorsConfig?: (google.cloud.retail.v2beta.IImportErrorsConfig|null); } - /** Represents a RejoinUserEventsMetadata. */ - class RejoinUserEventsMetadata implements IRejoinUserEventsMetadata { + /** Represents an ImportProductsResponse. */ + class ImportProductsResponse implements IImportProductsResponse { /** - * Constructs a new RejoinUserEventsMetadata. + * Constructs a new ImportProductsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IRejoinUserEventsMetadata); + constructor(properties?: google.cloud.retail.v2beta.IImportProductsResponse); + + /** ImportProductsResponse errorSamples. */ + public errorSamples: google.rpc.IStatus[]; + + /** ImportProductsResponse errorsConfig. */ + public errorsConfig?: (google.cloud.retail.v2beta.IImportErrorsConfig|null); /** - * Creates a new RejoinUserEventsMetadata instance using the specified properties. + * Creates a new ImportProductsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns RejoinUserEventsMetadata instance + * @returns ImportProductsResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IRejoinUserEventsMetadata): google.cloud.retail.v2alpha.RejoinUserEventsMetadata; + public static create(properties?: google.cloud.retail.v2beta.IImportProductsResponse): google.cloud.retail.v2beta.ImportProductsResponse; /** - * Encodes the specified RejoinUserEventsMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsMetadata.verify|verify} messages. - * @param message RejoinUserEventsMetadata message or plain object to encode + * Encodes the specified ImportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ImportProductsResponse.verify|verify} messages. + * @param message ImportProductsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IRejoinUserEventsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IImportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RejoinUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsMetadata.verify|verify} messages. - * @param message RejoinUserEventsMetadata message or plain object to encode + * Encodes the specified ImportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportProductsResponse.verify|verify} messages. + * @param message ImportProductsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRejoinUserEventsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IImportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RejoinUserEventsMetadata message from the specified reader or buffer. + * Decodes an ImportProductsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RejoinUserEventsMetadata + * @returns ImportProductsResponse * @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.RejoinUserEventsMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ImportProductsResponse; /** - * Decodes a RejoinUserEventsMetadata message from the specified reader or buffer, length delimited. + * Decodes an ImportProductsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RejoinUserEventsMetadata + * @returns ImportProductsResponse * @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.RejoinUserEventsMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ImportProductsResponse; /** - * Verifies a RejoinUserEventsMetadata message. + * Verifies an ImportProductsResponse 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 RejoinUserEventsMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an ImportProductsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RejoinUserEventsMetadata + * @returns ImportProductsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RejoinUserEventsMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ImportProductsResponse; /** - * Creates a plain object from a RejoinUserEventsMetadata message. Also converts values to other types if specified. - * @param message RejoinUserEventsMetadata + * Creates a plain object from an ImportProductsResponse message. Also converts values to other types if specified. + * @param message ImportProductsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.RejoinUserEventsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.ImportProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RejoinUserEventsMetadata to JSON. + * Converts this ImportProductsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - /** Namespace v2beta. */ - namespace v2beta { + /** Properties of an ImportUserEventsResponse. */ + interface IImportUserEventsResponse { - /** Properties of a ProductLevelConfig. */ - interface IProductLevelConfig { + /** ImportUserEventsResponse errorSamples */ + errorSamples?: (google.rpc.IStatus[]|null); - /** ProductLevelConfig ingestionProductType */ - ingestionProductType?: (string|null); + /** ImportUserEventsResponse errorsConfig */ + errorsConfig?: (google.cloud.retail.v2beta.IImportErrorsConfig|null); - /** ProductLevelConfig merchantCenterProductIdField */ - merchantCenterProductIdField?: (string|null); + /** ImportUserEventsResponse importSummary */ + importSummary?: (google.cloud.retail.v2beta.IUserEventImportSummary|null); } - /** Represents a ProductLevelConfig. */ - class ProductLevelConfig implements IProductLevelConfig { + /** Represents an ImportUserEventsResponse. */ + class ImportUserEventsResponse implements IImportUserEventsResponse { /** - * Constructs a new ProductLevelConfig. + * Constructs a new ImportUserEventsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IProductLevelConfig); + constructor(properties?: google.cloud.retail.v2beta.IImportUserEventsResponse); - /** ProductLevelConfig ingestionProductType. */ - public ingestionProductType: string; + /** ImportUserEventsResponse errorSamples. */ + public errorSamples: google.rpc.IStatus[]; - /** ProductLevelConfig merchantCenterProductIdField. */ - public merchantCenterProductIdField: string; + /** ImportUserEventsResponse errorsConfig. */ + public errorsConfig?: (google.cloud.retail.v2beta.IImportErrorsConfig|null); + + /** ImportUserEventsResponse importSummary. */ + public importSummary?: (google.cloud.retail.v2beta.IUserEventImportSummary|null); /** - * Creates a new ProductLevelConfig instance using the specified properties. + * Creates a new ImportUserEventsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ProductLevelConfig instance + * @returns ImportUserEventsResponse instance */ - public static create(properties?: google.cloud.retail.v2beta.IProductLevelConfig): google.cloud.retail.v2beta.ProductLevelConfig; + public static create(properties?: google.cloud.retail.v2beta.IImportUserEventsResponse): google.cloud.retail.v2beta.ImportUserEventsResponse; /** - * Encodes the specified ProductLevelConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ProductLevelConfig.verify|verify} messages. - * @param message ProductLevelConfig message or plain object to encode + * Encodes the specified ImportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ImportUserEventsResponse.verify|verify} messages. + * @param message ImportUserEventsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IProductLevelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IImportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ProductLevelConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ProductLevelConfig.verify|verify} messages. - * @param message ProductLevelConfig message or plain object to encode + * Encodes the specified ImportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportUserEventsResponse.verify|verify} messages. + * @param message ImportUserEventsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IProductLevelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IImportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ProductLevelConfig message from the specified reader or buffer. + * Decodes an ImportUserEventsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ProductLevelConfig + * @returns ImportUserEventsResponse * @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.v2beta.ProductLevelConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ImportUserEventsResponse; /** - * Decodes a ProductLevelConfig message from the specified reader or buffer, length delimited. + * Decodes an ImportUserEventsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ProductLevelConfig + * @returns ImportUserEventsResponse * @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.v2beta.ProductLevelConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ImportUserEventsResponse; /** - * Verifies a ProductLevelConfig message. + * Verifies an ImportUserEventsResponse 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 ProductLevelConfig message from a plain object. Also converts values to their respective internal types. + * Creates an ImportUserEventsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ProductLevelConfig + * @returns ImportUserEventsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ProductLevelConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ImportUserEventsResponse; /** - * Creates a plain object from a ProductLevelConfig message. Also converts values to other types if specified. - * @param message ProductLevelConfig + * Creates a plain object from an ImportUserEventsResponse message. Also converts values to other types if specified. + * @param message ImportUserEventsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.ProductLevelConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.ImportUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ProductLevelConfig to JSON. + * Converts this ImportUserEventsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Catalog. */ - interface ICatalog { - - /** Catalog name */ - name?: (string|null); + /** Properties of a UserEventImportSummary. */ + interface IUserEventImportSummary { - /** Catalog displayName */ - displayName?: (string|null); + /** UserEventImportSummary joinedEventsCount */ + joinedEventsCount?: (number|Long|string|null); - /** Catalog productLevelConfig */ - productLevelConfig?: (google.cloud.retail.v2beta.IProductLevelConfig|null); + /** UserEventImportSummary unjoinedEventsCount */ + unjoinedEventsCount?: (number|Long|string|null); } - /** Represents a Catalog. */ - class Catalog implements ICatalog { + /** Represents a UserEventImportSummary. */ + class UserEventImportSummary implements IUserEventImportSummary { /** - * Constructs a new Catalog. + * Constructs a new UserEventImportSummary. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.ICatalog); - - /** Catalog name. */ - public name: string; + constructor(properties?: google.cloud.retail.v2beta.IUserEventImportSummary); - /** Catalog displayName. */ - public displayName: string; + /** UserEventImportSummary joinedEventsCount. */ + public joinedEventsCount: (number|Long|string); - /** Catalog productLevelConfig. */ - public productLevelConfig?: (google.cloud.retail.v2beta.IProductLevelConfig|null); + /** UserEventImportSummary unjoinedEventsCount. */ + public unjoinedEventsCount: (number|Long|string); /** - * Creates a new Catalog instance using the specified properties. + * Creates a new UserEventImportSummary instance using the specified properties. * @param [properties] Properties to set - * @returns Catalog instance + * @returns UserEventImportSummary instance */ - public static create(properties?: google.cloud.retail.v2beta.ICatalog): google.cloud.retail.v2beta.Catalog; + public static create(properties?: google.cloud.retail.v2beta.IUserEventImportSummary): google.cloud.retail.v2beta.UserEventImportSummary; /** - * Encodes the specified Catalog message. Does not implicitly {@link google.cloud.retail.v2beta.Catalog.verify|verify} messages. - * @param message Catalog message or plain object to encode + * Encodes the specified UserEventImportSummary message. Does not implicitly {@link google.cloud.retail.v2beta.UserEventImportSummary.verify|verify} messages. + * @param message UserEventImportSummary message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.ICatalog, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IUserEventImportSummary, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Catalog message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Catalog.verify|verify} messages. - * @param message Catalog message or plain object to encode + * Encodes the specified UserEventImportSummary message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserEventImportSummary.verify|verify} messages. + * @param message UserEventImportSummary message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.ICatalog, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IUserEventImportSummary, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Catalog message from the specified reader or buffer. + * Decodes a UserEventImportSummary message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Catalog + * @returns UserEventImportSummary * @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.v2beta.Catalog; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.UserEventImportSummary; /** - * Decodes a Catalog message from the specified reader or buffer, length delimited. + * Decodes a UserEventImportSummary message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Catalog + * @returns UserEventImportSummary * @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.v2beta.Catalog; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.UserEventImportSummary; /** - * Verifies a Catalog message. + * Verifies a UserEventImportSummary 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 Catalog message from a plain object. Also converts values to their respective internal types. + * Creates a UserEventImportSummary message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Catalog + * @returns UserEventImportSummary */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Catalog; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UserEventImportSummary; /** - * Creates a plain object from a Catalog message. Also converts values to other types if specified. - * @param message Catalog + * Creates a plain object from a UserEventImportSummary message. Also converts values to other types if specified. + * @param message UserEventImportSummary * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.Catalog, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.UserEventImportSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Catalog to JSON. + * Converts this UserEventImportSummary to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** SolutionType enum. */ - enum SolutionType { - SOLUTION_TYPE_UNSPECIFIED = 0, - SOLUTION_TYPE_RECOMMENDATION = 1, - SOLUTION_TYPE_SEARCH = 2 - } - - /** Properties of a Condition. */ - interface ICondition { - - /** Condition queryTerms */ - queryTerms?: (google.cloud.retail.v2beta.Condition.IQueryTerm[]|null); + /** Properties of an ImportCompletionDataResponse. */ + interface IImportCompletionDataResponse { - /** Condition activeTimeRange */ - activeTimeRange?: (google.cloud.retail.v2beta.Condition.ITimeRange[]|null); + /** ImportCompletionDataResponse errorSamples */ + errorSamples?: (google.rpc.IStatus[]|null); } - /** Represents a Condition. */ - class Condition implements ICondition { + /** Represents an ImportCompletionDataResponse. */ + class ImportCompletionDataResponse implements IImportCompletionDataResponse { /** - * Constructs a new Condition. + * Constructs a new ImportCompletionDataResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.ICondition); - - /** Condition queryTerms. */ - public queryTerms: google.cloud.retail.v2beta.Condition.IQueryTerm[]; + constructor(properties?: google.cloud.retail.v2beta.IImportCompletionDataResponse); - /** Condition activeTimeRange. */ - public activeTimeRange: google.cloud.retail.v2beta.Condition.ITimeRange[]; + /** ImportCompletionDataResponse errorSamples. */ + public errorSamples: google.rpc.IStatus[]; /** - * Creates a new Condition instance using the specified properties. + * Creates a new ImportCompletionDataResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Condition instance + * @returns ImportCompletionDataResponse instance */ - public static create(properties?: google.cloud.retail.v2beta.ICondition): google.cloud.retail.v2beta.Condition; + public static create(properties?: google.cloud.retail.v2beta.IImportCompletionDataResponse): google.cloud.retail.v2beta.ImportCompletionDataResponse; /** - * Encodes the specified Condition message. Does not implicitly {@link google.cloud.retail.v2beta.Condition.verify|verify} messages. - * @param message Condition message or plain object to encode + * Encodes the specified ImportCompletionDataResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ImportCompletionDataResponse.verify|verify} messages. + * @param message ImportCompletionDataResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IImportCompletionDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Condition.verify|verify} messages. - * @param message Condition message or plain object to encode + * Encodes the specified ImportCompletionDataResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportCompletionDataResponse.verify|verify} messages. + * @param message ImportCompletionDataResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IImportCompletionDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Condition message from the specified reader or buffer. + * Decodes an ImportCompletionDataResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Condition + * @returns ImportCompletionDataResponse * @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.v2beta.Condition; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ImportCompletionDataResponse; /** - * Decodes a Condition message from the specified reader or buffer, length delimited. + * Decodes an ImportCompletionDataResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Condition + * @returns ImportCompletionDataResponse * @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.v2beta.Condition; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ImportCompletionDataResponse; /** - * Verifies a Condition message. + * Verifies an ImportCompletionDataResponse 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 Condition message from a plain object. Also converts values to their respective internal types. + * Creates an ImportCompletionDataResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Condition + * @returns ImportCompletionDataResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Condition; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ImportCompletionDataResponse; /** - * Creates a plain object from a Condition message. Also converts values to other types if specified. - * @param message Condition + * Creates a plain object from an ImportCompletionDataResponse message. Also converts values to other types if specified. + * @param message ImportCompletionDataResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.ImportCompletionDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Condition to JSON. + * Converts this ImportCompletionDataResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Condition { + /** Properties of a Product. */ + interface IProduct { - /** Properties of a QueryTerm. */ - interface IQueryTerm { + /** Product expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); - /** QueryTerm value */ - value?: (string|null); + /** Product ttl */ + ttl?: (google.protobuf.IDuration|null); - /** QueryTerm fullMatch */ - fullMatch?: (boolean|null); - } + /** Product name */ + name?: (string|null); - /** Represents a QueryTerm. */ - class QueryTerm implements IQueryTerm { + /** Product id */ + id?: (string|null); - /** - * Constructs a new QueryTerm. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.Condition.IQueryTerm); + /** Product type */ + type?: (google.cloud.retail.v2beta.Product.Type|keyof typeof google.cloud.retail.v2beta.Product.Type|null); - /** QueryTerm value. */ - public value: string; + /** Product primaryProductId */ + primaryProductId?: (string|null); - /** QueryTerm fullMatch. */ - public fullMatch: boolean; + /** Product collectionMemberIds */ + collectionMemberIds?: (string[]|null); - /** - * Creates a new QueryTerm instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryTerm instance - */ - public static create(properties?: google.cloud.retail.v2beta.Condition.IQueryTerm): google.cloud.retail.v2beta.Condition.QueryTerm; + /** Product gtin */ + gtin?: (string|null); - /** - * Encodes the specified QueryTerm message. Does not implicitly {@link google.cloud.retail.v2beta.Condition.QueryTerm.verify|verify} messages. - * @param message QueryTerm message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.Condition.IQueryTerm, writer?: $protobuf.Writer): $protobuf.Writer; + /** Product categories */ + categories?: (string[]|null); - /** - * Encodes the specified QueryTerm message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Condition.QueryTerm.verify|verify} messages. - * @param message QueryTerm message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.Condition.IQueryTerm, writer?: $protobuf.Writer): $protobuf.Writer; + /** Product title */ + title?: (string|null); - /** - * Decodes a QueryTerm message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryTerm - * @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.v2beta.Condition.QueryTerm; + /** Product brands */ + brands?: (string[]|null); - /** - * Decodes a QueryTerm message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryTerm - * @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.v2beta.Condition.QueryTerm; + /** Product description */ + description?: (string|null); - /** - * Verifies a QueryTerm 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); + /** Product languageCode */ + languageCode?: (string|null); - /** - * Creates a QueryTerm message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryTerm - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Condition.QueryTerm; + /** Product attributes */ + attributes?: ({ [k: string]: google.cloud.retail.v2beta.ICustomAttribute }|null); - /** - * Creates a plain object from a QueryTerm message. Also converts values to other types if specified. - * @param message QueryTerm - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.Condition.QueryTerm, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Product tags */ + tags?: (string[]|null); + + /** Product priceInfo */ + priceInfo?: (google.cloud.retail.v2beta.IPriceInfo|null); + + /** Product rating */ + rating?: (google.cloud.retail.v2beta.IRating|null); + + /** Product availableTime */ + availableTime?: (google.protobuf.ITimestamp|null); + + /** Product availability */ + availability?: (google.cloud.retail.v2beta.Product.Availability|keyof typeof google.cloud.retail.v2beta.Product.Availability|null); + + /** Product availableQuantity */ + availableQuantity?: (google.protobuf.IInt32Value|null); + + /** Product fulfillmentInfo */ + fulfillmentInfo?: (google.cloud.retail.v2beta.IFulfillmentInfo[]|null); + + /** Product uri */ + uri?: (string|null); + + /** Product images */ + images?: (google.cloud.retail.v2beta.IImage[]|null); + + /** Product audience */ + audience?: (google.cloud.retail.v2beta.IAudience|null); + + /** Product colorInfo */ + colorInfo?: (google.cloud.retail.v2beta.IColorInfo|null); + + /** Product sizes */ + sizes?: (string[]|null); + + /** Product materials */ + materials?: (string[]|null); + + /** Product patterns */ + patterns?: (string[]|null); + + /** Product conditions */ + conditions?: (string[]|null); - /** - * Converts this QueryTerm to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Product promotions */ + promotions?: (google.cloud.retail.v2beta.IPromotion[]|null); - /** Properties of a TimeRange. */ - interface ITimeRange { + /** Product publishTime */ + publishTime?: (google.protobuf.ITimestamp|null); - /** TimeRange startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** Product retrievableFields */ + retrievableFields?: (google.protobuf.IFieldMask|null); - /** TimeRange endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } + /** Product variants */ + variants?: (google.cloud.retail.v2beta.IProduct[]|null); + } - /** Represents a TimeRange. */ - class TimeRange implements ITimeRange { + /** Represents a Product. */ + class Product implements IProduct { - /** - * Constructs a new TimeRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.Condition.ITimeRange); + /** + * Constructs a new Product. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IProduct); - /** TimeRange startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** Product expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); - /** TimeRange endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** Product ttl. */ + public ttl?: (google.protobuf.IDuration|null); - /** - * Creates a new TimeRange instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeRange instance - */ - public static create(properties?: google.cloud.retail.v2beta.Condition.ITimeRange): google.cloud.retail.v2beta.Condition.TimeRange; + /** Product name. */ + public name: string; - /** - * Encodes the specified TimeRange message. Does not implicitly {@link google.cloud.retail.v2beta.Condition.TimeRange.verify|verify} messages. - * @param message TimeRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.Condition.ITimeRange, writer?: $protobuf.Writer): $protobuf.Writer; + /** Product id. */ + public id: string; - /** - * Encodes the specified TimeRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Condition.TimeRange.verify|verify} messages. - * @param message TimeRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.Condition.ITimeRange, writer?: $protobuf.Writer): $protobuf.Writer; + /** Product type. */ + public type: (google.cloud.retail.v2beta.Product.Type|keyof typeof google.cloud.retail.v2beta.Product.Type); - /** - * Decodes a TimeRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimeRange - * @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.v2beta.Condition.TimeRange; + /** Product primaryProductId. */ + public primaryProductId: string; - /** - * Decodes a TimeRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimeRange - * @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.v2beta.Condition.TimeRange; + /** Product collectionMemberIds. */ + public collectionMemberIds: string[]; - /** - * Verifies a TimeRange 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); + /** Product gtin. */ + public gtin: string; - /** - * Creates a TimeRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimeRange - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Condition.TimeRange; + /** Product categories. */ + public categories: string[]; - /** - * Creates a plain object from a TimeRange message. Also converts values to other types if specified. - * @param message TimeRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.Condition.TimeRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Product title. */ + public title: string; - /** - * Converts this TimeRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** Product brands. */ + public brands: string[]; - /** Properties of a Rule. */ - interface IRule { + /** Product description. */ + public description: string; - /** Rule boostAction */ - boostAction?: (google.cloud.retail.v2beta.Rule.IBoostAction|null); + /** Product languageCode. */ + public languageCode: string; - /** Rule redirectAction */ - redirectAction?: (google.cloud.retail.v2beta.Rule.IRedirectAction|null); + /** Product attributes. */ + public attributes: { [k: string]: google.cloud.retail.v2beta.ICustomAttribute }; - /** Rule onewaySynonymsAction */ - onewaySynonymsAction?: (google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction|null); + /** Product tags. */ + public tags: string[]; - /** Rule doNotAssociateAction */ - doNotAssociateAction?: (google.cloud.retail.v2beta.Rule.IDoNotAssociateAction|null); + /** Product priceInfo. */ + public priceInfo?: (google.cloud.retail.v2beta.IPriceInfo|null); - /** Rule replacementAction */ - replacementAction?: (google.cloud.retail.v2beta.Rule.IReplacementAction|null); + /** Product rating. */ + public rating?: (google.cloud.retail.v2beta.IRating|null); - /** Rule ignoreAction */ - ignoreAction?: (google.cloud.retail.v2beta.Rule.IIgnoreAction|null); + /** Product availableTime. */ + public availableTime?: (google.protobuf.ITimestamp|null); - /** Rule filterAction */ - filterAction?: (google.cloud.retail.v2beta.Rule.IFilterAction|null); + /** Product availability. */ + public availability: (google.cloud.retail.v2beta.Product.Availability|keyof typeof google.cloud.retail.v2beta.Product.Availability); - /** Rule twowaySynonymsAction */ - twowaySynonymsAction?: (google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction|null); + /** Product availableQuantity. */ + public availableQuantity?: (google.protobuf.IInt32Value|null); - /** Rule condition */ - condition?: (google.cloud.retail.v2beta.ICondition|null); - } + /** Product fulfillmentInfo. */ + public fulfillmentInfo: google.cloud.retail.v2beta.IFulfillmentInfo[]; - /** Represents a Rule. */ - class Rule implements IRule { + /** Product uri. */ + public uri: string; - /** - * Constructs a new Rule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.IRule); + /** Product images. */ + public images: google.cloud.retail.v2beta.IImage[]; - /** Rule boostAction. */ - public boostAction?: (google.cloud.retail.v2beta.Rule.IBoostAction|null); + /** Product audience. */ + public audience?: (google.cloud.retail.v2beta.IAudience|null); - /** Rule redirectAction. */ - public redirectAction?: (google.cloud.retail.v2beta.Rule.IRedirectAction|null); + /** Product colorInfo. */ + public colorInfo?: (google.cloud.retail.v2beta.IColorInfo|null); - /** Rule onewaySynonymsAction. */ - public onewaySynonymsAction?: (google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction|null); + /** Product sizes. */ + public sizes: string[]; - /** Rule doNotAssociateAction. */ - public doNotAssociateAction?: (google.cloud.retail.v2beta.Rule.IDoNotAssociateAction|null); + /** Product materials. */ + public materials: string[]; - /** Rule replacementAction. */ - public replacementAction?: (google.cloud.retail.v2beta.Rule.IReplacementAction|null); + /** Product patterns. */ + public patterns: string[]; - /** Rule ignoreAction. */ - public ignoreAction?: (google.cloud.retail.v2beta.Rule.IIgnoreAction|null); + /** Product conditions. */ + public conditions: string[]; - /** Rule filterAction. */ - public filterAction?: (google.cloud.retail.v2beta.Rule.IFilterAction|null); + /** Product promotions. */ + public promotions: google.cloud.retail.v2beta.IPromotion[]; - /** Rule twowaySynonymsAction. */ - public twowaySynonymsAction?: (google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction|null); + /** Product publishTime. */ + public publishTime?: (google.protobuf.ITimestamp|null); - /** Rule condition. */ - public condition?: (google.cloud.retail.v2beta.ICondition|null); + /** Product retrievableFields. */ + public retrievableFields?: (google.protobuf.IFieldMask|null); - /** Rule action. */ - public action?: ("boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"); + /** Product variants. */ + public variants: google.cloud.retail.v2beta.IProduct[]; + + /** Product expiration. */ + public expiration?: ("expireTime"|"ttl"); /** - * Creates a new Rule instance using the specified properties. + * Creates a new Product instance using the specified properties. * @param [properties] Properties to set - * @returns Rule instance + * @returns Product instance */ - public static create(properties?: google.cloud.retail.v2beta.IRule): google.cloud.retail.v2beta.Rule; + public static create(properties?: google.cloud.retail.v2beta.IProduct): google.cloud.retail.v2beta.Product; /** - * Encodes the specified Rule message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.verify|verify} messages. - * @param message Rule message or plain object to encode + * Encodes the specified Product message. Does not implicitly {@link google.cloud.retail.v2beta.Product.verify|verify} messages. + * @param message Product message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.verify|verify} messages. - * @param message Rule message or plain object to encode + * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Product.verify|verify} messages. + * @param message Product message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Rule message from the specified reader or buffer. + * Decodes a Product message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Rule + * @returns Product * @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.v2beta.Rule; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.Product; /** - * Decodes a Rule message from the specified reader or buffer, length delimited. + * Decodes a Product message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Rule + * @returns Product * @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.v2beta.Rule; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.Product; /** - * Verifies a Rule message. + * Verifies a Product 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 Rule message from a plain object. Also converts values to their respective internal types. + * Creates a Product message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Rule + * @returns Product */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Product; /** - * Creates a plain object from a Rule message. Also converts values to other types if specified. - * @param message Rule + * Creates a plain object from a Product message. Also converts values to other types if specified. + * @param message Product * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.Rule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.Product, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Rule to JSON. + * Converts this Product to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Rule { - - /** Properties of a BoostAction. */ - interface IBoostAction { - - /** BoostAction boost */ - boost?: (number|null); - - /** BoostAction productsFilter */ - productsFilter?: (string|null); - } - - /** Represents a BoostAction. */ - class BoostAction implements IBoostAction { - - /** - * Constructs a new BoostAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.Rule.IBoostAction); - - /** BoostAction boost. */ - public boost: number; - - /** BoostAction productsFilter. */ - public productsFilter: string; - - /** - * Creates a new BoostAction instance using the specified properties. - * @param [properties] Properties to set - * @returns BoostAction instance - */ - public static create(properties?: google.cloud.retail.v2beta.Rule.IBoostAction): google.cloud.retail.v2beta.Rule.BoostAction; - - /** - * Encodes the specified BoostAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.BoostAction.verify|verify} messages. - * @param message BoostAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.Rule.IBoostAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoostAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.BoostAction.verify|verify} messages. - * @param message BoostAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.IBoostAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BoostAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoostAction - * @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.v2beta.Rule.BoostAction; - - /** - * Decodes a BoostAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoostAction - * @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.v2beta.Rule.BoostAction; - - /** - * Verifies a BoostAction 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 BoostAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoostAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.BoostAction; - - /** - * Creates a plain object from a BoostAction message. Also converts values to other types if specified. - * @param message BoostAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.Rule.BoostAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + namespace Product { - /** - * Converts this BoostAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + PRIMARY = 1, + VARIANT = 2, + COLLECTION = 3 } - /** Properties of a FilterAction. */ - interface IFilterAction { - - /** FilterAction filter */ - filter?: (string|null); + /** Availability enum. */ + enum Availability { + AVAILABILITY_UNSPECIFIED = 0, + IN_STOCK = 1, + OUT_OF_STOCK = 2, + PREORDER = 3, + BACKORDER = 4 } + } - /** Represents a FilterAction. */ - class FilterAction implements IFilterAction { - - /** - * Constructs a new FilterAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.Rule.IFilterAction); - - /** FilterAction filter. */ - public filter: string; - - /** - * Creates a new FilterAction instance using the specified properties. - * @param [properties] Properties to set - * @returns FilterAction instance - */ - public static create(properties?: google.cloud.retail.v2beta.Rule.IFilterAction): google.cloud.retail.v2beta.Rule.FilterAction; - - /** - * Encodes the specified FilterAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.FilterAction.verify|verify} messages. - * @param message FilterAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.Rule.IFilterAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FilterAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.FilterAction.verify|verify} messages. - * @param message FilterAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.IFilterAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FilterAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FilterAction - * @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.v2beta.Rule.FilterAction; - - /** - * Decodes a FilterAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FilterAction - * @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.v2beta.Rule.FilterAction; - - /** - * Verifies a FilterAction 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); + /** Properties of a Promotion. */ + interface IPromotion { - /** - * Creates a FilterAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FilterAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.FilterAction; + /** Promotion promotionId */ + promotionId?: (string|null); + } - /** - * Creates a plain object from a FilterAction message. Also converts values to other types if specified. - * @param message FilterAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.Rule.FilterAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a Promotion. */ + class Promotion implements IPromotion { - /** - * Converts this FilterAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new Promotion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IPromotion); - /** Properties of a RedirectAction. */ - interface IRedirectAction { + /** Promotion promotionId. */ + public promotionId: string; - /** RedirectAction redirectUri */ - redirectUri?: (string|null); - } + /** + * Creates a new Promotion instance using the specified properties. + * @param [properties] Properties to set + * @returns Promotion instance + */ + public static create(properties?: google.cloud.retail.v2beta.IPromotion): google.cloud.retail.v2beta.Promotion; - /** Represents a RedirectAction. */ - class RedirectAction implements IRedirectAction { + /** + * Encodes the specified Promotion message. Does not implicitly {@link google.cloud.retail.v2beta.Promotion.verify|verify} messages. + * @param message Promotion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IPromotion, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new RedirectAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.Rule.IRedirectAction); + /** + * Encodes the specified Promotion message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Promotion.verify|verify} messages. + * @param message Promotion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IPromotion, writer?: $protobuf.Writer): $protobuf.Writer; - /** RedirectAction redirectUri. */ - public redirectUri: string; + /** + * Decodes a Promotion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Promotion + * @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.v2beta.Promotion; - /** - * Creates a new RedirectAction instance using the specified properties. - * @param [properties] Properties to set - * @returns RedirectAction instance - */ - public static create(properties?: google.cloud.retail.v2beta.Rule.IRedirectAction): google.cloud.retail.v2beta.Rule.RedirectAction; + /** + * Decodes a Promotion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Promotion + * @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.v2beta.Promotion; - /** - * Encodes the specified RedirectAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.RedirectAction.verify|verify} messages. - * @param message RedirectAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.Rule.IRedirectAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a Promotion 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); - /** - * Encodes the specified RedirectAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.RedirectAction.verify|verify} messages. - * @param message RedirectAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.IRedirectAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a Promotion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Promotion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Promotion; - /** - * Decodes a RedirectAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RedirectAction - * @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.v2beta.Rule.RedirectAction; + /** + * Creates a plain object from a Promotion message. Also converts values to other types if specified. + * @param message Promotion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.Promotion, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a RedirectAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RedirectAction - * @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.v2beta.Rule.RedirectAction; + /** + * Converts this Promotion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies a RedirectAction 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); + /** Properties of a UserEvent. */ + interface IUserEvent { - /** - * Creates a RedirectAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RedirectAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.RedirectAction; + /** UserEvent eventType */ + eventType?: (string|null); - /** - * Creates a plain object from a RedirectAction message. Also converts values to other types if specified. - * @param message RedirectAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.Rule.RedirectAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** UserEvent visitorId */ + visitorId?: (string|null); - /** - * Converts this RedirectAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** UserEvent sessionId */ + sessionId?: (string|null); - /** Properties of a TwowaySynonymsAction. */ - interface ITwowaySynonymsAction { + /** UserEvent eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); - /** TwowaySynonymsAction synonyms */ - synonyms?: (string[]|null); - } + /** UserEvent experimentIds */ + experimentIds?: (string[]|null); - /** Represents a TwowaySynonymsAction. */ - class TwowaySynonymsAction implements ITwowaySynonymsAction { + /** UserEvent attributionToken */ + attributionToken?: (string|null); - /** - * Constructs a new TwowaySynonymsAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction); + /** UserEvent productDetails */ + productDetails?: (google.cloud.retail.v2beta.IProductDetail[]|null); - /** TwowaySynonymsAction synonyms. */ - public synonyms: string[]; + /** UserEvent completionDetail */ + completionDetail?: (google.cloud.retail.v2beta.ICompletionDetail|null); - /** - * Creates a new TwowaySynonymsAction instance using the specified properties. - * @param [properties] Properties to set - * @returns TwowaySynonymsAction instance - */ - public static create(properties?: google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction): google.cloud.retail.v2beta.Rule.TwowaySynonymsAction; + /** UserEvent attributes */ + attributes?: ({ [k: string]: google.cloud.retail.v2beta.ICustomAttribute }|null); - /** - * Encodes the specified TwowaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.verify|verify} messages. - * @param message TwowaySynonymsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** UserEvent cartId */ + cartId?: (string|null); - /** - * Encodes the specified TwowaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.verify|verify} messages. - * @param message TwowaySynonymsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** UserEvent purchaseTransaction */ + purchaseTransaction?: (google.cloud.retail.v2beta.IPurchaseTransaction|null); - /** - * Decodes a TwowaySynonymsAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TwowaySynonymsAction - * @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.v2beta.Rule.TwowaySynonymsAction; + /** UserEvent searchQuery */ + searchQuery?: (string|null); - /** - * Decodes a TwowaySynonymsAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TwowaySynonymsAction - * @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.v2beta.Rule.TwowaySynonymsAction; + /** UserEvent filter */ + filter?: (string|null); - /** - * Verifies a TwowaySynonymsAction 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); + /** UserEvent orderBy */ + orderBy?: (string|null); - /** - * Creates a TwowaySynonymsAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TwowaySynonymsAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.TwowaySynonymsAction; + /** UserEvent offset */ + offset?: (number|null); - /** - * Creates a plain object from a TwowaySynonymsAction message. Also converts values to other types if specified. - * @param message TwowaySynonymsAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.Rule.TwowaySynonymsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** UserEvent pageCategories */ + pageCategories?: (string[]|null); - /** - * Converts this TwowaySynonymsAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** UserEvent userInfo */ + userInfo?: (google.cloud.retail.v2beta.IUserInfo|null); - /** Properties of an OnewaySynonymsAction. */ - interface IOnewaySynonymsAction { + /** UserEvent uri */ + uri?: (string|null); - /** OnewaySynonymsAction queryTerms */ - queryTerms?: (string[]|null); + /** UserEvent referrerUri */ + referrerUri?: (string|null); - /** OnewaySynonymsAction synonyms */ - synonyms?: (string[]|null); + /** UserEvent pageViewId */ + pageViewId?: (string|null); + } - /** OnewaySynonymsAction onewayTerms */ - onewayTerms?: (string[]|null); - } + /** Represents a UserEvent. */ + class UserEvent implements IUserEvent { - /** Represents an OnewaySynonymsAction. */ - class OnewaySynonymsAction implements IOnewaySynonymsAction { + /** + * Constructs a new UserEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IUserEvent); - /** - * Constructs a new OnewaySynonymsAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction); + /** UserEvent eventType. */ + public eventType: string; - /** OnewaySynonymsAction queryTerms. */ - public queryTerms: string[]; + /** UserEvent visitorId. */ + public visitorId: string; - /** OnewaySynonymsAction synonyms. */ - public synonyms: string[]; + /** UserEvent sessionId. */ + public sessionId: string; - /** OnewaySynonymsAction onewayTerms. */ - public onewayTerms: string[]; + /** UserEvent eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); - /** - * Creates a new OnewaySynonymsAction instance using the specified properties. - * @param [properties] Properties to set - * @returns OnewaySynonymsAction instance - */ - public static create(properties?: google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction): google.cloud.retail.v2beta.Rule.OnewaySynonymsAction; + /** UserEvent experimentIds. */ + public experimentIds: string[]; - /** - * Encodes the specified OnewaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.verify|verify} messages. - * @param message OnewaySynonymsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** UserEvent attributionToken. */ + public attributionToken: string; - /** - * Encodes the specified OnewaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.verify|verify} messages. - * @param message OnewaySynonymsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** UserEvent productDetails. */ + public productDetails: google.cloud.retail.v2beta.IProductDetail[]; - /** - * Decodes an OnewaySynonymsAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OnewaySynonymsAction - * @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.v2beta.Rule.OnewaySynonymsAction; + /** UserEvent completionDetail. */ + public completionDetail?: (google.cloud.retail.v2beta.ICompletionDetail|null); - /** - * Decodes an OnewaySynonymsAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OnewaySynonymsAction - * @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.v2beta.Rule.OnewaySynonymsAction; + /** UserEvent attributes. */ + public attributes: { [k: string]: google.cloud.retail.v2beta.ICustomAttribute }; - /** - * Verifies an OnewaySynonymsAction 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); + /** UserEvent cartId. */ + public cartId: string; - /** - * Creates an OnewaySynonymsAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OnewaySynonymsAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.OnewaySynonymsAction; + /** UserEvent purchaseTransaction. */ + public purchaseTransaction?: (google.cloud.retail.v2beta.IPurchaseTransaction|null); - /** - * Creates a plain object from an OnewaySynonymsAction message. Also converts values to other types if specified. - * @param message OnewaySynonymsAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.Rule.OnewaySynonymsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** UserEvent searchQuery. */ + public searchQuery: string; - /** - * Converts this OnewaySynonymsAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** UserEvent filter. */ + public filter: string; - /** Properties of a DoNotAssociateAction. */ - interface IDoNotAssociateAction { + /** UserEvent orderBy. */ + public orderBy: string; - /** DoNotAssociateAction queryTerms */ - queryTerms?: (string[]|null); + /** UserEvent offset. */ + public offset: number; - /** DoNotAssociateAction doNotAssociateTerms */ - doNotAssociateTerms?: (string[]|null); + /** UserEvent pageCategories. */ + public pageCategories: string[]; - /** DoNotAssociateAction terms */ - terms?: (string[]|null); - } + /** UserEvent userInfo. */ + public userInfo?: (google.cloud.retail.v2beta.IUserInfo|null); - /** Represents a DoNotAssociateAction. */ - class DoNotAssociateAction implements IDoNotAssociateAction { + /** UserEvent uri. */ + public uri: string; - /** - * Constructs a new DoNotAssociateAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.Rule.IDoNotAssociateAction); + /** UserEvent referrerUri. */ + public referrerUri: string; - /** DoNotAssociateAction queryTerms. */ - public queryTerms: string[]; + /** UserEvent pageViewId. */ + public pageViewId: string; - /** DoNotAssociateAction doNotAssociateTerms. */ - public doNotAssociateTerms: string[]; + /** + * Creates a new UserEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns UserEvent instance + */ + public static create(properties?: google.cloud.retail.v2beta.IUserEvent): google.cloud.retail.v2beta.UserEvent; - /** DoNotAssociateAction terms. */ - public terms: string[]; + /** + * Encodes the specified UserEvent message. Does not implicitly {@link google.cloud.retail.v2beta.UserEvent.verify|verify} messages. + * @param message UserEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IUserEvent, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new DoNotAssociateAction instance using the specified properties. - * @param [properties] Properties to set - * @returns DoNotAssociateAction instance - */ - public static create(properties?: google.cloud.retail.v2beta.Rule.IDoNotAssociateAction): google.cloud.retail.v2beta.Rule.DoNotAssociateAction; + /** + * Encodes the specified UserEvent message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserEvent.verify|verify} messages. + * @param message UserEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IUserEvent, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified DoNotAssociateAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.DoNotAssociateAction.verify|verify} messages. - * @param message DoNotAssociateAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.Rule.IDoNotAssociateAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a UserEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserEvent + * @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.v2beta.UserEvent; - /** - * Encodes the specified DoNotAssociateAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.DoNotAssociateAction.verify|verify} messages. - * @param message DoNotAssociateAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.IDoNotAssociateAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a UserEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserEvent + * @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.v2beta.UserEvent; - /** - * Decodes a DoNotAssociateAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DoNotAssociateAction - * @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.v2beta.Rule.DoNotAssociateAction; + /** + * Verifies a UserEvent 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); - /** - * Decodes a DoNotAssociateAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DoNotAssociateAction - * @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.v2beta.Rule.DoNotAssociateAction; + /** + * Creates a UserEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UserEvent; - /** - * Verifies a DoNotAssociateAction 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 plain object from a UserEvent message. Also converts values to other types if specified. + * @param message UserEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.UserEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a DoNotAssociateAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DoNotAssociateAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.DoNotAssociateAction; + /** + * Converts this UserEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a plain object from a DoNotAssociateAction message. Also converts values to other types if specified. - * @param message DoNotAssociateAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.Rule.DoNotAssociateAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of a ProductDetail. */ + interface IProductDetail { - /** - * Converts this DoNotAssociateAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ProductDetail product */ + product?: (google.cloud.retail.v2beta.IProduct|null); - /** Properties of a ReplacementAction. */ - interface IReplacementAction { + /** ProductDetail quantity */ + quantity?: (google.protobuf.IInt32Value|null); + } - /** ReplacementAction queryTerms */ - queryTerms?: (string[]|null); + /** Represents a ProductDetail. */ + class ProductDetail implements IProductDetail { - /** ReplacementAction replacementTerm */ - replacementTerm?: (string|null); + /** + * Constructs a new ProductDetail. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IProductDetail); - /** ReplacementAction term */ - term?: (string|null); - } + /** ProductDetail product. */ + public product?: (google.cloud.retail.v2beta.IProduct|null); - /** Represents a ReplacementAction. */ - class ReplacementAction implements IReplacementAction { + /** ProductDetail quantity. */ + public quantity?: (google.protobuf.IInt32Value|null); - /** - * Constructs a new ReplacementAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.Rule.IReplacementAction); + /** + * Creates a new ProductDetail instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductDetail instance + */ + public static create(properties?: google.cloud.retail.v2beta.IProductDetail): google.cloud.retail.v2beta.ProductDetail; - /** ReplacementAction queryTerms. */ - public queryTerms: string[]; + /** + * Encodes the specified ProductDetail message. Does not implicitly {@link google.cloud.retail.v2beta.ProductDetail.verify|verify} messages. + * @param message ProductDetail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IProductDetail, writer?: $protobuf.Writer): $protobuf.Writer; - /** ReplacementAction replacementTerm. */ - public replacementTerm: string; + /** + * Encodes the specified ProductDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ProductDetail.verify|verify} messages. + * @param message ProductDetail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IProductDetail, writer?: $protobuf.Writer): $protobuf.Writer; - /** ReplacementAction term. */ - public term: string; + /** + * Decodes a ProductDetail message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductDetail + * @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.v2beta.ProductDetail; - /** - * Creates a new ReplacementAction instance using the specified properties. - * @param [properties] Properties to set - * @returns ReplacementAction instance - */ - public static create(properties?: google.cloud.retail.v2beta.Rule.IReplacementAction): google.cloud.retail.v2beta.Rule.ReplacementAction; + /** + * Decodes a ProductDetail message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductDetail + * @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.v2beta.ProductDetail; - /** - * Encodes the specified ReplacementAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.ReplacementAction.verify|verify} messages. - * @param message ReplacementAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.Rule.IReplacementAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a ProductDetail 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); - /** - * Encodes the specified ReplacementAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.ReplacementAction.verify|verify} messages. - * @param message ReplacementAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.IReplacementAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a ProductDetail message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductDetail + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ProductDetail; - /** - * Decodes a ReplacementAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReplacementAction - * @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.v2beta.Rule.ReplacementAction; + /** + * Creates a plain object from a ProductDetail message. Also converts values to other types if specified. + * @param message ProductDetail + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.ProductDetail, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a ReplacementAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReplacementAction - * @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.v2beta.Rule.ReplacementAction; + /** + * Converts this ProductDetail to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies a ReplacementAction 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); + /** Properties of a CompletionDetail. */ + interface ICompletionDetail { - /** - * Creates a ReplacementAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReplacementAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.ReplacementAction; + /** CompletionDetail completionAttributionToken */ + completionAttributionToken?: (string|null); - /** - * Creates a plain object from a ReplacementAction message. Also converts values to other types if specified. - * @param message ReplacementAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.Rule.ReplacementAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** CompletionDetail selectedSuggestion */ + selectedSuggestion?: (string|null); - /** - * Converts this ReplacementAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** CompletionDetail selectedPosition */ + selectedPosition?: (number|null); + } - /** Properties of an IgnoreAction. */ - interface IIgnoreAction { + /** Represents a CompletionDetail. */ + class CompletionDetail implements ICompletionDetail { - /** IgnoreAction ignoreTerms */ - ignoreTerms?: (string[]|null); - } + /** + * Constructs a new CompletionDetail. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.ICompletionDetail); - /** Represents an IgnoreAction. */ - class IgnoreAction implements IIgnoreAction { + /** CompletionDetail completionAttributionToken. */ + public completionAttributionToken: string; - /** - * Constructs a new IgnoreAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.Rule.IIgnoreAction); + /** CompletionDetail selectedSuggestion. */ + public selectedSuggestion: string; - /** IgnoreAction ignoreTerms. */ - public ignoreTerms: string[]; + /** CompletionDetail selectedPosition. */ + public selectedPosition: number; - /** - * Creates a new IgnoreAction instance using the specified properties. - * @param [properties] Properties to set - * @returns IgnoreAction instance - */ - public static create(properties?: google.cloud.retail.v2beta.Rule.IIgnoreAction): google.cloud.retail.v2beta.Rule.IgnoreAction; + /** + * Creates a new CompletionDetail instance using the specified properties. + * @param [properties] Properties to set + * @returns CompletionDetail instance + */ + public static create(properties?: google.cloud.retail.v2beta.ICompletionDetail): google.cloud.retail.v2beta.CompletionDetail; - /** - * Encodes the specified IgnoreAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.IgnoreAction.verify|verify} messages. - * @param message IgnoreAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.Rule.IIgnoreAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified CompletionDetail message. Does not implicitly {@link google.cloud.retail.v2beta.CompletionDetail.verify|verify} messages. + * @param message CompletionDetail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.ICompletionDetail, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified IgnoreAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.IgnoreAction.verify|verify} messages. - * @param message IgnoreAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.IIgnoreAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified CompletionDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompletionDetail.verify|verify} messages. + * @param message CompletionDetail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.ICompletionDetail, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an IgnoreAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IgnoreAction - * @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.v2beta.Rule.IgnoreAction; + /** + * Decodes a CompletionDetail message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompletionDetail + * @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.v2beta.CompletionDetail; - /** - * Decodes an IgnoreAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IgnoreAction - * @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.v2beta.Rule.IgnoreAction; + /** + * Decodes a CompletionDetail message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompletionDetail + * @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.v2beta.CompletionDetail; - /** - * Verifies an IgnoreAction 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); + /** + * Verifies a CompletionDetail 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 IgnoreAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IgnoreAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.IgnoreAction; + /** + * Creates a CompletionDetail message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompletionDetail + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CompletionDetail; - /** - * Creates a plain object from an IgnoreAction message. Also converts values to other types if specified. - * @param message IgnoreAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.Rule.IgnoreAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a CompletionDetail message. Also converts values to other types if specified. + * @param message CompletionDetail + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.CompletionDetail, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this IgnoreAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this CompletionDetail to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } - /** Properties of an Audience. */ - interface IAudience { + /** Properties of a PurchaseTransaction. */ + interface IPurchaseTransaction { - /** Audience genders */ - genders?: (string[]|null); + /** PurchaseTransaction id */ + id?: (string|null); - /** Audience ageGroups */ - ageGroups?: (string[]|null); + /** PurchaseTransaction revenue */ + revenue?: (number|null); + + /** PurchaseTransaction tax */ + tax?: (number|null); + + /** PurchaseTransaction cost */ + cost?: (number|null); + + /** PurchaseTransaction currencyCode */ + currencyCode?: (string|null); } - /** Represents an Audience. */ - class Audience implements IAudience { + /** Represents a PurchaseTransaction. */ + class PurchaseTransaction implements IPurchaseTransaction { /** - * Constructs a new Audience. + * Constructs a new PurchaseTransaction. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IAudience); + constructor(properties?: google.cloud.retail.v2beta.IPurchaseTransaction); - /** Audience genders. */ - public genders: string[]; + /** PurchaseTransaction id. */ + public id: string; - /** Audience ageGroups. */ - public ageGroups: string[]; + /** PurchaseTransaction revenue. */ + public revenue: number; + + /** PurchaseTransaction tax. */ + public tax: number; + + /** PurchaseTransaction cost. */ + public cost: number; + + /** PurchaseTransaction currencyCode. */ + public currencyCode: string; /** - * Creates a new Audience instance using the specified properties. + * Creates a new PurchaseTransaction instance using the specified properties. * @param [properties] Properties to set - * @returns Audience instance + * @returns PurchaseTransaction instance */ - public static create(properties?: google.cloud.retail.v2beta.IAudience): google.cloud.retail.v2beta.Audience; + public static create(properties?: google.cloud.retail.v2beta.IPurchaseTransaction): google.cloud.retail.v2beta.PurchaseTransaction; /** - * Encodes the specified Audience message. Does not implicitly {@link google.cloud.retail.v2beta.Audience.verify|verify} messages. - * @param message Audience message or plain object to encode + * Encodes the specified PurchaseTransaction message. Does not implicitly {@link google.cloud.retail.v2beta.PurchaseTransaction.verify|verify} messages. + * @param message PurchaseTransaction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IAudience, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IPurchaseTransaction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Audience message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Audience.verify|verify} messages. - * @param message Audience message or plain object to encode + * Encodes the specified PurchaseTransaction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurchaseTransaction.verify|verify} messages. + * @param message PurchaseTransaction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IAudience, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IPurchaseTransaction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Audience message from the specified reader or buffer. + * Decodes a PurchaseTransaction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Audience + * @returns PurchaseTransaction * @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.v2beta.Audience; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.PurchaseTransaction; /** - * Decodes an Audience message from the specified reader or buffer, length delimited. + * Decodes a PurchaseTransaction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Audience + * @returns PurchaseTransaction * @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.v2beta.Audience; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.PurchaseTransaction; + + /** + * Verifies a PurchaseTransaction 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 PurchaseTransaction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurchaseTransaction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PurchaseTransaction; + + /** + * Creates a plain object from a PurchaseTransaction message. Also converts values to other types if specified. + * @param message PurchaseTransaction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.PurchaseTransaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PurchaseTransaction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Represents a CatalogService */ + class CatalogService extends $protobuf.rpc.Service { + + /** + * Constructs a new CatalogService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new CatalogService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): CatalogService; + + /** + * Calls ListCatalogs. + * @param request ListCatalogsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCatalogsResponse + */ + public listCatalogs(request: google.cloud.retail.v2beta.IListCatalogsRequest, callback: google.cloud.retail.v2beta.CatalogService.ListCatalogsCallback): void; + + /** + * Calls ListCatalogs. + * @param request ListCatalogsRequest message or plain object + * @returns Promise + */ + public listCatalogs(request: google.cloud.retail.v2beta.IListCatalogsRequest): Promise; + + /** + * Calls UpdateCatalog. + * @param request UpdateCatalogRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Catalog + */ + public updateCatalog(request: google.cloud.retail.v2beta.IUpdateCatalogRequest, callback: google.cloud.retail.v2beta.CatalogService.UpdateCatalogCallback): void; + + /** + * Calls UpdateCatalog. + * @param request UpdateCatalogRequest message or plain object + * @returns Promise + */ + public updateCatalog(request: google.cloud.retail.v2beta.IUpdateCatalogRequest): Promise; + + /** + * Calls SetDefaultBranch. + * @param request SetDefaultBranchRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public setDefaultBranch(request: google.cloud.retail.v2beta.ISetDefaultBranchRequest, callback: google.cloud.retail.v2beta.CatalogService.SetDefaultBranchCallback): void; + + /** + * Calls SetDefaultBranch. + * @param request SetDefaultBranchRequest message or plain object + * @returns Promise + */ + public setDefaultBranch(request: google.cloud.retail.v2beta.ISetDefaultBranchRequest): Promise; + + /** + * Calls GetDefaultBranch. + * @param request GetDefaultBranchRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GetDefaultBranchResponse + */ + public getDefaultBranch(request: google.cloud.retail.v2beta.IGetDefaultBranchRequest, callback: google.cloud.retail.v2beta.CatalogService.GetDefaultBranchCallback): void; + + /** + * Calls GetDefaultBranch. + * @param request GetDefaultBranchRequest message or plain object + * @returns Promise + */ + public getDefaultBranch(request: google.cloud.retail.v2beta.IGetDefaultBranchRequest): Promise; + + /** + * Calls GetCompletionConfig. + * @param request GetCompletionConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CompletionConfig + */ + public getCompletionConfig(request: google.cloud.retail.v2beta.IGetCompletionConfigRequest, callback: google.cloud.retail.v2beta.CatalogService.GetCompletionConfigCallback): void; + + /** + * Calls GetCompletionConfig. + * @param request GetCompletionConfigRequest message or plain object + * @returns Promise + */ + public getCompletionConfig(request: google.cloud.retail.v2beta.IGetCompletionConfigRequest): Promise; + + /** + * Calls UpdateCompletionConfig. + * @param request UpdateCompletionConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CompletionConfig + */ + public updateCompletionConfig(request: google.cloud.retail.v2beta.IUpdateCompletionConfigRequest, callback: google.cloud.retail.v2beta.CatalogService.UpdateCompletionConfigCallback): void; + + /** + * Calls UpdateCompletionConfig. + * @param request UpdateCompletionConfigRequest message or plain object + * @returns Promise + */ + public updateCompletionConfig(request: google.cloud.retail.v2beta.IUpdateCompletionConfigRequest): Promise; + + /** + * Calls GetAttributesConfig. + * @param request GetAttributesConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AttributesConfig + */ + public getAttributesConfig(request: google.cloud.retail.v2beta.IGetAttributesConfigRequest, callback: google.cloud.retail.v2beta.CatalogService.GetAttributesConfigCallback): void; + + /** + * Calls GetAttributesConfig. + * @param request GetAttributesConfigRequest message or plain object + * @returns Promise + */ + public getAttributesConfig(request: google.cloud.retail.v2beta.IGetAttributesConfigRequest): Promise; + + /** + * Calls UpdateAttributesConfig. + * @param request UpdateAttributesConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AttributesConfig + */ + public updateAttributesConfig(request: google.cloud.retail.v2beta.IUpdateAttributesConfigRequest, callback: google.cloud.retail.v2beta.CatalogService.UpdateAttributesConfigCallback): void; /** - * Verifies an Audience message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls UpdateAttributesConfig. + * @param request UpdateAttributesConfigRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public updateAttributesConfig(request: google.cloud.retail.v2beta.IUpdateAttributesConfigRequest): Promise; /** - * Creates an Audience message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Audience + * Calls AddCatalogAttribute. + * @param request AddCatalogAttributeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AttributesConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Audience; + public addCatalogAttribute(request: google.cloud.retail.v2beta.IAddCatalogAttributeRequest, callback: google.cloud.retail.v2beta.CatalogService.AddCatalogAttributeCallback): void; /** - * Creates a plain object from an Audience message. Also converts values to other types if specified. - * @param message Audience - * @param [options] Conversion options - * @returns Plain object + * Calls AddCatalogAttribute. + * @param request AddCatalogAttributeRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.retail.v2beta.Audience, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public addCatalogAttribute(request: google.cloud.retail.v2beta.IAddCatalogAttributeRequest): Promise; /** - * Converts this Audience to JSON. - * @returns JSON object + * Calls RemoveCatalogAttribute. + * @param request RemoveCatalogAttributeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AttributesConfig */ - public toJSON(): { [k: string]: any }; - } + public removeCatalogAttribute(request: google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest, callback: google.cloud.retail.v2beta.CatalogService.RemoveCatalogAttributeCallback): void; - /** Properties of a ColorInfo. */ - interface IColorInfo { + /** + * Calls RemoveCatalogAttribute. + * @param request RemoveCatalogAttributeRequest message or plain object + * @returns Promise + */ + public removeCatalogAttribute(request: google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest): Promise; - /** ColorInfo colorFamilies */ - colorFamilies?: (string[]|null); + /** + * Calls ReplaceCatalogAttribute. + * @param request ReplaceCatalogAttributeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AttributesConfig + */ + public replaceCatalogAttribute(request: google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest, callback: google.cloud.retail.v2beta.CatalogService.ReplaceCatalogAttributeCallback): void; - /** ColorInfo colors */ - colors?: (string[]|null); + /** + * Calls ReplaceCatalogAttribute. + * @param request ReplaceCatalogAttributeRequest message or plain object + * @returns Promise + */ + public replaceCatalogAttribute(request: google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest): Promise; } - /** Represents a ColorInfo. */ - class ColorInfo implements IColorInfo { + namespace CatalogService { /** - * Constructs a new ColorInfo. - * @param [properties] Properties to set + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#listCatalogs}. + * @param error Error, if any + * @param [response] ListCatalogsResponse */ - constructor(properties?: google.cloud.retail.v2beta.IColorInfo); - - /** ColorInfo colorFamilies. */ - public colorFamilies: string[]; + type ListCatalogsCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.ListCatalogsResponse) => void; - /** ColorInfo colors. */ - public colors: string[]; + /** + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#updateCatalog}. + * @param error Error, if any + * @param [response] Catalog + */ + type UpdateCatalogCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.Catalog) => void; /** - * Creates a new ColorInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ColorInfo instance + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#setDefaultBranch}. + * @param error Error, if any + * @param [response] Empty */ - public static create(properties?: google.cloud.retail.v2beta.IColorInfo): google.cloud.retail.v2beta.ColorInfo; + type SetDefaultBranchCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.retail.v2beta.ColorInfo.verify|verify} messages. - * @param message ColorInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#getDefaultBranch}. + * @param error Error, if any + * @param [response] GetDefaultBranchResponse */ - public static encode(message: google.cloud.retail.v2beta.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + type GetDefaultBranchCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.GetDefaultBranchResponse) => void; /** - * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ColorInfo.verify|verify} messages. - * @param message ColorInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#getCompletionConfig}. + * @param error Error, if any + * @param [response] CompletionConfig */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + type GetCompletionConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.CompletionConfig) => void; /** - * Decodes a ColorInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ColorInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#updateCompletionConfig}. + * @param error Error, if any + * @param [response] CompletionConfig */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ColorInfo; + type UpdateCompletionConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.CompletionConfig) => void; /** - * Decodes a ColorInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ColorInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#getAttributesConfig}. + * @param error Error, if any + * @param [response] AttributesConfig */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ColorInfo; + type GetAttributesConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.AttributesConfig) => void; /** - * Verifies a ColorInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#updateAttributesConfig}. + * @param error Error, if any + * @param [response] AttributesConfig */ - public static verify(message: { [k: string]: any }): (string|null); + type UpdateAttributesConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.AttributesConfig) => void; /** - * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ColorInfo + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#addCatalogAttribute}. + * @param error Error, if any + * @param [response] AttributesConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ColorInfo; + type AddCatalogAttributeCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.AttributesConfig) => void; /** - * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. - * @param message ColorInfo - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#removeCatalogAttribute}. + * @param error Error, if any + * @param [response] AttributesConfig */ - public static toObject(message: google.cloud.retail.v2beta.ColorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type RemoveCatalogAttributeCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.AttributesConfig) => void; /** - * Converts this ColorInfo to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#replaceCatalogAttribute}. + * @param error Error, if any + * @param [response] AttributesConfig */ - public toJSON(): { [k: string]: any }; + type ReplaceCatalogAttributeCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.AttributesConfig) => void; } - /** Properties of a CustomAttribute. */ - interface ICustomAttribute { - - /** CustomAttribute text */ - text?: (string[]|null); + /** Properties of a ListCatalogsRequest. */ + interface IListCatalogsRequest { - /** CustomAttribute numbers */ - numbers?: (number[]|null); + /** ListCatalogsRequest parent */ + parent?: (string|null); - /** CustomAttribute searchable */ - searchable?: (boolean|null); + /** ListCatalogsRequest pageSize */ + pageSize?: (number|null); - /** CustomAttribute indexable */ - indexable?: (boolean|null); + /** ListCatalogsRequest pageToken */ + pageToken?: (string|null); } - /** Represents a CustomAttribute. */ - class CustomAttribute implements ICustomAttribute { + /** Represents a ListCatalogsRequest. */ + class ListCatalogsRequest implements IListCatalogsRequest { /** - * Constructs a new CustomAttribute. + * Constructs a new ListCatalogsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.ICustomAttribute); - - /** CustomAttribute text. */ - public text: string[]; - - /** CustomAttribute numbers. */ - public numbers: number[]; - - /** CustomAttribute searchable. */ - public searchable?: (boolean|null); + constructor(properties?: google.cloud.retail.v2beta.IListCatalogsRequest); - /** CustomAttribute indexable. */ - public indexable?: (boolean|null); + /** ListCatalogsRequest parent. */ + public parent: string; - /** CustomAttribute _searchable. */ - public _searchable?: "searchable"; + /** ListCatalogsRequest pageSize. */ + public pageSize: number; - /** CustomAttribute _indexable. */ - public _indexable?: "indexable"; + /** ListCatalogsRequest pageToken. */ + public pageToken: string; /** - * Creates a new CustomAttribute instance using the specified properties. + * Creates a new ListCatalogsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CustomAttribute instance + * @returns ListCatalogsRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.ICustomAttribute): google.cloud.retail.v2beta.CustomAttribute; + public static create(properties?: google.cloud.retail.v2beta.IListCatalogsRequest): google.cloud.retail.v2beta.ListCatalogsRequest; /** - * Encodes the specified CustomAttribute message. Does not implicitly {@link google.cloud.retail.v2beta.CustomAttribute.verify|verify} messages. - * @param message CustomAttribute message or plain object to encode + * Encodes the specified ListCatalogsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ListCatalogsRequest.verify|verify} messages. + * @param message ListCatalogsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IListCatalogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CustomAttribute.verify|verify} messages. - * @param message CustomAttribute message or plain object to encode + * Encodes the specified ListCatalogsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListCatalogsRequest.verify|verify} messages. + * @param message ListCatalogsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IListCatalogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CustomAttribute message from the specified reader or buffer. + * Decodes a ListCatalogsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CustomAttribute + * @returns ListCatalogsRequest * @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.v2beta.CustomAttribute; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ListCatalogsRequest; /** - * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. + * Decodes a ListCatalogsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CustomAttribute + * @returns ListCatalogsRequest * @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.v2beta.CustomAttribute; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ListCatalogsRequest; /** - * Verifies a CustomAttribute message. + * Verifies a ListCatalogsRequest 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 CustomAttribute message from a plain object. Also converts values to their respective internal types. + * Creates a ListCatalogsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CustomAttribute + * @returns ListCatalogsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CustomAttribute; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ListCatalogsRequest; /** - * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. - * @param message CustomAttribute + * Creates a plain object from a ListCatalogsRequest message. Also converts values to other types if specified. + * @param message ListCatalogsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.CustomAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.ListCatalogsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CustomAttribute to JSON. + * Converts this ListCatalogsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a FulfillmentInfo. */ - interface IFulfillmentInfo { + /** Properties of a ListCatalogsResponse. */ + interface IListCatalogsResponse { - /** FulfillmentInfo type */ - type?: (string|null); + /** ListCatalogsResponse catalogs */ + catalogs?: (google.cloud.retail.v2beta.ICatalog[]|null); - /** FulfillmentInfo placeIds */ - placeIds?: (string[]|null); + /** ListCatalogsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a FulfillmentInfo. */ - class FulfillmentInfo implements IFulfillmentInfo { + /** Represents a ListCatalogsResponse. */ + class ListCatalogsResponse implements IListCatalogsResponse { /** - * Constructs a new FulfillmentInfo. + * Constructs a new ListCatalogsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IFulfillmentInfo); + constructor(properties?: google.cloud.retail.v2beta.IListCatalogsResponse); - /** FulfillmentInfo type. */ - public type: string; + /** ListCatalogsResponse catalogs. */ + public catalogs: google.cloud.retail.v2beta.ICatalog[]; - /** FulfillmentInfo placeIds. */ - public placeIds: string[]; + /** ListCatalogsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new FulfillmentInfo instance using the specified properties. + * Creates a new ListCatalogsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns FulfillmentInfo instance + * @returns ListCatalogsResponse instance */ - public static create(properties?: google.cloud.retail.v2beta.IFulfillmentInfo): google.cloud.retail.v2beta.FulfillmentInfo; + public static create(properties?: google.cloud.retail.v2beta.IListCatalogsResponse): google.cloud.retail.v2beta.ListCatalogsResponse; /** - * Encodes the specified FulfillmentInfo message. Does not implicitly {@link google.cloud.retail.v2beta.FulfillmentInfo.verify|verify} messages. - * @param message FulfillmentInfo message or plain object to encode + * Encodes the specified ListCatalogsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ListCatalogsResponse.verify|verify} messages. + * @param message ListCatalogsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IFulfillmentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IListCatalogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FulfillmentInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.FulfillmentInfo.verify|verify} messages. - * @param message FulfillmentInfo message or plain object to encode + * Encodes the specified ListCatalogsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListCatalogsResponse.verify|verify} messages. + * @param message ListCatalogsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IFulfillmentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IListCatalogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FulfillmentInfo message from the specified reader or buffer. + * Decodes a ListCatalogsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FulfillmentInfo + * @returns ListCatalogsResponse * @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.v2beta.FulfillmentInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ListCatalogsResponse; /** - * Decodes a FulfillmentInfo message from the specified reader or buffer, length delimited. + * Decodes a ListCatalogsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FulfillmentInfo + * @returns ListCatalogsResponse * @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.v2beta.FulfillmentInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ListCatalogsResponse; /** - * Verifies a FulfillmentInfo message. + * Verifies a ListCatalogsResponse 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 FulfillmentInfo message from a plain object. Also converts values to their respective internal types. + * Creates a ListCatalogsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FulfillmentInfo + * @returns ListCatalogsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.FulfillmentInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ListCatalogsResponse; /** - * Creates a plain object from a FulfillmentInfo message. Also converts values to other types if specified. - * @param message FulfillmentInfo + * Creates a plain object from a ListCatalogsResponse message. Also converts values to other types if specified. + * @param message ListCatalogsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.FulfillmentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.ListCatalogsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FulfillmentInfo to JSON. + * Converts this ListCatalogsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Image. */ - interface IImage { - - /** Image uri */ - uri?: (string|null); + /** Properties of an UpdateCatalogRequest. */ + interface IUpdateCatalogRequest { - /** Image height */ - height?: (number|null); + /** UpdateCatalogRequest catalog */ + catalog?: (google.cloud.retail.v2beta.ICatalog|null); - /** Image width */ - width?: (number|null); + /** UpdateCatalogRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents an Image. */ - class Image implements IImage { + /** Represents an UpdateCatalogRequest. */ + class UpdateCatalogRequest implements IUpdateCatalogRequest { /** - * Constructs a new Image. + * Constructs a new UpdateCatalogRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IImage); - - /** Image uri. */ - public uri: string; + constructor(properties?: google.cloud.retail.v2beta.IUpdateCatalogRequest); - /** Image height. */ - public height: number; + /** UpdateCatalogRequest catalog. */ + public catalog?: (google.cloud.retail.v2beta.ICatalog|null); - /** Image width. */ - public width: number; + /** UpdateCatalogRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new Image instance using the specified properties. + * Creates a new UpdateCatalogRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Image instance + * @returns UpdateCatalogRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IImage): google.cloud.retail.v2beta.Image; + public static create(properties?: google.cloud.retail.v2beta.IUpdateCatalogRequest): google.cloud.retail.v2beta.UpdateCatalogRequest; /** - * Encodes the specified Image message. Does not implicitly {@link google.cloud.retail.v2beta.Image.verify|verify} messages. - * @param message Image message or plain object to encode + * Encodes the specified UpdateCatalogRequest message. Does not implicitly {@link google.cloud.retail.v2beta.UpdateCatalogRequest.verify|verify} messages. + * @param message UpdateCatalogRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IUpdateCatalogRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Image.verify|verify} messages. - * @param message Image message or plain object to encode + * Encodes the specified UpdateCatalogRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UpdateCatalogRequest.verify|verify} messages. + * @param message UpdateCatalogRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IUpdateCatalogRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Image message from the specified reader or buffer. + * Decodes an UpdateCatalogRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Image + * @returns UpdateCatalogRequest * @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.v2beta.Image; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.UpdateCatalogRequest; /** - * Decodes an Image message from the specified reader or buffer, length delimited. + * Decodes an UpdateCatalogRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Image + * @returns UpdateCatalogRequest * @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.v2beta.Image; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.UpdateCatalogRequest; /** - * Verifies an Image message. + * Verifies an UpdateCatalogRequest 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 Image message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateCatalogRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Image + * @returns UpdateCatalogRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Image; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UpdateCatalogRequest; /** - * Creates a plain object from an Image message. Also converts values to other types if specified. - * @param message Image + * Creates a plain object from an UpdateCatalogRequest message. Also converts values to other types if specified. + * @param message UpdateCatalogRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.UpdateCatalogRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Image to JSON. + * Converts this UpdateCatalogRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Interval. */ - interface IInterval { + /** Properties of a SetDefaultBranchRequest. */ + interface ISetDefaultBranchRequest { - /** Interval minimum */ - minimum?: (number|null); + /** SetDefaultBranchRequest catalog */ + catalog?: (string|null); - /** Interval exclusiveMinimum */ - exclusiveMinimum?: (number|null); + /** SetDefaultBranchRequest branchId */ + branchId?: (string|null); - /** Interval maximum */ - maximum?: (number|null); + /** SetDefaultBranchRequest note */ + note?: (string|null); - /** Interval exclusiveMaximum */ - exclusiveMaximum?: (number|null); + /** SetDefaultBranchRequest force */ + force?: (boolean|null); } - /** Represents an Interval. */ - class Interval implements IInterval { + /** Represents a SetDefaultBranchRequest. */ + class SetDefaultBranchRequest implements ISetDefaultBranchRequest { /** - * Constructs a new Interval. + * Constructs a new SetDefaultBranchRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IInterval); - - /** Interval minimum. */ - public minimum?: (number|null); - - /** Interval exclusiveMinimum. */ - public exclusiveMinimum?: (number|null); + constructor(properties?: google.cloud.retail.v2beta.ISetDefaultBranchRequest); - /** Interval maximum. */ - public maximum?: (number|null); + /** SetDefaultBranchRequest catalog. */ + public catalog: string; - /** Interval exclusiveMaximum. */ - public exclusiveMaximum?: (number|null); + /** SetDefaultBranchRequest branchId. */ + public branchId: string; - /** Interval min. */ - public min?: ("minimum"|"exclusiveMinimum"); + /** SetDefaultBranchRequest note. */ + public note: string; - /** Interval max. */ - public max?: ("maximum"|"exclusiveMaximum"); + /** SetDefaultBranchRequest force. */ + public force: boolean; /** - * Creates a new Interval instance using the specified properties. + * Creates a new SetDefaultBranchRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Interval instance + * @returns SetDefaultBranchRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IInterval): google.cloud.retail.v2beta.Interval; + public static create(properties?: google.cloud.retail.v2beta.ISetDefaultBranchRequest): google.cloud.retail.v2beta.SetDefaultBranchRequest; /** - * Encodes the specified Interval message. Does not implicitly {@link google.cloud.retail.v2beta.Interval.verify|verify} messages. - * @param message Interval message or plain object to encode + * Encodes the specified SetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2beta.SetDefaultBranchRequest.verify|verify} messages. + * @param message SetDefaultBranchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.ISetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Interval.verify|verify} messages. - * @param message Interval message or plain object to encode + * Encodes the specified SetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SetDefaultBranchRequest.verify|verify} messages. + * @param message SetDefaultBranchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.ISetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Interval message from the specified reader or buffer. + * Decodes a SetDefaultBranchRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Interval + * @returns SetDefaultBranchRequest * @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.v2beta.Interval; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.SetDefaultBranchRequest; /** - * Decodes an Interval message from the specified reader or buffer, length delimited. + * Decodes a SetDefaultBranchRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Interval + * @returns SetDefaultBranchRequest * @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.v2beta.Interval; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.SetDefaultBranchRequest; /** - * Verifies an Interval message. + * Verifies a SetDefaultBranchRequest 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 Interval message from a plain object. Also converts values to their respective internal types. + * Creates a SetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Interval + * @returns SetDefaultBranchRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Interval; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SetDefaultBranchRequest; /** - * Creates a plain object from an Interval message. Also converts values to other types if specified. - * @param message Interval + * Creates a plain object from a SetDefaultBranchRequest message. Also converts values to other types if specified. + * @param message SetDefaultBranchRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.Interval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.SetDefaultBranchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Interval to JSON. + * Converts this SetDefaultBranchRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PriceInfo. */ - interface IPriceInfo { - - /** PriceInfo currencyCode */ - currencyCode?: (string|null); - - /** PriceInfo price */ - price?: (number|null); - - /** PriceInfo originalPrice */ - originalPrice?: (number|null); - - /** PriceInfo cost */ - cost?: (number|null); - - /** PriceInfo priceEffectiveTime */ - priceEffectiveTime?: (google.protobuf.ITimestamp|null); - - /** PriceInfo priceExpireTime */ - priceExpireTime?: (google.protobuf.ITimestamp|null); + /** Properties of a GetDefaultBranchRequest. */ + interface IGetDefaultBranchRequest { - /** PriceInfo priceRange */ - priceRange?: (google.cloud.retail.v2beta.PriceInfo.IPriceRange|null); + /** GetDefaultBranchRequest catalog */ + catalog?: (string|null); } - /** Represents a PriceInfo. */ - class PriceInfo implements IPriceInfo { + /** Represents a GetDefaultBranchRequest. */ + class GetDefaultBranchRequest implements IGetDefaultBranchRequest { /** - * Constructs a new PriceInfo. + * Constructs a new GetDefaultBranchRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IPriceInfo); - - /** PriceInfo currencyCode. */ - public currencyCode: string; - - /** PriceInfo price. */ - public price: number; - - /** PriceInfo originalPrice. */ - public originalPrice: number; - - /** PriceInfo cost. */ - public cost: number; - - /** PriceInfo priceEffectiveTime. */ - public priceEffectiveTime?: (google.protobuf.ITimestamp|null); - - /** PriceInfo priceExpireTime. */ - public priceExpireTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.cloud.retail.v2beta.IGetDefaultBranchRequest); - /** PriceInfo priceRange. */ - public priceRange?: (google.cloud.retail.v2beta.PriceInfo.IPriceRange|null); + /** GetDefaultBranchRequest catalog. */ + public catalog: string; /** - * Creates a new PriceInfo instance using the specified properties. + * Creates a new GetDefaultBranchRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PriceInfo instance + * @returns GetDefaultBranchRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IPriceInfo): google.cloud.retail.v2beta.PriceInfo; + public static create(properties?: google.cloud.retail.v2beta.IGetDefaultBranchRequest): google.cloud.retail.v2beta.GetDefaultBranchRequest; /** - * Encodes the specified PriceInfo message. Does not implicitly {@link google.cloud.retail.v2beta.PriceInfo.verify|verify} messages. - * @param message PriceInfo message or plain object to encode + * Encodes the specified GetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2beta.GetDefaultBranchRequest.verify|verify} messages. + * @param message GetDefaultBranchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IPriceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IGetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PriceInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PriceInfo.verify|verify} messages. - * @param message PriceInfo message or plain object to encode + * Encodes the specified GetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetDefaultBranchRequest.verify|verify} messages. + * @param message GetDefaultBranchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IPriceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IGetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PriceInfo message from the specified reader or buffer. + * Decodes a GetDefaultBranchRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PriceInfo + * @returns GetDefaultBranchRequest * @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.v2beta.PriceInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.GetDefaultBranchRequest; /** - * Decodes a PriceInfo message from the specified reader or buffer, length delimited. + * Decodes a GetDefaultBranchRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PriceInfo + * @returns GetDefaultBranchRequest * @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.v2beta.PriceInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.GetDefaultBranchRequest; /** - * Verifies a PriceInfo message. + * Verifies a GetDefaultBranchRequest 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 PriceInfo message from a plain object. Also converts values to their respective internal types. + * Creates a GetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PriceInfo + * @returns GetDefaultBranchRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PriceInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.GetDefaultBranchRequest; /** - * Creates a plain object from a PriceInfo message. Also converts values to other types if specified. - * @param message PriceInfo + * Creates a plain object from a GetDefaultBranchRequest message. Also converts values to other types if specified. + * @param message GetDefaultBranchRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.PriceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.GetDefaultBranchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PriceInfo to JSON. + * Converts this GetDefaultBranchRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace PriceInfo { - - /** Properties of a PriceRange. */ - interface IPriceRange { - - /** PriceRange price */ - price?: (google.cloud.retail.v2beta.IInterval|null); - - /** PriceRange originalPrice */ - originalPrice?: (google.cloud.retail.v2beta.IInterval|null); - } - - /** Represents a PriceRange. */ - class PriceRange implements IPriceRange { - - /** - * Constructs a new PriceRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.PriceInfo.IPriceRange); - - /** PriceRange price. */ - public price?: (google.cloud.retail.v2beta.IInterval|null); - - /** PriceRange originalPrice. */ - public originalPrice?: (google.cloud.retail.v2beta.IInterval|null); - - /** - * Creates a new PriceRange instance using the specified properties. - * @param [properties] Properties to set - * @returns PriceRange instance - */ - public static create(properties?: google.cloud.retail.v2beta.PriceInfo.IPriceRange): google.cloud.retail.v2beta.PriceInfo.PriceRange; - - /** - * Encodes the specified PriceRange message. Does not implicitly {@link google.cloud.retail.v2beta.PriceInfo.PriceRange.verify|verify} messages. - * @param message PriceRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.PriceInfo.IPriceRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PriceRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PriceInfo.PriceRange.verify|verify} messages. - * @param message PriceRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.PriceInfo.IPriceRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PriceRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PriceRange - * @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.v2beta.PriceInfo.PriceRange; - - /** - * Decodes a PriceRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PriceRange - * @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.v2beta.PriceInfo.PriceRange; - - /** - * Verifies a PriceRange 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 PriceRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PriceRange - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PriceInfo.PriceRange; - - /** - * Creates a plain object from a PriceRange message. Also converts values to other types if specified. - * @param message PriceRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.PriceInfo.PriceRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PriceRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a Rating. */ - interface IRating { + /** Properties of a GetDefaultBranchResponse. */ + interface IGetDefaultBranchResponse { - /** Rating ratingCount */ - ratingCount?: (number|null); + /** GetDefaultBranchResponse branch */ + branch?: (string|null); - /** Rating averageRating */ - averageRating?: (number|null); + /** GetDefaultBranchResponse setTime */ + setTime?: (google.protobuf.ITimestamp|null); - /** Rating ratingHistogram */ - ratingHistogram?: (number[]|null); + /** GetDefaultBranchResponse note */ + note?: (string|null); } - /** Represents a Rating. */ - class Rating implements IRating { + /** Represents a GetDefaultBranchResponse. */ + class GetDefaultBranchResponse implements IGetDefaultBranchResponse { /** - * Constructs a new Rating. + * Constructs a new GetDefaultBranchResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IRating); + constructor(properties?: google.cloud.retail.v2beta.IGetDefaultBranchResponse); - /** Rating ratingCount. */ - public ratingCount: number; + /** GetDefaultBranchResponse branch. */ + public branch: string; - /** Rating averageRating. */ - public averageRating: number; + /** GetDefaultBranchResponse setTime. */ + public setTime?: (google.protobuf.ITimestamp|null); - /** Rating ratingHistogram. */ - public ratingHistogram: number[]; + /** GetDefaultBranchResponse note. */ + public note: string; /** - * Creates a new Rating instance using the specified properties. + * Creates a new GetDefaultBranchResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Rating instance + * @returns GetDefaultBranchResponse instance */ - public static create(properties?: google.cloud.retail.v2beta.IRating): google.cloud.retail.v2beta.Rating; + public static create(properties?: google.cloud.retail.v2beta.IGetDefaultBranchResponse): google.cloud.retail.v2beta.GetDefaultBranchResponse; /** - * Encodes the specified Rating message. Does not implicitly {@link google.cloud.retail.v2beta.Rating.verify|verify} messages. - * @param message Rating message or plain object to encode + * Encodes the specified GetDefaultBranchResponse message. Does not implicitly {@link google.cloud.retail.v2beta.GetDefaultBranchResponse.verify|verify} messages. + * @param message GetDefaultBranchResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IRating, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IGetDefaultBranchResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Rating message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rating.verify|verify} messages. - * @param message Rating message or plain object to encode + * Encodes the specified GetDefaultBranchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetDefaultBranchResponse.verify|verify} messages. + * @param message GetDefaultBranchResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IRating, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IGetDefaultBranchResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Rating message from the specified reader or buffer. + * Decodes a GetDefaultBranchResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Rating + * @returns GetDefaultBranchResponse * @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.v2beta.Rating; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.GetDefaultBranchResponse; /** - * Decodes a Rating message from the specified reader or buffer, length delimited. + * Decodes a GetDefaultBranchResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Rating + * @returns GetDefaultBranchResponse * @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.v2beta.Rating; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.GetDefaultBranchResponse; /** - * Verifies a Rating message. + * Verifies a GetDefaultBranchResponse 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 Rating message from a plain object. Also converts values to their respective internal types. + * Creates a GetDefaultBranchResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Rating + * @returns GetDefaultBranchResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rating; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.GetDefaultBranchResponse; /** - * Creates a plain object from a Rating message. Also converts values to other types if specified. - * @param message Rating + * Creates a plain object from a GetDefaultBranchResponse message. Also converts values to other types if specified. + * @param message GetDefaultBranchResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.Rating, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.GetDefaultBranchResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Rating to JSON. + * Converts this GetDefaultBranchResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a UserInfo. */ - interface IUserInfo { - - /** UserInfo userId */ - userId?: (string|null); - - /** UserInfo ipAddress */ - ipAddress?: (string|null); - - /** UserInfo userAgent */ - userAgent?: (string|null); + /** Properties of a GetCompletionConfigRequest. */ + interface IGetCompletionConfigRequest { - /** UserInfo directUserRequest */ - directUserRequest?: (boolean|null); + /** GetCompletionConfigRequest name */ + name?: (string|null); } - /** Represents a UserInfo. */ - class UserInfo implements IUserInfo { + /** Represents a GetCompletionConfigRequest. */ + class GetCompletionConfigRequest implements IGetCompletionConfigRequest { /** - * Constructs a new UserInfo. + * Constructs a new GetCompletionConfigRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IUserInfo); - - /** UserInfo userId. */ - public userId: string; - - /** UserInfo ipAddress. */ - public ipAddress: string; - - /** UserInfo userAgent. */ - public userAgent: string; + constructor(properties?: google.cloud.retail.v2beta.IGetCompletionConfigRequest); - /** UserInfo directUserRequest. */ - public directUserRequest: boolean; + /** GetCompletionConfigRequest name. */ + public name: string; /** - * Creates a new UserInfo instance using the specified properties. + * Creates a new GetCompletionConfigRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UserInfo instance + * @returns GetCompletionConfigRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IUserInfo): google.cloud.retail.v2beta.UserInfo; + public static create(properties?: google.cloud.retail.v2beta.IGetCompletionConfigRequest): google.cloud.retail.v2beta.GetCompletionConfigRequest; /** - * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.retail.v2beta.UserInfo.verify|verify} messages. - * @param message UserInfo message or plain object to encode + * Encodes the specified GetCompletionConfigRequest message. Does not implicitly {@link google.cloud.retail.v2beta.GetCompletionConfigRequest.verify|verify} messages. + * @param message GetCompletionConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IGetCompletionConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserInfo.verify|verify} messages. - * @param message UserInfo message or plain object to encode + * Encodes the specified GetCompletionConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetCompletionConfigRequest.verify|verify} messages. + * @param message GetCompletionConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IGetCompletionConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a UserInfo message from the specified reader or buffer. + * Decodes a GetCompletionConfigRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UserInfo + * @returns GetCompletionConfigRequest * @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.v2beta.UserInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.GetCompletionConfigRequest; /** - * Decodes a UserInfo message from the specified reader or buffer, length delimited. + * Decodes a GetCompletionConfigRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UserInfo + * @returns GetCompletionConfigRequest * @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.v2beta.UserInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.GetCompletionConfigRequest; /** - * Verifies a UserInfo message. + * Verifies a GetCompletionConfigRequest 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 UserInfo message from a plain object. Also converts values to their respective internal types. + * Creates a GetCompletionConfigRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UserInfo + * @returns GetCompletionConfigRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UserInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.GetCompletionConfigRequest; /** - * Creates a plain object from a UserInfo message. Also converts values to other types if specified. - * @param message UserInfo + * Creates a plain object from a GetCompletionConfigRequest message. Also converts values to other types if specified. + * @param message GetCompletionConfigRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.UserInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.GetCompletionConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UserInfo to JSON. + * Converts this GetCompletionConfigRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Promotion. */ - interface IPromotion { + /** Properties of an UpdateCompletionConfigRequest. */ + interface IUpdateCompletionConfigRequest { - /** Promotion promotionId */ - promotionId?: (string|null); + /** UpdateCompletionConfigRequest completionConfig */ + completionConfig?: (google.cloud.retail.v2beta.ICompletionConfig|null); + + /** UpdateCompletionConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a Promotion. */ - class Promotion implements IPromotion { + /** Represents an UpdateCompletionConfigRequest. */ + class UpdateCompletionConfigRequest implements IUpdateCompletionConfigRequest { /** - * Constructs a new Promotion. + * Constructs a new UpdateCompletionConfigRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IPromotion); + constructor(properties?: google.cloud.retail.v2beta.IUpdateCompletionConfigRequest); - /** Promotion promotionId. */ - public promotionId: string; + /** UpdateCompletionConfigRequest completionConfig. */ + public completionConfig?: (google.cloud.retail.v2beta.ICompletionConfig|null); + + /** UpdateCompletionConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new Promotion instance using the specified properties. + * Creates a new UpdateCompletionConfigRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Promotion instance + * @returns UpdateCompletionConfigRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IPromotion): google.cloud.retail.v2beta.Promotion; + public static create(properties?: google.cloud.retail.v2beta.IUpdateCompletionConfigRequest): google.cloud.retail.v2beta.UpdateCompletionConfigRequest; /** - * Encodes the specified Promotion message. Does not implicitly {@link google.cloud.retail.v2beta.Promotion.verify|verify} messages. - * @param message Promotion message or plain object to encode + * Encodes the specified UpdateCompletionConfigRequest message. Does not implicitly {@link google.cloud.retail.v2beta.UpdateCompletionConfigRequest.verify|verify} messages. + * @param message UpdateCompletionConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IPromotion, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IUpdateCompletionConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Promotion message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Promotion.verify|verify} messages. - * @param message Promotion message or plain object to encode + * Encodes the specified UpdateCompletionConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UpdateCompletionConfigRequest.verify|verify} messages. + * @param message UpdateCompletionConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IPromotion, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IUpdateCompletionConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Promotion message from the specified reader or buffer. + * Decodes an UpdateCompletionConfigRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Promotion + * @returns UpdateCompletionConfigRequest * @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.v2beta.Promotion; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.UpdateCompletionConfigRequest; /** - * Decodes a Promotion message from the specified reader or buffer, length delimited. + * Decodes an UpdateCompletionConfigRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Promotion + * @returns UpdateCompletionConfigRequest * @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.v2beta.Promotion; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.UpdateCompletionConfigRequest; /** - * Verifies a Promotion message. + * Verifies an UpdateCompletionConfigRequest 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 Promotion message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateCompletionConfigRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Promotion + * @returns UpdateCompletionConfigRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Promotion; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UpdateCompletionConfigRequest; /** - * Creates a plain object from a Promotion message. Also converts values to other types if specified. - * @param message Promotion + * Creates a plain object from an UpdateCompletionConfigRequest message. Also converts values to other types if specified. + * @param message UpdateCompletionConfigRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.Promotion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.UpdateCompletionConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Promotion to JSON. + * Converts this UpdateCompletionConfigRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GcsSource. */ - interface IGcsSource { - - /** GcsSource inputUris */ - inputUris?: (string[]|null); + /** Properties of a GetAttributesConfigRequest. */ + interface IGetAttributesConfigRequest { - /** GcsSource dataSchema */ - dataSchema?: (string|null); + /** GetAttributesConfigRequest name */ + name?: (string|null); } - /** Represents a GcsSource. */ - class GcsSource implements IGcsSource { + /** Represents a GetAttributesConfigRequest. */ + class GetAttributesConfigRequest implements IGetAttributesConfigRequest { /** - * Constructs a new GcsSource. + * Constructs a new GetAttributesConfigRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IGcsSource); - - /** GcsSource inputUris. */ - public inputUris: string[]; + constructor(properties?: google.cloud.retail.v2beta.IGetAttributesConfigRequest); - /** GcsSource dataSchema. */ - public dataSchema: string; + /** GetAttributesConfigRequest name. */ + public name: string; /** - * Creates a new GcsSource instance using the specified properties. + * Creates a new GetAttributesConfigRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GcsSource instance + * @returns GetAttributesConfigRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IGcsSource): google.cloud.retail.v2beta.GcsSource; + public static create(properties?: google.cloud.retail.v2beta.IGetAttributesConfigRequest): google.cloud.retail.v2beta.GetAttributesConfigRequest; /** - * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.retail.v2beta.GcsSource.verify|verify} messages. - * @param message GcsSource message or plain object to encode + * Encodes the specified GetAttributesConfigRequest message. Does not implicitly {@link google.cloud.retail.v2beta.GetAttributesConfigRequest.verify|verify} messages. + * @param message GetAttributesConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IGetAttributesConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GcsSource.verify|verify} messages. - * @param message GcsSource message or plain object to encode + * Encodes the specified GetAttributesConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetAttributesConfigRequest.verify|verify} messages. + * @param message GetAttributesConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IGetAttributesConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GcsSource message from the specified reader or buffer. + * Decodes a GetAttributesConfigRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GcsSource + * @returns GetAttributesConfigRequest * @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.v2beta.GcsSource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.GetAttributesConfigRequest; /** - * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * Decodes a GetAttributesConfigRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GcsSource + * @returns GetAttributesConfigRequest * @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.v2beta.GcsSource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.GetAttributesConfigRequest; /** - * Verifies a GcsSource message. + * Verifies a GetAttributesConfigRequest 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 GcsSource message from a plain object. Also converts values to their respective internal types. + * Creates a GetAttributesConfigRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GcsSource + * @returns GetAttributesConfigRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.GcsSource; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.GetAttributesConfigRequest; /** - * Creates a plain object from a GcsSource message. Also converts values to other types if specified. - * @param message GcsSource + * Creates a plain object from a GetAttributesConfigRequest message. Also converts values to other types if specified. + * @param message GetAttributesConfigRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.GetAttributesConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GcsSource to JSON. + * Converts this GetAttributesConfigRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BigQuerySource. */ - interface IBigQuerySource { - - /** BigQuerySource partitionDate */ - partitionDate?: (google.type.IDate|null); - - /** BigQuerySource projectId */ - projectId?: (string|null); - - /** BigQuerySource datasetId */ - datasetId?: (string|null); - - /** BigQuerySource tableId */ - tableId?: (string|null); + /** Properties of an UpdateAttributesConfigRequest. */ + interface IUpdateAttributesConfigRequest { - /** BigQuerySource gcsStagingDir */ - gcsStagingDir?: (string|null); + /** UpdateAttributesConfigRequest attributesConfig */ + attributesConfig?: (google.cloud.retail.v2beta.IAttributesConfig|null); - /** BigQuerySource dataSchema */ - dataSchema?: (string|null); + /** UpdateAttributesConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a BigQuerySource. */ - class BigQuerySource implements IBigQuerySource { + /** Represents an UpdateAttributesConfigRequest. */ + class UpdateAttributesConfigRequest implements IUpdateAttributesConfigRequest { /** - * Constructs a new BigQuerySource. + * Constructs a new UpdateAttributesConfigRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IBigQuerySource); - - /** BigQuerySource partitionDate. */ - public partitionDate?: (google.type.IDate|null); - - /** BigQuerySource projectId. */ - public projectId: string; - - /** BigQuerySource datasetId. */ - public datasetId: string; - - /** BigQuerySource tableId. */ - public tableId: string; - - /** BigQuerySource gcsStagingDir. */ - public gcsStagingDir: string; + constructor(properties?: google.cloud.retail.v2beta.IUpdateAttributesConfigRequest); - /** BigQuerySource dataSchema. */ - public dataSchema: string; + /** UpdateAttributesConfigRequest attributesConfig. */ + public attributesConfig?: (google.cloud.retail.v2beta.IAttributesConfig|null); - /** BigQuerySource partition. */ - public partition?: "partitionDate"; + /** UpdateAttributesConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new BigQuerySource instance using the specified properties. + * Creates a new UpdateAttributesConfigRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BigQuerySource instance + * @returns UpdateAttributesConfigRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IBigQuerySource): google.cloud.retail.v2beta.BigQuerySource; + public static create(properties?: google.cloud.retail.v2beta.IUpdateAttributesConfigRequest): google.cloud.retail.v2beta.UpdateAttributesConfigRequest; /** - * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.retail.v2beta.BigQuerySource.verify|verify} messages. - * @param message BigQuerySource message or plain object to encode + * Encodes the specified UpdateAttributesConfigRequest message. Does not implicitly {@link google.cloud.retail.v2beta.UpdateAttributesConfigRequest.verify|verify} messages. + * @param message UpdateAttributesConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IUpdateAttributesConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.BigQuerySource.verify|verify} messages. - * @param message BigQuerySource message or plain object to encode + * Encodes the specified UpdateAttributesConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UpdateAttributesConfigRequest.verify|verify} messages. + * @param message UpdateAttributesConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IUpdateAttributesConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BigQuerySource message from the specified reader or buffer. + * Decodes an UpdateAttributesConfigRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BigQuerySource + * @returns UpdateAttributesConfigRequest * @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.v2beta.BigQuerySource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.UpdateAttributesConfigRequest; /** - * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. + * Decodes an UpdateAttributesConfigRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BigQuerySource + * @returns UpdateAttributesConfigRequest * @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.v2beta.BigQuerySource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.UpdateAttributesConfigRequest; /** - * Verifies a BigQuerySource message. + * Verifies an UpdateAttributesConfigRequest 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 BigQuerySource message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateAttributesConfigRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BigQuerySource + * @returns UpdateAttributesConfigRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.BigQuerySource; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UpdateAttributesConfigRequest; /** - * Creates a plain object from a BigQuerySource message. Also converts values to other types if specified. - * @param message BigQuerySource + * Creates a plain object from an UpdateAttributesConfigRequest message. Also converts values to other types if specified. + * @param message UpdateAttributesConfigRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.BigQuerySource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.UpdateAttributesConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BigQuerySource to JSON. + * Converts this UpdateAttributesConfigRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ProductInlineSource. */ - interface IProductInlineSource { + /** Properties of an AddCatalogAttributeRequest. */ + interface IAddCatalogAttributeRequest { - /** ProductInlineSource products */ - products?: (google.cloud.retail.v2beta.IProduct[]|null); + /** AddCatalogAttributeRequest attributesConfig */ + attributesConfig?: (string|null); + + /** AddCatalogAttributeRequest catalogAttribute */ + catalogAttribute?: (google.cloud.retail.v2beta.ICatalogAttribute|null); } - /** Represents a ProductInlineSource. */ - class ProductInlineSource implements IProductInlineSource { + /** Represents an AddCatalogAttributeRequest. */ + class AddCatalogAttributeRequest implements IAddCatalogAttributeRequest { /** - * Constructs a new ProductInlineSource. + * Constructs a new AddCatalogAttributeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IProductInlineSource); + constructor(properties?: google.cloud.retail.v2beta.IAddCatalogAttributeRequest); - /** ProductInlineSource products. */ - public products: google.cloud.retail.v2beta.IProduct[]; + /** AddCatalogAttributeRequest attributesConfig. */ + public attributesConfig: string; + + /** AddCatalogAttributeRequest catalogAttribute. */ + public catalogAttribute?: (google.cloud.retail.v2beta.ICatalogAttribute|null); /** - * Creates a new ProductInlineSource instance using the specified properties. + * Creates a new AddCatalogAttributeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ProductInlineSource instance + * @returns AddCatalogAttributeRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IProductInlineSource): google.cloud.retail.v2beta.ProductInlineSource; + public static create(properties?: google.cloud.retail.v2beta.IAddCatalogAttributeRequest): google.cloud.retail.v2beta.AddCatalogAttributeRequest; /** - * Encodes the specified ProductInlineSource message. Does not implicitly {@link google.cloud.retail.v2beta.ProductInlineSource.verify|verify} messages. - * @param message ProductInlineSource message or plain object to encode + * Encodes the specified AddCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2beta.AddCatalogAttributeRequest.verify|verify} messages. + * @param message AddCatalogAttributeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IProductInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IAddCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ProductInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ProductInlineSource.verify|verify} messages. - * @param message ProductInlineSource message or plain object to encode + * Encodes the specified AddCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddCatalogAttributeRequest.verify|verify} messages. + * @param message AddCatalogAttributeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IProductInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IAddCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ProductInlineSource message from the specified reader or buffer. + * 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 ProductInlineSource + * @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.v2beta.ProductInlineSource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.AddCatalogAttributeRequest; /** - * Decodes a ProductInlineSource message from the specified reader or buffer, length delimited. + * Decodes an AddCatalogAttributeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ProductInlineSource + * @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.v2beta.ProductInlineSource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.AddCatalogAttributeRequest; /** - * Verifies a ProductInlineSource message. + * 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 a ProductInlineSource message from a plain object. Also converts values to their respective internal types. + * Creates an AddCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ProductInlineSource + * @returns AddCatalogAttributeRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ProductInlineSource; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.AddCatalogAttributeRequest; /** - * Creates a plain object from a ProductInlineSource message. Also converts values to other types if specified. - * @param message ProductInlineSource + * 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.v2beta.ProductInlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.AddCatalogAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ProductInlineSource to JSON. + * Converts this AddCatalogAttributeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a UserEventInlineSource. */ - interface IUserEventInlineSource { + /** Properties of a RemoveCatalogAttributeRequest. */ + interface IRemoveCatalogAttributeRequest { - /** UserEventInlineSource userEvents */ - userEvents?: (google.cloud.retail.v2beta.IUserEvent[]|null); + /** RemoveCatalogAttributeRequest attributesConfig */ + attributesConfig?: (string|null); + + /** RemoveCatalogAttributeRequest key */ + key?: (string|null); } - /** Represents a UserEventInlineSource. */ - class UserEventInlineSource implements IUserEventInlineSource { + /** Represents a RemoveCatalogAttributeRequest. */ + class RemoveCatalogAttributeRequest implements IRemoveCatalogAttributeRequest { /** - * Constructs a new UserEventInlineSource. + * Constructs a new RemoveCatalogAttributeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IUserEventInlineSource); + constructor(properties?: google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest); - /** UserEventInlineSource userEvents. */ - public userEvents: google.cloud.retail.v2beta.IUserEvent[]; + /** RemoveCatalogAttributeRequest attributesConfig. */ + public attributesConfig: string; + + /** RemoveCatalogAttributeRequest key. */ + public key: string; /** - * Creates a new UserEventInlineSource instance using the specified properties. + * Creates a new RemoveCatalogAttributeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UserEventInlineSource instance + * @returns RemoveCatalogAttributeRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IUserEventInlineSource): google.cloud.retail.v2beta.UserEventInlineSource; + public static create(properties?: google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest): google.cloud.retail.v2beta.RemoveCatalogAttributeRequest; /** - * Encodes the specified UserEventInlineSource message. Does not implicitly {@link google.cloud.retail.v2beta.UserEventInlineSource.verify|verify} messages. - * @param message UserEventInlineSource message or plain object to encode + * Encodes the specified RemoveCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2beta.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.v2beta.IUserEventInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UserEventInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserEventInlineSource.verify|verify} messages. - * @param message UserEventInlineSource message or plain object to encode + * Encodes the specified RemoveCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.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.v2beta.IUserEventInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a UserEventInlineSource message from the specified reader or buffer. + * 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 UserEventInlineSource + * @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.v2beta.UserEventInlineSource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.RemoveCatalogAttributeRequest; /** - * Decodes a UserEventInlineSource message from the specified reader or buffer, length delimited. + * Decodes a RemoveCatalogAttributeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UserEventInlineSource + * @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.v2beta.UserEventInlineSource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.RemoveCatalogAttributeRequest; /** - * Verifies a UserEventInlineSource message. + * 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 UserEventInlineSource message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UserEventInlineSource + * @returns RemoveCatalogAttributeRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UserEventInlineSource; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.RemoveCatalogAttributeRequest; /** - * Creates a plain object from a UserEventInlineSource message. Also converts values to other types if specified. - * @param message UserEventInlineSource + * 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.v2beta.UserEventInlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.RemoveCatalogAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UserEventInlineSource to JSON. + * Converts this RemoveCatalogAttributeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ImportErrorsConfig. */ - interface IImportErrorsConfig { + /** Properties of a ReplaceCatalogAttributeRequest. */ + interface IReplaceCatalogAttributeRequest { - /** ImportErrorsConfig gcsPrefix */ - gcsPrefix?: (string|null); + /** ReplaceCatalogAttributeRequest attributesConfig */ + attributesConfig?: (string|null); + + /** ReplaceCatalogAttributeRequest catalogAttribute */ + catalogAttribute?: (google.cloud.retail.v2beta.ICatalogAttribute|null); + + /** ReplaceCatalogAttributeRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents an ImportErrorsConfig. */ - class ImportErrorsConfig implements IImportErrorsConfig { + /** Represents a ReplaceCatalogAttributeRequest. */ + class ReplaceCatalogAttributeRequest implements IReplaceCatalogAttributeRequest { /** - * Constructs a new ImportErrorsConfig. + * Constructs a new ReplaceCatalogAttributeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IImportErrorsConfig); + constructor(properties?: google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest); - /** ImportErrorsConfig gcsPrefix. */ - public gcsPrefix?: (string|null); + /** ReplaceCatalogAttributeRequest attributesConfig. */ + public attributesConfig: string; - /** ImportErrorsConfig destination. */ - public destination?: "gcsPrefix"; + /** ReplaceCatalogAttributeRequest catalogAttribute. */ + public catalogAttribute?: (google.cloud.retail.v2beta.ICatalogAttribute|null); + + /** ReplaceCatalogAttributeRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new ImportErrorsConfig instance using the specified properties. + * Creates a new ReplaceCatalogAttributeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ImportErrorsConfig instance + * @returns ReplaceCatalogAttributeRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IImportErrorsConfig): google.cloud.retail.v2beta.ImportErrorsConfig; + public static create(properties?: google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest): google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest; /** - * Encodes the specified ImportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ImportErrorsConfig.verify|verify} messages. - * @param message ImportErrorsConfig message or plain object to encode + * Encodes the specified ReplaceCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest.verify|verify} messages. + * @param message ReplaceCatalogAttributeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IImportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportErrorsConfig.verify|verify} messages. - * @param message ImportErrorsConfig message or plain object to encode + * Encodes the specified ReplaceCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest.verify|verify} messages. + * @param message ReplaceCatalogAttributeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IImportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportErrorsConfig message from the specified reader or buffer. + * Decodes a ReplaceCatalogAttributeRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportErrorsConfig + * @returns ReplaceCatalogAttributeRequest * @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.v2beta.ImportErrorsConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest; /** - * Decodes an ImportErrorsConfig message from the specified reader or buffer, length delimited. + * Decodes a ReplaceCatalogAttributeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportErrorsConfig + * @returns ReplaceCatalogAttributeRequest * @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.v2beta.ImportErrorsConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest; /** - * Verifies an ImportErrorsConfig message. + * Verifies a ReplaceCatalogAttributeRequest 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 ImportErrorsConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ReplaceCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportErrorsConfig + * @returns ReplaceCatalogAttributeRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ImportErrorsConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest; /** - * Creates a plain object from an ImportErrorsConfig message. Also converts values to other types if specified. - * @param message ImportErrorsConfig + * Creates a plain object from a ReplaceCatalogAttributeRequest message. Also converts values to other types if specified. + * @param message ReplaceCatalogAttributeRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.ImportErrorsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportErrorsConfig to JSON. + * Converts this ReplaceCatalogAttributeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ImportProductsRequest. */ - interface IImportProductsRequest { + /** Represents a CompletionService */ + class CompletionService extends $protobuf.rpc.Service { - /** ImportProductsRequest parent */ - parent?: (string|null); + /** + * Constructs a new CompletionService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** ImportProductsRequest requestId */ - requestId?: (string|null); + /** + * Creates new CompletionService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): CompletionService; - /** ImportProductsRequest inputConfig */ - inputConfig?: (google.cloud.retail.v2beta.IProductInputConfig|null); + /** + * Calls CompleteQuery. + * @param request CompleteQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CompleteQueryResponse + */ + public completeQuery(request: google.cloud.retail.v2beta.ICompleteQueryRequest, callback: google.cloud.retail.v2beta.CompletionService.CompleteQueryCallback): void; - /** ImportProductsRequest errorsConfig */ - errorsConfig?: (google.cloud.retail.v2beta.IImportErrorsConfig|null); + /** + * Calls CompleteQuery. + * @param request CompleteQueryRequest message or plain object + * @returns Promise + */ + public completeQuery(request: google.cloud.retail.v2beta.ICompleteQueryRequest): Promise; - /** ImportProductsRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** + * Calls ImportCompletionData. + * @param request ImportCompletionDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importCompletionData(request: google.cloud.retail.v2beta.IImportCompletionDataRequest, callback: google.cloud.retail.v2beta.CompletionService.ImportCompletionDataCallback): void; - /** ImportProductsRequest reconciliationMode */ - reconciliationMode?: (google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode|keyof typeof google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode|null); + /** + * Calls ImportCompletionData. + * @param request ImportCompletionDataRequest message or plain object + * @returns Promise + */ + public importCompletionData(request: google.cloud.retail.v2beta.IImportCompletionDataRequest): Promise; + } - /** ImportProductsRequest notificationPubsubTopic */ - notificationPubsubTopic?: (string|null); + namespace CompletionService { + + /** + * Callback as used by {@link google.cloud.retail.v2beta.CompletionService#completeQuery}. + * @param error Error, if any + * @param [response] CompleteQueryResponse + */ + type CompleteQueryCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.CompleteQueryResponse) => void; + + /** + * Callback as used by {@link google.cloud.retail.v2beta.CompletionService#importCompletionData}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportCompletionDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } - /** Represents an ImportProductsRequest. */ - class ImportProductsRequest implements IImportProductsRequest { + /** Properties of a CompleteQueryRequest. */ + interface ICompleteQueryRequest { + + /** CompleteQueryRequest catalog */ + catalog?: (string|null); + + /** CompleteQueryRequest query */ + query?: (string|null); + + /** CompleteQueryRequest visitorId */ + visitorId?: (string|null); + + /** CompleteQueryRequest languageCodes */ + languageCodes?: (string[]|null); + + /** CompleteQueryRequest deviceType */ + deviceType?: (string|null); + + /** CompleteQueryRequest dataset */ + dataset?: (string|null); + + /** CompleteQueryRequest maxSuggestions */ + maxSuggestions?: (number|null); + } + + /** Represents a CompleteQueryRequest. */ + class CompleteQueryRequest implements ICompleteQueryRequest { /** - * Constructs a new ImportProductsRequest. + * Constructs a new CompleteQueryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IImportProductsRequest); + constructor(properties?: google.cloud.retail.v2beta.ICompleteQueryRequest); - /** ImportProductsRequest parent. */ - public parent: string; + /** CompleteQueryRequest catalog. */ + public catalog: string; - /** ImportProductsRequest requestId. */ - public requestId: string; + /** CompleteQueryRequest query. */ + public query: string; - /** ImportProductsRequest inputConfig. */ - public inputConfig?: (google.cloud.retail.v2beta.IProductInputConfig|null); + /** CompleteQueryRequest visitorId. */ + public visitorId: string; - /** ImportProductsRequest errorsConfig. */ - public errorsConfig?: (google.cloud.retail.v2beta.IImportErrorsConfig|null); + /** CompleteQueryRequest languageCodes. */ + public languageCodes: string[]; - /** ImportProductsRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** CompleteQueryRequest deviceType. */ + public deviceType: string; - /** ImportProductsRequest reconciliationMode. */ - public reconciliationMode: (google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode|keyof typeof google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode); + /** CompleteQueryRequest dataset. */ + public dataset: string; - /** ImportProductsRequest notificationPubsubTopic. */ - public notificationPubsubTopic: string; + /** CompleteQueryRequest maxSuggestions. */ + public maxSuggestions: number; /** - * Creates a new ImportProductsRequest instance using the specified properties. + * Creates a new CompleteQueryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ImportProductsRequest instance + * @returns CompleteQueryRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IImportProductsRequest): google.cloud.retail.v2beta.ImportProductsRequest; + public static create(properties?: google.cloud.retail.v2beta.ICompleteQueryRequest): google.cloud.retail.v2beta.CompleteQueryRequest; /** - * Encodes the specified ImportProductsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ImportProductsRequest.verify|verify} messages. - * @param message ImportProductsRequest message or plain object to encode + * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryRequest.verify|verify} messages. + * @param message CompleteQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IImportProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportProductsRequest.verify|verify} messages. - * @param message ImportProductsRequest message or plain object to encode + * Encodes the specified CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryRequest.verify|verify} messages. + * @param message CompleteQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IImportProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportProductsRequest message from the specified reader or buffer. + * Decodes a CompleteQueryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportProductsRequest + * @returns CompleteQueryRequest * @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.v2beta.ImportProductsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.CompleteQueryRequest; /** - * Decodes an ImportProductsRequest message from the specified reader or buffer, length delimited. + * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportProductsRequest + * @returns CompleteQueryRequest * @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.v2beta.ImportProductsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.CompleteQueryRequest; /** - * Verifies an ImportProductsRequest message. + * Verifies a CompleteQueryRequest 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 ImportProductsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportProductsRequest + * @returns CompleteQueryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ImportProductsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CompleteQueryRequest; /** - * Creates a plain object from an ImportProductsRequest message. Also converts values to other types if specified. - * @param message ImportProductsRequest + * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. + * @param message CompleteQueryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.ImportProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.CompleteQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportProductsRequest to JSON. + * Converts this CompleteQueryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ImportProductsRequest { - - /** ReconciliationMode enum. */ - enum ReconciliationMode { - RECONCILIATION_MODE_UNSPECIFIED = 0, - INCREMENTAL = 1, - FULL = 2 - } - } - - /** Properties of an ImportUserEventsRequest. */ - interface IImportUserEventsRequest { + /** Properties of a CompleteQueryResponse. */ + interface ICompleteQueryResponse { - /** ImportUserEventsRequest parent */ - parent?: (string|null); + /** CompleteQueryResponse completionResults */ + completionResults?: (google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult[]|null); - /** ImportUserEventsRequest inputConfig */ - inputConfig?: (google.cloud.retail.v2beta.IUserEventInputConfig|null); + /** CompleteQueryResponse attributionToken */ + attributionToken?: (string|null); - /** ImportUserEventsRequest errorsConfig */ - errorsConfig?: (google.cloud.retail.v2beta.IImportErrorsConfig|null); + /** CompleteQueryResponse recentSearchResults */ + recentSearchResults?: (google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult[]|null); } - /** Represents an ImportUserEventsRequest. */ - class ImportUserEventsRequest implements IImportUserEventsRequest { + /** Represents a CompleteQueryResponse. */ + class CompleteQueryResponse implements ICompleteQueryResponse { /** - * Constructs a new ImportUserEventsRequest. + * Constructs a new CompleteQueryResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IImportUserEventsRequest); + constructor(properties?: google.cloud.retail.v2beta.ICompleteQueryResponse); - /** ImportUserEventsRequest parent. */ - public parent: string; + /** CompleteQueryResponse completionResults. */ + public completionResults: google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult[]; - /** ImportUserEventsRequest inputConfig. */ - public inputConfig?: (google.cloud.retail.v2beta.IUserEventInputConfig|null); + /** CompleteQueryResponse attributionToken. */ + public attributionToken: string; - /** ImportUserEventsRequest errorsConfig. */ - public errorsConfig?: (google.cloud.retail.v2beta.IImportErrorsConfig|null); + /** CompleteQueryResponse recentSearchResults. */ + public recentSearchResults: google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult[]; /** - * Creates a new ImportUserEventsRequest instance using the specified properties. + * Creates a new CompleteQueryResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ImportUserEventsRequest instance + * @returns CompleteQueryResponse instance */ - public static create(properties?: google.cloud.retail.v2beta.IImportUserEventsRequest): google.cloud.retail.v2beta.ImportUserEventsRequest; + public static create(properties?: google.cloud.retail.v2beta.ICompleteQueryResponse): google.cloud.retail.v2beta.CompleteQueryResponse; /** - * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ImportUserEventsRequest.verify|verify} messages. - * @param message ImportUserEventsRequest message or plain object to encode + * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.verify|verify} messages. + * @param message CompleteQueryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportUserEventsRequest.verify|verify} messages. - * @param message ImportUserEventsRequest message or plain object to encode + * Encodes the specified CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.verify|verify} messages. + * @param message CompleteQueryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportUserEventsRequest message from the specified reader or buffer. + * Decodes a CompleteQueryResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportUserEventsRequest + * @returns CompleteQueryResponse * @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.v2beta.ImportUserEventsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.CompleteQueryResponse; /** - * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportUserEventsRequest + * @returns CompleteQueryResponse * @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.v2beta.ImportUserEventsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.CompleteQueryResponse; /** - * Verifies an ImportUserEventsRequest message. + * Verifies a CompleteQueryResponse 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 ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportUserEventsRequest + * @returns CompleteQueryResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ImportUserEventsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CompleteQueryResponse; /** - * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. - * @param message ImportUserEventsRequest + * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. + * @param message CompleteQueryResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.ImportUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.CompleteQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportUserEventsRequest to JSON. + * Converts this CompleteQueryResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ImportCompletionDataRequest. */ - interface IImportCompletionDataRequest { + namespace CompleteQueryResponse { - /** ImportCompletionDataRequest parent */ - parent?: (string|null); + /** Properties of a CompletionResult. */ + interface ICompletionResult { - /** ImportCompletionDataRequest inputConfig */ - inputConfig?: (google.cloud.retail.v2beta.ICompletionDataInputConfig|null); + /** CompletionResult suggestion */ + suggestion?: (string|null); - /** ImportCompletionDataRequest notificationPubsubTopic */ - notificationPubsubTopic?: (string|null); + /** CompletionResult attributes */ + attributes?: ({ [k: string]: google.cloud.retail.v2beta.ICustomAttribute }|null); + } + + /** Represents a CompletionResult. */ + class CompletionResult implements ICompletionResult { + + /** + * Constructs a new CompletionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult); + + /** CompletionResult suggestion. */ + public suggestion: string; + + /** CompletionResult attributes. */ + public attributes: { [k: string]: google.cloud.retail.v2beta.ICustomAttribute }; + + /** + * Creates a new CompletionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns CompletionResult instance + */ + public static create(properties?: google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult): google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult; + + /** + * Encodes the specified CompletionResult message. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @param message CompletionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompletionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @param message CompletionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompletionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompletionResult + * @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.v2beta.CompleteQueryResponse.CompletionResult; + + /** + * Decodes a CompletionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompletionResult + * @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.v2beta.CompleteQueryResponse.CompletionResult; + + /** + * Verifies a CompletionResult 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 CompletionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompletionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult; + + /** + * Creates a plain object from a CompletionResult message. Also converts values to other types if specified. + * @param message CompletionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompletionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RecentSearchResult. */ + interface IRecentSearchResult { + + /** RecentSearchResult recentSearch */ + recentSearch?: (string|null); + } + + /** Represents a RecentSearchResult. */ + class RecentSearchResult implements IRecentSearchResult { + + /** + * Constructs a new RecentSearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult); + + /** RecentSearchResult recentSearch. */ + public recentSearch: string; + + /** + * Creates a new RecentSearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns RecentSearchResult instance + */ + public static create(properties?: google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult): google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult; + + /** + * Encodes the specified RecentSearchResult message. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. + * @param message RecentSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecentSearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. + * @param message RecentSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecentSearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecentSearchResult + * @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.v2beta.CompleteQueryResponse.RecentSearchResult; + + /** + * Decodes a RecentSearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecentSearchResult + * @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.v2beta.CompleteQueryResponse.RecentSearchResult; + + /** + * Verifies a RecentSearchResult 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 RecentSearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecentSearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult; + + /** + * Creates a plain object from a RecentSearchResult message. Also converts values to other types if specified. + * @param message RecentSearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecentSearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } - /** Represents an ImportCompletionDataRequest. */ - class ImportCompletionDataRequest implements IImportCompletionDataRequest { + /** Properties of a Control. */ + interface IControl { + + /** Control facetSpec */ + facetSpec?: (google.cloud.retail.v2beta.SearchRequest.IFacetSpec|null); + + /** Control rule */ + rule?: (google.cloud.retail.v2beta.IRule|null); + + /** Control name */ + name?: (string|null); + + /** Control displayName */ + displayName?: (string|null); + + /** Control associatedServingConfigIds */ + associatedServingConfigIds?: (string[]|null); + + /** Control solutionTypes */ + solutionTypes?: (google.cloud.retail.v2beta.SolutionType[]|null); + } + + /** Represents a Control. */ + class Control implements IControl { /** - * Constructs a new ImportCompletionDataRequest. + * Constructs a new Control. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IImportCompletionDataRequest); + constructor(properties?: google.cloud.retail.v2beta.IControl); - /** ImportCompletionDataRequest parent. */ - public parent: string; + /** Control facetSpec. */ + public facetSpec?: (google.cloud.retail.v2beta.SearchRequest.IFacetSpec|null); - /** ImportCompletionDataRequest inputConfig. */ - public inputConfig?: (google.cloud.retail.v2beta.ICompletionDataInputConfig|null); + /** Control rule. */ + public rule?: (google.cloud.retail.v2beta.IRule|null); - /** ImportCompletionDataRequest notificationPubsubTopic. */ - public notificationPubsubTopic: string; + /** Control name. */ + public name: string; + + /** Control displayName. */ + public displayName: string; + + /** Control associatedServingConfigIds. */ + public associatedServingConfigIds: string[]; + + /** Control solutionTypes. */ + public solutionTypes: google.cloud.retail.v2beta.SolutionType[]; + + /** Control control. */ + public control?: ("facetSpec"|"rule"); /** - * Creates a new ImportCompletionDataRequest instance using the specified properties. + * Creates a new Control instance using the specified properties. * @param [properties] Properties to set - * @returns ImportCompletionDataRequest instance + * @returns Control instance */ - public static create(properties?: google.cloud.retail.v2beta.IImportCompletionDataRequest): google.cloud.retail.v2beta.ImportCompletionDataRequest; + public static create(properties?: google.cloud.retail.v2beta.IControl): google.cloud.retail.v2beta.Control; /** - * Encodes the specified ImportCompletionDataRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ImportCompletionDataRequest.verify|verify} messages. - * @param message ImportCompletionDataRequest message or plain object to encode + * Encodes the specified Control message. Does not implicitly {@link google.cloud.retail.v2beta.Control.verify|verify} messages. + * @param message Control message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IImportCompletionDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IControl, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportCompletionDataRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportCompletionDataRequest.verify|verify} messages. - * @param message ImportCompletionDataRequest message or plain object to encode + * Encodes the specified Control message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Control.verify|verify} messages. + * @param message Control message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IImportCompletionDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IControl, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportCompletionDataRequest message from the specified reader or buffer. + * Decodes a Control message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportCompletionDataRequest + * @returns Control * @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.v2beta.ImportCompletionDataRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.Control; /** - * Decodes an ImportCompletionDataRequest message from the specified reader or buffer, length delimited. + * Decodes a Control message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportCompletionDataRequest + * @returns Control * @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.v2beta.ImportCompletionDataRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.Control; /** - * Verifies an ImportCompletionDataRequest message. + * Verifies a Control 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 ImportCompletionDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Control message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportCompletionDataRequest + * @returns Control */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ImportCompletionDataRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Control; /** - * Creates a plain object from an ImportCompletionDataRequest message. Also converts values to other types if specified. - * @param message ImportCompletionDataRequest + * Creates a plain object from a Control message. Also converts values to other types if specified. + * @param message Control * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.ImportCompletionDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.Control, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportCompletionDataRequest to JSON. + * Converts this Control to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ProductInputConfig. */ - interface IProductInputConfig { + /** Represents a SearchService */ + class SearchService extends $protobuf.rpc.Service { - /** ProductInputConfig productInlineSource */ - productInlineSource?: (google.cloud.retail.v2beta.IProductInlineSource|null); + /** + * Constructs a new SearchService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** ProductInputConfig gcsSource */ - gcsSource?: (google.cloud.retail.v2beta.IGcsSource|null); + /** + * Creates new SearchService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SearchService; - /** ProductInputConfig bigQuerySource */ - bigQuerySource?: (google.cloud.retail.v2beta.IBigQuerySource|null); + /** + * Calls Search. + * @param request SearchRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchResponse + */ + public search(request: google.cloud.retail.v2beta.ISearchRequest, callback: google.cloud.retail.v2beta.SearchService.SearchCallback): void; + + /** + * Calls Search. + * @param request SearchRequest message or plain object + * @returns Promise + */ + public search(request: google.cloud.retail.v2beta.ISearchRequest): Promise; } - /** Represents a ProductInputConfig. */ - class ProductInputConfig implements IProductInputConfig { + namespace SearchService { /** - * Constructs a new ProductInputConfig. - * @param [properties] Properties to set + * Callback as used by {@link google.cloud.retail.v2beta.SearchService#search}. + * @param error Error, if any + * @param [response] SearchResponse */ - constructor(properties?: google.cloud.retail.v2beta.IProductInputConfig); + type SearchCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.SearchResponse) => void; + } - /** ProductInputConfig productInlineSource. */ - public productInlineSource?: (google.cloud.retail.v2beta.IProductInlineSource|null); + /** Properties of a SearchRequest. */ + interface ISearchRequest { - /** ProductInputConfig gcsSource. */ - public gcsSource?: (google.cloud.retail.v2beta.IGcsSource|null); + /** SearchRequest placement */ + placement?: (string|null); - /** ProductInputConfig bigQuerySource. */ - public bigQuerySource?: (google.cloud.retail.v2beta.IBigQuerySource|null); + /** SearchRequest branch */ + branch?: (string|null); - /** ProductInputConfig source. */ - public source?: ("productInlineSource"|"gcsSource"|"bigQuerySource"); + /** SearchRequest query */ + query?: (string|null); - /** - * Creates a new ProductInputConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ProductInputConfig instance - */ - public static create(properties?: google.cloud.retail.v2beta.IProductInputConfig): google.cloud.retail.v2beta.ProductInputConfig; + /** SearchRequest visitorId */ + visitorId?: (string|null); - /** - * Encodes the specified ProductInputConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ProductInputConfig.verify|verify} messages. - * @param message ProductInputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.IProductInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** SearchRequest userInfo */ + userInfo?: (google.cloud.retail.v2beta.IUserInfo|null); - /** - * Encodes the specified ProductInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ProductInputConfig.verify|verify} messages. - * @param message ProductInputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IProductInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** SearchRequest pageSize */ + pageSize?: (number|null); - /** - * Decodes a ProductInputConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProductInputConfig - * @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.v2beta.ProductInputConfig; + /** SearchRequest pageToken */ + pageToken?: (string|null); - /** - * Decodes a ProductInputConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProductInputConfig - * @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.v2beta.ProductInputConfig; + /** SearchRequest offset */ + offset?: (number|null); - /** - * Verifies a ProductInputConfig 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); + /** SearchRequest filter */ + filter?: (string|null); - /** - * Creates a ProductInputConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProductInputConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ProductInputConfig; + /** SearchRequest canonicalFilter */ + canonicalFilter?: (string|null); - /** - * Creates a plain object from a ProductInputConfig message. Also converts values to other types if specified. - * @param message ProductInputConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.ProductInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** SearchRequest orderBy */ + orderBy?: (string|null); - /** - * Converts this ProductInputConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** SearchRequest facetSpecs */ + facetSpecs?: (google.cloud.retail.v2beta.SearchRequest.IFacetSpec[]|null); - /** Properties of a UserEventInputConfig. */ - interface IUserEventInputConfig { + /** SearchRequest dynamicFacetSpec */ + dynamicFacetSpec?: (google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec|null); - /** UserEventInputConfig userEventInlineSource */ - userEventInlineSource?: (google.cloud.retail.v2beta.IUserEventInlineSource|null); + /** SearchRequest boostSpec */ + boostSpec?: (google.cloud.retail.v2beta.SearchRequest.IBoostSpec|null); - /** UserEventInputConfig gcsSource */ - gcsSource?: (google.cloud.retail.v2beta.IGcsSource|null); + /** SearchRequest queryExpansionSpec */ + queryExpansionSpec?: (google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec|null); - /** UserEventInputConfig bigQuerySource */ - bigQuerySource?: (google.cloud.retail.v2beta.IBigQuerySource|null); + /** SearchRequest variantRollupKeys */ + variantRollupKeys?: (string[]|null); + + /** SearchRequest pageCategories */ + pageCategories?: (string[]|null); + + /** SearchRequest searchMode */ + searchMode?: (google.cloud.retail.v2beta.SearchRequest.SearchMode|keyof typeof google.cloud.retail.v2beta.SearchRequest.SearchMode|null); + + /** SearchRequest personalizationSpec */ + personalizationSpec?: (google.cloud.retail.v2beta.SearchRequest.IPersonalizationSpec|null); } - /** Represents a UserEventInputConfig. */ - class UserEventInputConfig implements IUserEventInputConfig { + /** Represents a SearchRequest. */ + class SearchRequest implements ISearchRequest { /** - * Constructs a new UserEventInputConfig. + * Constructs a new SearchRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IUserEventInputConfig); + constructor(properties?: google.cloud.retail.v2beta.ISearchRequest); - /** UserEventInputConfig userEventInlineSource. */ - public userEventInlineSource?: (google.cloud.retail.v2beta.IUserEventInlineSource|null); + /** SearchRequest placement. */ + public placement: string; - /** UserEventInputConfig gcsSource. */ - public gcsSource?: (google.cloud.retail.v2beta.IGcsSource|null); + /** SearchRequest branch. */ + public branch: string; - /** UserEventInputConfig bigQuerySource. */ - public bigQuerySource?: (google.cloud.retail.v2beta.IBigQuerySource|null); + /** SearchRequest query. */ + public query: string; - /** UserEventInputConfig source. */ - public source?: ("userEventInlineSource"|"gcsSource"|"bigQuerySource"); + /** SearchRequest visitorId. */ + public visitorId: string; + + /** SearchRequest userInfo. */ + public userInfo?: (google.cloud.retail.v2beta.IUserInfo|null); + + /** SearchRequest pageSize. */ + public pageSize: number; + + /** SearchRequest pageToken. */ + public pageToken: string; + + /** SearchRequest offset. */ + public offset: number; + + /** SearchRequest filter. */ + public filter: string; + + /** SearchRequest canonicalFilter. */ + public canonicalFilter: string; + + /** SearchRequest orderBy. */ + public orderBy: string; + + /** SearchRequest facetSpecs. */ + public facetSpecs: google.cloud.retail.v2beta.SearchRequest.IFacetSpec[]; + + /** SearchRequest dynamicFacetSpec. */ + public dynamicFacetSpec?: (google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec|null); + + /** SearchRequest boostSpec. */ + public boostSpec?: (google.cloud.retail.v2beta.SearchRequest.IBoostSpec|null); + + /** SearchRequest queryExpansionSpec. */ + public queryExpansionSpec?: (google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec|null); + + /** SearchRequest variantRollupKeys. */ + public variantRollupKeys: string[]; + + /** SearchRequest pageCategories. */ + public pageCategories: string[]; + + /** SearchRequest searchMode. */ + public searchMode: (google.cloud.retail.v2beta.SearchRequest.SearchMode|keyof typeof google.cloud.retail.v2beta.SearchRequest.SearchMode); + + /** SearchRequest personalizationSpec. */ + public personalizationSpec?: (google.cloud.retail.v2beta.SearchRequest.IPersonalizationSpec|null); /** - * Creates a new UserEventInputConfig instance using the specified properties. + * Creates a new SearchRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UserEventInputConfig instance + * @returns SearchRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IUserEventInputConfig): google.cloud.retail.v2beta.UserEventInputConfig; + public static create(properties?: google.cloud.retail.v2beta.ISearchRequest): google.cloud.retail.v2beta.SearchRequest; /** - * Encodes the specified UserEventInputConfig message. Does not implicitly {@link google.cloud.retail.v2beta.UserEventInputConfig.verify|verify} messages. - * @param message UserEventInputConfig message or plain object to encode + * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.verify|verify} messages. + * @param message SearchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IUserEventInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UserEventInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserEventInputConfig.verify|verify} messages. - * @param message UserEventInputConfig message or plain object to encode + * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.verify|verify} messages. + * @param message SearchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IUserEventInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a UserEventInputConfig message from the specified reader or buffer. + * Decodes a SearchRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UserEventInputConfig + * @returns SearchRequest * @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.v2beta.UserEventInputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.SearchRequest; /** - * Decodes a UserEventInputConfig message from the specified reader or buffer, length delimited. + * Decodes a SearchRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UserEventInputConfig + * @returns SearchRequest * @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.v2beta.UserEventInputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.SearchRequest; /** - * Verifies a UserEventInputConfig message. + * Verifies a SearchRequest 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 UserEventInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a SearchRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UserEventInputConfig + * @returns SearchRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UserEventInputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchRequest; /** - * Creates a plain object from a UserEventInputConfig message. Also converts values to other types if specified. - * @param message UserEventInputConfig + * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. + * @param message SearchRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.UserEventInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.SearchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UserEventInputConfig to JSON. + * Converts this SearchRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CompletionDataInputConfig. */ - interface ICompletionDataInputConfig { + namespace SearchRequest { - /** CompletionDataInputConfig bigQuerySource */ - bigQuerySource?: (google.cloud.retail.v2beta.IBigQuerySource|null); - } + /** Properties of a FacetSpec. */ + interface IFacetSpec { - /** Represents a CompletionDataInputConfig. */ - class CompletionDataInputConfig implements ICompletionDataInputConfig { + /** FacetSpec facetKey */ + facetKey?: (google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey|null); - /** - * Constructs a new CompletionDataInputConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.ICompletionDataInputConfig); + /** FacetSpec limit */ + limit?: (number|null); - /** CompletionDataInputConfig bigQuerySource. */ - public bigQuerySource?: (google.cloud.retail.v2beta.IBigQuerySource|null); + /** FacetSpec excludedFilterKeys */ + excludedFilterKeys?: (string[]|null); - /** CompletionDataInputConfig source. */ - public source?: "bigQuerySource"; + /** FacetSpec enableDynamicPosition */ + enableDynamicPosition?: (boolean|null); + } - /** - * Creates a new CompletionDataInputConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns CompletionDataInputConfig instance - */ - public static create(properties?: google.cloud.retail.v2beta.ICompletionDataInputConfig): google.cloud.retail.v2beta.CompletionDataInputConfig; + /** Represents a FacetSpec. */ + class FacetSpec implements IFacetSpec { - /** - * Encodes the specified CompletionDataInputConfig message. Does not implicitly {@link google.cloud.retail.v2beta.CompletionDataInputConfig.verify|verify} messages. - * @param message CompletionDataInputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.ICompletionDataInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new FacetSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.SearchRequest.IFacetSpec); - /** - * Encodes the specified CompletionDataInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompletionDataInputConfig.verify|verify} messages. - * @param message CompletionDataInputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.ICompletionDataInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** FacetSpec facetKey. */ + public facetKey?: (google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey|null); - /** - * Decodes a CompletionDataInputConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CompletionDataInputConfig - * @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.v2beta.CompletionDataInputConfig; + /** FacetSpec limit. */ + public limit: number; - /** - * Decodes a CompletionDataInputConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CompletionDataInputConfig - * @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.v2beta.CompletionDataInputConfig; + /** FacetSpec excludedFilterKeys. */ + public excludedFilterKeys: string[]; - /** - * Verifies a CompletionDataInputConfig 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); + /** FacetSpec enableDynamicPosition. */ + public enableDynamicPosition: boolean; - /** - * Creates a CompletionDataInputConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CompletionDataInputConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CompletionDataInputConfig; + /** + * Creates a new FacetSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetSpec instance + */ + public static create(properties?: google.cloud.retail.v2beta.SearchRequest.IFacetSpec): google.cloud.retail.v2beta.SearchRequest.FacetSpec; - /** - * Creates a plain object from a CompletionDataInputConfig message. Also converts values to other types if specified. - * @param message CompletionDataInputConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.CompletionDataInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified FacetSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.FacetSpec.verify|verify} messages. + * @param message FacetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.SearchRequest.IFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.FacetSpec.verify|verify} messages. + * @param message FacetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.SearchRequest.IFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FacetSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetSpec + * @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.v2beta.SearchRequest.FacetSpec; + + /** + * Decodes a FacetSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetSpec + * @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.v2beta.SearchRequest.FacetSpec; + + /** + * Verifies a FacetSpec 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 FacetSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchRequest.FacetSpec; + + /** + * Creates a plain object from a FacetSpec message. Also converts values to other types if specified. + * @param message FacetSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.SearchRequest.FacetSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FacetSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FacetSpec { + + /** Properties of a FacetKey. */ + interface IFacetKey { + + /** FacetKey key */ + key?: (string|null); + + /** FacetKey intervals */ + intervals?: (google.cloud.retail.v2beta.IInterval[]|null); + + /** FacetKey restrictedValues */ + restrictedValues?: (string[]|null); + + /** FacetKey prefixes */ + prefixes?: (string[]|null); + + /** FacetKey contains */ + contains?: (string[]|null); + + /** FacetKey orderBy */ + orderBy?: (string|null); + + /** FacetKey query */ + query?: (string|null); + } + + /** Represents a FacetKey. */ + class FacetKey implements IFacetKey { + + /** + * Constructs a new FacetKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey); + + /** FacetKey key. */ + public key: string; + + /** FacetKey intervals. */ + public intervals: google.cloud.retail.v2beta.IInterval[]; - /** - * Converts this CompletionDataInputConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FacetKey restrictedValues. */ + public restrictedValues: string[]; - /** Properties of an ImportMetadata. */ - interface IImportMetadata { + /** FacetKey prefixes. */ + public prefixes: string[]; - /** ImportMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** FacetKey contains. */ + public contains: string[]; - /** ImportMetadata updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** FacetKey orderBy. */ + public orderBy: string; - /** ImportMetadata successCount */ - successCount?: (number|Long|string|null); + /** FacetKey query. */ + public query: string; - /** ImportMetadata failureCount */ - failureCount?: (number|Long|string|null); + /** + * Creates a new FacetKey instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetKey instance + */ + public static create(properties?: google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey): google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey; - /** ImportMetadata requestId */ - requestId?: (string|null); + /** + * Encodes the specified FacetKey message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. + * @param message FacetKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey, writer?: $protobuf.Writer): $protobuf.Writer; - /** ImportMetadata notificationPubsubTopic */ - notificationPubsubTopic?: (string|null); - } + /** + * Encodes the specified FacetKey message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. + * @param message FacetKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents an ImportMetadata. */ - class ImportMetadata implements IImportMetadata { + /** + * Decodes a FacetKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetKey + * @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.v2beta.SearchRequest.FacetSpec.FacetKey; - /** - * Constructs a new ImportMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.IImportMetadata); + /** + * Decodes a FacetKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetKey + * @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.v2beta.SearchRequest.FacetSpec.FacetKey; - /** ImportMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** + * Verifies a FacetKey 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); - /** ImportMetadata updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** + * Creates a FacetKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey; - /** ImportMetadata successCount. */ - public successCount: (number|Long|string); + /** + * Creates a plain object from a FacetKey message. Also converts values to other types if specified. + * @param message FacetKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ImportMetadata failureCount. */ - public failureCount: (number|Long|string); + /** + * Converts this FacetKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** ImportMetadata requestId. */ - public requestId: string; + /** Properties of a DynamicFacetSpec. */ + interface IDynamicFacetSpec { - /** ImportMetadata notificationPubsubTopic. */ - public notificationPubsubTopic: string; + /** DynamicFacetSpec mode */ + mode?: (google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode|keyof typeof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode|null); + } - /** - * Creates a new ImportMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportMetadata instance - */ - public static create(properties?: google.cloud.retail.v2beta.IImportMetadata): google.cloud.retail.v2beta.ImportMetadata; + /** Represents a DynamicFacetSpec. */ + class DynamicFacetSpec implements IDynamicFacetSpec { - /** - * Encodes the specified ImportMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.ImportMetadata.verify|verify} messages. - * @param message ImportMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.IImportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new DynamicFacetSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec); - /** - * Encodes the specified ImportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportMetadata.verify|verify} messages. - * @param message ImportMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IImportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** DynamicFacetSpec mode. */ + public mode: (google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode|keyof typeof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode); - /** - * Decodes an ImportMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportMetadata - * @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.v2beta.ImportMetadata; + /** + * Creates a new DynamicFacetSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns DynamicFacetSpec instance + */ + public static create(properties?: google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec): google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec; - /** - * Decodes an ImportMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportMetadata - * @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.v2beta.ImportMetadata; + /** + * Encodes the specified DynamicFacetSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.verify|verify} messages. + * @param message DynamicFacetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an ImportMetadata 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); + /** + * Encodes the specified DynamicFacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.verify|verify} messages. + * @param message DynamicFacetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates an ImportMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ImportMetadata; + /** + * Decodes a DynamicFacetSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DynamicFacetSpec + * @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.v2beta.SearchRequest.DynamicFacetSpec; - /** - * Creates a plain object from an ImportMetadata message. Also converts values to other types if specified. - * @param message ImportMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.ImportMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a DynamicFacetSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DynamicFacetSpec + * @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.v2beta.SearchRequest.DynamicFacetSpec; - /** - * Converts this ImportMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies a DynamicFacetSpec 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); - /** Properties of an ImportProductsResponse. */ - interface IImportProductsResponse { + /** + * Creates a DynamicFacetSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DynamicFacetSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec; - /** ImportProductsResponse errorSamples */ - errorSamples?: (google.rpc.IStatus[]|null); + /** + * Creates a plain object from a DynamicFacetSpec message. Also converts values to other types if specified. + * @param message DynamicFacetSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DynamicFacetSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ImportProductsResponse errorsConfig */ - errorsConfig?: (google.cloud.retail.v2beta.IImportErrorsConfig|null); - } + namespace DynamicFacetSpec { - /** Represents an ImportProductsResponse. */ - class ImportProductsResponse implements IImportProductsResponse { + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + DISABLED = 1, + ENABLED = 2 + } + } - /** - * Constructs a new ImportProductsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.IImportProductsResponse); + /** Properties of a BoostSpec. */ + interface IBoostSpec { - /** ImportProductsResponse errorSamples. */ - public errorSamples: google.rpc.IStatus[]; + /** BoostSpec conditionBoostSpecs */ + conditionBoostSpecs?: (google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec[]|null); - /** ImportProductsResponse errorsConfig. */ - public errorsConfig?: (google.cloud.retail.v2beta.IImportErrorsConfig|null); + /** BoostSpec skipBoostSpecValidation */ + skipBoostSpecValidation?: (boolean|null); + } - /** - * Creates a new ImportProductsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportProductsResponse instance - */ - public static create(properties?: google.cloud.retail.v2beta.IImportProductsResponse): google.cloud.retail.v2beta.ImportProductsResponse; + /** Represents a BoostSpec. */ + class BoostSpec implements IBoostSpec { - /** - * Encodes the specified ImportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ImportProductsResponse.verify|verify} messages. - * @param message ImportProductsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.IImportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new BoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.SearchRequest.IBoostSpec); - /** - * Encodes the specified ImportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportProductsResponse.verify|verify} messages. - * @param message ImportProductsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IImportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** BoostSpec conditionBoostSpecs. */ + public conditionBoostSpecs: google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec[]; - /** - * Decodes an ImportProductsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportProductsResponse - * @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.v2beta.ImportProductsResponse; + /** BoostSpec skipBoostSpecValidation. */ + public skipBoostSpecValidation?: (boolean|null); - /** - * Decodes an ImportProductsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportProductsResponse - * @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.v2beta.ImportProductsResponse; + /** BoostSpec _skipBoostSpecValidation. */ + public _skipBoostSpecValidation?: "skipBoostSpecValidation"; - /** - * Verifies an ImportProductsResponse 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 new BoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostSpec instance + */ + public static create(properties?: google.cloud.retail.v2beta.SearchRequest.IBoostSpec): google.cloud.retail.v2beta.SearchRequest.BoostSpec; - /** - * Creates an ImportProductsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportProductsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ImportProductsResponse; + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.SearchRequest.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from an ImportProductsResponse message. Also converts values to other types if specified. - * @param message ImportProductsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.ImportProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.SearchRequest.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this ImportProductsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostSpec + * @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.v2beta.SearchRequest.BoostSpec; - /** Properties of an ImportUserEventsResponse. */ - interface IImportUserEventsResponse { + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostSpec + * @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.v2beta.SearchRequest.BoostSpec; - /** ImportUserEventsResponse errorSamples */ - errorSamples?: (google.rpc.IStatus[]|null); + /** + * Verifies a BoostSpec 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); - /** ImportUserEventsResponse errorsConfig */ - errorsConfig?: (google.cloud.retail.v2beta.IImportErrorsConfig|null); + /** + * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchRequest.BoostSpec; - /** ImportUserEventsResponse importSummary */ - importSummary?: (google.cloud.retail.v2beta.IUserEventImportSummary|null); - } + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @param message BoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.SearchRequest.BoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents an ImportUserEventsResponse. */ - class ImportUserEventsResponse implements IImportUserEventsResponse { + /** + * Converts this BoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new ImportUserEventsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.IImportUserEventsResponse); + namespace BoostSpec { - /** ImportUserEventsResponse errorSamples. */ - public errorSamples: google.rpc.IStatus[]; + /** Properties of a ConditionBoostSpec. */ + interface IConditionBoostSpec { - /** ImportUserEventsResponse errorsConfig. */ - public errorsConfig?: (google.cloud.retail.v2beta.IImportErrorsConfig|null); + /** ConditionBoostSpec condition */ + condition?: (string|null); - /** ImportUserEventsResponse importSummary. */ - public importSummary?: (google.cloud.retail.v2beta.IUserEventImportSummary|null); + /** ConditionBoostSpec boost */ + boost?: (number|null); + } - /** - * Creates a new ImportUserEventsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportUserEventsResponse instance - */ - public static create(properties?: google.cloud.retail.v2beta.IImportUserEventsResponse): google.cloud.retail.v2beta.ImportUserEventsResponse; + /** Represents a ConditionBoostSpec. */ + class ConditionBoostSpec implements IConditionBoostSpec { - /** - * Encodes the specified ImportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ImportUserEventsResponse.verify|verify} messages. - * @param message ImportUserEventsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.IImportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new ConditionBoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec); - /** - * Encodes the specified ImportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportUserEventsResponse.verify|verify} messages. - * @param message ImportUserEventsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IImportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** ConditionBoostSpec condition. */ + public condition: string; - /** - * Decodes an ImportUserEventsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportUserEventsResponse - * @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.v2beta.ImportUserEventsResponse; + /** ConditionBoostSpec boost. */ + public boost: number; - /** - * Decodes an ImportUserEventsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportUserEventsResponse - * @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.v2beta.ImportUserEventsResponse; + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionBoostSpec instance + */ + public static create(properties?: google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec): google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec; - /** - * Verifies an ImportUserEventsResponse 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); + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates an ImportUserEventsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportUserEventsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ImportUserEventsResponse; + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from an ImportUserEventsResponse message. Also converts values to other types if specified. - * @param message ImportUserEventsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.ImportUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionBoostSpec + * @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.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec; - /** - * Converts this ImportUserEventsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionBoostSpec + * @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.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec; - /** Properties of a UserEventImportSummary. */ - interface IUserEventImportSummary { + /** + * Verifies a ConditionBoostSpec 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); - /** UserEventImportSummary joinedEventsCount */ - joinedEventsCount?: (number|Long|string|null); + /** + * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionBoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec; - /** UserEventImportSummary unjoinedEventsCount */ - unjoinedEventsCount?: (number|Long|string|null); - } + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @param message ConditionBoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents a UserEventImportSummary. */ - class UserEventImportSummary implements IUserEventImportSummary { + /** + * Converts this ConditionBoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * Constructs a new UserEventImportSummary. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.IUserEventImportSummary); + /** Properties of a QueryExpansionSpec. */ + interface IQueryExpansionSpec { - /** UserEventImportSummary joinedEventsCount. */ - public joinedEventsCount: (number|Long|string); + /** QueryExpansionSpec condition */ + condition?: (google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition|null); - /** UserEventImportSummary unjoinedEventsCount. */ - public unjoinedEventsCount: (number|Long|string); + /** QueryExpansionSpec pinUnexpandedResults */ + pinUnexpandedResults?: (boolean|null); + } - /** - * Creates a new UserEventImportSummary instance using the specified properties. - * @param [properties] Properties to set - * @returns UserEventImportSummary instance - */ - public static create(properties?: google.cloud.retail.v2beta.IUserEventImportSummary): google.cloud.retail.v2beta.UserEventImportSummary; + /** Represents a QueryExpansionSpec. */ + class QueryExpansionSpec implements IQueryExpansionSpec { - /** - * Encodes the specified UserEventImportSummary message. Does not implicitly {@link google.cloud.retail.v2beta.UserEventImportSummary.verify|verify} messages. - * @param message UserEventImportSummary message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.IUserEventImportSummary, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new QueryExpansionSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec); - /** - * Encodes the specified UserEventImportSummary message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserEventImportSummary.verify|verify} messages. - * @param message UserEventImportSummary message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IUserEventImportSummary, writer?: $protobuf.Writer): $protobuf.Writer; + /** QueryExpansionSpec condition. */ + public condition: (google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition); - /** - * Decodes a UserEventImportSummary message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UserEventImportSummary - * @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.v2beta.UserEventImportSummary; + /** QueryExpansionSpec pinUnexpandedResults. */ + public pinUnexpandedResults: boolean; - /** - * Decodes a UserEventImportSummary message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UserEventImportSummary - * @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.v2beta.UserEventImportSummary; + /** + * Creates a new QueryExpansionSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryExpansionSpec instance + */ + public static create(properties?: google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec): google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec; - /** - * Verifies a UserEventImportSummary 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); + /** + * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * @param message QueryExpansionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a UserEventImportSummary message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UserEventImportSummary - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UserEventImportSummary; + /** + * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * @param message QueryExpansionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a UserEventImportSummary message. Also converts values to other types if specified. - * @param message UserEventImportSummary - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.UserEventImportSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a QueryExpansionSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryExpansionSpec + * @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.v2beta.SearchRequest.QueryExpansionSpec; - /** - * Converts this UserEventImportSummary to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryExpansionSpec + * @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.v2beta.SearchRequest.QueryExpansionSpec; - /** Properties of an ImportCompletionDataResponse. */ - interface IImportCompletionDataResponse { + /** + * Verifies a QueryExpansionSpec 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); - /** ImportCompletionDataResponse errorSamples */ - errorSamples?: (google.rpc.IStatus[]|null); - } + /** + * Creates a QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryExpansionSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec; - /** Represents an ImportCompletionDataResponse. */ - class ImportCompletionDataResponse implements IImportCompletionDataResponse { + /** + * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. + * @param message QueryExpansionSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new ImportCompletionDataResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.IImportCompletionDataResponse); + /** + * Converts this QueryExpansionSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ImportCompletionDataResponse errorSamples. */ - public errorSamples: google.rpc.IStatus[]; + namespace QueryExpansionSpec { - /** - * Creates a new ImportCompletionDataResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportCompletionDataResponse instance - */ - public static create(properties?: google.cloud.retail.v2beta.IImportCompletionDataResponse): google.cloud.retail.v2beta.ImportCompletionDataResponse; + /** Condition enum. */ + enum Condition { + CONDITION_UNSPECIFIED = 0, + DISABLED = 1, + AUTO = 3 + } + } - /** - * Encodes the specified ImportCompletionDataResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ImportCompletionDataResponse.verify|verify} messages. - * @param message ImportCompletionDataResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.IImportCompletionDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a PersonalizationSpec. */ + interface IPersonalizationSpec { - /** - * Encodes the specified ImportCompletionDataResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportCompletionDataResponse.verify|verify} messages. - * @param message ImportCompletionDataResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IImportCompletionDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** PersonalizationSpec mode */ + mode?: (google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode|keyof typeof google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode|null); + } - /** - * Decodes an ImportCompletionDataResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportCompletionDataResponse - * @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.v2beta.ImportCompletionDataResponse; + /** Represents a PersonalizationSpec. */ + class PersonalizationSpec implements IPersonalizationSpec { - /** - * Decodes an ImportCompletionDataResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportCompletionDataResponse - * @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.v2beta.ImportCompletionDataResponse; + /** + * Constructs a new PersonalizationSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.SearchRequest.IPersonalizationSpec); - /** - * Verifies an ImportCompletionDataResponse 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); + /** PersonalizationSpec mode. */ + public mode: (google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode|keyof typeof google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode); - /** - * Creates an ImportCompletionDataResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportCompletionDataResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ImportCompletionDataResponse; + /** + * Creates a new PersonalizationSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonalizationSpec instance + */ + public static create(properties?: google.cloud.retail.v2beta.SearchRequest.IPersonalizationSpec): google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec; - /** - * Creates a plain object from an ImportCompletionDataResponse message. Also converts values to other types if specified. - * @param message ImportCompletionDataResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.ImportCompletionDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified PersonalizationSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.verify|verify} messages. + * @param message PersonalizationSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.SearchRequest.IPersonalizationSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this ImportCompletionDataResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified PersonalizationSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.verify|verify} messages. + * @param message PersonalizationSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.SearchRequest.IPersonalizationSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a Product. */ - interface IProduct { + /** + * Decodes a PersonalizationSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonalizationSpec + * @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.v2beta.SearchRequest.PersonalizationSpec; - /** Product expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); + /** + * Decodes a PersonalizationSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonalizationSpec + * @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.v2beta.SearchRequest.PersonalizationSpec; - /** Product ttl */ - ttl?: (google.protobuf.IDuration|null); + /** + * Verifies a PersonalizationSpec 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); - /** Product name */ - name?: (string|null); + /** + * Creates a PersonalizationSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonalizationSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec; - /** Product id */ - id?: (string|null); + /** + * Creates a plain object from a PersonalizationSpec message. Also converts values to other types if specified. + * @param message PersonalizationSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Product type */ - type?: (google.cloud.retail.v2beta.Product.Type|keyof typeof google.cloud.retail.v2beta.Product.Type|null); + /** + * Converts this PersonalizationSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Product primaryProductId */ - primaryProductId?: (string|null); + namespace PersonalizationSpec { - /** Product collectionMemberIds */ - collectionMemberIds?: (string[]|null); + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + AUTO = 1, + DISABLED = 2 + } + } - /** Product gtin */ - gtin?: (string|null); + /** SearchMode enum. */ + enum SearchMode { + SEARCH_MODE_UNSPECIFIED = 0, + PRODUCT_SEARCH_ONLY = 1, + FACETED_SEARCH_ONLY = 2 + } + } - /** Product categories */ - categories?: (string[]|null); + /** Properties of a SearchResponse. */ + interface ISearchResponse { - /** Product title */ - title?: (string|null); + /** SearchResponse results */ + results?: (google.cloud.retail.v2beta.SearchResponse.ISearchResult[]|null); - /** Product brands */ - brands?: (string[]|null); + /** SearchResponse facets */ + facets?: (google.cloud.retail.v2beta.SearchResponse.IFacet[]|null); - /** Product description */ - description?: (string|null); + /** SearchResponse totalSize */ + totalSize?: (number|null); - /** Product languageCode */ - languageCode?: (string|null); + /** SearchResponse correctedQuery */ + correctedQuery?: (string|null); - /** Product attributes */ - attributes?: ({ [k: string]: google.cloud.retail.v2beta.ICustomAttribute }|null); + /** SearchResponse attributionToken */ + attributionToken?: (string|null); - /** Product tags */ - tags?: (string[]|null); + /** SearchResponse nextPageToken */ + nextPageToken?: (string|null); - /** Product priceInfo */ - priceInfo?: (google.cloud.retail.v2beta.IPriceInfo|null); + /** SearchResponse queryExpansionInfo */ + queryExpansionInfo?: (google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo|null); - /** Product rating */ - rating?: (google.cloud.retail.v2beta.IRating|null); + /** SearchResponse redirectUri */ + redirectUri?: (string|null); - /** Product availableTime */ - availableTime?: (google.protobuf.ITimestamp|null); + /** SearchResponse appliedControls */ + appliedControls?: (string[]|null); - /** Product availability */ - availability?: (google.cloud.retail.v2beta.Product.Availability|keyof typeof google.cloud.retail.v2beta.Product.Availability|null); + /** SearchResponse invalidConditionBoostSpecs */ + invalidConditionBoostSpecs?: (google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec[]|null); + } - /** Product availableQuantity */ - availableQuantity?: (google.protobuf.IInt32Value|null); + /** Represents a SearchResponse. */ + class SearchResponse implements ISearchResponse { - /** Product fulfillmentInfo */ - fulfillmentInfo?: (google.cloud.retail.v2beta.IFulfillmentInfo[]|null); + /** + * Constructs a new SearchResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.ISearchResponse); - /** Product uri */ - uri?: (string|null); + /** SearchResponse results. */ + public results: google.cloud.retail.v2beta.SearchResponse.ISearchResult[]; - /** Product images */ - images?: (google.cloud.retail.v2beta.IImage[]|null); + /** SearchResponse facets. */ + public facets: google.cloud.retail.v2beta.SearchResponse.IFacet[]; - /** Product audience */ - audience?: (google.cloud.retail.v2beta.IAudience|null); + /** SearchResponse totalSize. */ + public totalSize: number; - /** Product colorInfo */ - colorInfo?: (google.cloud.retail.v2beta.IColorInfo|null); + /** SearchResponse correctedQuery. */ + public correctedQuery: string; - /** Product sizes */ - sizes?: (string[]|null); + /** SearchResponse attributionToken. */ + public attributionToken: string; - /** Product materials */ - materials?: (string[]|null); + /** SearchResponse nextPageToken. */ + public nextPageToken: string; - /** Product patterns */ - patterns?: (string[]|null); + /** SearchResponse queryExpansionInfo. */ + public queryExpansionInfo?: (google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo|null); - /** Product conditions */ - conditions?: (string[]|null); + /** SearchResponse redirectUri. */ + public redirectUri: string; - /** Product promotions */ - promotions?: (google.cloud.retail.v2beta.IPromotion[]|null); + /** SearchResponse appliedControls. */ + public appliedControls: string[]; - /** Product publishTime */ - publishTime?: (google.protobuf.ITimestamp|null); + /** SearchResponse invalidConditionBoostSpecs. */ + public invalidConditionBoostSpecs: google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec[]; - /** Product retrievableFields */ - retrievableFields?: (google.protobuf.IFieldMask|null); + /** + * Creates a new SearchResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchResponse instance + */ + public static create(properties?: google.cloud.retail.v2beta.ISearchResponse): google.cloud.retail.v2beta.SearchResponse; - /** Product variants */ - variants?: (google.cloud.retail.v2beta.IProduct[]|null); - } + /** + * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.verify|verify} messages. + * @param message SearchResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a Product. */ - class Product implements IProduct { + /** + * Encodes the specified SearchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.verify|verify} messages. + * @param message SearchResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchResponse + * @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.v2beta.SearchResponse; /** - * Constructs a new Product. - * @param [properties] Properties to set + * Decodes a SearchResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.cloud.retail.v2beta.IProduct); - - /** Product expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.SearchResponse; - /** Product ttl. */ - public ttl?: (google.protobuf.IDuration|null); + /** + * Verifies a SearchResponse 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); - /** Product name. */ - public name: string; + /** + * Creates a SearchResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchResponse; - /** Product id. */ - public id: string; + /** + * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. + * @param message SearchResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.SearchResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Product type. */ - public type: (google.cloud.retail.v2beta.Product.Type|keyof typeof google.cloud.retail.v2beta.Product.Type); + /** + * Converts this SearchResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Product primaryProductId. */ - public primaryProductId: string; + namespace SearchResponse { - /** Product collectionMemberIds. */ - public collectionMemberIds: string[]; + /** Properties of a SearchResult. */ + interface ISearchResult { - /** Product gtin. */ - public gtin: string; + /** SearchResult id */ + id?: (string|null); - /** Product categories. */ - public categories: string[]; + /** SearchResult product */ + product?: (google.cloud.retail.v2beta.IProduct|null); - /** Product title. */ - public title: string; + /** SearchResult matchingVariantCount */ + matchingVariantCount?: (number|null); - /** Product brands. */ - public brands: string[]; + /** SearchResult matchingVariantFields */ + matchingVariantFields?: ({ [k: string]: google.protobuf.IFieldMask }|null); - /** Product description. */ - public description: string; + /** SearchResult variantRollupValues */ + variantRollupValues?: ({ [k: string]: google.protobuf.IValue }|null); + } - /** Product languageCode. */ - public languageCode: string; + /** Represents a SearchResult. */ + class SearchResult implements ISearchResult { - /** Product attributes. */ - public attributes: { [k: string]: google.cloud.retail.v2beta.ICustomAttribute }; + /** + * Constructs a new SearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.SearchResponse.ISearchResult); - /** Product tags. */ - public tags: string[]; + /** SearchResult id. */ + public id: string; - /** Product priceInfo. */ - public priceInfo?: (google.cloud.retail.v2beta.IPriceInfo|null); + /** SearchResult product. */ + public product?: (google.cloud.retail.v2beta.IProduct|null); - /** Product rating. */ - public rating?: (google.cloud.retail.v2beta.IRating|null); + /** SearchResult matchingVariantCount. */ + public matchingVariantCount: number; - /** Product availableTime. */ - public availableTime?: (google.protobuf.ITimestamp|null); + /** SearchResult matchingVariantFields. */ + public matchingVariantFields: { [k: string]: google.protobuf.IFieldMask }; - /** Product availability. */ - public availability: (google.cloud.retail.v2beta.Product.Availability|keyof typeof google.cloud.retail.v2beta.Product.Availability); + /** SearchResult variantRollupValues. */ + public variantRollupValues: { [k: string]: google.protobuf.IValue }; - /** Product availableQuantity. */ - public availableQuantity?: (google.protobuf.IInt32Value|null); + /** + * Creates a new SearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchResult instance + */ + public static create(properties?: google.cloud.retail.v2beta.SearchResponse.ISearchResult): google.cloud.retail.v2beta.SearchResponse.SearchResult; - /** Product fulfillmentInfo. */ - public fulfillmentInfo: google.cloud.retail.v2beta.IFulfillmentInfo[]; + /** + * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.SearchResult.verify|verify} messages. + * @param message SearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** Product uri. */ - public uri: string; + /** + * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.SearchResult.verify|verify} messages. + * @param message SearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** Product images. */ - public images: google.cloud.retail.v2beta.IImage[]; + /** + * Decodes a SearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchResult + * @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.v2beta.SearchResponse.SearchResult; - /** Product audience. */ - public audience?: (google.cloud.retail.v2beta.IAudience|null); + /** + * Decodes a SearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchResult + * @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.v2beta.SearchResponse.SearchResult; - /** Product colorInfo. */ - public colorInfo?: (google.cloud.retail.v2beta.IColorInfo|null); + /** + * Verifies a SearchResult 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); - /** Product sizes. */ - public sizes: string[]; + /** + * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchResponse.SearchResult; - /** Product materials. */ - public materials: string[]; + /** + * Creates a plain object from a SearchResult message. Also converts values to other types if specified. + * @param message SearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.SearchResponse.SearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Product patterns. */ - public patterns: string[]; + /** + * Converts this SearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Product conditions. */ - public conditions: string[]; + /** Properties of a Facet. */ + interface IFacet { - /** Product promotions. */ - public promotions: google.cloud.retail.v2beta.IPromotion[]; + /** Facet key */ + key?: (string|null); - /** Product publishTime. */ - public publishTime?: (google.protobuf.ITimestamp|null); + /** Facet values */ + values?: (google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue[]|null); - /** Product retrievableFields. */ - public retrievableFields?: (google.protobuf.IFieldMask|null); + /** Facet dynamicFacet */ + dynamicFacet?: (boolean|null); + } - /** Product variants. */ - public variants: google.cloud.retail.v2beta.IProduct[]; + /** Represents a Facet. */ + class Facet implements IFacet { - /** Product expiration. */ - public expiration?: ("expireTime"|"ttl"); + /** + * Constructs a new Facet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.SearchResponse.IFacet); - /** - * Creates a new Product instance using the specified properties. - * @param [properties] Properties to set - * @returns Product instance - */ - public static create(properties?: google.cloud.retail.v2beta.IProduct): google.cloud.retail.v2beta.Product; + /** Facet key. */ + public key: string; - /** - * Encodes the specified Product message. Does not implicitly {@link google.cloud.retail.v2beta.Product.verify|verify} messages. - * @param message Product message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + /** Facet values. */ + public values: google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue[]; - /** - * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Product.verify|verify} messages. - * @param message Product message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + /** Facet dynamicFacet. */ + public dynamicFacet: boolean; - /** - * Decodes a Product message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Product - * @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.v2beta.Product; + /** + * Creates a new Facet instance using the specified properties. + * @param [properties] Properties to set + * @returns Facet instance + */ + public static create(properties?: google.cloud.retail.v2beta.SearchResponse.IFacet): google.cloud.retail.v2beta.SearchResponse.Facet; - /** - * Decodes a Product message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Product - * @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.v2beta.Product; + /** + * Encodes the specified Facet message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.Facet.verify|verify} messages. + * @param message Facet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.SearchResponse.IFacet, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a Product 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); + /** + * Encodes the specified Facet message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.Facet.verify|verify} messages. + * @param message Facet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.SearchResponse.IFacet, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a Product message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Product - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Product; + /** + * Decodes a Facet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Facet + * @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.v2beta.SearchResponse.Facet; - /** - * Creates a plain object from a Product message. Also converts values to other types if specified. - * @param message Product - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.Product, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a Facet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Facet + * @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.v2beta.SearchResponse.Facet; - /** - * Converts this Product to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies a Facet 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); - namespace Product { + /** + * Creates a Facet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Facet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchResponse.Facet; - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - PRIMARY = 1, - VARIANT = 2, - COLLECTION = 3 - } + /** + * Creates a plain object from a Facet message. Also converts values to other types if specified. + * @param message Facet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.SearchResponse.Facet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Availability enum. */ - enum Availability { - AVAILABILITY_UNSPECIFIED = 0, - IN_STOCK = 1, - OUT_OF_STOCK = 2, - PREORDER = 3, - BACKORDER = 4 + /** + * Converts this Facet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } - } - /** Properties of a UserEvent. */ - interface IUserEvent { + namespace Facet { - /** UserEvent eventType */ - eventType?: (string|null); + /** Properties of a FacetValue. */ + interface IFacetValue { - /** UserEvent visitorId */ - visitorId?: (string|null); + /** FacetValue value */ + value?: (string|null); - /** UserEvent sessionId */ - sessionId?: (string|null); + /** FacetValue interval */ + interval?: (google.cloud.retail.v2beta.IInterval|null); - /** UserEvent eventTime */ - eventTime?: (google.protobuf.ITimestamp|null); + /** FacetValue count */ + count?: (number|Long|string|null); + } - /** UserEvent experimentIds */ - experimentIds?: (string[]|null); + /** Represents a FacetValue. */ + class FacetValue implements IFacetValue { - /** UserEvent attributionToken */ - attributionToken?: (string|null); + /** + * Constructs a new FacetValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue); - /** UserEvent productDetails */ - productDetails?: (google.cloud.retail.v2beta.IProductDetail[]|null); + /** FacetValue value. */ + public value?: (string|null); - /** UserEvent completionDetail */ - completionDetail?: (google.cloud.retail.v2beta.ICompletionDetail|null); + /** FacetValue interval. */ + public interval?: (google.cloud.retail.v2beta.IInterval|null); - /** UserEvent attributes */ - attributes?: ({ [k: string]: google.cloud.retail.v2beta.ICustomAttribute }|null); + /** FacetValue count. */ + public count: (number|Long|string); - /** UserEvent cartId */ - cartId?: (string|null); + /** FacetValue facetValue. */ + public facetValue?: ("value"|"interval"); - /** UserEvent purchaseTransaction */ - purchaseTransaction?: (google.cloud.retail.v2beta.IPurchaseTransaction|null); + /** + * Creates a new FacetValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetValue instance + */ + public static create(properties?: google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue): google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue; - /** UserEvent searchQuery */ - searchQuery?: (string|null); + /** + * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.verify|verify} messages. + * @param message FacetValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** UserEvent filter */ - filter?: (string|null); + /** + * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.verify|verify} messages. + * @param message FacetValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** UserEvent orderBy */ - orderBy?: (string|null); + /** + * Decodes a FacetValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetValue + * @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.v2beta.SearchResponse.Facet.FacetValue; - /** UserEvent offset */ - offset?: (number|null); + /** + * Decodes a FacetValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetValue + * @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.v2beta.SearchResponse.Facet.FacetValue; - /** UserEvent pageCategories */ - pageCategories?: (string[]|null); + /** + * Verifies a FacetValue 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); - /** UserEvent userInfo */ - userInfo?: (google.cloud.retail.v2beta.IUserInfo|null); + /** + * Creates a FacetValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue; - /** UserEvent uri */ - uri?: (string|null); + /** + * Creates a plain object from a FacetValue message. Also converts values to other types if specified. + * @param message FacetValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** UserEvent referrerUri */ - referrerUri?: (string|null); + /** + * Converts this FacetValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** UserEvent pageViewId */ - pageViewId?: (string|null); - } + /** Properties of a QueryExpansionInfo. */ + interface IQueryExpansionInfo { - /** Represents a UserEvent. */ - class UserEvent implements IUserEvent { + /** QueryExpansionInfo expandedQuery */ + expandedQuery?: (boolean|null); - /** - * Constructs a new UserEvent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.IUserEvent); + /** QueryExpansionInfo pinnedResultCount */ + pinnedResultCount?: (number|Long|string|null); + } + + /** Represents a QueryExpansionInfo. */ + class QueryExpansionInfo implements IQueryExpansionInfo { + + /** + * Constructs a new QueryExpansionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo); - /** UserEvent eventType. */ - public eventType: string; + /** QueryExpansionInfo expandedQuery. */ + public expandedQuery: boolean; - /** UserEvent visitorId. */ - public visitorId: string; + /** QueryExpansionInfo pinnedResultCount. */ + public pinnedResultCount: (number|Long|string); - /** UserEvent sessionId. */ - public sessionId: string; + /** + * Creates a new QueryExpansionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryExpansionInfo instance + */ + public static create(properties?: google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo): google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo; - /** UserEvent eventTime. */ - public eventTime?: (google.protobuf.ITimestamp|null); + /** + * Encodes the specified QueryExpansionInfo message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.verify|verify} messages. + * @param message QueryExpansionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - /** UserEvent experimentIds. */ - public experimentIds: string[]; + /** + * Encodes the specified QueryExpansionInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.verify|verify} messages. + * @param message QueryExpansionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - /** UserEvent attributionToken. */ - public attributionToken: string; + /** + * Decodes a QueryExpansionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryExpansionInfo + * @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.v2beta.SearchResponse.QueryExpansionInfo; - /** UserEvent productDetails. */ - public productDetails: google.cloud.retail.v2beta.IProductDetail[]; + /** + * Decodes a QueryExpansionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryExpansionInfo + * @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.v2beta.SearchResponse.QueryExpansionInfo; - /** UserEvent completionDetail. */ - public completionDetail?: (google.cloud.retail.v2beta.ICompletionDetail|null); + /** + * Verifies a QueryExpansionInfo 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); - /** UserEvent attributes. */ - public attributes: { [k: string]: google.cloud.retail.v2beta.ICustomAttribute }; + /** + * Creates a QueryExpansionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryExpansionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo; - /** UserEvent cartId. */ - public cartId: string; + /** + * Creates a plain object from a QueryExpansionInfo message. Also converts values to other types if specified. + * @param message QueryExpansionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** UserEvent purchaseTransaction. */ - public purchaseTransaction?: (google.cloud.retail.v2beta.IPurchaseTransaction|null); + /** + * Converts this QueryExpansionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** UserEvent searchQuery. */ - public searchQuery: string; + /** Represents a ControlService */ + class ControlService extends $protobuf.rpc.Service { - /** UserEvent filter. */ - public filter: string; + /** + * Constructs a new ControlService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** UserEvent orderBy. */ - public orderBy: string; + /** + * Creates new ControlService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ControlService; - /** UserEvent offset. */ - public offset: number; + /** + * Calls CreateControl. + * @param request CreateControlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Control + */ + public createControl(request: google.cloud.retail.v2beta.ICreateControlRequest, callback: google.cloud.retail.v2beta.ControlService.CreateControlCallback): void; - /** UserEvent pageCategories. */ - public pageCategories: string[]; + /** + * Calls CreateControl. + * @param request CreateControlRequest message or plain object + * @returns Promise + */ + public createControl(request: google.cloud.retail.v2beta.ICreateControlRequest): Promise; - /** UserEvent userInfo. */ - public userInfo?: (google.cloud.retail.v2beta.IUserInfo|null); + /** + * Calls DeleteControl. + * @param request DeleteControlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteControl(request: google.cloud.retail.v2beta.IDeleteControlRequest, callback: google.cloud.retail.v2beta.ControlService.DeleteControlCallback): void; - /** UserEvent uri. */ - public uri: string; + /** + * Calls DeleteControl. + * @param request DeleteControlRequest message or plain object + * @returns Promise + */ + public deleteControl(request: google.cloud.retail.v2beta.IDeleteControlRequest): Promise; - /** UserEvent referrerUri. */ - public referrerUri: string; + /** + * Calls UpdateControl. + * @param request UpdateControlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Control + */ + public updateControl(request: google.cloud.retail.v2beta.IUpdateControlRequest, callback: google.cloud.retail.v2beta.ControlService.UpdateControlCallback): void; - /** UserEvent pageViewId. */ - public pageViewId: string; + /** + * Calls UpdateControl. + * @param request UpdateControlRequest message or plain object + * @returns Promise + */ + public updateControl(request: google.cloud.retail.v2beta.IUpdateControlRequest): Promise; /** - * Creates a new UserEvent instance using the specified properties. - * @param [properties] Properties to set - * @returns UserEvent instance + * Calls GetControl. + * @param request GetControlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Control */ - public static create(properties?: google.cloud.retail.v2beta.IUserEvent): google.cloud.retail.v2beta.UserEvent; + public getControl(request: google.cloud.retail.v2beta.IGetControlRequest, callback: google.cloud.retail.v2beta.ControlService.GetControlCallback): void; /** - * Encodes the specified UserEvent message. Does not implicitly {@link google.cloud.retail.v2beta.UserEvent.verify|verify} messages. - * @param message UserEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls GetControl. + * @param request GetControlRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.retail.v2beta.IUserEvent, writer?: $protobuf.Writer): $protobuf.Writer; + public getControl(request: google.cloud.retail.v2beta.IGetControlRequest): Promise; /** - * Encodes the specified UserEvent message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserEvent.verify|verify} messages. - * @param message UserEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListControls. + * @param request ListControlsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListControlsResponse */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IUserEvent, writer?: $protobuf.Writer): $protobuf.Writer; + public listControls(request: google.cloud.retail.v2beta.IListControlsRequest, callback: google.cloud.retail.v2beta.ControlService.ListControlsCallback): void; /** - * Decodes a UserEvent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UserEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListControls. + * @param request ListControlsRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.UserEvent; + public listControls(request: google.cloud.retail.v2beta.IListControlsRequest): Promise; + } + + namespace ControlService { /** - * Decodes a UserEvent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UserEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2beta.ControlService#createControl}. + * @param error Error, if any + * @param [response] Control */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.UserEvent; + type CreateControlCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.Control) => void; /** - * Verifies a UserEvent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.retail.v2beta.ControlService#deleteControl}. + * @param error Error, if any + * @param [response] Empty */ - public static verify(message: { [k: string]: any }): (string|null); + type DeleteControlCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Creates a UserEvent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UserEvent + * Callback as used by {@link google.cloud.retail.v2beta.ControlService#updateControl}. + * @param error Error, if any + * @param [response] Control */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UserEvent; + type UpdateControlCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.Control) => void; /** - * Creates a plain object from a UserEvent message. Also converts values to other types if specified. - * @param message UserEvent - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.retail.v2beta.ControlService#getControl}. + * @param error Error, if any + * @param [response] Control */ - public static toObject(message: google.cloud.retail.v2beta.UserEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type GetControlCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.Control) => void; /** - * Converts this UserEvent to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.retail.v2beta.ControlService#listControls}. + * @param error Error, if any + * @param [response] ListControlsResponse */ - public toJSON(): { [k: string]: any }; + type ListControlsCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.ListControlsResponse) => void; } - /** Properties of a ProductDetail. */ - interface IProductDetail { + /** Properties of a CreateControlRequest. */ + interface ICreateControlRequest { - /** ProductDetail product */ - product?: (google.cloud.retail.v2beta.IProduct|null); + /** CreateControlRequest parent */ + parent?: (string|null); - /** ProductDetail quantity */ - quantity?: (google.protobuf.IInt32Value|null); + /** CreateControlRequest control */ + control?: (google.cloud.retail.v2beta.IControl|null); + + /** CreateControlRequest controlId */ + controlId?: (string|null); } - /** Represents a ProductDetail. */ - class ProductDetail implements IProductDetail { + /** Represents a CreateControlRequest. */ + class CreateControlRequest implements ICreateControlRequest { /** - * Constructs a new ProductDetail. + * Constructs a new CreateControlRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IProductDetail); + constructor(properties?: google.cloud.retail.v2beta.ICreateControlRequest); - /** ProductDetail product. */ - public product?: (google.cloud.retail.v2beta.IProduct|null); + /** CreateControlRequest parent. */ + public parent: string; - /** ProductDetail quantity. */ - public quantity?: (google.protobuf.IInt32Value|null); + /** CreateControlRequest control. */ + public control?: (google.cloud.retail.v2beta.IControl|null); + + /** CreateControlRequest controlId. */ + public controlId: string; /** - * Creates a new ProductDetail instance using the specified properties. + * Creates a new CreateControlRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ProductDetail instance + * @returns CreateControlRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IProductDetail): google.cloud.retail.v2beta.ProductDetail; + public static create(properties?: google.cloud.retail.v2beta.ICreateControlRequest): google.cloud.retail.v2beta.CreateControlRequest; /** - * Encodes the specified ProductDetail message. Does not implicitly {@link google.cloud.retail.v2beta.ProductDetail.verify|verify} messages. - * @param message ProductDetail message or plain object to encode + * Encodes the specified CreateControlRequest message. Does not implicitly {@link google.cloud.retail.v2beta.CreateControlRequest.verify|verify} messages. + * @param message CreateControlRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IProductDetail, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.ICreateControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ProductDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ProductDetail.verify|verify} messages. - * @param message ProductDetail message or plain object to encode + * Encodes the specified CreateControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CreateControlRequest.verify|verify} messages. + * @param message CreateControlRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IProductDetail, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.ICreateControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ProductDetail message from the specified reader or buffer. + * Decodes a CreateControlRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ProductDetail + * @returns CreateControlRequest * @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.v2beta.ProductDetail; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.CreateControlRequest; /** - * Decodes a ProductDetail message from the specified reader or buffer, length delimited. + * Decodes a CreateControlRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ProductDetail + * @returns CreateControlRequest * @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.v2beta.ProductDetail; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.CreateControlRequest; /** - * Verifies a ProductDetail message. + * Verifies a CreateControlRequest 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 ProductDetail message from a plain object. Also converts values to their respective internal types. + * Creates a CreateControlRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ProductDetail + * @returns CreateControlRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ProductDetail; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CreateControlRequest; /** - * Creates a plain object from a ProductDetail message. Also converts values to other types if specified. - * @param message ProductDetail + * Creates a plain object from a CreateControlRequest message. Also converts values to other types if specified. + * @param message CreateControlRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.ProductDetail, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.CreateControlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ProductDetail to JSON. + * Converts this CreateControlRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CompletionDetail. */ - interface ICompletionDetail { - - /** CompletionDetail completionAttributionToken */ - completionAttributionToken?: (string|null); + /** Properties of an UpdateControlRequest. */ + interface IUpdateControlRequest { - /** CompletionDetail selectedSuggestion */ - selectedSuggestion?: (string|null); + /** UpdateControlRequest control */ + control?: (google.cloud.retail.v2beta.IControl|null); - /** CompletionDetail selectedPosition */ - selectedPosition?: (number|null); + /** UpdateControlRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a CompletionDetail. */ - class CompletionDetail implements ICompletionDetail { + /** Represents an UpdateControlRequest. */ + class UpdateControlRequest implements IUpdateControlRequest { /** - * Constructs a new CompletionDetail. + * Constructs a new UpdateControlRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.ICompletionDetail); - - /** CompletionDetail completionAttributionToken. */ - public completionAttributionToken: string; + constructor(properties?: google.cloud.retail.v2beta.IUpdateControlRequest); - /** CompletionDetail selectedSuggestion. */ - public selectedSuggestion: string; + /** UpdateControlRequest control. */ + public control?: (google.cloud.retail.v2beta.IControl|null); - /** CompletionDetail selectedPosition. */ - public selectedPosition: number; + /** UpdateControlRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new CompletionDetail instance using the specified properties. + * Creates a new UpdateControlRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CompletionDetail instance + * @returns UpdateControlRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.ICompletionDetail): google.cloud.retail.v2beta.CompletionDetail; + public static create(properties?: google.cloud.retail.v2beta.IUpdateControlRequest): google.cloud.retail.v2beta.UpdateControlRequest; /** - * Encodes the specified CompletionDetail message. Does not implicitly {@link google.cloud.retail.v2beta.CompletionDetail.verify|verify} messages. - * @param message CompletionDetail message or plain object to encode + * Encodes the specified UpdateControlRequest message. Does not implicitly {@link google.cloud.retail.v2beta.UpdateControlRequest.verify|verify} messages. + * @param message UpdateControlRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.ICompletionDetail, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IUpdateControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CompletionDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompletionDetail.verify|verify} messages. - * @param message CompletionDetail message or plain object to encode + * Encodes the specified UpdateControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UpdateControlRequest.verify|verify} messages. + * @param message UpdateControlRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.ICompletionDetail, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IUpdateControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CompletionDetail message from the specified reader or buffer. + * Decodes an UpdateControlRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CompletionDetail + * @returns UpdateControlRequest * @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.v2beta.CompletionDetail; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.UpdateControlRequest; /** - * Decodes a CompletionDetail message from the specified reader or buffer, length delimited. + * Decodes an UpdateControlRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CompletionDetail + * @returns UpdateControlRequest * @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.v2beta.CompletionDetail; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.UpdateControlRequest; /** - * Verifies a CompletionDetail message. + * Verifies an UpdateControlRequest 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 CompletionDetail message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateControlRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CompletionDetail + * @returns UpdateControlRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CompletionDetail; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UpdateControlRequest; /** - * Creates a plain object from a CompletionDetail message. Also converts values to other types if specified. - * @param message CompletionDetail + * Creates a plain object from an UpdateControlRequest message. Also converts values to other types if specified. + * @param message UpdateControlRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.CompletionDetail, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.UpdateControlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CompletionDetail to JSON. + * Converts this UpdateControlRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PurchaseTransaction. */ - interface IPurchaseTransaction { - - /** PurchaseTransaction id */ - id?: (string|null); - - /** PurchaseTransaction revenue */ - revenue?: (number|null); - - /** PurchaseTransaction tax */ - tax?: (number|null); - - /** PurchaseTransaction cost */ - cost?: (number|null); + /** Properties of a DeleteControlRequest. */ + interface IDeleteControlRequest { - /** PurchaseTransaction currencyCode */ - currencyCode?: (string|null); + /** DeleteControlRequest name */ + name?: (string|null); } - /** Represents a PurchaseTransaction. */ - class PurchaseTransaction implements IPurchaseTransaction { + /** Represents a DeleteControlRequest. */ + class DeleteControlRequest implements IDeleteControlRequest { /** - * Constructs a new PurchaseTransaction. + * Constructs a new DeleteControlRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IPurchaseTransaction); - - /** PurchaseTransaction id. */ - public id: string; - - /** PurchaseTransaction revenue. */ - public revenue: number; + constructor(properties?: google.cloud.retail.v2beta.IDeleteControlRequest); - /** PurchaseTransaction tax. */ - public tax: number; - - /** PurchaseTransaction cost. */ - public cost: number; - - /** PurchaseTransaction currencyCode. */ - public currencyCode: string; + /** DeleteControlRequest name. */ + public name: string; /** - * Creates a new PurchaseTransaction instance using the specified properties. + * Creates a new DeleteControlRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PurchaseTransaction instance + * @returns DeleteControlRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IPurchaseTransaction): google.cloud.retail.v2beta.PurchaseTransaction; + public static create(properties?: google.cloud.retail.v2beta.IDeleteControlRequest): google.cloud.retail.v2beta.DeleteControlRequest; /** - * Encodes the specified PurchaseTransaction message. Does not implicitly {@link google.cloud.retail.v2beta.PurchaseTransaction.verify|verify} messages. - * @param message PurchaseTransaction message or plain object to encode + * Encodes the specified DeleteControlRequest message. Does not implicitly {@link google.cloud.retail.v2beta.DeleteControlRequest.verify|verify} messages. + * @param message DeleteControlRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IPurchaseTransaction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IDeleteControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PurchaseTransaction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurchaseTransaction.verify|verify} messages. - * @param message PurchaseTransaction message or plain object to encode + * Encodes the specified DeleteControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.DeleteControlRequest.verify|verify} messages. + * @param message DeleteControlRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IPurchaseTransaction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IDeleteControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PurchaseTransaction message from the specified reader or buffer. + * Decodes a DeleteControlRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PurchaseTransaction + * @returns DeleteControlRequest * @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.v2beta.PurchaseTransaction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.DeleteControlRequest; /** - * Decodes a PurchaseTransaction message from the specified reader or buffer, length delimited. + * Decodes a DeleteControlRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PurchaseTransaction + * @returns DeleteControlRequest * @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.v2beta.PurchaseTransaction; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.DeleteControlRequest; /** - * Verifies a PurchaseTransaction message. + * Verifies a DeleteControlRequest 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 PurchaseTransaction message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteControlRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PurchaseTransaction + * @returns DeleteControlRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PurchaseTransaction; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.DeleteControlRequest; /** - * Creates a plain object from a PurchaseTransaction message. Also converts values to other types if specified. - * @param message PurchaseTransaction + * Creates a plain object from a DeleteControlRequest message. Also converts values to other types if specified. + * @param message DeleteControlRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.PurchaseTransaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.DeleteControlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PurchaseTransaction to JSON. + * Converts this DeleteControlRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents a CatalogService */ - class CatalogService extends $protobuf.rpc.Service { - - /** - * Constructs a new CatalogService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + /** Properties of a GetControlRequest. */ + interface IGetControlRequest { - /** - * Creates new CatalogService service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): CatalogService; + /** GetControlRequest name */ + name?: (string|null); + } - /** - * Calls ListCatalogs. - * @param request ListCatalogsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCatalogsResponse - */ - public listCatalogs(request: google.cloud.retail.v2beta.IListCatalogsRequest, callback: google.cloud.retail.v2beta.CatalogService.ListCatalogsCallback): void; + /** Represents a GetControlRequest. */ + class GetControlRequest implements IGetControlRequest { /** - * Calls ListCatalogs. - * @param request ListCatalogsRequest message or plain object - * @returns Promise + * Constructs a new GetControlRequest. + * @param [properties] Properties to set */ - public listCatalogs(request: google.cloud.retail.v2beta.IListCatalogsRequest): Promise; + constructor(properties?: google.cloud.retail.v2beta.IGetControlRequest); - /** - * Calls UpdateCatalog. - * @param request UpdateCatalogRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Catalog - */ - public updateCatalog(request: google.cloud.retail.v2beta.IUpdateCatalogRequest, callback: google.cloud.retail.v2beta.CatalogService.UpdateCatalogCallback): void; + /** GetControlRequest name. */ + public name: string; /** - * Calls UpdateCatalog. - * @param request UpdateCatalogRequest message or plain object - * @returns Promise + * Creates a new GetControlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetControlRequest instance */ - public updateCatalog(request: google.cloud.retail.v2beta.IUpdateCatalogRequest): Promise; + public static create(properties?: google.cloud.retail.v2beta.IGetControlRequest): google.cloud.retail.v2beta.GetControlRequest; /** - * Calls SetDefaultBranch. - * @param request SetDefaultBranchRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Encodes the specified GetControlRequest message. Does not implicitly {@link google.cloud.retail.v2beta.GetControlRequest.verify|verify} messages. + * @param message GetControlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public setDefaultBranch(request: google.cloud.retail.v2beta.ISetDefaultBranchRequest, callback: google.cloud.retail.v2beta.CatalogService.SetDefaultBranchCallback): void; + public static encode(message: google.cloud.retail.v2beta.IGetControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls SetDefaultBranch. - * @param request SetDefaultBranchRequest message or plain object - * @returns Promise + * Encodes the specified GetControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetControlRequest.verify|verify} messages. + * @param message GetControlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public setDefaultBranch(request: google.cloud.retail.v2beta.ISetDefaultBranchRequest): Promise; + public static encodeDelimited(message: google.cloud.retail.v2beta.IGetControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetDefaultBranch. - * @param request GetDefaultBranchRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GetDefaultBranchResponse + * Decodes a GetControlRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getDefaultBranch(request: google.cloud.retail.v2beta.IGetDefaultBranchRequest, callback: google.cloud.retail.v2beta.CatalogService.GetDefaultBranchCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.GetControlRequest; /** - * Calls GetDefaultBranch. - * @param request GetDefaultBranchRequest message or plain object - * @returns Promise + * Decodes a GetControlRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getDefaultBranch(request: google.cloud.retail.v2beta.IGetDefaultBranchRequest): Promise; - } - - namespace CatalogService { + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.GetControlRequest; /** - * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#listCatalogs}. - * @param error Error, if any - * @param [response] ListCatalogsResponse + * Verifies a GetControlRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type ListCatalogsCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.ListCatalogsResponse) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#updateCatalog}. - * @param error Error, if any - * @param [response] Catalog + * Creates a GetControlRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetControlRequest */ - type UpdateCatalogCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.Catalog) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.GetControlRequest; /** - * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#setDefaultBranch}. - * @param error Error, if any - * @param [response] Empty + * Creates a plain object from a GetControlRequest message. Also converts values to other types if specified. + * @param message GetControlRequest + * @param [options] Conversion options + * @returns Plain object */ - type SetDefaultBranchCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static toObject(message: google.cloud.retail.v2beta.GetControlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#getDefaultBranch}. - * @param error Error, if any - * @param [response] GetDefaultBranchResponse + * Converts this GetControlRequest to JSON. + * @returns JSON object */ - type GetDefaultBranchCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.GetDefaultBranchResponse) => void; + public toJSON(): { [k: string]: any }; } - /** Properties of a ListCatalogsRequest. */ - interface IListCatalogsRequest { + /** Properties of a ListControlsRequest. */ + interface IListControlsRequest { - /** ListCatalogsRequest parent */ + /** ListControlsRequest parent */ parent?: (string|null); - /** ListCatalogsRequest pageSize */ + /** ListControlsRequest pageSize */ pageSize?: (number|null); - /** ListCatalogsRequest pageToken */ + /** ListControlsRequest pageToken */ pageToken?: (string|null); + + /** ListControlsRequest filter */ + filter?: (string|null); } - /** Represents a ListCatalogsRequest. */ - class ListCatalogsRequest implements IListCatalogsRequest { + /** Represents a ListControlsRequest. */ + class ListControlsRequest implements IListControlsRequest { /** - * Constructs a new ListCatalogsRequest. + * Constructs a new ListControlsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IListCatalogsRequest); + constructor(properties?: google.cloud.retail.v2beta.IListControlsRequest); - /** ListCatalogsRequest parent. */ + /** ListControlsRequest parent. */ public parent: string; - /** ListCatalogsRequest pageSize. */ + /** ListControlsRequest pageSize. */ public pageSize: number; - /** ListCatalogsRequest pageToken. */ + /** ListControlsRequest pageToken. */ public pageToken: string; + /** ListControlsRequest filter. */ + public filter: string; + /** - * Creates a new ListCatalogsRequest instance using the specified properties. + * Creates a new ListControlsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListCatalogsRequest instance + * @returns ListControlsRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IListCatalogsRequest): google.cloud.retail.v2beta.ListCatalogsRequest; + public static create(properties?: google.cloud.retail.v2beta.IListControlsRequest): google.cloud.retail.v2beta.ListControlsRequest; /** - * Encodes the specified ListCatalogsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ListCatalogsRequest.verify|verify} messages. - * @param message ListCatalogsRequest message or plain object to encode + * Encodes the specified ListControlsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ListControlsRequest.verify|verify} messages. + * @param message ListControlsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IListCatalogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IListControlsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListCatalogsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListCatalogsRequest.verify|verify} messages. - * @param message ListCatalogsRequest message or plain object to encode + * Encodes the specified ListControlsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListControlsRequest.verify|verify} messages. + * @param message ListControlsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IListCatalogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IListControlsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListCatalogsRequest message from the specified reader or buffer. + * Decodes a ListControlsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListCatalogsRequest + * @returns ListControlsRequest * @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.v2beta.ListCatalogsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ListControlsRequest; /** - * Decodes a ListCatalogsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListControlsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListCatalogsRequest + * @returns ListControlsRequest * @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.v2beta.ListCatalogsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ListControlsRequest; /** - * Verifies a ListCatalogsRequest message. + * Verifies a ListControlsRequest 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 ListCatalogsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListControlsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListCatalogsRequest + * @returns ListControlsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ListCatalogsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ListControlsRequest; /** - * Creates a plain object from a ListCatalogsRequest message. Also converts values to other types if specified. - * @param message ListCatalogsRequest + * Creates a plain object from a ListControlsRequest message. Also converts values to other types if specified. + * @param message ListControlsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.ListCatalogsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.ListControlsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListCatalogsRequest to JSON. + * Converts this ListControlsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListCatalogsResponse. */ - interface IListCatalogsResponse { + /** Properties of a ListControlsResponse. */ + interface IListControlsResponse { - /** ListCatalogsResponse catalogs */ - catalogs?: (google.cloud.retail.v2beta.ICatalog[]|null); + /** ListControlsResponse controls */ + controls?: (google.cloud.retail.v2beta.IControl[]|null); - /** ListCatalogsResponse nextPageToken */ + /** ListControlsResponse nextPageToken */ nextPageToken?: (string|null); } - /** Represents a ListCatalogsResponse. */ - class ListCatalogsResponse implements IListCatalogsResponse { + /** Represents a ListControlsResponse. */ + class ListControlsResponse implements IListControlsResponse { /** - * Constructs a new ListCatalogsResponse. + * Constructs a new ListControlsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IListCatalogsResponse); + constructor(properties?: google.cloud.retail.v2beta.IListControlsResponse); - /** ListCatalogsResponse catalogs. */ - public catalogs: google.cloud.retail.v2beta.ICatalog[]; + /** ListControlsResponse controls. */ + public controls: google.cloud.retail.v2beta.IControl[]; - /** ListCatalogsResponse nextPageToken. */ + /** ListControlsResponse nextPageToken. */ public nextPageToken: string; /** - * Creates a new ListCatalogsResponse instance using the specified properties. + * Creates a new ListControlsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListCatalogsResponse instance + * @returns ListControlsResponse instance */ - public static create(properties?: google.cloud.retail.v2beta.IListCatalogsResponse): google.cloud.retail.v2beta.ListCatalogsResponse; + public static create(properties?: google.cloud.retail.v2beta.IListControlsResponse): google.cloud.retail.v2beta.ListControlsResponse; /** - * Encodes the specified ListCatalogsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ListCatalogsResponse.verify|verify} messages. - * @param message ListCatalogsResponse message or plain object to encode + * Encodes the specified ListControlsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ListControlsResponse.verify|verify} messages. + * @param message ListControlsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IListCatalogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IListControlsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListCatalogsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListCatalogsResponse.verify|verify} messages. - * @param message ListCatalogsResponse message or plain object to encode + * Encodes the specified ListControlsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListControlsResponse.verify|verify} messages. + * @param message ListControlsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IListCatalogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IListControlsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListCatalogsResponse message from the specified reader or buffer. + * Decodes a ListControlsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListCatalogsResponse + * @returns ListControlsResponse * @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.v2beta.ListCatalogsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ListControlsResponse; /** - * Decodes a ListCatalogsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListControlsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListCatalogsResponse + * @returns ListControlsResponse * @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.v2beta.ListCatalogsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ListControlsResponse; /** - * Verifies a ListCatalogsResponse message. + * Verifies a ListControlsResponse 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 ListCatalogsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListControlsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListCatalogsResponse + * @returns ListControlsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ListCatalogsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ListControlsResponse; /** - * Creates a plain object from a ListCatalogsResponse message. Also converts values to other types if specified. - * @param message ListCatalogsResponse + * Creates a plain object from a ListControlsResponse message. Also converts values to other types if specified. + * @param message ListControlsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.ListCatalogsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.ListControlsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListCatalogsResponse to JSON. + * Converts this ListControlsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateCatalogRequest. */ - interface IUpdateCatalogRequest { - - /** UpdateCatalogRequest catalog */ - catalog?: (google.cloud.retail.v2beta.ICatalog|null); + /** Properties of an ExportErrorsConfig. */ + interface IExportErrorsConfig { - /** UpdateCatalogRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** ExportErrorsConfig gcsPrefix */ + gcsPrefix?: (string|null); } - /** Represents an UpdateCatalogRequest. */ - class UpdateCatalogRequest implements IUpdateCatalogRequest { + /** Represents an ExportErrorsConfig. */ + class ExportErrorsConfig implements IExportErrorsConfig { /** - * Constructs a new UpdateCatalogRequest. + * Constructs a new ExportErrorsConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IUpdateCatalogRequest); + constructor(properties?: google.cloud.retail.v2beta.IExportErrorsConfig); - /** UpdateCatalogRequest catalog. */ - public catalog?: (google.cloud.retail.v2beta.ICatalog|null); + /** ExportErrorsConfig gcsPrefix. */ + public gcsPrefix?: (string|null); - /** UpdateCatalogRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** ExportErrorsConfig destination. */ + public destination?: "gcsPrefix"; /** - * Creates a new UpdateCatalogRequest instance using the specified properties. + * Creates a new ExportErrorsConfig instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateCatalogRequest instance + * @returns ExportErrorsConfig instance */ - public static create(properties?: google.cloud.retail.v2beta.IUpdateCatalogRequest): google.cloud.retail.v2beta.UpdateCatalogRequest; + public static create(properties?: google.cloud.retail.v2beta.IExportErrorsConfig): google.cloud.retail.v2beta.ExportErrorsConfig; /** - * Encodes the specified UpdateCatalogRequest message. Does not implicitly {@link google.cloud.retail.v2beta.UpdateCatalogRequest.verify|verify} messages. - * @param message UpdateCatalogRequest message or plain object to encode + * Encodes the specified ExportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ExportErrorsConfig.verify|verify} messages. + * @param message ExportErrorsConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IUpdateCatalogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IExportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateCatalogRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UpdateCatalogRequest.verify|verify} messages. - * @param message UpdateCatalogRequest message or plain object to encode + * Encodes the specified ExportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ExportErrorsConfig.verify|verify} messages. + * @param message ExportErrorsConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IUpdateCatalogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IExportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateCatalogRequest message from the specified reader or buffer. + * Decodes an ExportErrorsConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateCatalogRequest + * @returns ExportErrorsConfig * @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.v2beta.UpdateCatalogRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ExportErrorsConfig; /** - * Decodes an UpdateCatalogRequest message from the specified reader or buffer, length delimited. + * Decodes an ExportErrorsConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateCatalogRequest + * @returns ExportErrorsConfig * @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.v2beta.UpdateCatalogRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ExportErrorsConfig; /** - * Verifies an UpdateCatalogRequest message. + * Verifies an ExportErrorsConfig 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 UpdateCatalogRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExportErrorsConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateCatalogRequest + * @returns ExportErrorsConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UpdateCatalogRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ExportErrorsConfig; /** - * Creates a plain object from an UpdateCatalogRequest message. Also converts values to other types if specified. - * @param message UpdateCatalogRequest + * Creates a plain object from an ExportErrorsConfig message. Also converts values to other types if specified. + * @param message ExportErrorsConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.UpdateCatalogRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.ExportErrorsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateCatalogRequest to JSON. + * Converts this ExportErrorsConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SetDefaultBranchRequest. */ - interface ISetDefaultBranchRequest { - - /** SetDefaultBranchRequest catalog */ - catalog?: (string|null); + /** Properties of an ExportMetadata. */ + interface IExportMetadata { - /** SetDefaultBranchRequest branchId */ - branchId?: (string|null); + /** ExportMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** SetDefaultBranchRequest note */ - note?: (string|null); + /** ExportMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); } - /** Represents a SetDefaultBranchRequest. */ - class SetDefaultBranchRequest implements ISetDefaultBranchRequest { + /** Represents an ExportMetadata. */ + class ExportMetadata implements IExportMetadata { /** - * Constructs a new SetDefaultBranchRequest. + * Constructs a new ExportMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.ISetDefaultBranchRequest); - - /** SetDefaultBranchRequest catalog. */ - public catalog: string; + constructor(properties?: google.cloud.retail.v2beta.IExportMetadata); - /** SetDefaultBranchRequest branchId. */ - public branchId: string; + /** ExportMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** SetDefaultBranchRequest note. */ - public note: string; + /** ExportMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new SetDefaultBranchRequest instance using the specified properties. + * Creates a new ExportMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns SetDefaultBranchRequest instance + * @returns ExportMetadata instance */ - public static create(properties?: google.cloud.retail.v2beta.ISetDefaultBranchRequest): google.cloud.retail.v2beta.SetDefaultBranchRequest; + public static create(properties?: google.cloud.retail.v2beta.IExportMetadata): google.cloud.retail.v2beta.ExportMetadata; /** - * Encodes the specified SetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2beta.SetDefaultBranchRequest.verify|verify} messages. - * @param message SetDefaultBranchRequest message or plain object to encode + * Encodes the specified ExportMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.ExportMetadata.verify|verify} messages. + * @param message ExportMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.ISetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IExportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SetDefaultBranchRequest.verify|verify} messages. - * @param message SetDefaultBranchRequest message or plain object to encode + * Encodes the specified ExportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ExportMetadata.verify|verify} messages. + * @param message ExportMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.ISetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IExportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SetDefaultBranchRequest message from the specified reader or buffer. + * Decodes an ExportMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SetDefaultBranchRequest + * @returns ExportMetadata * @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.v2beta.SetDefaultBranchRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ExportMetadata; /** - * Decodes a SetDefaultBranchRequest message from the specified reader or buffer, length delimited. + * Decodes an ExportMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SetDefaultBranchRequest + * @returns ExportMetadata * @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.v2beta.SetDefaultBranchRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ExportMetadata; /** - * Verifies a SetDefaultBranchRequest message. + * Verifies an ExportMetadata 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 SetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExportMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SetDefaultBranchRequest + * @returns ExportMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SetDefaultBranchRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ExportMetadata; /** - * Creates a plain object from a SetDefaultBranchRequest message. Also converts values to other types if specified. - * @param message SetDefaultBranchRequest + * Creates a plain object from an ExportMetadata message. Also converts values to other types if specified. + * @param message ExportMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.SetDefaultBranchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.ExportMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SetDefaultBranchRequest to JSON. + * Converts this ExportMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetDefaultBranchRequest. */ - interface IGetDefaultBranchRequest { + /** Properties of an ExportProductsResponse. */ + interface IExportProductsResponse { - /** GetDefaultBranchRequest catalog */ - catalog?: (string|null); + /** ExportProductsResponse errorSamples */ + errorSamples?: (google.rpc.IStatus[]|null); + + /** ExportProductsResponse errorsConfig */ + errorsConfig?: (google.cloud.retail.v2beta.IExportErrorsConfig|null); } - /** Represents a GetDefaultBranchRequest. */ - class GetDefaultBranchRequest implements IGetDefaultBranchRequest { + /** Represents an ExportProductsResponse. */ + class ExportProductsResponse implements IExportProductsResponse { /** - * Constructs a new GetDefaultBranchRequest. + * Constructs a new ExportProductsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IGetDefaultBranchRequest); + constructor(properties?: google.cloud.retail.v2beta.IExportProductsResponse); - /** GetDefaultBranchRequest catalog. */ - public catalog: string; + /** ExportProductsResponse errorSamples. */ + public errorSamples: google.rpc.IStatus[]; + + /** ExportProductsResponse errorsConfig. */ + public errorsConfig?: (google.cloud.retail.v2beta.IExportErrorsConfig|null); /** - * Creates a new GetDefaultBranchRequest instance using the specified properties. + * Creates a new ExportProductsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetDefaultBranchRequest instance + * @returns ExportProductsResponse instance */ - public static create(properties?: google.cloud.retail.v2beta.IGetDefaultBranchRequest): google.cloud.retail.v2beta.GetDefaultBranchRequest; + public static create(properties?: google.cloud.retail.v2beta.IExportProductsResponse): google.cloud.retail.v2beta.ExportProductsResponse; /** - * Encodes the specified GetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2beta.GetDefaultBranchRequest.verify|verify} messages. - * @param message GetDefaultBranchRequest message or plain object to encode + * Encodes the specified ExportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ExportProductsResponse.verify|verify} messages. + * @param message ExportProductsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IGetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IExportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetDefaultBranchRequest.verify|verify} messages. - * @param message GetDefaultBranchRequest message or plain object to encode + * Encodes the specified ExportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ExportProductsResponse.verify|verify} messages. + * @param message ExportProductsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IGetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IExportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetDefaultBranchRequest message from the specified reader or buffer. + * Decodes an ExportProductsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetDefaultBranchRequest + * @returns ExportProductsResponse * @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.v2beta.GetDefaultBranchRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ExportProductsResponse; /** - * Decodes a GetDefaultBranchRequest message from the specified reader or buffer, length delimited. + * Decodes an ExportProductsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetDefaultBranchRequest + * @returns ExportProductsResponse * @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.v2beta.GetDefaultBranchRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ExportProductsResponse; /** - * Verifies a GetDefaultBranchRequest message. + * Verifies an ExportProductsResponse 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 GetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExportProductsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetDefaultBranchRequest + * @returns ExportProductsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.GetDefaultBranchRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ExportProductsResponse; /** - * Creates a plain object from a GetDefaultBranchRequest message. Also converts values to other types if specified. - * @param message GetDefaultBranchRequest + * Creates a plain object from an ExportProductsResponse message. Also converts values to other types if specified. + * @param message ExportProductsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.GetDefaultBranchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.ExportProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetDefaultBranchRequest to JSON. + * Converts this ExportProductsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetDefaultBranchResponse. */ - interface IGetDefaultBranchResponse { - - /** GetDefaultBranchResponse branch */ - branch?: (string|null); + /** Properties of an ExportUserEventsResponse. */ + interface IExportUserEventsResponse { - /** GetDefaultBranchResponse setTime */ - setTime?: (google.protobuf.ITimestamp|null); + /** ExportUserEventsResponse errorSamples */ + errorSamples?: (google.rpc.IStatus[]|null); - /** GetDefaultBranchResponse note */ - note?: (string|null); + /** ExportUserEventsResponse errorsConfig */ + errorsConfig?: (google.cloud.retail.v2beta.IExportErrorsConfig|null); } - /** Represents a GetDefaultBranchResponse. */ - class GetDefaultBranchResponse implements IGetDefaultBranchResponse { + /** Represents an ExportUserEventsResponse. */ + class ExportUserEventsResponse implements IExportUserEventsResponse { /** - * Constructs a new GetDefaultBranchResponse. + * Constructs a new ExportUserEventsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IGetDefaultBranchResponse); - - /** GetDefaultBranchResponse branch. */ - public branch: string; + constructor(properties?: google.cloud.retail.v2beta.IExportUserEventsResponse); - /** GetDefaultBranchResponse setTime. */ - public setTime?: (google.protobuf.ITimestamp|null); + /** ExportUserEventsResponse errorSamples. */ + public errorSamples: google.rpc.IStatus[]; - /** GetDefaultBranchResponse note. */ - public note: string; + /** ExportUserEventsResponse errorsConfig. */ + public errorsConfig?: (google.cloud.retail.v2beta.IExportErrorsConfig|null); /** - * Creates a new GetDefaultBranchResponse instance using the specified properties. + * Creates a new ExportUserEventsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetDefaultBranchResponse instance + * @returns ExportUserEventsResponse instance */ - public static create(properties?: google.cloud.retail.v2beta.IGetDefaultBranchResponse): google.cloud.retail.v2beta.GetDefaultBranchResponse; + public static create(properties?: google.cloud.retail.v2beta.IExportUserEventsResponse): google.cloud.retail.v2beta.ExportUserEventsResponse; /** - * Encodes the specified GetDefaultBranchResponse message. Does not implicitly {@link google.cloud.retail.v2beta.GetDefaultBranchResponse.verify|verify} messages. - * @param message GetDefaultBranchResponse message or plain object to encode + * Encodes the specified ExportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ExportUserEventsResponse.verify|verify} messages. + * @param message ExportUserEventsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IGetDefaultBranchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IExportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetDefaultBranchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetDefaultBranchResponse.verify|verify} messages. - * @param message GetDefaultBranchResponse message or plain object to encode + * Encodes the specified ExportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ExportUserEventsResponse.verify|verify} messages. + * @param message ExportUserEventsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IGetDefaultBranchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IExportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetDefaultBranchResponse message from the specified reader or buffer. + * Decodes an ExportUserEventsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetDefaultBranchResponse + * @returns ExportUserEventsResponse * @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.v2beta.GetDefaultBranchResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ExportUserEventsResponse; /** - * Decodes a GetDefaultBranchResponse message from the specified reader or buffer, length delimited. + * Decodes an ExportUserEventsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetDefaultBranchResponse + * @returns ExportUserEventsResponse * @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.v2beta.GetDefaultBranchResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ExportUserEventsResponse; /** - * Verifies a GetDefaultBranchResponse message. + * Verifies an ExportUserEventsResponse 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 GetDefaultBranchResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ExportUserEventsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetDefaultBranchResponse + * @returns ExportUserEventsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.GetDefaultBranchResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ExportUserEventsResponse; /** - * Creates a plain object from a GetDefaultBranchResponse message. Also converts values to other types if specified. - * @param message GetDefaultBranchResponse + * Creates a plain object from an ExportUserEventsResponse message. Also converts values to other types if specified. + * @param message ExportUserEventsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.GetDefaultBranchResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.ExportUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetDefaultBranchResponse to JSON. + * Converts this ExportUserEventsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents a CompletionService */ - class CompletionService extends $protobuf.rpc.Service { + /** Represents a PredictionService */ + class PredictionService extends $protobuf.rpc.Service { /** - * Constructs a new CompletionService service. + * Constructs a new PredictionService service. * @param rpcImpl RPC implementation * @param [requestDelimited=false] Whether requests are length-delimited * @param [responseDelimited=false] Whether responses are length-delimited @@ -26945,2602 +32599,2338 @@ export namespace google { constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates new CompletionService service using the specified rpc implementation. + * Creates new PredictionService service using the specified rpc implementation. * @param rpcImpl RPC implementation * @param [requestDelimited=false] Whether requests are length-delimited * @param [responseDelimited=false] Whether responses are length-delimited * @returns RPC service. Useful where requests and/or responses are streamed. */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): CompletionService; - - /** - * Calls CompleteQuery. - * @param request CompleteQueryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CompleteQueryResponse - */ - public completeQuery(request: google.cloud.retail.v2beta.ICompleteQueryRequest, callback: google.cloud.retail.v2beta.CompletionService.CompleteQueryCallback): void; - - /** - * Calls CompleteQuery. - * @param request CompleteQueryRequest message or plain object - * @returns Promise - */ - public completeQuery(request: google.cloud.retail.v2beta.ICompleteQueryRequest): Promise; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): PredictionService; /** - * Calls ImportCompletionData. - * @param request ImportCompletionDataRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Calls Predict. + * @param request PredictRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PredictResponse */ - public importCompletionData(request: google.cloud.retail.v2beta.IImportCompletionDataRequest, callback: google.cloud.retail.v2beta.CompletionService.ImportCompletionDataCallback): void; + public predict(request: google.cloud.retail.v2beta.IPredictRequest, callback: google.cloud.retail.v2beta.PredictionService.PredictCallback): void; /** - * Calls ImportCompletionData. - * @param request ImportCompletionDataRequest message or plain object + * Calls Predict. + * @param request PredictRequest message or plain object * @returns Promise */ - public importCompletionData(request: google.cloud.retail.v2beta.IImportCompletionDataRequest): Promise; + public predict(request: google.cloud.retail.v2beta.IPredictRequest): Promise; } - namespace CompletionService { - - /** - * Callback as used by {@link google.cloud.retail.v2beta.CompletionService#completeQuery}. - * @param error Error, if any - * @param [response] CompleteQueryResponse - */ - type CompleteQueryCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.CompleteQueryResponse) => void; + namespace PredictionService { /** - * Callback as used by {@link google.cloud.retail.v2beta.CompletionService#importCompletionData}. + * Callback as used by {@link google.cloud.retail.v2beta.PredictionService#predict}. * @param error Error, if any - * @param [response] Operation + * @param [response] PredictResponse */ - type ImportCompletionDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + type PredictCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.PredictResponse) => void; } - /** Properties of a CompleteQueryRequest. */ - interface ICompleteQueryRequest { + /** Properties of a PredictRequest. */ + interface IPredictRequest { - /** CompleteQueryRequest catalog */ - catalog?: (string|null); + /** PredictRequest placement */ + placement?: (string|null); - /** CompleteQueryRequest query */ - query?: (string|null); + /** PredictRequest userEvent */ + userEvent?: (google.cloud.retail.v2beta.IUserEvent|null); - /** CompleteQueryRequest visitorId */ - visitorId?: (string|null); + /** PredictRequest pageSize */ + pageSize?: (number|null); - /** CompleteQueryRequest languageCodes */ - languageCodes?: (string[]|null); + /** PredictRequest pageToken */ + pageToken?: (string|null); - /** CompleteQueryRequest deviceType */ - deviceType?: (string|null); + /** PredictRequest filter */ + filter?: (string|null); - /** CompleteQueryRequest dataset */ - dataset?: (string|null); + /** PredictRequest validateOnly */ + validateOnly?: (boolean|null); - /** CompleteQueryRequest maxSuggestions */ - maxSuggestions?: (number|null); + /** PredictRequest params */ + params?: ({ [k: string]: google.protobuf.IValue }|null); + + /** PredictRequest labels */ + labels?: ({ [k: string]: string }|null); } - /** Represents a CompleteQueryRequest. */ - class CompleteQueryRequest implements ICompleteQueryRequest { + /** Represents a PredictRequest. */ + class PredictRequest implements IPredictRequest { /** - * Constructs a new CompleteQueryRequest. + * Constructs a new PredictRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.ICompleteQueryRequest); + constructor(properties?: google.cloud.retail.v2beta.IPredictRequest); - /** CompleteQueryRequest catalog. */ - public catalog: string; + /** PredictRequest placement. */ + public placement: string; - /** CompleteQueryRequest query. */ - public query: string; + /** PredictRequest userEvent. */ + public userEvent?: (google.cloud.retail.v2beta.IUserEvent|null); - /** CompleteQueryRequest visitorId. */ - public visitorId: string; + /** PredictRequest pageSize. */ + public pageSize: number; - /** CompleteQueryRequest languageCodes. */ - public languageCodes: string[]; + /** PredictRequest pageToken. */ + public pageToken: string; - /** CompleteQueryRequest deviceType. */ - public deviceType: string; + /** PredictRequest filter. */ + public filter: string; - /** CompleteQueryRequest dataset. */ - public dataset: string; + /** PredictRequest validateOnly. */ + public validateOnly: boolean; - /** CompleteQueryRequest maxSuggestions. */ - public maxSuggestions: number; + /** PredictRequest params. */ + public params: { [k: string]: google.protobuf.IValue }; + + /** PredictRequest labels. */ + public labels: { [k: string]: string }; /** - * Creates a new CompleteQueryRequest instance using the specified properties. + * Creates a new PredictRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CompleteQueryRequest instance + * @returns PredictRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.ICompleteQueryRequest): google.cloud.retail.v2beta.CompleteQueryRequest; + public static create(properties?: google.cloud.retail.v2beta.IPredictRequest): google.cloud.retail.v2beta.PredictRequest; /** - * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryRequest.verify|verify} messages. - * @param message CompleteQueryRequest message or plain object to encode + * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.retail.v2beta.PredictRequest.verify|verify} messages. + * @param message PredictRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryRequest.verify|verify} messages. - * @param message CompleteQueryRequest message or plain object to encode + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PredictRequest.verify|verify} messages. + * @param message PredictRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CompleteQueryRequest message from the specified reader or buffer. + * Decodes a PredictRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CompleteQueryRequest + * @returns PredictRequest * @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.v2beta.CompleteQueryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.PredictRequest; /** - * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CompleteQueryRequest + * @returns PredictRequest * @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.v2beta.CompleteQueryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.PredictRequest; /** - * Verifies a CompleteQueryRequest message. + * Verifies a PredictRequest 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 CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CompleteQueryRequest + * @returns PredictRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CompleteQueryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PredictRequest; /** - * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. - * @param message CompleteQueryRequest + * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. + * @param message PredictRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.CompleteQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.PredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CompleteQueryRequest to JSON. + * Converts this PredictRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CompleteQueryResponse. */ - interface ICompleteQueryResponse { + /** Properties of a PredictResponse. */ + interface IPredictResponse { - /** CompleteQueryResponse completionResults */ - completionResults?: (google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult[]|null); + /** PredictResponse results */ + results?: (google.cloud.retail.v2beta.PredictResponse.IPredictionResult[]|null); - /** CompleteQueryResponse attributionToken */ + /** PredictResponse attributionToken */ attributionToken?: (string|null); - /** CompleteQueryResponse recentSearchResults */ - recentSearchResults?: (google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult[]|null); + /** PredictResponse missingIds */ + missingIds?: (string[]|null); + + /** PredictResponse validateOnly */ + validateOnly?: (boolean|null); } - /** Represents a CompleteQueryResponse. */ - class CompleteQueryResponse implements ICompleteQueryResponse { + /** Represents a PredictResponse. */ + class PredictResponse implements IPredictResponse { /** - * Constructs a new CompleteQueryResponse. + * Constructs a new PredictResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.ICompleteQueryResponse); + constructor(properties?: google.cloud.retail.v2beta.IPredictResponse); - /** CompleteQueryResponse completionResults. */ - public completionResults: google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult[]; + /** PredictResponse results. */ + public results: google.cloud.retail.v2beta.PredictResponse.IPredictionResult[]; - /** CompleteQueryResponse attributionToken. */ + /** PredictResponse attributionToken. */ public attributionToken: string; - /** CompleteQueryResponse recentSearchResults. */ - public recentSearchResults: google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult[]; + /** PredictResponse missingIds. */ + public missingIds: string[]; + + /** PredictResponse validateOnly. */ + public validateOnly: boolean; /** - * Creates a new CompleteQueryResponse instance using the specified properties. + * Creates a new PredictResponse instance using the specified properties. * @param [properties] Properties to set - * @returns CompleteQueryResponse instance + * @returns PredictResponse instance */ - public static create(properties?: google.cloud.retail.v2beta.ICompleteQueryResponse): google.cloud.retail.v2beta.CompleteQueryResponse; + public static create(properties?: google.cloud.retail.v2beta.IPredictResponse): google.cloud.retail.v2beta.PredictResponse; /** - * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.verify|verify} messages. - * @param message CompleteQueryResponse message or plain object to encode + * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.retail.v2beta.PredictResponse.verify|verify} messages. + * @param message PredictResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.verify|verify} messages. - * @param message CompleteQueryResponse message or plain object to encode + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PredictResponse.verify|verify} messages. + * @param message PredictResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CompleteQueryResponse message from the specified reader or buffer. + * Decodes a PredictResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CompleteQueryResponse + * @returns PredictResponse * @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.v2beta.CompleteQueryResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.PredictResponse; /** - * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. + * Decodes a PredictResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CompleteQueryResponse + * @returns PredictResponse * @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.v2beta.CompleteQueryResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.PredictResponse; /** - * Verifies a CompleteQueryResponse message. + * Verifies a PredictResponse 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 CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CompleteQueryResponse + * @returns PredictResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CompleteQueryResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PredictResponse; /** - * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. - * @param message CompleteQueryResponse + * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * @param message PredictResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.CompleteQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.PredictResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CompleteQueryResponse to JSON. + * Converts this PredictResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace CompleteQueryResponse { + namespace PredictResponse { - /** Properties of a CompletionResult. */ - interface ICompletionResult { + /** Properties of a PredictionResult. */ + interface IPredictionResult { - /** CompletionResult suggestion */ - suggestion?: (string|null); + /** PredictionResult id */ + id?: (string|null); - /** CompletionResult attributes */ - attributes?: ({ [k: string]: google.cloud.retail.v2beta.ICustomAttribute }|null); + /** PredictionResult metadata */ + metadata?: ({ [k: string]: google.protobuf.IValue }|null); } - /** Represents a CompletionResult. */ - class CompletionResult implements ICompletionResult { - - /** - * Constructs a new CompletionResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult); - - /** CompletionResult suggestion. */ - public suggestion: string; - - /** CompletionResult attributes. */ - public attributes: { [k: string]: google.cloud.retail.v2beta.ICustomAttribute }; + /** Represents a PredictionResult. */ + class PredictionResult implements IPredictionResult { /** - * Creates a new CompletionResult instance using the specified properties. + * Constructs a new PredictionResult. * @param [properties] Properties to set - * @returns CompletionResult instance - */ - public static create(properties?: google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult): google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult; - - /** - * Encodes the specified CompletionResult message. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.verify|verify} messages. - * @param message CompletionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CompletionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.verify|verify} messages. - * @param message CompletionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CompletionResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CompletionResult - * @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.v2beta.CompleteQueryResponse.CompletionResult; - - /** - * Decodes a CompletionResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CompletionResult - * @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.v2beta.CompleteQueryResponse.CompletionResult; - - /** - * Verifies a CompletionResult 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 CompletionResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CompletionResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult; - - /** - * Creates a plain object from a CompletionResult message. Also converts values to other types if specified. - * @param message CompletionResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CompletionResult to JSON. - * @returns JSON object */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RecentSearchResult. */ - interface IRecentSearchResult { - - /** RecentSearchResult recentSearch */ - recentSearch?: (string|null); - } - - /** Represents a RecentSearchResult. */ - class RecentSearchResult implements IRecentSearchResult { + constructor(properties?: google.cloud.retail.v2beta.PredictResponse.IPredictionResult); - /** - * Constructs a new RecentSearchResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult); + /** PredictionResult id. */ + public id: string; - /** RecentSearchResult recentSearch. */ - public recentSearch: string; + /** PredictionResult metadata. */ + public metadata: { [k: string]: google.protobuf.IValue }; /** - * Creates a new RecentSearchResult instance using the specified properties. + * Creates a new PredictionResult instance using the specified properties. * @param [properties] Properties to set - * @returns RecentSearchResult instance + * @returns PredictionResult instance */ - public static create(properties?: google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult): google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult; + public static create(properties?: google.cloud.retail.v2beta.PredictResponse.IPredictionResult): google.cloud.retail.v2beta.PredictResponse.PredictionResult; /** - * Encodes the specified RecentSearchResult message. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. - * @param message RecentSearchResult message or plain object to encode + * Encodes the specified PredictionResult message. Does not implicitly {@link google.cloud.retail.v2beta.PredictResponse.PredictionResult.verify|verify} messages. + * @param message PredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.PredictResponse.IPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RecentSearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. - * @param message RecentSearchResult message or plain object to encode + * Encodes the specified PredictionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PredictResponse.PredictionResult.verify|verify} messages. + * @param message PredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.PredictResponse.IPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RecentSearchResult message from the specified reader or buffer. + * Decodes a PredictionResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RecentSearchResult + * @returns PredictionResult * @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.v2beta.CompleteQueryResponse.RecentSearchResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.PredictResponse.PredictionResult; /** - * Decodes a RecentSearchResult message from the specified reader or buffer, length delimited. + * Decodes a PredictionResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RecentSearchResult + * @returns PredictionResult * @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.v2beta.CompleteQueryResponse.RecentSearchResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.PredictResponse.PredictionResult; /** - * Verifies a RecentSearchResult message. + * Verifies a PredictionResult 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 RecentSearchResult message from a plain object. Also converts values to their respective internal types. + * Creates a PredictionResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RecentSearchResult + * @returns PredictionResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PredictResponse.PredictionResult; /** - * Creates a plain object from a RecentSearchResult message. Also converts values to other types if specified. - * @param message RecentSearchResult + * Creates a plain object from a PredictionResult message. Also converts values to other types if specified. + * @param message PredictionResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.PredictResponse.PredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RecentSearchResult to JSON. + * Converts this PredictionResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } } - /** Properties of an ExportErrorsConfig. */ - interface IExportErrorsConfig { + /** Represents a ProductService */ + class ProductService extends $protobuf.rpc.Service { - /** ExportErrorsConfig gcsPrefix */ - gcsPrefix?: (string|null); - } + /** + * Constructs a new ProductService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** Represents an ExportErrorsConfig. */ - class ExportErrorsConfig implements IExportErrorsConfig { + /** + * Creates new ProductService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ProductService; /** - * Constructs a new ExportErrorsConfig. - * @param [properties] Properties to set + * Calls CreateProduct. + * @param request CreateProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product */ - constructor(properties?: google.cloud.retail.v2beta.IExportErrorsConfig); + public createProduct(request: google.cloud.retail.v2beta.ICreateProductRequest, callback: google.cloud.retail.v2beta.ProductService.CreateProductCallback): void; - /** ExportErrorsConfig gcsPrefix. */ - public gcsPrefix?: (string|null); + /** + * Calls CreateProduct. + * @param request CreateProductRequest message or plain object + * @returns Promise + */ + public createProduct(request: google.cloud.retail.v2beta.ICreateProductRequest): Promise; - /** ExportErrorsConfig destination. */ - public destination?: "gcsPrefix"; + /** + * Calls GetProduct. + * @param request GetProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product + */ + public getProduct(request: google.cloud.retail.v2beta.IGetProductRequest, callback: google.cloud.retail.v2beta.ProductService.GetProductCallback): void; /** - * Creates a new ExportErrorsConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportErrorsConfig instance + * Calls GetProduct. + * @param request GetProductRequest message or plain object + * @returns Promise */ - public static create(properties?: google.cloud.retail.v2beta.IExportErrorsConfig): google.cloud.retail.v2beta.ExportErrorsConfig; + public getProduct(request: google.cloud.retail.v2beta.IGetProductRequest): Promise; /** - * Encodes the specified ExportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ExportErrorsConfig.verify|verify} messages. - * @param message ExportErrorsConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListProducts. + * @param request ListProductsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProductsResponse */ - public static encode(message: google.cloud.retail.v2beta.IExportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public listProducts(request: google.cloud.retail.v2beta.IListProductsRequest, callback: google.cloud.retail.v2beta.ProductService.ListProductsCallback): void; /** - * Encodes the specified ExportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ExportErrorsConfig.verify|verify} messages. - * @param message ExportErrorsConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListProducts. + * @param request ListProductsRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IExportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public listProducts(request: google.cloud.retail.v2beta.IListProductsRequest): Promise; /** - * Decodes an ExportErrorsConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportErrorsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls UpdateProduct. + * @param request UpdateProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ExportErrorsConfig; + public updateProduct(request: google.cloud.retail.v2beta.IUpdateProductRequest, callback: google.cloud.retail.v2beta.ProductService.UpdateProductCallback): void; /** - * Decodes an ExportErrorsConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportErrorsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls UpdateProduct. + * @param request UpdateProductRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ExportErrorsConfig; + public updateProduct(request: google.cloud.retail.v2beta.IUpdateProductRequest): Promise; /** - * Verifies an ExportErrorsConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls DeleteProduct. + * @param request DeleteProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static verify(message: { [k: string]: any }): (string|null); + public deleteProduct(request: google.cloud.retail.v2beta.IDeleteProductRequest, callback: google.cloud.retail.v2beta.ProductService.DeleteProductCallback): void; /** - * Creates an ExportErrorsConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportErrorsConfig + * Calls DeleteProduct. + * @param request DeleteProductRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ExportErrorsConfig; + public deleteProduct(request: google.cloud.retail.v2beta.IDeleteProductRequest): Promise; /** - * Creates a plain object from an ExportErrorsConfig message. Also converts values to other types if specified. - * @param message ExportErrorsConfig - * @param [options] Conversion options - * @returns Plain object + * Calls ImportProducts. + * @param request ImportProductsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static toObject(message: google.cloud.retail.v2beta.ExportErrorsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public importProducts(request: google.cloud.retail.v2beta.IImportProductsRequest, callback: google.cloud.retail.v2beta.ProductService.ImportProductsCallback): void; /** - * Converts this ExportErrorsConfig to JSON. - * @returns JSON object + * Calls ImportProducts. + * @param request ImportProductsRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ExportMetadata. */ - interface IExportMetadata { - - /** ExportMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ExportMetadata updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an ExportMetadata. */ - class ExportMetadata implements IExportMetadata { + public importProducts(request: google.cloud.retail.v2beta.IImportProductsRequest): Promise; /** - * Constructs a new ExportMetadata. - * @param [properties] Properties to set + * Calls SetInventory. + * @param request SetInventoryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - constructor(properties?: google.cloud.retail.v2beta.IExportMetadata); - - /** ExportMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ExportMetadata updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + public setInventory(request: google.cloud.retail.v2beta.ISetInventoryRequest, callback: google.cloud.retail.v2beta.ProductService.SetInventoryCallback): void; /** - * Creates a new ExportMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportMetadata instance + * Calls SetInventory. + * @param request SetInventoryRequest message or plain object + * @returns Promise */ - public static create(properties?: google.cloud.retail.v2beta.IExportMetadata): google.cloud.retail.v2beta.ExportMetadata; + public setInventory(request: google.cloud.retail.v2beta.ISetInventoryRequest): Promise; /** - * Encodes the specified ExportMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.ExportMetadata.verify|verify} messages. - * @param message ExportMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls AddFulfillmentPlaces. + * @param request AddFulfillmentPlacesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static encode(message: google.cloud.retail.v2beta.IExportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public addFulfillmentPlaces(request: google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest, callback: google.cloud.retail.v2beta.ProductService.AddFulfillmentPlacesCallback): void; /** - * Encodes the specified ExportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ExportMetadata.verify|verify} messages. - * @param message ExportMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls AddFulfillmentPlaces. + * @param request AddFulfillmentPlacesRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IExportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public addFulfillmentPlaces(request: google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest): Promise; /** - * Decodes an ExportMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls RemoveFulfillmentPlaces. + * @param request RemoveFulfillmentPlacesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ExportMetadata; + public removeFulfillmentPlaces(request: google.cloud.retail.v2beta.IRemoveFulfillmentPlacesRequest, callback: google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlacesCallback): void; /** - * Decodes an ExportMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls RemoveFulfillmentPlaces. + * @param request RemoveFulfillmentPlacesRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ExportMetadata; + public removeFulfillmentPlaces(request: google.cloud.retail.v2beta.IRemoveFulfillmentPlacesRequest): Promise; /** - * Verifies an ExportMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls AddLocalInventories. + * @param request AddLocalInventoriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static verify(message: { [k: string]: any }): (string|null); + public addLocalInventories(request: google.cloud.retail.v2beta.IAddLocalInventoriesRequest, callback: google.cloud.retail.v2beta.ProductService.AddLocalInventoriesCallback): void; /** - * Creates an ExportMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportMetadata + * Calls AddLocalInventories. + * @param request AddLocalInventoriesRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ExportMetadata; + public addLocalInventories(request: google.cloud.retail.v2beta.IAddLocalInventoriesRequest): Promise; /** - * Creates a plain object from an ExportMetadata message. Also converts values to other types if specified. - * @param message ExportMetadata - * @param [options] Conversion options - * @returns Plain object + * Calls RemoveLocalInventories. + * @param request RemoveLocalInventoriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static toObject(message: google.cloud.retail.v2beta.ExportMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public removeLocalInventories(request: google.cloud.retail.v2beta.IRemoveLocalInventoriesRequest, callback: google.cloud.retail.v2beta.ProductService.RemoveLocalInventoriesCallback): void; /** - * Converts this ExportMetadata to JSON. - * @returns JSON object + * Calls RemoveLocalInventories. + * @param request RemoveLocalInventoriesRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ExportProductsResponse. */ - interface IExportProductsResponse { - - /** ExportProductsResponse errorSamples */ - errorSamples?: (google.rpc.IStatus[]|null); - - /** ExportProductsResponse errorsConfig */ - errorsConfig?: (google.cloud.retail.v2beta.IExportErrorsConfig|null); + public removeLocalInventories(request: google.cloud.retail.v2beta.IRemoveLocalInventoriesRequest): Promise; } - /** Represents an ExportProductsResponse. */ - class ExportProductsResponse implements IExportProductsResponse { + namespace ProductService { /** - * Constructs a new ExportProductsResponse. - * @param [properties] Properties to set + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#createProduct}. + * @param error Error, if any + * @param [response] Product */ - constructor(properties?: google.cloud.retail.v2beta.IExportProductsResponse); - - /** ExportProductsResponse errorSamples. */ - public errorSamples: google.rpc.IStatus[]; - - /** ExportProductsResponse errorsConfig. */ - public errorsConfig?: (google.cloud.retail.v2beta.IExportErrorsConfig|null); + type CreateProductCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.Product) => void; /** - * Creates a new ExportProductsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportProductsResponse instance + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#getProduct}. + * @param error Error, if any + * @param [response] Product */ - public static create(properties?: google.cloud.retail.v2beta.IExportProductsResponse): google.cloud.retail.v2beta.ExportProductsResponse; + type GetProductCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.Product) => void; /** - * Encodes the specified ExportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ExportProductsResponse.verify|verify} messages. - * @param message ExportProductsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#listProducts}. + * @param error Error, if any + * @param [response] ListProductsResponse */ - public static encode(message: google.cloud.retail.v2beta.IExportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + type ListProductsCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.ListProductsResponse) => void; /** - * Encodes the specified ExportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ExportProductsResponse.verify|verify} messages. - * @param message ExportProductsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#updateProduct}. + * @param error Error, if any + * @param [response] Product */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IExportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + type UpdateProductCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.Product) => void; /** - * Decodes an ExportProductsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportProductsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#deleteProduct}. + * @param error Error, if any + * @param [response] Empty */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ExportProductsResponse; + type DeleteProductCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Decodes an ExportProductsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportProductsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#importProducts}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportProductsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#setInventory}. + * @param error Error, if any + * @param [response] Operation */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ExportProductsResponse; + type SetInventoryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Verifies an ExportProductsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#addFulfillmentPlaces}. + * @param error Error, if any + * @param [response] Operation */ - public static verify(message: { [k: string]: any }): (string|null); + type AddFulfillmentPlacesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates an ExportProductsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportProductsResponse + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#removeFulfillmentPlaces}. + * @param error Error, if any + * @param [response] Operation */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ExportProductsResponse; + type RemoveFulfillmentPlacesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates a plain object from an ExportProductsResponse message. Also converts values to other types if specified. - * @param message ExportProductsResponse - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#addLocalInventories}. + * @param error Error, if any + * @param [response] Operation */ - public static toObject(message: google.cloud.retail.v2beta.ExportProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type AddLocalInventoriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Converts this ExportProductsResponse to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#removeLocalInventories}. + * @param error Error, if any + * @param [response] Operation */ - public toJSON(): { [k: string]: any }; + type RemoveLocalInventoriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } - /** Properties of an ExportUserEventsResponse. */ - interface IExportUserEventsResponse { + /** Properties of a CreateProductRequest. */ + interface ICreateProductRequest { - /** ExportUserEventsResponse errorSamples */ - errorSamples?: (google.rpc.IStatus[]|null); + /** CreateProductRequest parent */ + parent?: (string|null); - /** ExportUserEventsResponse errorsConfig */ - errorsConfig?: (google.cloud.retail.v2beta.IExportErrorsConfig|null); + /** CreateProductRequest product */ + product?: (google.cloud.retail.v2beta.IProduct|null); + + /** CreateProductRequest productId */ + productId?: (string|null); } - /** Represents an ExportUserEventsResponse. */ - class ExportUserEventsResponse implements IExportUserEventsResponse { + /** Represents a CreateProductRequest. */ + class CreateProductRequest implements ICreateProductRequest { /** - * Constructs a new ExportUserEventsResponse. + * Constructs a new CreateProductRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IExportUserEventsResponse); + constructor(properties?: google.cloud.retail.v2beta.ICreateProductRequest); - /** ExportUserEventsResponse errorSamples. */ - public errorSamples: google.rpc.IStatus[]; + /** CreateProductRequest parent. */ + public parent: string; - /** ExportUserEventsResponse errorsConfig. */ - public errorsConfig?: (google.cloud.retail.v2beta.IExportErrorsConfig|null); + /** CreateProductRequest product. */ + public product?: (google.cloud.retail.v2beta.IProduct|null); + + /** CreateProductRequest productId. */ + public productId: string; /** - * Creates a new ExportUserEventsResponse instance using the specified properties. + * Creates a new CreateProductRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ExportUserEventsResponse instance + * @returns CreateProductRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IExportUserEventsResponse): google.cloud.retail.v2beta.ExportUserEventsResponse; + public static create(properties?: google.cloud.retail.v2beta.ICreateProductRequest): google.cloud.retail.v2beta.CreateProductRequest; /** - * Encodes the specified ExportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ExportUserEventsResponse.verify|verify} messages. - * @param message ExportUserEventsResponse message or plain object to encode + * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.retail.v2beta.CreateProductRequest.verify|verify} messages. + * @param message CreateProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IExportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ExportUserEventsResponse.verify|verify} messages. - * @param message ExportUserEventsResponse message or plain object to encode + * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CreateProductRequest.verify|verify} messages. + * @param message CreateProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IExportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportUserEventsResponse message from the specified reader or buffer. + * Decodes a CreateProductRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportUserEventsResponse + * @returns CreateProductRequest * @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.v2beta.ExportUserEventsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.CreateProductRequest; /** - * Decodes an ExportUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportUserEventsResponse + * @returns CreateProductRequest * @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.v2beta.ExportUserEventsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.CreateProductRequest; /** - * Verifies an ExportUserEventsResponse message. + * Verifies a CreateProductRequest 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 ExportUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateProductRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportUserEventsResponse + * @returns CreateProductRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ExportUserEventsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CreateProductRequest; /** - * Creates a plain object from an ExportUserEventsResponse message. Also converts values to other types if specified. - * @param message ExportUserEventsResponse + * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. + * @param message CreateProductRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.ExportUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.CreateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportUserEventsResponse to JSON. + * Converts this CreateProductRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents a PredictionService */ - class PredictionService extends $protobuf.rpc.Service { - - /** - * Constructs a new PredictionService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new PredictionService service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): PredictionService; - - /** - * Calls Predict. - * @param request PredictRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PredictResponse - */ - public predict(request: google.cloud.retail.v2beta.IPredictRequest, callback: google.cloud.retail.v2beta.PredictionService.PredictCallback): void; - - /** - * Calls Predict. - * @param request PredictRequest message or plain object - * @returns Promise - */ - public predict(request: google.cloud.retail.v2beta.IPredictRequest): Promise; - } - - namespace PredictionService { - - /** - * Callback as used by {@link google.cloud.retail.v2beta.PredictionService#predict}. - * @param error Error, if any - * @param [response] PredictResponse - */ - type PredictCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.PredictResponse) => void; - } - - /** Properties of a PredictRequest. */ - interface IPredictRequest { - - /** PredictRequest placement */ - placement?: (string|null); - - /** PredictRequest userEvent */ - userEvent?: (google.cloud.retail.v2beta.IUserEvent|null); - - /** PredictRequest pageSize */ - pageSize?: (number|null); - - /** PredictRequest pageToken */ - pageToken?: (string|null); - - /** PredictRequest filter */ - filter?: (string|null); - - /** PredictRequest validateOnly */ - validateOnly?: (boolean|null); - - /** PredictRequest params */ - params?: ({ [k: string]: google.protobuf.IValue }|null); + /** Properties of a GetProductRequest. */ + interface IGetProductRequest { - /** PredictRequest labels */ - labels?: ({ [k: string]: string }|null); + /** GetProductRequest name */ + name?: (string|null); } - /** Represents a PredictRequest. */ - class PredictRequest implements IPredictRequest { + /** Represents a GetProductRequest. */ + class GetProductRequest implements IGetProductRequest { /** - * Constructs a new PredictRequest. + * Constructs a new GetProductRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IPredictRequest); - - /** PredictRequest placement. */ - public placement: string; - - /** PredictRequest userEvent. */ - public userEvent?: (google.cloud.retail.v2beta.IUserEvent|null); - - /** PredictRequest pageSize. */ - public pageSize: number; - - /** PredictRequest pageToken. */ - public pageToken: string; - - /** PredictRequest filter. */ - public filter: string; - - /** PredictRequest validateOnly. */ - public validateOnly: boolean; - - /** PredictRequest params. */ - public params: { [k: string]: google.protobuf.IValue }; + constructor(properties?: google.cloud.retail.v2beta.IGetProductRequest); - /** PredictRequest labels. */ - public labels: { [k: string]: string }; + /** GetProductRequest name. */ + public name: string; /** - * Creates a new PredictRequest instance using the specified properties. + * Creates a new GetProductRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PredictRequest instance + * @returns GetProductRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IPredictRequest): google.cloud.retail.v2beta.PredictRequest; + public static create(properties?: google.cloud.retail.v2beta.IGetProductRequest): google.cloud.retail.v2beta.GetProductRequest; /** - * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.retail.v2beta.PredictRequest.verify|verify} messages. - * @param message PredictRequest message or plain object to encode + * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.retail.v2beta.GetProductRequest.verify|verify} messages. + * @param message GetProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PredictRequest.verify|verify} messages. - * @param message PredictRequest message or plain object to encode + * Encodes the specified GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetProductRequest.verify|verify} messages. + * @param message GetProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PredictRequest message from the specified reader or buffer. + * Decodes a GetProductRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PredictRequest + * @returns GetProductRequest * @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.v2beta.PredictRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.GetProductRequest; /** - * Decodes a PredictRequest message from the specified reader or buffer, length delimited. + * Decodes a GetProductRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PredictRequest + * @returns GetProductRequest * @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.v2beta.PredictRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.GetProductRequest; /** - * Verifies a PredictRequest message. + * Verifies a GetProductRequest 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 PredictRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetProductRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PredictRequest + * @returns GetProductRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PredictRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.GetProductRequest; /** - * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. - * @param message PredictRequest + * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. + * @param message GetProductRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.PredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.GetProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PredictRequest to JSON. + * Converts this GetProductRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PredictResponse. */ - interface IPredictResponse { - - /** PredictResponse results */ - results?: (google.cloud.retail.v2beta.PredictResponse.IPredictionResult[]|null); + /** Properties of an UpdateProductRequest. */ + interface IUpdateProductRequest { - /** PredictResponse attributionToken */ - attributionToken?: (string|null); + /** UpdateProductRequest product */ + product?: (google.cloud.retail.v2beta.IProduct|null); - /** PredictResponse missingIds */ - missingIds?: (string[]|null); + /** UpdateProductRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** PredictResponse validateOnly */ - validateOnly?: (boolean|null); + /** UpdateProductRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a PredictResponse. */ - class PredictResponse implements IPredictResponse { + /** Represents an UpdateProductRequest. */ + class UpdateProductRequest implements IUpdateProductRequest { /** - * Constructs a new PredictResponse. + * Constructs a new UpdateProductRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IPredictResponse); - - /** PredictResponse results. */ - public results: google.cloud.retail.v2beta.PredictResponse.IPredictionResult[]; + constructor(properties?: google.cloud.retail.v2beta.IUpdateProductRequest); - /** PredictResponse attributionToken. */ - public attributionToken: string; + /** UpdateProductRequest product. */ + public product?: (google.cloud.retail.v2beta.IProduct|null); - /** PredictResponse missingIds. */ - public missingIds: string[]; + /** UpdateProductRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** PredictResponse validateOnly. */ - public validateOnly: boolean; + /** UpdateProductRequest allowMissing. */ + public allowMissing: boolean; /** - * Creates a new PredictResponse instance using the specified properties. + * Creates a new UpdateProductRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PredictResponse instance + * @returns UpdateProductRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IPredictResponse): google.cloud.retail.v2beta.PredictResponse; + public static create(properties?: google.cloud.retail.v2beta.IUpdateProductRequest): google.cloud.retail.v2beta.UpdateProductRequest; /** - * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.retail.v2beta.PredictResponse.verify|verify} messages. - * @param message PredictResponse message or plain object to encode + * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.retail.v2beta.UpdateProductRequest.verify|verify} messages. + * @param message UpdateProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PredictResponse.verify|verify} messages. - * @param message PredictResponse message or plain object to encode + * Encodes the specified UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UpdateProductRequest.verify|verify} messages. + * @param message UpdateProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PredictResponse message from the specified reader or buffer. + * Decodes an UpdateProductRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PredictResponse + * @returns UpdateProductRequest * @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.v2beta.PredictResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.UpdateProductRequest; /** - * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PredictResponse + * @returns UpdateProductRequest * @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.v2beta.PredictResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.UpdateProductRequest; /** - * Verifies a PredictResponse message. + * Verifies an UpdateProductRequest 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 PredictResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateProductRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PredictResponse + * @returns UpdateProductRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PredictResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UpdateProductRequest; /** - * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. - * @param message PredictResponse + * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. + * @param message UpdateProductRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.PredictResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.UpdateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PredictResponse to JSON. + * Converts this UpdateProductRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace PredictResponse { - - /** Properties of a PredictionResult. */ - interface IPredictionResult { - - /** PredictionResult id */ - id?: (string|null); - - /** PredictionResult metadata */ - metadata?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a PredictionResult. */ - class PredictionResult implements IPredictionResult { - - /** - * Constructs a new PredictionResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.PredictResponse.IPredictionResult); - - /** PredictionResult id. */ - public id: string; - - /** PredictionResult metadata. */ - public metadata: { [k: string]: google.protobuf.IValue }; - - /** - * Creates a new PredictionResult instance using the specified properties. - * @param [properties] Properties to set - * @returns PredictionResult instance - */ - public static create(properties?: google.cloud.retail.v2beta.PredictResponse.IPredictionResult): google.cloud.retail.v2beta.PredictResponse.PredictionResult; - - /** - * Encodes the specified PredictionResult message. Does not implicitly {@link google.cloud.retail.v2beta.PredictResponse.PredictionResult.verify|verify} messages. - * @param message PredictionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.PredictResponse.IPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PredictionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PredictResponse.PredictionResult.verify|verify} messages. - * @param message PredictionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.PredictResponse.IPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PredictionResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PredictionResult - * @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.v2beta.PredictResponse.PredictionResult; - - /** - * Decodes a PredictionResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PredictionResult - * @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.v2beta.PredictResponse.PredictionResult; - - /** - * Verifies a PredictionResult 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 PredictionResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PredictionResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PredictResponse.PredictionResult; - - /** - * Creates a plain object from a PredictionResult message. Also converts values to other types if specified. - * @param message PredictionResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.PredictResponse.PredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of a DeleteProductRequest. */ + interface IDeleteProductRequest { - /** - * Converts this PredictionResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** DeleteProductRequest name */ + name?: (string|null); } - /** Represents a ProductService */ - class ProductService extends $protobuf.rpc.Service { + /** Represents a DeleteProductRequest. */ + class DeleteProductRequest implements IDeleteProductRequest { /** - * Constructs a new ProductService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Constructs a new DeleteProductRequest. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.cloud.retail.v2beta.IDeleteProductRequest); + + /** DeleteProductRequest name. */ + public name: string; /** - * Creates new ProductService service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. + * Creates a new DeleteProductRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProductRequest instance */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ProductService; + public static create(properties?: google.cloud.retail.v2beta.IDeleteProductRequest): google.cloud.retail.v2beta.DeleteProductRequest; /** - * Calls CreateProduct. - * @param request CreateProductRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Product + * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.retail.v2beta.DeleteProductRequest.verify|verify} messages. + * @param message DeleteProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createProduct(request: google.cloud.retail.v2beta.ICreateProductRequest, callback: google.cloud.retail.v2beta.ProductService.CreateProductCallback): void; + public static encode(message: google.cloud.retail.v2beta.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateProduct. - * @param request CreateProductRequest message or plain object - * @returns Promise + * Encodes the specified DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.DeleteProductRequest.verify|verify} messages. + * @param message DeleteProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createProduct(request: google.cloud.retail.v2beta.ICreateProductRequest): Promise; + public static encodeDelimited(message: google.cloud.retail.v2beta.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetProduct. - * @param request GetProductRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Product + * Decodes a DeleteProductRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getProduct(request: google.cloud.retail.v2beta.IGetProductRequest, callback: google.cloud.retail.v2beta.ProductService.GetProductCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.DeleteProductRequest; /** - * Calls GetProduct. - * @param request GetProductRequest message or plain object - * @returns Promise + * Decodes a DeleteProductRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getProduct(request: google.cloud.retail.v2beta.IGetProductRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.DeleteProductRequest; /** - * Calls ListProducts. - * @param request ListProductsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListProductsResponse + * Verifies a DeleteProductRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public listProducts(request: google.cloud.retail.v2beta.IListProductsRequest, callback: google.cloud.retail.v2beta.ProductService.ListProductsCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls ListProducts. - * @param request ListProductsRequest message or plain object - * @returns Promise + * Creates a DeleteProductRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProductRequest */ - public listProducts(request: google.cloud.retail.v2beta.IListProductsRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.DeleteProductRequest; /** - * Calls UpdateProduct. - * @param request UpdateProductRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Product + * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. + * @param message DeleteProductRequest + * @param [options] Conversion options + * @returns Plain object */ - public updateProduct(request: google.cloud.retail.v2beta.IUpdateProductRequest, callback: google.cloud.retail.v2beta.ProductService.UpdateProductCallback): void; + public static toObject(message: google.cloud.retail.v2beta.DeleteProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls UpdateProduct. - * @param request UpdateProductRequest message or plain object - * @returns Promise + * Converts this DeleteProductRequest to JSON. + * @returns JSON object */ - public updateProduct(request: google.cloud.retail.v2beta.IUpdateProductRequest): Promise; + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductsRequest. */ + interface IListProductsRequest { + + /** ListProductsRequest parent */ + parent?: (string|null); + + /** ListProductsRequest pageSize */ + pageSize?: (number|null); + + /** ListProductsRequest pageToken */ + pageToken?: (string|null); + + /** ListProductsRequest filter */ + filter?: (string|null); + + /** ListProductsRequest readMask */ + readMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a ListProductsRequest. */ + class ListProductsRequest implements IListProductsRequest { /** - * Calls DeleteProduct. - * @param request DeleteProductRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Constructs a new ListProductsRequest. + * @param [properties] Properties to set */ - public deleteProduct(request: google.cloud.retail.v2beta.IDeleteProductRequest, callback: google.cloud.retail.v2beta.ProductService.DeleteProductCallback): void; + constructor(properties?: google.cloud.retail.v2beta.IListProductsRequest); + + /** ListProductsRequest parent. */ + public parent: string; + + /** ListProductsRequest pageSize. */ + public pageSize: number; + + /** ListProductsRequest pageToken. */ + public pageToken: string; + + /** ListProductsRequest filter. */ + public filter: string; + + /** ListProductsRequest readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); /** - * Calls DeleteProduct. - * @param request DeleteProductRequest message or plain object - * @returns Promise + * Creates a new ListProductsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductsRequest instance */ - public deleteProduct(request: google.cloud.retail.v2beta.IDeleteProductRequest): Promise; + public static create(properties?: google.cloud.retail.v2beta.IListProductsRequest): google.cloud.retail.v2beta.ListProductsRequest; /** - * Calls ImportProducts. - * @param request ImportProductsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ListProductsRequest.verify|verify} messages. + * @param message ListProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public importProducts(request: google.cloud.retail.v2beta.IImportProductsRequest, callback: google.cloud.retail.v2beta.ProductService.ImportProductsCallback): void; + public static encode(message: google.cloud.retail.v2beta.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ImportProducts. - * @param request ImportProductsRequest message or plain object - * @returns Promise + * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListProductsRequest.verify|verify} messages. + * @param message ListProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public importProducts(request: google.cloud.retail.v2beta.IImportProductsRequest): Promise; + public static encodeDelimited(message: google.cloud.retail.v2beta.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls SetInventory. - * @param request SetInventoryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Decodes a ListProductsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public setInventory(request: google.cloud.retail.v2beta.ISetInventoryRequest, callback: google.cloud.retail.v2beta.ProductService.SetInventoryCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ListProductsRequest; /** - * Calls SetInventory. - * @param request SetInventoryRequest message or plain object - * @returns Promise + * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public setInventory(request: google.cloud.retail.v2beta.ISetInventoryRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ListProductsRequest; /** - * Calls AddFulfillmentPlaces. - * @param request AddFulfillmentPlacesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Verifies a ListProductsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public addFulfillmentPlaces(request: google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest, callback: google.cloud.retail.v2beta.ProductService.AddFulfillmentPlacesCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls AddFulfillmentPlaces. - * @param request AddFulfillmentPlacesRequest message or plain object - * @returns Promise + * Creates a ListProductsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductsRequest */ - public addFulfillmentPlaces(request: google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ListProductsRequest; /** - * Calls RemoveFulfillmentPlaces. - * @param request RemoveFulfillmentPlacesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. + * @param message ListProductsRequest + * @param [options] Conversion options + * @returns Plain object */ - public removeFulfillmentPlaces(request: google.cloud.retail.v2beta.IRemoveFulfillmentPlacesRequest, callback: google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlacesCallback): void; + public static toObject(message: google.cloud.retail.v2beta.ListProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls RemoveFulfillmentPlaces. - * @param request RemoveFulfillmentPlacesRequest message or plain object - * @returns Promise + * Converts this ListProductsRequest to JSON. + * @returns JSON object */ - public removeFulfillmentPlaces(request: google.cloud.retail.v2beta.IRemoveFulfillmentPlacesRequest): Promise; + public toJSON(): { [k: string]: any }; } - namespace ProductService { + /** Properties of a ListProductsResponse. */ + interface IListProductsResponse { + + /** ListProductsResponse products */ + products?: (google.cloud.retail.v2beta.IProduct[]|null); + + /** ListProductsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProductsResponse. */ + class ListProductsResponse implements IListProductsResponse { /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#createProduct}. - * @param error Error, if any - * @param [response] Product + * Constructs a new ListProductsResponse. + * @param [properties] Properties to set */ - type CreateProductCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.Product) => void; + constructor(properties?: google.cloud.retail.v2beta.IListProductsResponse); + + /** ListProductsResponse products. */ + public products: google.cloud.retail.v2beta.IProduct[]; + + /** ListProductsResponse nextPageToken. */ + public nextPageToken: string; /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#getProduct}. - * @param error Error, if any - * @param [response] Product + * Creates a new ListProductsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductsResponse instance */ - type GetProductCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.Product) => void; + public static create(properties?: google.cloud.retail.v2beta.IListProductsResponse): google.cloud.retail.v2beta.ListProductsResponse; /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#listProducts}. - * @param error Error, if any - * @param [response] ListProductsResponse + * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ListProductsResponse.verify|verify} messages. + * @param message ListProductsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type ListProductsCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.ListProductsResponse) => void; + public static encode(message: google.cloud.retail.v2beta.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#updateProduct}. - * @param error Error, if any - * @param [response] Product + * Encodes the specified ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListProductsResponse.verify|verify} messages. + * @param message ListProductsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type UpdateProductCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.Product) => void; + public static encodeDelimited(message: google.cloud.retail.v2beta.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#deleteProduct}. - * @param error Error, if any - * @param [response] Empty + * Decodes a ListProductsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type DeleteProductCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ListProductsResponse; /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#importProducts}. - * @param error Error, if any - * @param [response] Operation + * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type ImportProductsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ListProductsResponse; /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#setInventory}. - * @param error Error, if any - * @param [response] Operation + * Verifies a ListProductsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type SetInventoryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#addFulfillmentPlaces}. - * @param error Error, if any - * @param [response] Operation + * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ListProductsResponse; + + /** + * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. + * @param message ListProductsResponse + * @param [options] Conversion options + * @returns Plain object */ - type AddFulfillmentPlacesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static toObject(message: google.cloud.retail.v2beta.ListProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#removeFulfillmentPlaces}. - * @param error Error, if any - * @param [response] Operation + * Converts this ListProductsResponse to JSON. + * @returns JSON object */ - type RemoveFulfillmentPlacesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public toJSON(): { [k: string]: any }; } - /** Properties of a CreateProductRequest. */ - interface ICreateProductRequest { + /** Properties of a SetInventoryRequest. */ + interface ISetInventoryRequest { - /** CreateProductRequest parent */ - parent?: (string|null); + /** SetInventoryRequest inventory */ + inventory?: (google.cloud.retail.v2beta.IProduct|null); - /** CreateProductRequest product */ - product?: (google.cloud.retail.v2beta.IProduct|null); + /** SetInventoryRequest setMask */ + setMask?: (google.protobuf.IFieldMask|null); - /** CreateProductRequest productId */ - productId?: (string|null); + /** SetInventoryRequest setTime */ + setTime?: (google.protobuf.ITimestamp|null); + + /** SetInventoryRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a CreateProductRequest. */ - class CreateProductRequest implements ICreateProductRequest { + /** Represents a SetInventoryRequest. */ + class SetInventoryRequest implements ISetInventoryRequest { /** - * Constructs a new CreateProductRequest. + * Constructs a new SetInventoryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.ICreateProductRequest); + constructor(properties?: google.cloud.retail.v2beta.ISetInventoryRequest); - /** CreateProductRequest parent. */ - public parent: string; + /** SetInventoryRequest inventory. */ + public inventory?: (google.cloud.retail.v2beta.IProduct|null); - /** CreateProductRequest product. */ - public product?: (google.cloud.retail.v2beta.IProduct|null); + /** SetInventoryRequest setMask. */ + public setMask?: (google.protobuf.IFieldMask|null); - /** CreateProductRequest productId. */ - public productId: string; + /** SetInventoryRequest setTime. */ + public setTime?: (google.protobuf.ITimestamp|null); + + /** SetInventoryRequest allowMissing. */ + public allowMissing: boolean; /** - * Creates a new CreateProductRequest instance using the specified properties. + * Creates a new SetInventoryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateProductRequest instance + * @returns SetInventoryRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.ICreateProductRequest): google.cloud.retail.v2beta.CreateProductRequest; + public static create(properties?: google.cloud.retail.v2beta.ISetInventoryRequest): google.cloud.retail.v2beta.SetInventoryRequest; /** - * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.retail.v2beta.CreateProductRequest.verify|verify} messages. - * @param message CreateProductRequest message or plain object to encode + * Encodes the specified SetInventoryRequest message. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryRequest.verify|verify} messages. + * @param message SetInventoryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.ISetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CreateProductRequest.verify|verify} messages. - * @param message CreateProductRequest message or plain object to encode + * Encodes the specified SetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryRequest.verify|verify} messages. + * @param message SetInventoryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.ISetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateProductRequest message from the specified reader or buffer. + * Decodes a SetInventoryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateProductRequest + * @returns SetInventoryRequest * @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.v2beta.CreateProductRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.SetInventoryRequest; /** - * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. + * Decodes a SetInventoryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateProductRequest + * @returns SetInventoryRequest * @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.v2beta.CreateProductRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.SetInventoryRequest; /** - * Verifies a CreateProductRequest message. + * Verifies a SetInventoryRequest 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 CreateProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SetInventoryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateProductRequest + * @returns SetInventoryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CreateProductRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SetInventoryRequest; /** - * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. - * @param message CreateProductRequest + * Creates a plain object from a SetInventoryRequest message. Also converts values to other types if specified. + * @param message SetInventoryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.CreateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.SetInventoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateProductRequest to JSON. + * Converts this SetInventoryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetProductRequest. */ - interface IGetProductRequest { - - /** GetProductRequest name */ - name?: (string|null); + /** Properties of a SetInventoryMetadata. */ + interface ISetInventoryMetadata { } - /** Represents a GetProductRequest. */ - class GetProductRequest implements IGetProductRequest { + /** Represents a SetInventoryMetadata. */ + class SetInventoryMetadata implements ISetInventoryMetadata { /** - * Constructs a new GetProductRequest. + * Constructs a new SetInventoryMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IGetProductRequest); - - /** GetProductRequest name. */ - public name: string; + constructor(properties?: google.cloud.retail.v2beta.ISetInventoryMetadata); /** - * Creates a new GetProductRequest instance using the specified properties. + * Creates a new SetInventoryMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns GetProductRequest instance + * @returns SetInventoryMetadata instance */ - public static create(properties?: google.cloud.retail.v2beta.IGetProductRequest): google.cloud.retail.v2beta.GetProductRequest; + public static create(properties?: google.cloud.retail.v2beta.ISetInventoryMetadata): google.cloud.retail.v2beta.SetInventoryMetadata; /** - * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.retail.v2beta.GetProductRequest.verify|verify} messages. - * @param message GetProductRequest message or plain object to encode + * Encodes the specified SetInventoryMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryMetadata.verify|verify} messages. + * @param message SetInventoryMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.ISetInventoryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetProductRequest.verify|verify} messages. - * @param message GetProductRequest message or plain object to encode + * Encodes the specified SetInventoryMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryMetadata.verify|verify} messages. + * @param message SetInventoryMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.ISetInventoryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetProductRequest message from the specified reader or buffer. + * Decodes a SetInventoryMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetProductRequest + * @returns SetInventoryMetadata * @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.v2beta.GetProductRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.SetInventoryMetadata; /** - * Decodes a GetProductRequest message from the specified reader or buffer, length delimited. + * Decodes a SetInventoryMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetProductRequest + * @returns SetInventoryMetadata * @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.v2beta.GetProductRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.SetInventoryMetadata; /** - * Verifies a GetProductRequest message. + * Verifies a SetInventoryMetadata 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 GetProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SetInventoryMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetProductRequest + * @returns SetInventoryMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.GetProductRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SetInventoryMetadata; /** - * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. - * @param message GetProductRequest + * Creates a plain object from a SetInventoryMetadata message. Also converts values to other types if specified. + * @param message SetInventoryMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.GetProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.SetInventoryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetProductRequest to JSON. + * Converts this SetInventoryMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateProductRequest. */ - interface IUpdateProductRequest { - - /** UpdateProductRequest product */ - product?: (google.cloud.retail.v2beta.IProduct|null); - - /** UpdateProductRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateProductRequest allowMissing */ - allowMissing?: (boolean|null); + /** Properties of a SetInventoryResponse. */ + interface ISetInventoryResponse { } - /** Represents an UpdateProductRequest. */ - class UpdateProductRequest implements IUpdateProductRequest { + /** Represents a SetInventoryResponse. */ + class SetInventoryResponse implements ISetInventoryResponse { /** - * Constructs a new UpdateProductRequest. + * Constructs a new SetInventoryResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IUpdateProductRequest); - - /** UpdateProductRequest product. */ - public product?: (google.cloud.retail.v2beta.IProduct|null); - - /** UpdateProductRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateProductRequest allowMissing. */ - public allowMissing: boolean; + constructor(properties?: google.cloud.retail.v2beta.ISetInventoryResponse); /** - * Creates a new UpdateProductRequest instance using the specified properties. + * Creates a new SetInventoryResponse instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateProductRequest instance + * @returns SetInventoryResponse instance */ - public static create(properties?: google.cloud.retail.v2beta.IUpdateProductRequest): google.cloud.retail.v2beta.UpdateProductRequest; + public static create(properties?: google.cloud.retail.v2beta.ISetInventoryResponse): google.cloud.retail.v2beta.SetInventoryResponse; /** - * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.retail.v2beta.UpdateProductRequest.verify|verify} messages. - * @param message UpdateProductRequest message or plain object to encode + * Encodes the specified SetInventoryResponse message. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryResponse.verify|verify} messages. + * @param message SetInventoryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.ISetInventoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UpdateProductRequest.verify|verify} messages. - * @param message UpdateProductRequest message or plain object to encode + * Encodes the specified SetInventoryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryResponse.verify|verify} messages. + * @param message SetInventoryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.ISetInventoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateProductRequest message from the specified reader or buffer. + * Decodes a SetInventoryResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateProductRequest + * @returns SetInventoryResponse * @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.v2beta.UpdateProductRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.SetInventoryResponse; /** - * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. + * Decodes a SetInventoryResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateProductRequest + * @returns SetInventoryResponse * @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.v2beta.UpdateProductRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.SetInventoryResponse; /** - * Verifies an UpdateProductRequest message. + * Verifies a SetInventoryResponse 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 UpdateProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SetInventoryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateProductRequest + * @returns SetInventoryResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UpdateProductRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SetInventoryResponse; /** - * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. - * @param message UpdateProductRequest + * Creates a plain object from a SetInventoryResponse message. Also converts values to other types if specified. + * @param message SetInventoryResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.UpdateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.SetInventoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateProductRequest to JSON. + * Converts this SetInventoryResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteProductRequest. */ - interface IDeleteProductRequest { + /** Properties of an AddFulfillmentPlacesRequest. */ + interface IAddFulfillmentPlacesRequest { + + /** AddFulfillmentPlacesRequest product */ + product?: (string|null); + + /** AddFulfillmentPlacesRequest type */ + type?: (string|null); + + /** AddFulfillmentPlacesRequest placeIds */ + placeIds?: (string[]|null); + + /** AddFulfillmentPlacesRequest addTime */ + addTime?: (google.protobuf.ITimestamp|null); - /** DeleteProductRequest name */ - name?: (string|null); + /** AddFulfillmentPlacesRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a DeleteProductRequest. */ - class DeleteProductRequest implements IDeleteProductRequest { + /** Represents an AddFulfillmentPlacesRequest. */ + class AddFulfillmentPlacesRequest implements IAddFulfillmentPlacesRequest { /** - * Constructs a new DeleteProductRequest. + * Constructs a new AddFulfillmentPlacesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IDeleteProductRequest); + constructor(properties?: google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest); - /** DeleteProductRequest name. */ - public name: string; + /** AddFulfillmentPlacesRequest product. */ + public product: string; + + /** AddFulfillmentPlacesRequest type. */ + public type: string; + + /** AddFulfillmentPlacesRequest placeIds. */ + public placeIds: string[]; + + /** AddFulfillmentPlacesRequest addTime. */ + public addTime?: (google.protobuf.ITimestamp|null); + + /** AddFulfillmentPlacesRequest allowMissing. */ + public allowMissing: boolean; /** - * Creates a new DeleteProductRequest instance using the specified properties. + * Creates a new AddFulfillmentPlacesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteProductRequest instance + * @returns AddFulfillmentPlacesRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IDeleteProductRequest): google.cloud.retail.v2beta.DeleteProductRequest; + public static create(properties?: google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest): google.cloud.retail.v2beta.AddFulfillmentPlacesRequest; /** - * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.retail.v2beta.DeleteProductRequest.verify|verify} messages. - * @param message DeleteProductRequest message or plain object to encode + * Encodes the specified AddFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.verify|verify} messages. + * @param message AddFulfillmentPlacesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.DeleteProductRequest.verify|verify} messages. - * @param message DeleteProductRequest message or plain object to encode + * Encodes the specified AddFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.verify|verify} messages. + * @param message AddFulfillmentPlacesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteProductRequest message from the specified reader or buffer. + * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteProductRequest + * @returns AddFulfillmentPlacesRequest * @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.v2beta.DeleteProductRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.AddFulfillmentPlacesRequest; /** - * Decodes a DeleteProductRequest message from the specified reader or buffer, length delimited. + * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteProductRequest + * @returns AddFulfillmentPlacesRequest * @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.v2beta.DeleteProductRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.AddFulfillmentPlacesRequest; /** - * Verifies a DeleteProductRequest message. + * Verifies an AddFulfillmentPlacesRequest 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 DeleteProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AddFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteProductRequest + * @returns AddFulfillmentPlacesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.DeleteProductRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.AddFulfillmentPlacesRequest; /** - * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. - * @param message DeleteProductRequest + * Creates a plain object from an AddFulfillmentPlacesRequest message. Also converts values to other types if specified. + * @param message AddFulfillmentPlacesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.DeleteProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.AddFulfillmentPlacesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteProductRequest to JSON. + * Converts this AddFulfillmentPlacesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListProductsRequest. */ - interface IListProductsRequest { - - /** ListProductsRequest parent */ - parent?: (string|null); - - /** ListProductsRequest pageSize */ - pageSize?: (number|null); - - /** ListProductsRequest pageToken */ - pageToken?: (string|null); - - /** ListProductsRequest filter */ - filter?: (string|null); - - /** ListProductsRequest readMask */ - readMask?: (google.protobuf.IFieldMask|null); + /** Properties of an AddFulfillmentPlacesMetadata. */ + interface IAddFulfillmentPlacesMetadata { } - /** Represents a ListProductsRequest. */ - class ListProductsRequest implements IListProductsRequest { + /** Represents an AddFulfillmentPlacesMetadata. */ + class AddFulfillmentPlacesMetadata implements IAddFulfillmentPlacesMetadata { /** - * Constructs a new ListProductsRequest. + * Constructs a new AddFulfillmentPlacesMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IListProductsRequest); - - /** ListProductsRequest parent. */ - public parent: string; - - /** ListProductsRequest pageSize. */ - public pageSize: number; - - /** ListProductsRequest pageToken. */ - public pageToken: string; - - /** ListProductsRequest filter. */ - public filter: string; - - /** ListProductsRequest readMask. */ - public readMask?: (google.protobuf.IFieldMask|null); + constructor(properties?: google.cloud.retail.v2beta.IAddFulfillmentPlacesMetadata); /** - * Creates a new ListProductsRequest instance using the specified properties. + * Creates a new AddFulfillmentPlacesMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns ListProductsRequest instance + * @returns AddFulfillmentPlacesMetadata instance */ - public static create(properties?: google.cloud.retail.v2beta.IListProductsRequest): google.cloud.retail.v2beta.ListProductsRequest; + public static create(properties?: google.cloud.retail.v2beta.IAddFulfillmentPlacesMetadata): google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata; /** - * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ListProductsRequest.verify|verify} messages. - * @param message ListProductsRequest message or plain object to encode + * Encodes the specified AddFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata.verify|verify} messages. + * @param message AddFulfillmentPlacesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IAddFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListProductsRequest.verify|verify} messages. - * @param message ListProductsRequest message or plain object to encode + * Encodes the specified AddFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata.verify|verify} messages. + * @param message AddFulfillmentPlacesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IAddFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListProductsRequest message from the specified reader or buffer. + * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListProductsRequest + * @returns AddFulfillmentPlacesMetadata * @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.v2beta.ListProductsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata; /** - * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. + * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListProductsRequest + * @returns AddFulfillmentPlacesMetadata * @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.v2beta.ListProductsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata; /** - * Verifies a ListProductsRequest message. + * Verifies an AddFulfillmentPlacesMetadata 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 ListProductsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AddFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListProductsRequest + * @returns AddFulfillmentPlacesMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ListProductsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata; /** - * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. - * @param message ListProductsRequest + * Creates a plain object from an AddFulfillmentPlacesMetadata message. Also converts values to other types if specified. + * @param message AddFulfillmentPlacesMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.ListProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListProductsRequest to JSON. + * Converts this AddFulfillmentPlacesMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListProductsResponse. */ - interface IListProductsResponse { - - /** ListProductsResponse products */ - products?: (google.cloud.retail.v2beta.IProduct[]|null); - - /** ListProductsResponse nextPageToken */ - nextPageToken?: (string|null); + /** Properties of an AddFulfillmentPlacesResponse. */ + interface IAddFulfillmentPlacesResponse { } - /** Represents a ListProductsResponse. */ - class ListProductsResponse implements IListProductsResponse { + /** Represents an AddFulfillmentPlacesResponse. */ + class AddFulfillmentPlacesResponse implements IAddFulfillmentPlacesResponse { /** - * Constructs a new ListProductsResponse. + * Constructs a new AddFulfillmentPlacesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IListProductsResponse); - - /** ListProductsResponse products. */ - public products: google.cloud.retail.v2beta.IProduct[]; - - /** ListProductsResponse nextPageToken. */ - public nextPageToken: string; + constructor(properties?: google.cloud.retail.v2beta.IAddFulfillmentPlacesResponse); /** - * Creates a new ListProductsResponse instance using the specified properties. + * Creates a new AddFulfillmentPlacesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListProductsResponse instance + * @returns AddFulfillmentPlacesResponse instance */ - public static create(properties?: google.cloud.retail.v2beta.IListProductsResponse): google.cloud.retail.v2beta.ListProductsResponse; + public static create(properties?: google.cloud.retail.v2beta.IAddFulfillmentPlacesResponse): google.cloud.retail.v2beta.AddFulfillmentPlacesResponse; /** - * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ListProductsResponse.verify|verify} messages. - * @param message ListProductsResponse message or plain object to encode + * Encodes the specified AddFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesResponse.verify|verify} messages. + * @param message AddFulfillmentPlacesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IAddFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListProductsResponse.verify|verify} messages. - * @param message ListProductsResponse message or plain object to encode + * Encodes the specified AddFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesResponse.verify|verify} messages. + * @param message AddFulfillmentPlacesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IAddFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListProductsResponse message from the specified reader or buffer. + * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListProductsResponse + * @returns AddFulfillmentPlacesResponse * @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.v2beta.ListProductsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.AddFulfillmentPlacesResponse; /** - * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. + * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListProductsResponse + * @returns AddFulfillmentPlacesResponse * @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.v2beta.ListProductsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.AddFulfillmentPlacesResponse; /** - * Verifies a ListProductsResponse message. + * Verifies an AddFulfillmentPlacesResponse 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 ListProductsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AddFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListProductsResponse + * @returns AddFulfillmentPlacesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ListProductsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.AddFulfillmentPlacesResponse; /** - * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. - * @param message ListProductsResponse + * Creates a plain object from an AddFulfillmentPlacesResponse message. Also converts values to other types if specified. + * @param message AddFulfillmentPlacesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.ListProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.AddFulfillmentPlacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListProductsResponse to JSON. + * Converts this AddFulfillmentPlacesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SetInventoryRequest. */ - interface ISetInventoryRequest { + /** Properties of an AddLocalInventoriesRequest. */ + interface IAddLocalInventoriesRequest { - /** SetInventoryRequest inventory */ - inventory?: (google.cloud.retail.v2beta.IProduct|null); + /** AddLocalInventoriesRequest product */ + product?: (string|null); - /** SetInventoryRequest setMask */ - setMask?: (google.protobuf.IFieldMask|null); + /** AddLocalInventoriesRequest localInventories */ + localInventories?: (google.cloud.retail.v2beta.ILocalInventory[]|null); - /** SetInventoryRequest setTime */ - setTime?: (google.protobuf.ITimestamp|null); + /** AddLocalInventoriesRequest addMask */ + addMask?: (google.protobuf.IFieldMask|null); - /** SetInventoryRequest allowMissing */ + /** AddLocalInventoriesRequest addTime */ + addTime?: (google.protobuf.ITimestamp|null); + + /** AddLocalInventoriesRequest allowMissing */ allowMissing?: (boolean|null); } - /** Represents a SetInventoryRequest. */ - class SetInventoryRequest implements ISetInventoryRequest { + /** Represents an AddLocalInventoriesRequest. */ + class AddLocalInventoriesRequest implements IAddLocalInventoriesRequest { /** - * Constructs a new SetInventoryRequest. + * Constructs a new AddLocalInventoriesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.ISetInventoryRequest); + constructor(properties?: google.cloud.retail.v2beta.IAddLocalInventoriesRequest); - /** SetInventoryRequest inventory. */ - public inventory?: (google.cloud.retail.v2beta.IProduct|null); + /** AddLocalInventoriesRequest product. */ + public product: string; - /** SetInventoryRequest setMask. */ - public setMask?: (google.protobuf.IFieldMask|null); + /** AddLocalInventoriesRequest localInventories. */ + public localInventories: google.cloud.retail.v2beta.ILocalInventory[]; - /** SetInventoryRequest setTime. */ - public setTime?: (google.protobuf.ITimestamp|null); + /** AddLocalInventoriesRequest addMask. */ + public addMask?: (google.protobuf.IFieldMask|null); - /** SetInventoryRequest allowMissing. */ + /** AddLocalInventoriesRequest addTime. */ + public addTime?: (google.protobuf.ITimestamp|null); + + /** AddLocalInventoriesRequest allowMissing. */ public allowMissing: boolean; /** - * Creates a new SetInventoryRequest instance using the specified properties. + * Creates a new AddLocalInventoriesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SetInventoryRequest instance + * @returns AddLocalInventoriesRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.ISetInventoryRequest): google.cloud.retail.v2beta.SetInventoryRequest; + public static create(properties?: google.cloud.retail.v2beta.IAddLocalInventoriesRequest): google.cloud.retail.v2beta.AddLocalInventoriesRequest; /** - * Encodes the specified SetInventoryRequest message. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryRequest.verify|verify} messages. - * @param message SetInventoryRequest message or plain object to encode + * Encodes the specified AddLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2beta.AddLocalInventoriesRequest.verify|verify} messages. + * @param message AddLocalInventoriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.ISetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IAddLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryRequest.verify|verify} messages. - * @param message SetInventoryRequest message or plain object to encode + * Encodes the specified AddLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddLocalInventoriesRequest.verify|verify} messages. + * @param message AddLocalInventoriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.ISetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IAddLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SetInventoryRequest message from the specified reader or buffer. + * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SetInventoryRequest + * @returns AddLocalInventoriesRequest * @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.v2beta.SetInventoryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.AddLocalInventoriesRequest; /** - * Decodes a SetInventoryRequest message from the specified reader or buffer, length delimited. + * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SetInventoryRequest + * @returns AddLocalInventoriesRequest * @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.v2beta.SetInventoryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.AddLocalInventoriesRequest; /** - * Verifies a SetInventoryRequest message. + * Verifies an AddLocalInventoriesRequest 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 SetInventoryRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AddLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SetInventoryRequest + * @returns AddLocalInventoriesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SetInventoryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.AddLocalInventoriesRequest; /** - * Creates a plain object from a SetInventoryRequest message. Also converts values to other types if specified. - * @param message SetInventoryRequest + * Creates a plain object from an AddLocalInventoriesRequest message. Also converts values to other types if specified. + * @param message AddLocalInventoriesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.SetInventoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.AddLocalInventoriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SetInventoryRequest to JSON. + * Converts this AddLocalInventoriesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SetInventoryMetadata. */ - interface ISetInventoryMetadata { + /** Properties of an AddLocalInventoriesMetadata. */ + interface IAddLocalInventoriesMetadata { } - /** Represents a SetInventoryMetadata. */ - class SetInventoryMetadata implements ISetInventoryMetadata { + /** Represents an AddLocalInventoriesMetadata. */ + class AddLocalInventoriesMetadata implements IAddLocalInventoriesMetadata { /** - * Constructs a new SetInventoryMetadata. + * Constructs a new AddLocalInventoriesMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.ISetInventoryMetadata); + constructor(properties?: google.cloud.retail.v2beta.IAddLocalInventoriesMetadata); /** - * Creates a new SetInventoryMetadata instance using the specified properties. + * Creates a new AddLocalInventoriesMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns SetInventoryMetadata instance + * @returns AddLocalInventoriesMetadata instance */ - public static create(properties?: google.cloud.retail.v2beta.ISetInventoryMetadata): google.cloud.retail.v2beta.SetInventoryMetadata; + public static create(properties?: google.cloud.retail.v2beta.IAddLocalInventoriesMetadata): google.cloud.retail.v2beta.AddLocalInventoriesMetadata; /** - * Encodes the specified SetInventoryMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryMetadata.verify|verify} messages. - * @param message SetInventoryMetadata message or plain object to encode + * Encodes the specified AddLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.AddLocalInventoriesMetadata.verify|verify} messages. + * @param message AddLocalInventoriesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.ISetInventoryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IAddLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SetInventoryMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryMetadata.verify|verify} messages. - * @param message SetInventoryMetadata message or plain object to encode + * Encodes the specified AddLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddLocalInventoriesMetadata.verify|verify} messages. + * @param message AddLocalInventoriesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.ISetInventoryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IAddLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SetInventoryMetadata message from the specified reader or buffer. + * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SetInventoryMetadata + * @returns AddLocalInventoriesMetadata * @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.v2beta.SetInventoryMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.AddLocalInventoriesMetadata; /** - * Decodes a SetInventoryMetadata message from the specified reader or buffer, length delimited. + * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SetInventoryMetadata + * @returns AddLocalInventoriesMetadata * @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.v2beta.SetInventoryMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.AddLocalInventoriesMetadata; /** - * Verifies a SetInventoryMetadata message. + * Verifies an AddLocalInventoriesMetadata 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 SetInventoryMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an AddLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SetInventoryMetadata + * @returns AddLocalInventoriesMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SetInventoryMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.AddLocalInventoriesMetadata; /** - * Creates a plain object from a SetInventoryMetadata message. Also converts values to other types if specified. - * @param message SetInventoryMetadata + * Creates a plain object from an AddLocalInventoriesMetadata message. Also converts values to other types if specified. + * @param message AddLocalInventoriesMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.SetInventoryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.AddLocalInventoriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SetInventoryMetadata to JSON. + * Converts this AddLocalInventoriesMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SetInventoryResponse. */ - interface ISetInventoryResponse { + /** Properties of an AddLocalInventoriesResponse. */ + interface IAddLocalInventoriesResponse { } - /** Represents a SetInventoryResponse. */ - class SetInventoryResponse implements ISetInventoryResponse { + /** Represents an AddLocalInventoriesResponse. */ + class AddLocalInventoriesResponse implements IAddLocalInventoriesResponse { /** - * Constructs a new SetInventoryResponse. + * Constructs a new AddLocalInventoriesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.ISetInventoryResponse); + constructor(properties?: google.cloud.retail.v2beta.IAddLocalInventoriesResponse); /** - * Creates a new SetInventoryResponse instance using the specified properties. + * Creates a new AddLocalInventoriesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns SetInventoryResponse instance + * @returns AddLocalInventoriesResponse instance */ - public static create(properties?: google.cloud.retail.v2beta.ISetInventoryResponse): google.cloud.retail.v2beta.SetInventoryResponse; + public static create(properties?: google.cloud.retail.v2beta.IAddLocalInventoriesResponse): google.cloud.retail.v2beta.AddLocalInventoriesResponse; /** - * Encodes the specified SetInventoryResponse message. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryResponse.verify|verify} messages. - * @param message SetInventoryResponse message or plain object to encode + * Encodes the specified AddLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2beta.AddLocalInventoriesResponse.verify|verify} messages. + * @param message AddLocalInventoriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.ISetInventoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IAddLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SetInventoryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryResponse.verify|verify} messages. - * @param message SetInventoryResponse message or plain object to encode + * Encodes the specified AddLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddLocalInventoriesResponse.verify|verify} messages. + * @param message AddLocalInventoriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.ISetInventoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IAddLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SetInventoryResponse message from the specified reader or buffer. + * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SetInventoryResponse + * @returns AddLocalInventoriesResponse * @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.v2beta.SetInventoryResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.AddLocalInventoriesResponse; /** - * Decodes a SetInventoryResponse message from the specified reader or buffer, length delimited. + * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SetInventoryResponse + * @returns AddLocalInventoriesResponse * @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.v2beta.SetInventoryResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.AddLocalInventoriesResponse; /** - * Verifies a SetInventoryResponse message. + * Verifies an AddLocalInventoriesResponse 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 SetInventoryResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AddLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SetInventoryResponse + * @returns AddLocalInventoriesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SetInventoryResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.AddLocalInventoriesResponse; /** - * Creates a plain object from a SetInventoryResponse message. Also converts values to other types if specified. - * @param message SetInventoryResponse + * Creates a plain object from an AddLocalInventoriesResponse message. Also converts values to other types if specified. + * @param message AddLocalInventoriesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.SetInventoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.AddLocalInventoriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SetInventoryResponse to JSON. + * Converts this AddLocalInventoriesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AddFulfillmentPlacesRequest. */ - interface IAddFulfillmentPlacesRequest { + /** Properties of a RemoveLocalInventoriesRequest. */ + interface IRemoveLocalInventoriesRequest { - /** AddFulfillmentPlacesRequest product */ + /** RemoveLocalInventoriesRequest product */ product?: (string|null); - /** AddFulfillmentPlacesRequest type */ - type?: (string|null); - - /** AddFulfillmentPlacesRequest placeIds */ + /** RemoveLocalInventoriesRequest placeIds */ placeIds?: (string[]|null); - /** AddFulfillmentPlacesRequest addTime */ - addTime?: (google.protobuf.ITimestamp|null); + /** RemoveLocalInventoriesRequest removeTime */ + removeTime?: (google.protobuf.ITimestamp|null); - /** AddFulfillmentPlacesRequest allowMissing */ + /** RemoveLocalInventoriesRequest allowMissing */ allowMissing?: (boolean|null); } - /** Represents an AddFulfillmentPlacesRequest. */ - class AddFulfillmentPlacesRequest implements IAddFulfillmentPlacesRequest { + /** Represents a RemoveLocalInventoriesRequest. */ + class RemoveLocalInventoriesRequest implements IRemoveLocalInventoriesRequest { /** - * Constructs a new AddFulfillmentPlacesRequest. + * Constructs a new RemoveLocalInventoriesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest); + constructor(properties?: google.cloud.retail.v2beta.IRemoveLocalInventoriesRequest); - /** AddFulfillmentPlacesRequest product. */ + /** RemoveLocalInventoriesRequest product. */ public product: string; - /** AddFulfillmentPlacesRequest type. */ - public type: string; - - /** AddFulfillmentPlacesRequest placeIds. */ + /** RemoveLocalInventoriesRequest placeIds. */ public placeIds: string[]; - /** AddFulfillmentPlacesRequest addTime. */ - public addTime?: (google.protobuf.ITimestamp|null); + /** RemoveLocalInventoriesRequest removeTime. */ + public removeTime?: (google.protobuf.ITimestamp|null); - /** AddFulfillmentPlacesRequest allowMissing. */ + /** RemoveLocalInventoriesRequest allowMissing. */ public allowMissing: boolean; /** - * Creates a new AddFulfillmentPlacesRequest instance using the specified properties. + * Creates a new RemoveLocalInventoriesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns AddFulfillmentPlacesRequest instance + * @returns RemoveLocalInventoriesRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest): google.cloud.retail.v2beta.AddFulfillmentPlacesRequest; + public static create(properties?: google.cloud.retail.v2beta.IRemoveLocalInventoriesRequest): google.cloud.retail.v2beta.RemoveLocalInventoriesRequest; /** - * Encodes the specified AddFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.verify|verify} messages. - * @param message AddFulfillmentPlacesRequest message or plain object to encode + * Encodes the specified RemoveLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2beta.RemoveLocalInventoriesRequest.verify|verify} messages. + * @param message RemoveLocalInventoriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IRemoveLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AddFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.verify|verify} messages. - * @param message AddFulfillmentPlacesRequest message or plain object to encode + * Encodes the specified RemoveLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.RemoveLocalInventoriesRequest.verify|verify} messages. + * @param message RemoveLocalInventoriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IRemoveLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AddFulfillmentPlacesRequest + * @returns RemoveLocalInventoriesRequest * @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.v2beta.AddFulfillmentPlacesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.RemoveLocalInventoriesRequest; /** - * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AddFulfillmentPlacesRequest + * @returns RemoveLocalInventoriesRequest * @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.v2beta.AddFulfillmentPlacesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.RemoveLocalInventoriesRequest; /** - * Verifies an AddFulfillmentPlacesRequest message. + * Verifies a RemoveLocalInventoriesRequest 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 AddFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AddFulfillmentPlacesRequest + * @returns RemoveLocalInventoriesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.AddFulfillmentPlacesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.RemoveLocalInventoriesRequest; /** - * Creates a plain object from an AddFulfillmentPlacesRequest message. Also converts values to other types if specified. - * @param message AddFulfillmentPlacesRequest + * Creates a plain object from a RemoveLocalInventoriesRequest message. Also converts values to other types if specified. + * @param message RemoveLocalInventoriesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.AddFulfillmentPlacesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.RemoveLocalInventoriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AddFulfillmentPlacesRequest to JSON. + * Converts this RemoveLocalInventoriesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AddFulfillmentPlacesMetadata. */ - interface IAddFulfillmentPlacesMetadata { + /** Properties of a RemoveLocalInventoriesMetadata. */ + interface IRemoveLocalInventoriesMetadata { } - /** Represents an AddFulfillmentPlacesMetadata. */ - class AddFulfillmentPlacesMetadata implements IAddFulfillmentPlacesMetadata { + /** Represents a RemoveLocalInventoriesMetadata. */ + class RemoveLocalInventoriesMetadata implements IRemoveLocalInventoriesMetadata { /** - * Constructs a new AddFulfillmentPlacesMetadata. + * Constructs a new RemoveLocalInventoriesMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IAddFulfillmentPlacesMetadata); + constructor(properties?: google.cloud.retail.v2beta.IRemoveLocalInventoriesMetadata); /** - * Creates a new AddFulfillmentPlacesMetadata instance using the specified properties. + * Creates a new RemoveLocalInventoriesMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns AddFulfillmentPlacesMetadata instance + * @returns RemoveLocalInventoriesMetadata instance */ - public static create(properties?: google.cloud.retail.v2beta.IAddFulfillmentPlacesMetadata): google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata; + public static create(properties?: google.cloud.retail.v2beta.IRemoveLocalInventoriesMetadata): google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata; /** - * Encodes the specified AddFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata.verify|verify} messages. - * @param message AddFulfillmentPlacesMetadata message or plain object to encode + * Encodes the specified RemoveLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata.verify|verify} messages. + * @param message RemoveLocalInventoriesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IAddFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IRemoveLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AddFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata.verify|verify} messages. - * @param message AddFulfillmentPlacesMetadata message or plain object to encode + * Encodes the specified RemoveLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata.verify|verify} messages. + * @param message RemoveLocalInventoriesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IAddFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IRemoveLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AddFulfillmentPlacesMetadata + * @returns RemoveLocalInventoriesMetadata * @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.v2beta.AddFulfillmentPlacesMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata; /** - * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AddFulfillmentPlacesMetadata + * @returns RemoveLocalInventoriesMetadata * @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.v2beta.AddFulfillmentPlacesMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata; /** - * Verifies an AddFulfillmentPlacesMetadata message. + * Verifies a RemoveLocalInventoriesMetadata 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 AddFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AddFulfillmentPlacesMetadata + * @returns RemoveLocalInventoriesMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata; /** - * Creates a plain object from an AddFulfillmentPlacesMetadata message. Also converts values to other types if specified. - * @param message AddFulfillmentPlacesMetadata + * Creates a plain object from a RemoveLocalInventoriesMetadata message. Also converts values to other types if specified. + * @param message RemoveLocalInventoriesMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AddFulfillmentPlacesMetadata to JSON. + * Converts this RemoveLocalInventoriesMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AddFulfillmentPlacesResponse. */ - interface IAddFulfillmentPlacesResponse { + /** Properties of a RemoveLocalInventoriesResponse. */ + interface IRemoveLocalInventoriesResponse { } - /** Represents an AddFulfillmentPlacesResponse. */ - class AddFulfillmentPlacesResponse implements IAddFulfillmentPlacesResponse { + /** Represents a RemoveLocalInventoriesResponse. */ + class RemoveLocalInventoriesResponse implements IRemoveLocalInventoriesResponse { /** - * Constructs a new AddFulfillmentPlacesResponse. + * Constructs a new RemoveLocalInventoriesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IAddFulfillmentPlacesResponse); + constructor(properties?: google.cloud.retail.v2beta.IRemoveLocalInventoriesResponse); /** - * Creates a new AddFulfillmentPlacesResponse instance using the specified properties. + * Creates a new RemoveLocalInventoriesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns AddFulfillmentPlacesResponse instance + * @returns RemoveLocalInventoriesResponse instance */ - public static create(properties?: google.cloud.retail.v2beta.IAddFulfillmentPlacesResponse): google.cloud.retail.v2beta.AddFulfillmentPlacesResponse; + public static create(properties?: google.cloud.retail.v2beta.IRemoveLocalInventoriesResponse): google.cloud.retail.v2beta.RemoveLocalInventoriesResponse; /** - * Encodes the specified AddFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesResponse.verify|verify} messages. - * @param message AddFulfillmentPlacesResponse message or plain object to encode + * Encodes the specified RemoveLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2beta.RemoveLocalInventoriesResponse.verify|verify} messages. + * @param message RemoveLocalInventoriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IAddFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IRemoveLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AddFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesResponse.verify|verify} messages. - * @param message AddFulfillmentPlacesResponse message or plain object to encode + * Encodes the specified RemoveLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.RemoveLocalInventoriesResponse.verify|verify} messages. + * @param message RemoveLocalInventoriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IAddFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IRemoveLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AddFulfillmentPlacesResponse + * @returns RemoveLocalInventoriesResponse * @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.v2beta.AddFulfillmentPlacesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.RemoveLocalInventoriesResponse; /** - * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AddFulfillmentPlacesResponse + * @returns RemoveLocalInventoriesResponse * @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.v2beta.AddFulfillmentPlacesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.RemoveLocalInventoriesResponse; /** - * Verifies an AddFulfillmentPlacesResponse message. + * Verifies a RemoveLocalInventoriesResponse 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 AddFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AddFulfillmentPlacesResponse + * @returns RemoveLocalInventoriesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.AddFulfillmentPlacesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.RemoveLocalInventoriesResponse; /** - * Creates a plain object from an AddFulfillmentPlacesResponse message. Also converts values to other types if specified. - * @param message AddFulfillmentPlacesResponse + * Creates a plain object from a RemoveLocalInventoriesResponse message. Also converts values to other types if specified. + * @param message RemoveLocalInventoriesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.AddFulfillmentPlacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.RemoveLocalInventoriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AddFulfillmentPlacesResponse to JSON. + * Converts this RemoveLocalInventoriesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -29765,1783 +35155,1468 @@ export namespace google { public static create(properties?: google.cloud.retail.v2beta.IRemoveFulfillmentPlacesResponse): google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse; /** - * Encodes the specified RemoveFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse.verify|verify} messages. - * @param message RemoveFulfillmentPlacesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.IRemoveFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RemoveFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse.verify|verify} messages. - * @param message RemoveFulfillmentPlacesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IRemoveFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RemoveFulfillmentPlacesResponse - * @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.v2beta.RemoveFulfillmentPlacesResponse; - - /** - * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RemoveFulfillmentPlacesResponse - * @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.v2beta.RemoveFulfillmentPlacesResponse; - - /** - * Verifies a RemoveFulfillmentPlacesResponse 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 RemoveFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RemoveFulfillmentPlacesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse; - - /** - * Creates a plain object from a RemoveFulfillmentPlacesResponse message. Also converts values to other types if specified. - * @param message RemoveFulfillmentPlacesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RemoveFulfillmentPlacesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PurgeMetadata. */ - interface IPurgeMetadata { - } - - /** Represents a PurgeMetadata. */ - class PurgeMetadata implements IPurgeMetadata { - - /** - * Constructs a new PurgeMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.IPurgeMetadata); - - /** - * Creates a new PurgeMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns PurgeMetadata instance - */ - public static create(properties?: google.cloud.retail.v2beta.IPurgeMetadata): google.cloud.retail.v2beta.PurgeMetadata; - - /** - * Encodes the specified PurgeMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeMetadata.verify|verify} messages. - * @param message PurgeMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.IPurgeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PurgeMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeMetadata.verify|verify} messages. - * @param message PurgeMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IPurgeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PurgeMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PurgeMetadata - * @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.v2beta.PurgeMetadata; - - /** - * Decodes a PurgeMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PurgeMetadata - * @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.v2beta.PurgeMetadata; - - /** - * Verifies a PurgeMetadata 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 PurgeMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PurgeMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PurgeMetadata; - - /** - * Creates a plain object from a PurgeMetadata message. Also converts values to other types if specified. - * @param message PurgeMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.PurgeMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PurgeMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PurgeUserEventsRequest. */ - interface IPurgeUserEventsRequest { - - /** PurgeUserEventsRequest parent */ - parent?: (string|null); - - /** PurgeUserEventsRequest filter */ - filter?: (string|null); - - /** PurgeUserEventsRequest force */ - force?: (boolean|null); - } - - /** Represents a PurgeUserEventsRequest. */ - class PurgeUserEventsRequest implements IPurgeUserEventsRequest { - - /** - * Constructs a new PurgeUserEventsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.IPurgeUserEventsRequest); - - /** PurgeUserEventsRequest parent. */ - public parent: string; - - /** PurgeUserEventsRequest filter. */ - public filter: string; - - /** PurgeUserEventsRequest force. */ - public force: boolean; - - /** - * Creates a new PurgeUserEventsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PurgeUserEventsRequest instance - */ - public static create(properties?: google.cloud.retail.v2beta.IPurgeUserEventsRequest): google.cloud.retail.v2beta.PurgeUserEventsRequest; - - /** - * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeUserEventsRequest.verify|verify} messages. - * @param message PurgeUserEventsRequest message or plain object to encode + * Encodes the specified RemoveFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * @param message RemoveFulfillmentPlacesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IPurgeUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IRemoveFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeUserEventsRequest.verify|verify} messages. - * @param message PurgeUserEventsRequest message or plain object to encode + * Encodes the specified RemoveFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * @param message RemoveFulfillmentPlacesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IPurgeUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IRemoveFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. + * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PurgeUserEventsRequest + * @returns RemoveFulfillmentPlacesResponse * @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.v2beta.PurgeUserEventsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse; /** - * Decodes a PurgeUserEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PurgeUserEventsRequest + * @returns RemoveFulfillmentPlacesResponse * @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.v2beta.PurgeUserEventsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse; /** - * Verifies a PurgeUserEventsRequest message. + * Verifies a RemoveFulfillmentPlacesResponse 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 PurgeUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PurgeUserEventsRequest + * @returns RemoveFulfillmentPlacesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PurgeUserEventsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse; /** - * Creates a plain object from a PurgeUserEventsRequest message. Also converts values to other types if specified. - * @param message PurgeUserEventsRequest + * Creates a plain object from a RemoveFulfillmentPlacesResponse message. Also converts values to other types if specified. + * @param message RemoveFulfillmentPlacesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.PurgeUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PurgeUserEventsRequest to JSON. + * Converts this RemoveFulfillmentPlacesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PurgeUserEventsResponse. */ - interface IPurgeUserEventsResponse { - - /** PurgeUserEventsResponse purgedEventsCount */ - purgedEventsCount?: (number|Long|string|null); + /** Properties of a PurgeMetadata. */ + interface IPurgeMetadata { } - /** Represents a PurgeUserEventsResponse. */ - class PurgeUserEventsResponse implements IPurgeUserEventsResponse { + /** Represents a PurgeMetadata. */ + class PurgeMetadata implements IPurgeMetadata { /** - * Constructs a new PurgeUserEventsResponse. + * Constructs a new PurgeMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2beta.IPurgeUserEventsResponse); - - /** PurgeUserEventsResponse purgedEventsCount. */ - public purgedEventsCount: (number|Long|string); + constructor(properties?: google.cloud.retail.v2beta.IPurgeMetadata); /** - * Creates a new PurgeUserEventsResponse instance using the specified properties. + * Creates a new PurgeMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns PurgeUserEventsResponse instance + * @returns PurgeMetadata instance */ - public static create(properties?: google.cloud.retail.v2beta.IPurgeUserEventsResponse): google.cloud.retail.v2beta.PurgeUserEventsResponse; + public static create(properties?: google.cloud.retail.v2beta.IPurgeMetadata): google.cloud.retail.v2beta.PurgeMetadata; /** - * Encodes the specified PurgeUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeUserEventsResponse.verify|verify} messages. - * @param message PurgeUserEventsResponse message or plain object to encode + * Encodes the specified PurgeMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeMetadata.verify|verify} messages. + * @param message PurgeMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.IPurgeUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IPurgeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PurgeUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeUserEventsResponse.verify|verify} messages. - * @param message PurgeUserEventsResponse message or plain object to encode + * Encodes the specified PurgeMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeMetadata.verify|verify} messages. + * @param message PurgeMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.IPurgeUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IPurgeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PurgeUserEventsResponse message from the specified reader or buffer. + * Decodes a PurgeMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PurgeUserEventsResponse + * @returns PurgeMetadata * @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.v2beta.PurgeUserEventsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.PurgeMetadata; /** - * Decodes a PurgeUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes a PurgeMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PurgeUserEventsResponse + * @returns PurgeMetadata * @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.v2beta.PurgeUserEventsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.PurgeMetadata; /** - * Verifies a PurgeUserEventsResponse message. + * Verifies a PurgeMetadata 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 PurgeUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PurgeUserEventsResponse + * @returns PurgeMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PurgeUserEventsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PurgeMetadata; /** - * Creates a plain object from a PurgeUserEventsResponse message. Also converts values to other types if specified. - * @param message PurgeUserEventsResponse + * Creates a plain object from a PurgeMetadata message. Also converts values to other types if specified. + * @param message PurgeMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.PurgeUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.PurgeMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PurgeUserEventsResponse to JSON. + * Converts this PurgeMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents a SearchService */ - class SearchService extends $protobuf.rpc.Service { - - /** - * Constructs a new SearchService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + /** Properties of a PurgeUserEventsRequest. */ + interface IPurgeUserEventsRequest { - /** - * Creates new SearchService service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SearchService; + /** PurgeUserEventsRequest parent */ + parent?: (string|null); - /** - * Calls Search. - * @param request SearchRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SearchResponse - */ - public search(request: google.cloud.retail.v2beta.ISearchRequest, callback: google.cloud.retail.v2beta.SearchService.SearchCallback): void; + /** PurgeUserEventsRequest filter */ + filter?: (string|null); - /** - * Calls Search. - * @param request SearchRequest message or plain object - * @returns Promise - */ - public search(request: google.cloud.retail.v2beta.ISearchRequest): Promise; + /** PurgeUserEventsRequest force */ + force?: (boolean|null); } - namespace SearchService { + /** Represents a PurgeUserEventsRequest. */ + class PurgeUserEventsRequest implements IPurgeUserEventsRequest { /** - * Callback as used by {@link google.cloud.retail.v2beta.SearchService#search}. - * @param error Error, if any - * @param [response] SearchResponse + * Constructs a new PurgeUserEventsRequest. + * @param [properties] Properties to set */ - type SearchCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.SearchResponse) => void; - } - - /** Properties of a SearchRequest. */ - interface ISearchRequest { - - /** SearchRequest placement */ - placement?: (string|null); - - /** SearchRequest branch */ - branch?: (string|null); - - /** SearchRequest query */ - query?: (string|null); - - /** SearchRequest visitorId */ - visitorId?: (string|null); - - /** SearchRequest userInfo */ - userInfo?: (google.cloud.retail.v2beta.IUserInfo|null); - - /** SearchRequest pageSize */ - pageSize?: (number|null); - - /** SearchRequest pageToken */ - pageToken?: (string|null); - - /** SearchRequest offset */ - offset?: (number|null); - - /** SearchRequest filter */ - filter?: (string|null); - - /** SearchRequest canonicalFilter */ - canonicalFilter?: (string|null); - - /** SearchRequest orderBy */ - orderBy?: (string|null); - - /** SearchRequest facetSpecs */ - facetSpecs?: (google.cloud.retail.v2beta.SearchRequest.IFacetSpec[]|null); - - /** SearchRequest dynamicFacetSpec */ - dynamicFacetSpec?: (google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec|null); - - /** SearchRequest boostSpec */ - boostSpec?: (google.cloud.retail.v2beta.SearchRequest.IBoostSpec|null); - - /** SearchRequest queryExpansionSpec */ - queryExpansionSpec?: (google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec|null); - - /** SearchRequest variantRollupKeys */ - variantRollupKeys?: (string[]|null); + constructor(properties?: google.cloud.retail.v2beta.IPurgeUserEventsRequest); - /** SearchRequest pageCategories */ - pageCategories?: (string[]|null); + /** PurgeUserEventsRequest parent. */ + public parent: string; - /** SearchRequest searchMode */ - searchMode?: (google.cloud.retail.v2beta.SearchRequest.SearchMode|keyof typeof google.cloud.retail.v2beta.SearchRequest.SearchMode|null); - } + /** PurgeUserEventsRequest filter. */ + public filter: string; - /** Represents a SearchRequest. */ - class SearchRequest implements ISearchRequest { + /** PurgeUserEventsRequest force. */ + public force: boolean; /** - * Constructs a new SearchRequest. + * Creates a new PurgeUserEventsRequest instance using the specified properties. * @param [properties] Properties to set + * @returns PurgeUserEventsRequest instance */ - constructor(properties?: google.cloud.retail.v2beta.ISearchRequest); - - /** SearchRequest placement. */ - public placement: string; - - /** SearchRequest branch. */ - public branch: string; - - /** SearchRequest query. */ - public query: string; - - /** SearchRequest visitorId. */ - public visitorId: string; - - /** SearchRequest userInfo. */ - public userInfo?: (google.cloud.retail.v2beta.IUserInfo|null); - - /** SearchRequest pageSize. */ - public pageSize: number; + public static create(properties?: google.cloud.retail.v2beta.IPurgeUserEventsRequest): google.cloud.retail.v2beta.PurgeUserEventsRequest; - /** SearchRequest pageToken. */ - public pageToken: string; + /** + * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeUserEventsRequest.verify|verify} messages. + * @param message PurgeUserEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IPurgeUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** SearchRequest offset. */ - public offset: number; + /** + * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeUserEventsRequest.verify|verify} messages. + * @param message PurgeUserEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IPurgeUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** SearchRequest filter. */ - public filter: string; + /** + * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurgeUserEventsRequest + * @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.v2beta.PurgeUserEventsRequest; - /** SearchRequest canonicalFilter. */ - public canonicalFilter: string; + /** + * Decodes a PurgeUserEventsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurgeUserEventsRequest + * @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.v2beta.PurgeUserEventsRequest; - /** SearchRequest orderBy. */ - public orderBy: string; + /** + * Verifies a PurgeUserEventsRequest 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); - /** SearchRequest facetSpecs. */ - public facetSpecs: google.cloud.retail.v2beta.SearchRequest.IFacetSpec[]; + /** + * Creates a PurgeUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurgeUserEventsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PurgeUserEventsRequest; - /** SearchRequest dynamicFacetSpec. */ - public dynamicFacetSpec?: (google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec|null); + /** + * Creates a plain object from a PurgeUserEventsRequest message. Also converts values to other types if specified. + * @param message PurgeUserEventsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.PurgeUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** SearchRequest boostSpec. */ - public boostSpec?: (google.cloud.retail.v2beta.SearchRequest.IBoostSpec|null); + /** + * Converts this PurgeUserEventsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** SearchRequest queryExpansionSpec. */ - public queryExpansionSpec?: (google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec|null); + /** Properties of a PurgeUserEventsResponse. */ + interface IPurgeUserEventsResponse { - /** SearchRequest variantRollupKeys. */ - public variantRollupKeys: string[]; + /** PurgeUserEventsResponse purgedEventsCount */ + purgedEventsCount?: (number|Long|string|null); + } - /** SearchRequest pageCategories. */ - public pageCategories: string[]; + /** Represents a PurgeUserEventsResponse. */ + class PurgeUserEventsResponse implements IPurgeUserEventsResponse { - /** SearchRequest searchMode. */ - public searchMode: (google.cloud.retail.v2beta.SearchRequest.SearchMode|keyof typeof google.cloud.retail.v2beta.SearchRequest.SearchMode); + /** + * Constructs a new PurgeUserEventsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IPurgeUserEventsResponse); + + /** PurgeUserEventsResponse purgedEventsCount. */ + public purgedEventsCount: (number|Long|string); /** - * Creates a new SearchRequest instance using the specified properties. + * Creates a new PurgeUserEventsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns SearchRequest instance + * @returns PurgeUserEventsResponse instance */ - public static create(properties?: google.cloud.retail.v2beta.ISearchRequest): google.cloud.retail.v2beta.SearchRequest; + public static create(properties?: google.cloud.retail.v2beta.IPurgeUserEventsResponse): google.cloud.retail.v2beta.PurgeUserEventsResponse; /** - * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.verify|verify} messages. - * @param message SearchRequest message or plain object to encode + * Encodes the specified PurgeUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeUserEventsResponse.verify|verify} messages. + * @param message PurgeUserEventsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IPurgeUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.verify|verify} messages. - * @param message SearchRequest message or plain object to encode + * Encodes the specified PurgeUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeUserEventsResponse.verify|verify} messages. + * @param message PurgeUserEventsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IPurgeUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SearchRequest message from the specified reader or buffer. + * Decodes a PurgeUserEventsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SearchRequest + * @returns PurgeUserEventsResponse * @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.v2beta.SearchRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.PurgeUserEventsResponse; /** - * Decodes a SearchRequest message from the specified reader or buffer, length delimited. + * Decodes a PurgeUserEventsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SearchRequest + * @returns PurgeUserEventsResponse * @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.v2beta.SearchRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.PurgeUserEventsResponse; /** - * Verifies a SearchRequest message. + * Verifies a PurgeUserEventsResponse 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 SearchRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeUserEventsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SearchRequest + * @returns PurgeUserEventsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PurgeUserEventsResponse; /** - * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. - * @param message SearchRequest + * Creates a plain object from a PurgeUserEventsResponse message. Also converts values to other types if specified. + * @param message PurgeUserEventsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.SearchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.PurgeUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SearchRequest to JSON. + * Converts this PurgeUserEventsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace SearchRequest { + /** Properties of a ServingConfig. */ + interface IServingConfig { - /** Properties of a FacetSpec. */ - interface IFacetSpec { + /** ServingConfig name */ + name?: (string|null); - /** FacetSpec facetKey */ - facetKey?: (google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey|null); + /** ServingConfig displayName */ + displayName?: (string|null); - /** FacetSpec limit */ - limit?: (number|null); + /** ServingConfig modelId */ + modelId?: (string|null); - /** FacetSpec excludedFilterKeys */ - excludedFilterKeys?: (string[]|null); + /** ServingConfig priceRerankingLevel */ + priceRerankingLevel?: (string|null); - /** FacetSpec enableDynamicPosition */ - enableDynamicPosition?: (boolean|null); - } + /** ServingConfig facetControlIds */ + facetControlIds?: (string[]|null); - /** Represents a FacetSpec. */ - class FacetSpec implements IFacetSpec { + /** ServingConfig dynamicFacetSpec */ + dynamicFacetSpec?: (google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec|null); - /** - * Constructs a new FacetSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.SearchRequest.IFacetSpec); + /** ServingConfig boostControlIds */ + boostControlIds?: (string[]|null); - /** FacetSpec facetKey. */ - public facetKey?: (google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey|null); + /** ServingConfig filterControlIds */ + filterControlIds?: (string[]|null); - /** FacetSpec limit. */ - public limit: number; + /** ServingConfig redirectControlIds */ + redirectControlIds?: (string[]|null); - /** FacetSpec excludedFilterKeys. */ - public excludedFilterKeys: string[]; + /** ServingConfig twowaySynonymsControlIds */ + twowaySynonymsControlIds?: (string[]|null); - /** FacetSpec enableDynamicPosition. */ - public enableDynamicPosition: boolean; + /** ServingConfig onewaySynonymsControlIds */ + onewaySynonymsControlIds?: (string[]|null); - /** - * Creates a new FacetSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns FacetSpec instance - */ - public static create(properties?: google.cloud.retail.v2beta.SearchRequest.IFacetSpec): google.cloud.retail.v2beta.SearchRequest.FacetSpec; + /** ServingConfig doNotAssociateControlIds */ + doNotAssociateControlIds?: (string[]|null); - /** - * Encodes the specified FacetSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.FacetSpec.verify|verify} messages. - * @param message FacetSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.SearchRequest.IFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** ServingConfig replacementControlIds */ + replacementControlIds?: (string[]|null); - /** - * Encodes the specified FacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.FacetSpec.verify|verify} messages. - * @param message FacetSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.SearchRequest.IFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** ServingConfig ignoreControlIds */ + ignoreControlIds?: (string[]|null); - /** - * Decodes a FacetSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FacetSpec - * @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.v2beta.SearchRequest.FacetSpec; + /** ServingConfig diversityLevel */ + diversityLevel?: (string|null); - /** - * Decodes a FacetSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FacetSpec - * @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.v2beta.SearchRequest.FacetSpec; + /** ServingConfig enableCategoryFilterLevel */ + enableCategoryFilterLevel?: (string|null); - /** - * Verifies a FacetSpec 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); + /** ServingConfig solutionTypes */ + solutionTypes?: (google.cloud.retail.v2beta.SolutionType[]|null); + } - /** - * Creates a FacetSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FacetSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchRequest.FacetSpec; + /** Represents a ServingConfig. */ + class ServingConfig implements IServingConfig { - /** - * Creates a plain object from a FacetSpec message. Also converts values to other types if specified. - * @param message FacetSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.SearchRequest.FacetSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new ServingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IServingConfig); - /** - * Converts this FacetSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ServingConfig name. */ + public name: string; - namespace FacetSpec { + /** ServingConfig displayName. */ + public displayName: string; - /** Properties of a FacetKey. */ - interface IFacetKey { + /** ServingConfig modelId. */ + public modelId: string; - /** FacetKey key */ - key?: (string|null); + /** ServingConfig priceRerankingLevel. */ + public priceRerankingLevel: string; - /** FacetKey intervals */ - intervals?: (google.cloud.retail.v2beta.IInterval[]|null); + /** ServingConfig facetControlIds. */ + public facetControlIds: string[]; - /** FacetKey restrictedValues */ - restrictedValues?: (string[]|null); + /** ServingConfig dynamicFacetSpec. */ + public dynamicFacetSpec?: (google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec|null); - /** FacetKey prefixes */ - prefixes?: (string[]|null); + /** ServingConfig boostControlIds. */ + public boostControlIds: string[]; - /** FacetKey contains */ - contains?: (string[]|null); + /** ServingConfig filterControlIds. */ + public filterControlIds: string[]; - /** FacetKey orderBy */ - orderBy?: (string|null); + /** ServingConfig redirectControlIds. */ + public redirectControlIds: string[]; - /** FacetKey query */ - query?: (string|null); - } + /** ServingConfig twowaySynonymsControlIds. */ + public twowaySynonymsControlIds: string[]; - /** Represents a FacetKey. */ - class FacetKey implements IFacetKey { + /** ServingConfig onewaySynonymsControlIds. */ + public onewaySynonymsControlIds: string[]; - /** - * Constructs a new FacetKey. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey); + /** ServingConfig doNotAssociateControlIds. */ + public doNotAssociateControlIds: string[]; - /** FacetKey key. */ - public key: string; + /** ServingConfig replacementControlIds. */ + public replacementControlIds: string[]; - /** FacetKey intervals. */ - public intervals: google.cloud.retail.v2beta.IInterval[]; + /** ServingConfig ignoreControlIds. */ + public ignoreControlIds: string[]; + + /** ServingConfig diversityLevel. */ + public diversityLevel: string; + + /** ServingConfig enableCategoryFilterLevel. */ + public enableCategoryFilterLevel: string; + + /** ServingConfig solutionTypes. */ + public solutionTypes: google.cloud.retail.v2beta.SolutionType[]; + + /** + * Creates a new ServingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServingConfig instance + */ + public static create(properties?: google.cloud.retail.v2beta.IServingConfig): google.cloud.retail.v2beta.ServingConfig; - /** FacetKey restrictedValues. */ - public restrictedValues: string[]; + /** + * Encodes the specified ServingConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ServingConfig.verify|verify} messages. + * @param message ServingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IServingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** FacetKey prefixes. */ - public prefixes: string[]; + /** + * Encodes the specified ServingConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ServingConfig.verify|verify} messages. + * @param message ServingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IServingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** FacetKey contains. */ - public contains: string[]; + /** + * Decodes a ServingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServingConfig + * @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.v2beta.ServingConfig; - /** FacetKey orderBy. */ - public orderBy: string; + /** + * Decodes a ServingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServingConfig + * @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.v2beta.ServingConfig; - /** FacetKey query. */ - public query: string; + /** + * Verifies a ServingConfig 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 new FacetKey instance using the specified properties. - * @param [properties] Properties to set - * @returns FacetKey instance - */ - public static create(properties?: google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey): google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey; + /** + * Creates a ServingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ServingConfig; - /** - * Encodes the specified FacetKey message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. - * @param message FacetKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a ServingConfig message. Also converts values to other types if specified. + * @param message ServingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.ServingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified FacetKey message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. - * @param message FacetKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this ServingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a FacetKey message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FacetKey - * @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.v2beta.SearchRequest.FacetSpec.FacetKey; + /** Represents a ServingConfigService */ + class ServingConfigService extends $protobuf.rpc.Service { - /** - * Decodes a FacetKey message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FacetKey - * @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.v2beta.SearchRequest.FacetSpec.FacetKey; + /** + * Constructs a new ServingConfigService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** - * Verifies a FacetKey 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 new ServingConfigService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ServingConfigService; - /** - * Creates a FacetKey message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FacetKey - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey; + /** + * Calls CreateServingConfig. + * @param request CreateServingConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ServingConfig + */ + public createServingConfig(request: google.cloud.retail.v2beta.ICreateServingConfigRequest, callback: google.cloud.retail.v2beta.ServingConfigService.CreateServingConfigCallback): void; - /** - * Creates a plain object from a FacetKey message. Also converts values to other types if specified. - * @param message FacetKey - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Calls CreateServingConfig. + * @param request CreateServingConfigRequest message or plain object + * @returns Promise + */ + public createServingConfig(request: google.cloud.retail.v2beta.ICreateServingConfigRequest): Promise; - /** - * Converts this FacetKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Calls DeleteServingConfig. + * @param request DeleteServingConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteServingConfig(request: google.cloud.retail.v2beta.IDeleteServingConfigRequest, callback: google.cloud.retail.v2beta.ServingConfigService.DeleteServingConfigCallback): void; - /** Properties of a DynamicFacetSpec. */ - interface IDynamicFacetSpec { + /** + * Calls DeleteServingConfig. + * @param request DeleteServingConfigRequest message or plain object + * @returns Promise + */ + public deleteServingConfig(request: google.cloud.retail.v2beta.IDeleteServingConfigRequest): Promise; - /** DynamicFacetSpec mode */ - mode?: (google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode|keyof typeof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode|null); - } + /** + * Calls UpdateServingConfig. + * @param request UpdateServingConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ServingConfig + */ + public updateServingConfig(request: google.cloud.retail.v2beta.IUpdateServingConfigRequest, callback: google.cloud.retail.v2beta.ServingConfigService.UpdateServingConfigCallback): void; - /** Represents a DynamicFacetSpec. */ - class DynamicFacetSpec implements IDynamicFacetSpec { + /** + * Calls UpdateServingConfig. + * @param request UpdateServingConfigRequest message or plain object + * @returns Promise + */ + public updateServingConfig(request: google.cloud.retail.v2beta.IUpdateServingConfigRequest): Promise; - /** - * Constructs a new DynamicFacetSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec); + /** + * Calls GetServingConfig. + * @param request GetServingConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ServingConfig + */ + public getServingConfig(request: google.cloud.retail.v2beta.IGetServingConfigRequest, callback: google.cloud.retail.v2beta.ServingConfigService.GetServingConfigCallback): void; - /** DynamicFacetSpec mode. */ - public mode: (google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode|keyof typeof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode); + /** + * Calls GetServingConfig. + * @param request GetServingConfigRequest message or plain object + * @returns Promise + */ + public getServingConfig(request: google.cloud.retail.v2beta.IGetServingConfigRequest): Promise; - /** - * Creates a new DynamicFacetSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns DynamicFacetSpec instance - */ - public static create(properties?: google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec): google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec; + /** + * Calls ListServingConfigs. + * @param request ListServingConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListServingConfigsResponse + */ + public listServingConfigs(request: google.cloud.retail.v2beta.IListServingConfigsRequest, callback: google.cloud.retail.v2beta.ServingConfigService.ListServingConfigsCallback): void; - /** - * Encodes the specified DynamicFacetSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.verify|verify} messages. - * @param message DynamicFacetSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls ListServingConfigs. + * @param request ListServingConfigsRequest message or plain object + * @returns Promise + */ + public listServingConfigs(request: google.cloud.retail.v2beta.IListServingConfigsRequest): Promise; - /** - * Encodes the specified DynamicFacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.verify|verify} messages. - * @param message DynamicFacetSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls AddControl. + * @param request AddControlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ServingConfig + */ + public addControl(request: google.cloud.retail.v2beta.IAddControlRequest, callback: google.cloud.retail.v2beta.ServingConfigService.AddControlCallback): void; - /** - * Decodes a DynamicFacetSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DynamicFacetSpec - * @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.v2beta.SearchRequest.DynamicFacetSpec; + /** + * Calls AddControl. + * @param request AddControlRequest message or plain object + * @returns Promise + */ + public addControl(request: google.cloud.retail.v2beta.IAddControlRequest): Promise; - /** - * Decodes a DynamicFacetSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DynamicFacetSpec - * @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.v2beta.SearchRequest.DynamicFacetSpec; + /** + * Calls RemoveControl. + * @param request RemoveControlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ServingConfig + */ + public removeControl(request: google.cloud.retail.v2beta.IRemoveControlRequest, callback: google.cloud.retail.v2beta.ServingConfigService.RemoveControlCallback): void; - /** - * Verifies a DynamicFacetSpec 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); + /** + * Calls RemoveControl. + * @param request RemoveControlRequest message or plain object + * @returns Promise + */ + public removeControl(request: google.cloud.retail.v2beta.IRemoveControlRequest): Promise; + } - /** - * Creates a DynamicFacetSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DynamicFacetSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec; + namespace ServingConfigService { - /** - * Creates a plain object from a DynamicFacetSpec message. Also converts values to other types if specified. - * @param message DynamicFacetSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Callback as used by {@link google.cloud.retail.v2beta.ServingConfigService#createServingConfig}. + * @param error Error, if any + * @param [response] ServingConfig + */ + type CreateServingConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.ServingConfig) => void; - /** - * Converts this DynamicFacetSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Callback as used by {@link google.cloud.retail.v2beta.ServingConfigService#deleteServingConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteServingConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - namespace DynamicFacetSpec { + /** + * Callback as used by {@link google.cloud.retail.v2beta.ServingConfigService#updateServingConfig}. + * @param error Error, if any + * @param [response] ServingConfig + */ + type UpdateServingConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.ServingConfig) => void; - /** Mode enum. */ - enum Mode { - MODE_UNSPECIFIED = 0, - DISABLED = 1, - ENABLED = 2 - } - } + /** + * Callback as used by {@link google.cloud.retail.v2beta.ServingConfigService#getServingConfig}. + * @param error Error, if any + * @param [response] ServingConfig + */ + type GetServingConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.ServingConfig) => void; - /** Properties of a BoostSpec. */ - interface IBoostSpec { + /** + * Callback as used by {@link google.cloud.retail.v2beta.ServingConfigService#listServingConfigs}. + * @param error Error, if any + * @param [response] ListServingConfigsResponse + */ + type ListServingConfigsCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.ListServingConfigsResponse) => void; - /** BoostSpec conditionBoostSpecs */ - conditionBoostSpecs?: (google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec[]|null); - } + /** + * Callback as used by {@link google.cloud.retail.v2beta.ServingConfigService#addControl}. + * @param error Error, if any + * @param [response] ServingConfig + */ + type AddControlCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.ServingConfig) => void; - /** Represents a BoostSpec. */ - class BoostSpec implements IBoostSpec { + /** + * Callback as used by {@link google.cloud.retail.v2beta.ServingConfigService#removeControl}. + * @param error Error, if any + * @param [response] ServingConfig + */ + type RemoveControlCallback = (error: (Error|null), response?: google.cloud.retail.v2beta.ServingConfig) => void; + } - /** - * Constructs a new BoostSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.SearchRequest.IBoostSpec); + /** Properties of a CreateServingConfigRequest. */ + interface ICreateServingConfigRequest { - /** BoostSpec conditionBoostSpecs. */ - public conditionBoostSpecs: google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec[]; + /** CreateServingConfigRequest parent */ + parent?: (string|null); - /** - * Creates a new BoostSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns BoostSpec instance - */ - public static create(properties?: google.cloud.retail.v2beta.SearchRequest.IBoostSpec): google.cloud.retail.v2beta.SearchRequest.BoostSpec; + /** CreateServingConfigRequest servingConfig */ + servingConfig?: (google.cloud.retail.v2beta.IServingConfig|null); - /** - * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.BoostSpec.verify|verify} messages. - * @param message BoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.SearchRequest.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** CreateServingConfigRequest servingConfigId */ + servingConfigId?: (string|null); + } - /** - * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.BoostSpec.verify|verify} messages. - * @param message BoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.SearchRequest.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a CreateServingConfigRequest. */ + class CreateServingConfigRequest implements ICreateServingConfigRequest { - /** - * Decodes a BoostSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoostSpec - * @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.v2beta.SearchRequest.BoostSpec; + /** + * Constructs a new CreateServingConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.ICreateServingConfigRequest); - /** - * Decodes a BoostSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoostSpec - * @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.v2beta.SearchRequest.BoostSpec; + /** CreateServingConfigRequest parent. */ + public parent: string; - /** - * Verifies a BoostSpec 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); + /** CreateServingConfigRequest servingConfig. */ + public servingConfig?: (google.cloud.retail.v2beta.IServingConfig|null); - /** - * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoostSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchRequest.BoostSpec; + /** CreateServingConfigRequest servingConfigId. */ + public servingConfigId: string; - /** - * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. - * @param message BoostSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.SearchRequest.BoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a new CreateServingConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateServingConfigRequest instance + */ + public static create(properties?: google.cloud.retail.v2beta.ICreateServingConfigRequest): google.cloud.retail.v2beta.CreateServingConfigRequest; - /** - * Converts this BoostSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified CreateServingConfigRequest message. Does not implicitly {@link google.cloud.retail.v2beta.CreateServingConfigRequest.verify|verify} messages. + * @param message CreateServingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.ICreateServingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - namespace BoostSpec { + /** + * Encodes the specified CreateServingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CreateServingConfigRequest.verify|verify} messages. + * @param message CreateServingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.ICreateServingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a ConditionBoostSpec. */ - interface IConditionBoostSpec { + /** + * Decodes a CreateServingConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateServingConfigRequest + * @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.v2beta.CreateServingConfigRequest; - /** ConditionBoostSpec condition */ - condition?: (string|null); + /** + * Decodes a CreateServingConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateServingConfigRequest + * @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.v2beta.CreateServingConfigRequest; - /** ConditionBoostSpec boost */ - boost?: (number|null); - } + /** + * Verifies a CreateServingConfigRequest 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); - /** Represents a ConditionBoostSpec. */ - class ConditionBoostSpec implements IConditionBoostSpec { + /** + * Creates a CreateServingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateServingConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CreateServingConfigRequest; - /** - * Constructs a new ConditionBoostSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec); + /** + * Creates a plain object from a CreateServingConfigRequest message. Also converts values to other types if specified. + * @param message CreateServingConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.CreateServingConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ConditionBoostSpec condition. */ - public condition: string; + /** + * Converts this CreateServingConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ConditionBoostSpec boost. */ - public boost: number; + /** Properties of an UpdateServingConfigRequest. */ + interface IUpdateServingConfigRequest { - /** - * Creates a new ConditionBoostSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns ConditionBoostSpec instance - */ - public static create(properties?: google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec): google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec; + /** UpdateServingConfigRequest servingConfig */ + servingConfig?: (google.cloud.retail.v2beta.IServingConfig|null); - /** - * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @param message ConditionBoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** UpdateServingConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } - /** - * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @param message ConditionBoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents an UpdateServingConfigRequest. */ + class UpdateServingConfigRequest implements IUpdateServingConfigRequest { - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConditionBoostSpec - * @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.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec; + /** + * Constructs a new UpdateServingConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IUpdateServingConfigRequest); - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConditionBoostSpec - * @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.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec; + /** UpdateServingConfigRequest servingConfig. */ + public servingConfig?: (google.cloud.retail.v2beta.IServingConfig|null); - /** - * Verifies a ConditionBoostSpec 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); + /** UpdateServingConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** - * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConditionBoostSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec; + /** + * Creates a new UpdateServingConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateServingConfigRequest instance + */ + public static create(properties?: google.cloud.retail.v2beta.IUpdateServingConfigRequest): google.cloud.retail.v2beta.UpdateServingConfigRequest; - /** - * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. - * @param message ConditionBoostSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified UpdateServingConfigRequest message. Does not implicitly {@link google.cloud.retail.v2beta.UpdateServingConfigRequest.verify|verify} messages. + * @param message UpdateServingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IUpdateServingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this ConditionBoostSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Encodes the specified UpdateServingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UpdateServingConfigRequest.verify|verify} messages. + * @param message UpdateServingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IUpdateServingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a QueryExpansionSpec. */ - interface IQueryExpansionSpec { + /** + * Decodes an UpdateServingConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateServingConfigRequest + * @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.v2beta.UpdateServingConfigRequest; - /** QueryExpansionSpec condition */ - condition?: (google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition|null); + /** + * Decodes an UpdateServingConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateServingConfigRequest + * @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.v2beta.UpdateServingConfigRequest; + + /** + * Verifies an UpdateServingConfigRequest 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 UpdateServingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateServingConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.UpdateServingConfigRequest; - /** QueryExpansionSpec pinUnexpandedResults */ - pinUnexpandedResults?: (boolean|null); - } + /** + * Creates a plain object from an UpdateServingConfigRequest message. Also converts values to other types if specified. + * @param message UpdateServingConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.UpdateServingConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents a QueryExpansionSpec. */ - class QueryExpansionSpec implements IQueryExpansionSpec { + /** + * Converts this UpdateServingConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new QueryExpansionSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec); + /** Properties of a DeleteServingConfigRequest. */ + interface IDeleteServingConfigRequest { - /** QueryExpansionSpec condition. */ - public condition: (google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition); + /** DeleteServingConfigRequest name */ + name?: (string|null); + } - /** QueryExpansionSpec pinUnexpandedResults. */ - public pinUnexpandedResults: boolean; + /** Represents a DeleteServingConfigRequest. */ + class DeleteServingConfigRequest implements IDeleteServingConfigRequest { - /** - * Creates a new QueryExpansionSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryExpansionSpec instance - */ - public static create(properties?: google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec): google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec; + /** + * Constructs a new DeleteServingConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IDeleteServingConfigRequest); - /** - * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.verify|verify} messages. - * @param message QueryExpansionSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** DeleteServingConfigRequest name. */ + public name: string; - /** - * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.verify|verify} messages. - * @param message QueryExpansionSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new DeleteServingConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteServingConfigRequest instance + */ + public static create(properties?: google.cloud.retail.v2beta.IDeleteServingConfigRequest): google.cloud.retail.v2beta.DeleteServingConfigRequest; - /** - * Decodes a QueryExpansionSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryExpansionSpec - * @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.v2beta.SearchRequest.QueryExpansionSpec; + /** + * Encodes the specified DeleteServingConfigRequest message. Does not implicitly {@link google.cloud.retail.v2beta.DeleteServingConfigRequest.verify|verify} messages. + * @param message DeleteServingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IDeleteServingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryExpansionSpec - * @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.v2beta.SearchRequest.QueryExpansionSpec; + /** + * Encodes the specified DeleteServingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.DeleteServingConfigRequest.verify|verify} messages. + * @param message DeleteServingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IDeleteServingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a QueryExpansionSpec 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); + /** + * Decodes a DeleteServingConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteServingConfigRequest + * @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.v2beta.DeleteServingConfigRequest; - /** - * Creates a QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryExpansionSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec; + /** + * Decodes a DeleteServingConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteServingConfigRequest + * @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.v2beta.DeleteServingConfigRequest; - /** - * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. - * @param message QueryExpansionSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a DeleteServingConfigRequest 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); - /** - * Converts this QueryExpansionSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a DeleteServingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteServingConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.DeleteServingConfigRequest; - namespace QueryExpansionSpec { + /** + * Creates a plain object from a DeleteServingConfigRequest message. Also converts values to other types if specified. + * @param message DeleteServingConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.DeleteServingConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Condition enum. */ - enum Condition { - CONDITION_UNSPECIFIED = 0, - DISABLED = 1, - AUTO = 3 - } - } + /** + * Converts this DeleteServingConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** SearchMode enum. */ - enum SearchMode { - SEARCH_MODE_UNSPECIFIED = 0, - PRODUCT_SEARCH_ONLY = 1, - FACETED_SEARCH_ONLY = 2 - } + /** Properties of a GetServingConfigRequest. */ + interface IGetServingConfigRequest { + + /** GetServingConfigRequest name */ + name?: (string|null); } - /** Properties of a SearchResponse. */ - interface ISearchResponse { + /** Represents a GetServingConfigRequest. */ + class GetServingConfigRequest implements IGetServingConfigRequest { - /** SearchResponse results */ - results?: (google.cloud.retail.v2beta.SearchResponse.ISearchResult[]|null); + /** + * Constructs a new GetServingConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IGetServingConfigRequest); - /** SearchResponse facets */ - facets?: (google.cloud.retail.v2beta.SearchResponse.IFacet[]|null); + /** GetServingConfigRequest name. */ + public name: string; - /** SearchResponse totalSize */ - totalSize?: (number|null); + /** + * Creates a new GetServingConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetServingConfigRequest instance + */ + public static create(properties?: google.cloud.retail.v2beta.IGetServingConfigRequest): google.cloud.retail.v2beta.GetServingConfigRequest; - /** SearchResponse correctedQuery */ - correctedQuery?: (string|null); + /** + * Encodes the specified GetServingConfigRequest message. Does not implicitly {@link google.cloud.retail.v2beta.GetServingConfigRequest.verify|verify} messages. + * @param message GetServingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IGetServingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** SearchResponse attributionToken */ - attributionToken?: (string|null); + /** + * Encodes the specified GetServingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetServingConfigRequest.verify|verify} messages. + * @param message GetServingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IGetServingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** SearchResponse nextPageToken */ - nextPageToken?: (string|null); + /** + * Decodes a GetServingConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetServingConfigRequest + * @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.v2beta.GetServingConfigRequest; - /** SearchResponse queryExpansionInfo */ - queryExpansionInfo?: (google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo|null); + /** + * Decodes a GetServingConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetServingConfigRequest + * @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.v2beta.GetServingConfigRequest; - /** SearchResponse redirectUri */ - redirectUri?: (string|null); + /** + * Verifies a GetServingConfigRequest 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); - /** SearchResponse appliedControls */ - appliedControls?: (string[]|null); - } + /** + * Creates a GetServingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetServingConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.GetServingConfigRequest; - /** Represents a SearchResponse. */ - class SearchResponse implements ISearchResponse { + /** + * Creates a plain object from a GetServingConfigRequest message. Also converts values to other types if specified. + * @param message GetServingConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.GetServingConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Constructs a new SearchResponse. - * @param [properties] Properties to set + * Converts this GetServingConfigRequest to JSON. + * @returns JSON object */ - constructor(properties?: google.cloud.retail.v2beta.ISearchResponse); + public toJSON(): { [k: string]: any }; + } - /** SearchResponse results. */ - public results: google.cloud.retail.v2beta.SearchResponse.ISearchResult[]; + /** Properties of a ListServingConfigsRequest. */ + interface IListServingConfigsRequest { - /** SearchResponse facets. */ - public facets: google.cloud.retail.v2beta.SearchResponse.IFacet[]; + /** ListServingConfigsRequest parent */ + parent?: (string|null); - /** SearchResponse totalSize. */ - public totalSize: number; + /** ListServingConfigsRequest pageSize */ + pageSize?: (number|null); - /** SearchResponse correctedQuery. */ - public correctedQuery: string; + /** ListServingConfigsRequest pageToken */ + pageToken?: (string|null); + } - /** SearchResponse attributionToken. */ - public attributionToken: string; + /** Represents a ListServingConfigsRequest. */ + class ListServingConfigsRequest implements IListServingConfigsRequest { - /** SearchResponse nextPageToken. */ - public nextPageToken: string; + /** + * Constructs a new ListServingConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IListServingConfigsRequest); - /** SearchResponse queryExpansionInfo. */ - public queryExpansionInfo?: (google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo|null); + /** ListServingConfigsRequest parent. */ + public parent: string; - /** SearchResponse redirectUri. */ - public redirectUri: string; + /** ListServingConfigsRequest pageSize. */ + public pageSize: number; - /** SearchResponse appliedControls. */ - public appliedControls: string[]; + /** ListServingConfigsRequest pageToken. */ + public pageToken: string; /** - * Creates a new SearchResponse instance using the specified properties. + * Creates a new ListServingConfigsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SearchResponse instance + * @returns ListServingConfigsRequest instance */ - public static create(properties?: google.cloud.retail.v2beta.ISearchResponse): google.cloud.retail.v2beta.SearchResponse; + public static create(properties?: google.cloud.retail.v2beta.IListServingConfigsRequest): google.cloud.retail.v2beta.ListServingConfigsRequest; /** - * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.verify|verify} messages. - * @param message SearchResponse message or plain object to encode + * Encodes the specified ListServingConfigsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ListServingConfigsRequest.verify|verify} messages. + * @param message ListServingConfigsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2beta.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2beta.IListServingConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SearchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.verify|verify} messages. - * @param message SearchResponse message or plain object to encode + * Encodes the specified ListServingConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListServingConfigsRequest.verify|verify} messages. + * @param message ListServingConfigsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2beta.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2beta.IListServingConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SearchResponse message from the specified reader or buffer. + * Decodes a ListServingConfigsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SearchResponse + * @returns ListServingConfigsRequest * @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.v2beta.SearchResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.ListServingConfigsRequest; /** - * Decodes a SearchResponse message from the specified reader or buffer, length delimited. + * Decodes a ListServingConfigsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SearchResponse + * @returns ListServingConfigsRequest * @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.v2beta.SearchResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.ListServingConfigsRequest; /** - * Verifies a SearchResponse message. + * Verifies a ListServingConfigsRequest 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 SearchResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListServingConfigsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SearchResponse + * @returns ListServingConfigsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ListServingConfigsRequest; /** - * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. - * @param message SearchResponse + * Creates a plain object from a ListServingConfigsRequest message. Also converts values to other types if specified. + * @param message ListServingConfigsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2beta.SearchResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2beta.ListServingConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SearchResponse to JSON. + * Converts this ListServingConfigsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace SearchResponse { - - /** Properties of a SearchResult. */ - interface ISearchResult { - - /** SearchResult id */ - id?: (string|null); - - /** SearchResult product */ - product?: (google.cloud.retail.v2beta.IProduct|null); - - /** SearchResult matchingVariantCount */ - matchingVariantCount?: (number|null); - - /** SearchResult matchingVariantFields */ - matchingVariantFields?: ({ [k: string]: google.protobuf.IFieldMask }|null); - - /** SearchResult variantRollupValues */ - variantRollupValues?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a SearchResult. */ - class SearchResult implements ISearchResult { - - /** - * Constructs a new SearchResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.SearchResponse.ISearchResult); - - /** SearchResult id. */ - public id: string; - - /** SearchResult product. */ - public product?: (google.cloud.retail.v2beta.IProduct|null); - - /** SearchResult matchingVariantCount. */ - public matchingVariantCount: number; - - /** SearchResult matchingVariantFields. */ - public matchingVariantFields: { [k: string]: google.protobuf.IFieldMask }; - - /** SearchResult variantRollupValues. */ - public variantRollupValues: { [k: string]: google.protobuf.IValue }; - - /** - * Creates a new SearchResult instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchResult instance - */ - public static create(properties?: google.cloud.retail.v2beta.SearchResponse.ISearchResult): google.cloud.retail.v2beta.SearchResponse.SearchResult; - - /** - * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.SearchResult.verify|verify} messages. - * @param message SearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.SearchResult.verify|verify} messages. - * @param message SearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchResult - * @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.v2beta.SearchResponse.SearchResult; - - /** - * Decodes a SearchResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchResult - * @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.v2beta.SearchResponse.SearchResult; - - /** - * Verifies a SearchResult 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 SearchResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchResponse.SearchResult; - - /** - * Creates a plain object from a SearchResult message. Also converts values to other types if specified. - * @param message SearchResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.SearchResponse.SearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Facet. */ - interface IFacet { - - /** Facet key */ - key?: (string|null); - - /** Facet values */ - values?: (google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue[]|null); - - /** Facet dynamicFacet */ - dynamicFacet?: (boolean|null); - } - - /** Represents a Facet. */ - class Facet implements IFacet { - - /** - * Constructs a new Facet. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.SearchResponse.IFacet); - - /** Facet key. */ - public key: string; + /** Properties of a ListServingConfigsResponse. */ + interface IListServingConfigsResponse { - /** Facet values. */ - public values: google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue[]; + /** ListServingConfigsResponse servingConfigs */ + servingConfigs?: (google.cloud.retail.v2beta.IServingConfig[]|null); - /** Facet dynamicFacet. */ - public dynamicFacet: boolean; + /** ListServingConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** - * Creates a new Facet instance using the specified properties. - * @param [properties] Properties to set - * @returns Facet instance - */ - public static create(properties?: google.cloud.retail.v2beta.SearchResponse.IFacet): google.cloud.retail.v2beta.SearchResponse.Facet; + /** Represents a ListServingConfigsResponse. */ + class ListServingConfigsResponse implements IListServingConfigsResponse { - /** - * Encodes the specified Facet message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.Facet.verify|verify} messages. - * @param message Facet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.SearchResponse.IFacet, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new ListServingConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IListServingConfigsResponse); - /** - * Encodes the specified Facet message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.Facet.verify|verify} messages. - * @param message Facet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.SearchResponse.IFacet, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListServingConfigsResponse servingConfigs. */ + public servingConfigs: google.cloud.retail.v2beta.IServingConfig[]; - /** - * Decodes a Facet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Facet - * @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.v2beta.SearchResponse.Facet; + /** ListServingConfigsResponse nextPageToken. */ + public nextPageToken: string; - /** - * Decodes a Facet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Facet - * @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.v2beta.SearchResponse.Facet; + /** + * Creates a new ListServingConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServingConfigsResponse instance + */ + public static create(properties?: google.cloud.retail.v2beta.IListServingConfigsResponse): google.cloud.retail.v2beta.ListServingConfigsResponse; - /** - * Verifies a Facet 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); + /** + * Encodes the specified ListServingConfigsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ListServingConfigsResponse.verify|verify} messages. + * @param message ListServingConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IListServingConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a Facet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Facet - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchResponse.Facet; + /** + * Encodes the specified ListServingConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListServingConfigsResponse.verify|verify} messages. + * @param message ListServingConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IListServingConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a Facet message. Also converts values to other types if specified. - * @param message Facet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.SearchResponse.Facet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a ListServingConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServingConfigsResponse + * @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.v2beta.ListServingConfigsResponse; - /** - * Converts this Facet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a ListServingConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServingConfigsResponse + * @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.v2beta.ListServingConfigsResponse; - namespace Facet { + /** + * Verifies a ListServingConfigsResponse 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); - /** Properties of a FacetValue. */ - interface IFacetValue { + /** + * Creates a ListServingConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServingConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.ListServingConfigsResponse; - /** FacetValue value */ - value?: (string|null); + /** + * Creates a plain object from a ListServingConfigsResponse message. Also converts values to other types if specified. + * @param message ListServingConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.ListServingConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FacetValue interval */ - interval?: (google.cloud.retail.v2beta.IInterval|null); + /** + * Converts this ListServingConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FacetValue count */ - count?: (number|Long|string|null); - } + /** Properties of an AddControlRequest. */ + interface IAddControlRequest { - /** Represents a FacetValue. */ - class FacetValue implements IFacetValue { + /** AddControlRequest servingConfig */ + servingConfig?: (string|null); - /** - * Constructs a new FacetValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue); + /** AddControlRequest controlId */ + controlId?: (string|null); + } - /** FacetValue value. */ - public value?: (string|null); + /** Represents an AddControlRequest. */ + class AddControlRequest implements IAddControlRequest { - /** FacetValue interval. */ - public interval?: (google.cloud.retail.v2beta.IInterval|null); + /** + * Constructs a new AddControlRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IAddControlRequest); - /** FacetValue count. */ - public count: (number|Long|string); + /** AddControlRequest servingConfig. */ + public servingConfig: string; - /** FacetValue facetValue. */ - public facetValue?: ("value"|"interval"); + /** AddControlRequest controlId. */ + public controlId: string; - /** - * Creates a new FacetValue instance using the specified properties. - * @param [properties] Properties to set - * @returns FacetValue instance - */ - public static create(properties?: google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue): google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue; + /** + * Creates a new AddControlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddControlRequest instance + */ + public static create(properties?: google.cloud.retail.v2beta.IAddControlRequest): google.cloud.retail.v2beta.AddControlRequest; - /** - * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.verify|verify} messages. - * @param message FacetValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified AddControlRequest message. Does not implicitly {@link google.cloud.retail.v2beta.AddControlRequest.verify|verify} messages. + * @param message AddControlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IAddControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.verify|verify} messages. - * @param message FacetValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified AddControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddControlRequest.verify|verify} messages. + * @param message AddControlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IAddControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a FacetValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FacetValue - * @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.v2beta.SearchResponse.Facet.FacetValue; + /** + * Decodes an AddControlRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddControlRequest + * @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.v2beta.AddControlRequest; - /** - * Decodes a FacetValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FacetValue - * @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.v2beta.SearchResponse.Facet.FacetValue; + /** + * Decodes an AddControlRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddControlRequest + * @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.v2beta.AddControlRequest; - /** - * Verifies a FacetValue 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); + /** + * Verifies an AddControlRequest 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 FacetValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FacetValue - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue; + /** + * Creates an AddControlRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddControlRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.AddControlRequest; - /** - * Creates a plain object from a FacetValue message. Also converts values to other types if specified. - * @param message FacetValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from an AddControlRequest message. Also converts values to other types if specified. + * @param message AddControlRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.AddControlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this FacetValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Converts this AddControlRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of a QueryExpansionInfo. */ - interface IQueryExpansionInfo { + /** Properties of a RemoveControlRequest. */ + interface IRemoveControlRequest { - /** QueryExpansionInfo expandedQuery */ - expandedQuery?: (boolean|null); + /** RemoveControlRequest servingConfig */ + servingConfig?: (string|null); - /** QueryExpansionInfo pinnedResultCount */ - pinnedResultCount?: (number|Long|string|null); - } + /** RemoveControlRequest controlId */ + controlId?: (string|null); + } - /** Represents a QueryExpansionInfo. */ - class QueryExpansionInfo implements IQueryExpansionInfo { + /** Represents a RemoveControlRequest. */ + class RemoveControlRequest implements IRemoveControlRequest { - /** - * Constructs a new QueryExpansionInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo); + /** + * Constructs a new RemoveControlRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IRemoveControlRequest); - /** QueryExpansionInfo expandedQuery. */ - public expandedQuery: boolean; + /** RemoveControlRequest servingConfig. */ + public servingConfig: string; - /** QueryExpansionInfo pinnedResultCount. */ - public pinnedResultCount: (number|Long|string); + /** RemoveControlRequest controlId. */ + public controlId: string; - /** - * Creates a new QueryExpansionInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryExpansionInfo instance - */ - public static create(properties?: google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo): google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo; + /** + * Creates a new RemoveControlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveControlRequest instance + */ + public static create(properties?: google.cloud.retail.v2beta.IRemoveControlRequest): google.cloud.retail.v2beta.RemoveControlRequest; - /** - * Encodes the specified QueryExpansionInfo message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.verify|verify} messages. - * @param message QueryExpansionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified RemoveControlRequest message. Does not implicitly {@link google.cloud.retail.v2beta.RemoveControlRequest.verify|verify} messages. + * @param message RemoveControlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IRemoveControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified QueryExpansionInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.verify|verify} messages. - * @param message QueryExpansionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified RemoveControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.RemoveControlRequest.verify|verify} messages. + * @param message RemoveControlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IRemoveControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a QueryExpansionInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryExpansionInfo - * @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.v2beta.SearchResponse.QueryExpansionInfo; + /** + * Decodes a RemoveControlRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveControlRequest + * @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.v2beta.RemoveControlRequest; - /** - * Decodes a QueryExpansionInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryExpansionInfo - * @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.v2beta.SearchResponse.QueryExpansionInfo; + /** + * Decodes a RemoveControlRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveControlRequest + * @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.v2beta.RemoveControlRequest; - /** - * Verifies a QueryExpansionInfo 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); + /** + * Verifies a RemoveControlRequest 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 QueryExpansionInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryExpansionInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo; + /** + * Creates a RemoveControlRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveControlRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.RemoveControlRequest; - /** - * Creates a plain object from a QueryExpansionInfo message. Also converts values to other types if specified. - * @param message QueryExpansionInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a RemoveControlRequest message. Also converts values to other types if specified. + * @param message RemoveControlRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.RemoveControlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this QueryExpansionInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this RemoveControlRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } /** Represents a UserEventService */ diff --git a/packages/google-cloud-retail/protos/protos.js b/packages/google-cloud-retail/protos/protos.js index f4ea68b17ad..b4e3120af83 100644 --- a/packages/google-cloud-retail/protos/protos.js +++ b/packages/google-cloud-retail/protos/protos.js @@ -1372,6 +1372,7 @@ * @property {string|null} [catalog] SetDefaultBranchRequest catalog * @property {string|null} [branchId] SetDefaultBranchRequest branchId * @property {string|null} [note] SetDefaultBranchRequest note + * @property {boolean|null} [force] SetDefaultBranchRequest force */ /** @@ -1413,6 +1414,14 @@ */ SetDefaultBranchRequest.prototype.note = ""; + /** + * SetDefaultBranchRequest force. + * @member {boolean} force + * @memberof google.cloud.retail.v2.SetDefaultBranchRequest + * @instance + */ + SetDefaultBranchRequest.prototype.force = false; + /** * Creates a new SetDefaultBranchRequest instance using the specified properties. * @function create @@ -1443,6 +1452,8 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.branchId); if (message.note != null && Object.hasOwnProperty.call(message, "note")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.note); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.force); return writer; }; @@ -1486,6 +1497,9 @@ case 3: message.note = reader.string(); break; + case 4: + message.force = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -1530,6 +1544,9 @@ if (message.note != null && message.hasOwnProperty("note")) if (!$util.isString(message.note)) return "note: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; @@ -1551,6 +1568,8 @@ message.branchId = String(object.branchId); if (object.note != null) message.note = String(object.note); + if (object.force != null) + message.force = Boolean(object.force); return message; }; @@ -1571,6 +1590,7 @@ object.catalog = ""; object.branchId = ""; object.note = ""; + object.force = false; } if (message.catalog != null && message.hasOwnProperty("catalog")) object.catalog = message.catalog; @@ -1578,6 +1598,8 @@ object.branchId = message.branchId; if (message.note != null && message.hasOwnProperty("note")) object.note = message.note; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; return object; }; @@ -4653,24 +4675,29 @@ return UserInfo; })(); - v2.Promotion = (function() { + v2.LocalInventory = (function() { /** - * Properties of a Promotion. + * Properties of a LocalInventory. * @memberof google.cloud.retail.v2 - * @interface IPromotion - * @property {string|null} [promotionId] Promotion promotionId + * @interface ILocalInventory + * @property {string|null} [placeId] LocalInventory placeId + * @property {google.cloud.retail.v2.IPriceInfo|null} [priceInfo] LocalInventory priceInfo + * @property {Object.|null} [attributes] LocalInventory attributes + * @property {Array.|null} [fulfillmentTypes] LocalInventory fulfillmentTypes */ /** - * Constructs a new Promotion. + * Constructs a new LocalInventory. * @memberof google.cloud.retail.v2 - * @classdesc Represents a Promotion. - * @implements IPromotion + * @classdesc Represents a LocalInventory. + * @implements ILocalInventory * @constructor - * @param {google.cloud.retail.v2.IPromotion=} [properties] Properties to set + * @param {google.cloud.retail.v2.ILocalInventory=} [properties] Properties to set */ - function Promotion(properties) { + function LocalInventory(properties) { + this.attributes = {}; + this.fulfillmentTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4678,75 +4705,139 @@ } /** - * Promotion promotionId. - * @member {string} promotionId - * @memberof google.cloud.retail.v2.Promotion + * LocalInventory placeId. + * @member {string} placeId + * @memberof google.cloud.retail.v2.LocalInventory * @instance */ - Promotion.prototype.promotionId = ""; + LocalInventory.prototype.placeId = ""; /** - * Creates a new Promotion instance using the specified properties. + * LocalInventory priceInfo. + * @member {google.cloud.retail.v2.IPriceInfo|null|undefined} priceInfo + * @memberof google.cloud.retail.v2.LocalInventory + * @instance + */ + LocalInventory.prototype.priceInfo = null; + + /** + * LocalInventory attributes. + * @member {Object.} attributes + * @memberof google.cloud.retail.v2.LocalInventory + * @instance + */ + LocalInventory.prototype.attributes = $util.emptyObject; + + /** + * LocalInventory fulfillmentTypes. + * @member {Array.} fulfillmentTypes + * @memberof google.cloud.retail.v2.LocalInventory + * @instance + */ + LocalInventory.prototype.fulfillmentTypes = $util.emptyArray; + + /** + * Creates a new LocalInventory instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2.Promotion + * @memberof google.cloud.retail.v2.LocalInventory * @static - * @param {google.cloud.retail.v2.IPromotion=} [properties] Properties to set - * @returns {google.cloud.retail.v2.Promotion} Promotion instance + * @param {google.cloud.retail.v2.ILocalInventory=} [properties] Properties to set + * @returns {google.cloud.retail.v2.LocalInventory} LocalInventory instance */ - Promotion.create = function create(properties) { - return new Promotion(properties); + LocalInventory.create = function create(properties) { + return new LocalInventory(properties); }; /** - * Encodes the specified Promotion message. Does not implicitly {@link google.cloud.retail.v2.Promotion.verify|verify} messages. + * Encodes the specified LocalInventory message. Does not implicitly {@link google.cloud.retail.v2.LocalInventory.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2.Promotion + * @memberof google.cloud.retail.v2.LocalInventory * @static - * @param {google.cloud.retail.v2.IPromotion} message Promotion message or plain object to encode + * @param {google.cloud.retail.v2.ILocalInventory} message LocalInventory message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Promotion.encode = function encode(message, writer) { + LocalInventory.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.promotionId != null && Object.hasOwnProperty.call(message, "promotionId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.promotionId); + if (message.placeId != null && Object.hasOwnProperty.call(message, "placeId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.placeId); + if (message.priceInfo != null && Object.hasOwnProperty.call(message, "priceInfo")) + $root.google.cloud.retail.v2.PriceInfo.encode(message.priceInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.retail.v2.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.fulfillmentTypes != null && message.fulfillmentTypes.length) + for (var i = 0; i < message.fulfillmentTypes.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.fulfillmentTypes[i]); return writer; }; /** - * Encodes the specified Promotion message, length delimited. Does not implicitly {@link google.cloud.retail.v2.Promotion.verify|verify} messages. + * Encodes the specified LocalInventory message, length delimited. Does not implicitly {@link google.cloud.retail.v2.LocalInventory.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2.Promotion + * @memberof google.cloud.retail.v2.LocalInventory * @static - * @param {google.cloud.retail.v2.IPromotion} message Promotion message or plain object to encode + * @param {google.cloud.retail.v2.ILocalInventory} message LocalInventory message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Promotion.encodeDelimited = function encodeDelimited(message, writer) { + LocalInventory.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Promotion message from the specified reader or buffer. + * Decodes a LocalInventory message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2.Promotion + * @memberof google.cloud.retail.v2.LocalInventory * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.Promotion} Promotion + * @returns {google.cloud.retail.v2.LocalInventory} LocalInventory * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Promotion.decode = function decode(reader, length) { + LocalInventory.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.v2.Promotion(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.LocalInventory(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.promotionId = reader.string(); + message.placeId = reader.string(); + break; + case 2: + message.priceInfo = $root.google.cloud.retail.v2.PriceInfo.decode(reader, reader.uint32()); + break; + case 3: + if (message.attributes === $util.emptyObject) + message.attributes = {}; + 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.v2.CustomAttribute.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + case 4: + if (!(message.fulfillmentTypes && message.fulfillmentTypes.length)) + message.fulfillmentTypes = []; + message.fulfillmentTypes.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4757,87 +4848,150 @@ }; /** - * Decodes a Promotion message from the specified reader or buffer, length delimited. + * Decodes a LocalInventory message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2.Promotion + * @memberof google.cloud.retail.v2.LocalInventory * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.Promotion} Promotion + * @returns {google.cloud.retail.v2.LocalInventory} LocalInventory * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Promotion.decodeDelimited = function decodeDelimited(reader) { + LocalInventory.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Promotion message. + * Verifies a LocalInventory message. * @function verify - * @memberof google.cloud.retail.v2.Promotion + * @memberof google.cloud.retail.v2.LocalInventory * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Promotion.verify = function verify(message) { + LocalInventory.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.promotionId != null && message.hasOwnProperty("promotionId")) - if (!$util.isString(message.promotionId)) - return "promotionId: string expected"; + if (message.placeId != null && message.hasOwnProperty("placeId")) + if (!$util.isString(message.placeId)) + return "placeId: string expected"; + if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) { + var error = $root.google.cloud.retail.v2.PriceInfo.verify(message.priceInfo); + if (error) + return "priceInfo." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.retail.v2.CustomAttribute.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + if (message.fulfillmentTypes != null && message.hasOwnProperty("fulfillmentTypes")) { + if (!Array.isArray(message.fulfillmentTypes)) + return "fulfillmentTypes: array expected"; + for (var i = 0; i < message.fulfillmentTypes.length; ++i) + if (!$util.isString(message.fulfillmentTypes[i])) + return "fulfillmentTypes: string[] expected"; + } return null; }; /** - * Creates a Promotion message from a plain object. Also converts values to their respective internal types. + * Creates a LocalInventory message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2.Promotion + * @memberof google.cloud.retail.v2.LocalInventory * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.Promotion} Promotion + * @returns {google.cloud.retail.v2.LocalInventory} LocalInventory */ - Promotion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.Promotion) + LocalInventory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.LocalInventory) return object; - var message = new $root.google.cloud.retail.v2.Promotion(); - if (object.promotionId != null) - message.promotionId = String(object.promotionId); + var message = new $root.google.cloud.retail.v2.LocalInventory(); + if (object.placeId != null) + message.placeId = String(object.placeId); + if (object.priceInfo != null) { + if (typeof object.priceInfo !== "object") + throw TypeError(".google.cloud.retail.v2.LocalInventory.priceInfo: object expected"); + message.priceInfo = $root.google.cloud.retail.v2.PriceInfo.fromObject(object.priceInfo); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.retail.v2.LocalInventory.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2.LocalInventory.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.retail.v2.CustomAttribute.fromObject(object.attributes[keys[i]]); + } + } + if (object.fulfillmentTypes) { + if (!Array.isArray(object.fulfillmentTypes)) + throw TypeError(".google.cloud.retail.v2.LocalInventory.fulfillmentTypes: array expected"); + message.fulfillmentTypes = []; + for (var i = 0; i < object.fulfillmentTypes.length; ++i) + message.fulfillmentTypes[i] = String(object.fulfillmentTypes[i]); + } return message; }; /** - * Creates a plain object from a Promotion message. Also converts values to other types if specified. + * Creates a plain object from a LocalInventory message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2.Promotion + * @memberof google.cloud.retail.v2.LocalInventory * @static - * @param {google.cloud.retail.v2.Promotion} message Promotion + * @param {google.cloud.retail.v2.LocalInventory} message LocalInventory * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Promotion.toObject = function toObject(message, options) { + LocalInventory.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.promotionId = ""; - if (message.promotionId != null && message.hasOwnProperty("promotionId")) - object.promotionId = message.promotionId; + if (options.arrays || options.defaults) + object.fulfillmentTypes = []; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.placeId = ""; + object.priceInfo = null; + } + if (message.placeId != null && message.hasOwnProperty("placeId")) + object.placeId = message.placeId; + if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) + object.priceInfo = $root.google.cloud.retail.v2.PriceInfo.toObject(message.priceInfo, options); + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.retail.v2.CustomAttribute.toObject(message.attributes[keys2[j]], options); + } + if (message.fulfillmentTypes && message.fulfillmentTypes.length) { + object.fulfillmentTypes = []; + for (var j = 0; j < message.fulfillmentTypes.length; ++j) + object.fulfillmentTypes[j] = message.fulfillmentTypes[j]; + } return object; }; /** - * Converts this Promotion to JSON. + * Converts this LocalInventory to JSON. * @function toJSON - * @memberof google.cloud.retail.v2.Promotion + * @memberof google.cloud.retail.v2.LocalInventory * @instance * @returns {Object.} JSON object */ - Promotion.prototype.toJSON = function toJSON() { + LocalInventory.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Promotion; + return LocalInventory; })(); v2.CompletionService = (function() { @@ -11376,6 +11530,193 @@ return Product; })(); + v2.Promotion = (function() { + + /** + * Properties of a Promotion. + * @memberof google.cloud.retail.v2 + * @interface IPromotion + * @property {string|null} [promotionId] Promotion promotionId + */ + + /** + * Constructs a new Promotion. + * @memberof google.cloud.retail.v2 + * @classdesc Represents a Promotion. + * @implements IPromotion + * @constructor + * @param {google.cloud.retail.v2.IPromotion=} [properties] Properties to set + */ + function Promotion(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]]; + } + + /** + * Promotion promotionId. + * @member {string} promotionId + * @memberof google.cloud.retail.v2.Promotion + * @instance + */ + Promotion.prototype.promotionId = ""; + + /** + * Creates a new Promotion instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.Promotion + * @static + * @param {google.cloud.retail.v2.IPromotion=} [properties] Properties to set + * @returns {google.cloud.retail.v2.Promotion} Promotion instance + */ + Promotion.create = function create(properties) { + return new Promotion(properties); + }; + + /** + * Encodes the specified Promotion message. Does not implicitly {@link google.cloud.retail.v2.Promotion.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.Promotion + * @static + * @param {google.cloud.retail.v2.IPromotion} message Promotion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Promotion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.promotionId != null && Object.hasOwnProperty.call(message, "promotionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.promotionId); + return writer; + }; + + /** + * Encodes the specified Promotion message, length delimited. Does not implicitly {@link google.cloud.retail.v2.Promotion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.Promotion + * @static + * @param {google.cloud.retail.v2.IPromotion} message Promotion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Promotion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Promotion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.Promotion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.Promotion} Promotion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Promotion.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.v2.Promotion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.promotionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Promotion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.Promotion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.Promotion} Promotion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Promotion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Promotion message. + * @function verify + * @memberof google.cloud.retail.v2.Promotion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Promotion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.promotionId != null && message.hasOwnProperty("promotionId")) + if (!$util.isString(message.promotionId)) + return "promotionId: string expected"; + return null; + }; + + /** + * Creates a Promotion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.Promotion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.Promotion} Promotion + */ + Promotion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.Promotion) + return object; + var message = new $root.google.cloud.retail.v2.Promotion(); + if (object.promotionId != null) + message.promotionId = String(object.promotionId); + return message; + }; + + /** + * Creates a plain object from a Promotion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.Promotion + * @static + * @param {google.cloud.retail.v2.Promotion} message Promotion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Promotion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.promotionId = ""; + if (message.promotionId != null && message.hasOwnProperty("promotionId")) + object.promotionId = message.promotionId; + return object; + }; + + /** + * Converts this Promotion to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.Promotion + * @instance + * @returns {Object.} JSON object + */ + Promotion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Promotion; + })(); + v2.UserEvent = (function() { /** @@ -14195,6 +14536,72 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.retail.v2.ProductService#addLocalInventories}. + * @memberof google.cloud.retail.v2.ProductService + * @typedef AddLocalInventoriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AddLocalInventories. + * @function addLocalInventories + * @memberof google.cloud.retail.v2.ProductService + * @instance + * @param {google.cloud.retail.v2.IAddLocalInventoriesRequest} request AddLocalInventoriesRequest message or plain object + * @param {google.cloud.retail.v2.ProductService.AddLocalInventoriesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductService.prototype.addLocalInventories = function addLocalInventories(request, callback) { + return this.rpcCall(addLocalInventories, $root.google.cloud.retail.v2.AddLocalInventoriesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AddLocalInventories" }); + + /** + * Calls AddLocalInventories. + * @function addLocalInventories + * @memberof google.cloud.retail.v2.ProductService + * @instance + * @param {google.cloud.retail.v2.IAddLocalInventoriesRequest} request AddLocalInventoriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2.ProductService#removeLocalInventories}. + * @memberof google.cloud.retail.v2.ProductService + * @typedef RemoveLocalInventoriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RemoveLocalInventories. + * @function removeLocalInventories + * @memberof google.cloud.retail.v2.ProductService + * @instance + * @param {google.cloud.retail.v2.IRemoveLocalInventoriesRequest} request RemoveLocalInventoriesRequest message or plain object + * @param {google.cloud.retail.v2.ProductService.RemoveLocalInventoriesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductService.prototype.removeLocalInventories = function removeLocalInventories(request, callback) { + return this.rpcCall(removeLocalInventories, $root.google.cloud.retail.v2.RemoveLocalInventoriesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RemoveLocalInventories" }); + + /** + * Calls RemoveLocalInventories. + * @function removeLocalInventories + * @memberof google.cloud.retail.v2.ProductService + * @instance + * @param {google.cloud.retail.v2.IRemoveLocalInventoriesRequest} request RemoveLocalInventoriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return ProductService; })(); @@ -16770,29 +17177,29 @@ return AddFulfillmentPlacesResponse; })(); - v2.RemoveFulfillmentPlacesRequest = (function() { + v2.AddLocalInventoriesRequest = (function() { /** - * Properties of a RemoveFulfillmentPlacesRequest. + * Properties of an AddLocalInventoriesRequest. * @memberof google.cloud.retail.v2 - * @interface IRemoveFulfillmentPlacesRequest - * @property {string|null} [product] RemoveFulfillmentPlacesRequest product - * @property {string|null} [type] RemoveFulfillmentPlacesRequest type - * @property {Array.|null} [placeIds] RemoveFulfillmentPlacesRequest placeIds - * @property {google.protobuf.ITimestamp|null} [removeTime] RemoveFulfillmentPlacesRequest removeTime - * @property {boolean|null} [allowMissing] RemoveFulfillmentPlacesRequest allowMissing + * @interface IAddLocalInventoriesRequest + * @property {string|null} [product] AddLocalInventoriesRequest product + * @property {Array.|null} [localInventories] AddLocalInventoriesRequest localInventories + * @property {google.protobuf.IFieldMask|null} [addMask] AddLocalInventoriesRequest addMask + * @property {google.protobuf.ITimestamp|null} [addTime] AddLocalInventoriesRequest addTime + * @property {boolean|null} [allowMissing] AddLocalInventoriesRequest allowMissing */ /** - * Constructs a new RemoveFulfillmentPlacesRequest. + * Constructs a new AddLocalInventoriesRequest. * @memberof google.cloud.retail.v2 - * @classdesc Represents a RemoveFulfillmentPlacesRequest. - * @implements IRemoveFulfillmentPlacesRequest + * @classdesc Represents an AddLocalInventoriesRequest. + * @implements IAddLocalInventoriesRequest * @constructor - * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2.IAddLocalInventoriesRequest=} [properties] Properties to set */ - function RemoveFulfillmentPlacesRequest(properties) { - this.placeIds = []; + function AddLocalInventoriesRequest(properties) { + this.localInventories = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16800,111 +17207,111 @@ } /** - * RemoveFulfillmentPlacesRequest product. + * AddLocalInventoriesRequest product. * @member {string} product - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2.AddLocalInventoriesRequest * @instance */ - RemoveFulfillmentPlacesRequest.prototype.product = ""; + AddLocalInventoriesRequest.prototype.product = ""; /** - * RemoveFulfillmentPlacesRequest type. - * @member {string} type - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * AddLocalInventoriesRequest localInventories. + * @member {Array.} localInventories + * @memberof google.cloud.retail.v2.AddLocalInventoriesRequest * @instance */ - RemoveFulfillmentPlacesRequest.prototype.type = ""; + AddLocalInventoriesRequest.prototype.localInventories = $util.emptyArray; /** - * RemoveFulfillmentPlacesRequest placeIds. - * @member {Array.} placeIds - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * AddLocalInventoriesRequest addMask. + * @member {google.protobuf.IFieldMask|null|undefined} addMask + * @memberof google.cloud.retail.v2.AddLocalInventoriesRequest * @instance */ - RemoveFulfillmentPlacesRequest.prototype.placeIds = $util.emptyArray; + AddLocalInventoriesRequest.prototype.addMask = null; /** - * RemoveFulfillmentPlacesRequest removeTime. - * @member {google.protobuf.ITimestamp|null|undefined} removeTime - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * AddLocalInventoriesRequest addTime. + * @member {google.protobuf.ITimestamp|null|undefined} addTime + * @memberof google.cloud.retail.v2.AddLocalInventoriesRequest * @instance */ - RemoveFulfillmentPlacesRequest.prototype.removeTime = null; + AddLocalInventoriesRequest.prototype.addTime = null; /** - * RemoveFulfillmentPlacesRequest allowMissing. + * AddLocalInventoriesRequest allowMissing. * @member {boolean} allowMissing - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2.AddLocalInventoriesRequest * @instance */ - RemoveFulfillmentPlacesRequest.prototype.allowMissing = false; + AddLocalInventoriesRequest.prototype.allowMissing = false; /** - * Creates a new RemoveFulfillmentPlacesRequest instance using the specified properties. + * Creates a new AddLocalInventoriesRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2.AddLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest instance + * @param {google.cloud.retail.v2.IAddLocalInventoriesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2.AddLocalInventoriesRequest} AddLocalInventoriesRequest instance */ - RemoveFulfillmentPlacesRequest.create = function create(properties) { - return new RemoveFulfillmentPlacesRequest(properties); + AddLocalInventoriesRequest.create = function create(properties) { + return new AddLocalInventoriesRequest(properties); }; /** - * Encodes the specified RemoveFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.verify|verify} messages. + * Encodes the specified AddLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2.AddLocalInventoriesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2.AddLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest message or plain object to encode + * @param {google.cloud.retail.v2.IAddLocalInventoriesRequest} message AddLocalInventoriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesRequest.encode = function encode(message, writer) { + AddLocalInventoriesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.product != null && Object.hasOwnProperty.call(message, "product")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.placeIds != null && message.placeIds.length) - for (var i = 0; i < message.placeIds.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.placeIds[i]); - if (message.removeTime != null && Object.hasOwnProperty.call(message, "removeTime")) - $root.google.protobuf.Timestamp.encode(message.removeTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.localInventories != null && message.localInventories.length) + for (var i = 0; i < message.localInventories.length; ++i) + $root.google.cloud.retail.v2.LocalInventory.encode(message.localInventories[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.addMask != null && Object.hasOwnProperty.call(message, "addMask")) + $root.google.protobuf.FieldMask.encode(message.addMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.addTime != null && Object.hasOwnProperty.call(message, "addTime")) + $root.google.protobuf.Timestamp.encode(message.addTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowMissing); return writer; }; /** - * Encodes the specified RemoveFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.verify|verify} messages. + * Encodes the specified AddLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.AddLocalInventoriesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2.AddLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest message or plain object to encode + * @param {google.cloud.retail.v2.IAddLocalInventoriesRequest} message AddLocalInventoriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesRequest.encodeDelimited = function encodeDelimited(message, writer) { + AddLocalInventoriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer. + * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2.AddLocalInventoriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2.AddLocalInventoriesRequest} AddLocalInventoriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesRequest.decode = function decode(reader, length) { + AddLocalInventoriesRequest.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.v2.RemoveFulfillmentPlacesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.AddLocalInventoriesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -16912,17 +17319,17 @@ message.product = reader.string(); break; case 2: - message.type = reader.string(); - break; - case 3: - if (!(message.placeIds && message.placeIds.length)) - message.placeIds = []; - message.placeIds.push(reader.string()); + if (!(message.localInventories && message.localInventories.length)) + message.localInventories = []; + message.localInventories.push($root.google.cloud.retail.v2.LocalInventory.decode(reader, reader.uint32())); break; case 4: - message.removeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.addMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; case 5: + message.addTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: message.allowMissing = reader.bool(); break; default: @@ -16934,49 +17341,53 @@ }; /** - * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. + * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2.AddLocalInventoriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2.AddLocalInventoriesRequest} AddLocalInventoriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesRequest.decodeDelimited = function decodeDelimited(reader) { + AddLocalInventoriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveFulfillmentPlacesRequest message. + * Verifies an AddLocalInventoriesRequest message. * @function verify - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2.AddLocalInventoriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveFulfillmentPlacesRequest.verify = function verify(message) { + AddLocalInventoriesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.product != null && message.hasOwnProperty("product")) if (!$util.isString(message.product)) return "product: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.placeIds != null && message.hasOwnProperty("placeIds")) { - if (!Array.isArray(message.placeIds)) - return "placeIds: array expected"; - for (var i = 0; i < message.placeIds.length; ++i) - if (!$util.isString(message.placeIds[i])) - return "placeIds: string[] expected"; + 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.v2.LocalInventory.verify(message.localInventories[i]); + if (error) + return "localInventories." + error; + } } - if (message.removeTime != null && message.hasOwnProperty("removeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.removeTime); + if (message.addMask != null && message.hasOwnProperty("addMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.addMask); if (error) - return "removeTime." + error; + return "addMask." + error; + } + if (message.addTime != null && message.hasOwnProperty("addTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.addTime); + if (error) + return "addTime." + error; } if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) if (typeof message.allowMissing !== "boolean") @@ -16985,32 +17396,38 @@ }; /** - * Creates a RemoveFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AddLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2.AddLocalInventoriesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2.AddLocalInventoriesRequest} AddLocalInventoriesRequest */ - RemoveFulfillmentPlacesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest) + AddLocalInventoriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.AddLocalInventoriesRequest) return object; - var message = new $root.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest(); + var message = new $root.google.cloud.retail.v2.AddLocalInventoriesRequest(); if (object.product != null) message.product = String(object.product); - if (object.type != null) - message.type = String(object.type); - if (object.placeIds) { - if (!Array.isArray(object.placeIds)) - throw TypeError(".google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.placeIds: array expected"); - message.placeIds = []; - for (var i = 0; i < object.placeIds.length; ++i) - message.placeIds[i] = String(object.placeIds[i]); + if (object.localInventories) { + if (!Array.isArray(object.localInventories)) + throw TypeError(".google.cloud.retail.v2.AddLocalInventoriesRequest.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.v2.AddLocalInventoriesRequest.localInventories: object expected"); + message.localInventories[i] = $root.google.cloud.retail.v2.LocalInventory.fromObject(object.localInventories[i]); + } } - if (object.removeTime != null) { - if (typeof object.removeTime !== "object") - throw TypeError(".google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.removeTime: object expected"); - message.removeTime = $root.google.protobuf.Timestamp.fromObject(object.removeTime); + if (object.addMask != null) { + if (typeof object.addMask !== "object") + throw TypeError(".google.cloud.retail.v2.AddLocalInventoriesRequest.addMask: object expected"); + message.addMask = $root.google.protobuf.FieldMask.fromObject(object.addMask); + } + if (object.addTime != null) { + if (typeof object.addTime !== "object") + throw TypeError(".google.cloud.retail.v2.AddLocalInventoriesRequest.addTime: object expected"); + message.addTime = $root.google.protobuf.Timestamp.fromObject(object.addTime); } if (object.allowMissing != null) message.allowMissing = Boolean(object.allowMissing); @@ -17018,73 +17435,73 @@ }; /** - * Creates a plain object from a RemoveFulfillmentPlacesRequest message. Also converts values to other types if specified. + * Creates a plain object from an AddLocalInventoriesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2.AddLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2.RemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest + * @param {google.cloud.retail.v2.AddLocalInventoriesRequest} message AddLocalInventoriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveFulfillmentPlacesRequest.toObject = function toObject(message, options) { + AddLocalInventoriesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.placeIds = []; + object.localInventories = []; if (options.defaults) { object.product = ""; - object.type = ""; - object.removeTime = null; + object.addMask = null; + object.addTime = null; object.allowMissing = false; } if (message.product != null && message.hasOwnProperty("product")) object.product = message.product; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.placeIds && message.placeIds.length) { - object.placeIds = []; - for (var j = 0; j < message.placeIds.length; ++j) - object.placeIds[j] = message.placeIds[j]; + if (message.localInventories && message.localInventories.length) { + object.localInventories = []; + for (var j = 0; j < message.localInventories.length; ++j) + object.localInventories[j] = $root.google.cloud.retail.v2.LocalInventory.toObject(message.localInventories[j], options); } - if (message.removeTime != null && message.hasOwnProperty("removeTime")) - object.removeTime = $root.google.protobuf.Timestamp.toObject(message.removeTime, options); + if (message.addMask != null && message.hasOwnProperty("addMask")) + object.addMask = $root.google.protobuf.FieldMask.toObject(message.addMask, options); + if (message.addTime != null && message.hasOwnProperty("addTime")) + object.addTime = $root.google.protobuf.Timestamp.toObject(message.addTime, options); if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) object.allowMissing = message.allowMissing; return object; }; /** - * Converts this RemoveFulfillmentPlacesRequest to JSON. + * Converts this AddLocalInventoriesRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2.AddLocalInventoriesRequest * @instance * @returns {Object.} JSON object */ - RemoveFulfillmentPlacesRequest.prototype.toJSON = function toJSON() { + AddLocalInventoriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RemoveFulfillmentPlacesRequest; + return AddLocalInventoriesRequest; })(); - v2.RemoveFulfillmentPlacesMetadata = (function() { + v2.AddLocalInventoriesMetadata = (function() { /** - * Properties of a RemoveFulfillmentPlacesMetadata. + * Properties of an AddLocalInventoriesMetadata. * @memberof google.cloud.retail.v2 - * @interface IRemoveFulfillmentPlacesMetadata + * @interface IAddLocalInventoriesMetadata */ /** - * Constructs a new RemoveFulfillmentPlacesMetadata. + * Constructs a new AddLocalInventoriesMetadata. * @memberof google.cloud.retail.v2 - * @classdesc Represents a RemoveFulfillmentPlacesMetadata. - * @implements IRemoveFulfillmentPlacesMetadata + * @classdesc Represents an AddLocalInventoriesMetadata. + * @implements IAddLocalInventoriesMetadata * @constructor - * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2.IAddLocalInventoriesMetadata=} [properties] Properties to set */ - function RemoveFulfillmentPlacesMetadata(properties) { + function AddLocalInventoriesMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17092,60 +17509,60 @@ } /** - * Creates a new RemoveFulfillmentPlacesMetadata instance using the specified properties. + * Creates a new AddLocalInventoriesMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2.AddLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata instance + * @param {google.cloud.retail.v2.IAddLocalInventoriesMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata instance */ - RemoveFulfillmentPlacesMetadata.create = function create(properties) { - return new RemoveFulfillmentPlacesMetadata(properties); + AddLocalInventoriesMetadata.create = function create(properties) { + return new AddLocalInventoriesMetadata(properties); }; /** - * Encodes the specified RemoveFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata.verify|verify} messages. + * Encodes the specified AddLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2.AddLocalInventoriesMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2.AddLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata message or plain object to encode + * @param {google.cloud.retail.v2.IAddLocalInventoriesMetadata} message AddLocalInventoriesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesMetadata.encode = function encode(message, writer) { + AddLocalInventoriesMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** - * Encodes the specified RemoveFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata.verify|verify} messages. + * Encodes the specified AddLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.AddLocalInventoriesMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2.AddLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata message or plain object to encode + * @param {google.cloud.retail.v2.IAddLocalInventoriesMetadata} message AddLocalInventoriesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + AddLocalInventoriesMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer. + * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2.AddLocalInventoriesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesMetadata.decode = function decode(reader, length) { + AddLocalInventoriesMetadata.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.v2.RemoveFulfillmentPlacesMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.AddLocalInventoriesMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -17158,93 +17575,93 @@ }; /** - * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. + * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2.AddLocalInventoriesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesMetadata.decodeDelimited = function decodeDelimited(reader) { + AddLocalInventoriesMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveFulfillmentPlacesMetadata message. + * Verifies an AddLocalInventoriesMetadata message. * @function verify - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2.AddLocalInventoriesMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveFulfillmentPlacesMetadata.verify = function verify(message) { + AddLocalInventoriesMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** - * Creates a RemoveFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an AddLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2.AddLocalInventoriesMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata */ - RemoveFulfillmentPlacesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata) + AddLocalInventoriesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.AddLocalInventoriesMetadata) return object; - return new $root.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata(); + return new $root.google.cloud.retail.v2.AddLocalInventoriesMetadata(); }; /** - * Creates a plain object from a RemoveFulfillmentPlacesMetadata message. Also converts values to other types if specified. + * Creates a plain object from an AddLocalInventoriesMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2.AddLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata + * @param {google.cloud.retail.v2.AddLocalInventoriesMetadata} message AddLocalInventoriesMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveFulfillmentPlacesMetadata.toObject = function toObject() { + AddLocalInventoriesMetadata.toObject = function toObject() { return {}; }; /** - * Converts this RemoveFulfillmentPlacesMetadata to JSON. + * Converts this AddLocalInventoriesMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2.AddLocalInventoriesMetadata * @instance * @returns {Object.} JSON object */ - RemoveFulfillmentPlacesMetadata.prototype.toJSON = function toJSON() { + AddLocalInventoriesMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RemoveFulfillmentPlacesMetadata; + return AddLocalInventoriesMetadata; })(); - v2.RemoveFulfillmentPlacesResponse = (function() { + v2.AddLocalInventoriesResponse = (function() { /** - * Properties of a RemoveFulfillmentPlacesResponse. + * Properties of an AddLocalInventoriesResponse. * @memberof google.cloud.retail.v2 - * @interface IRemoveFulfillmentPlacesResponse + * @interface IAddLocalInventoriesResponse */ /** - * Constructs a new RemoveFulfillmentPlacesResponse. + * Constructs a new AddLocalInventoriesResponse. * @memberof google.cloud.retail.v2 - * @classdesc Represents a RemoveFulfillmentPlacesResponse. - * @implements IRemoveFulfillmentPlacesResponse + * @classdesc Represents an AddLocalInventoriesResponse. + * @implements IAddLocalInventoriesResponse * @constructor - * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2.IAddLocalInventoriesResponse=} [properties] Properties to set */ - function RemoveFulfillmentPlacesResponse(properties) { + function AddLocalInventoriesResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17252,60 +17669,60 @@ } /** - * Creates a new RemoveFulfillmentPlacesResponse instance using the specified properties. + * Creates a new AddLocalInventoriesResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2.AddLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse instance + * @param {google.cloud.retail.v2.IAddLocalInventoriesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2.AddLocalInventoriesResponse} AddLocalInventoriesResponse instance */ - RemoveFulfillmentPlacesResponse.create = function create(properties) { - return new RemoveFulfillmentPlacesResponse(properties); + AddLocalInventoriesResponse.create = function create(properties) { + return new AddLocalInventoriesResponse(properties); }; /** - * Encodes the specified RemoveFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * Encodes the specified AddLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2.AddLocalInventoriesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2.AddLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse message or plain object to encode + * @param {google.cloud.retail.v2.IAddLocalInventoriesResponse} message AddLocalInventoriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesResponse.encode = function encode(message, writer) { + AddLocalInventoriesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** - * Encodes the specified RemoveFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * Encodes the specified AddLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.AddLocalInventoriesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2.AddLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse message or plain object to encode + * @param {google.cloud.retail.v2.IAddLocalInventoriesResponse} message AddLocalInventoriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + AddLocalInventoriesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer. + * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2.AddLocalInventoriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2.AddLocalInventoriesResponse} AddLocalInventoriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesResponse.decode = function decode(reader, length) { + AddLocalInventoriesResponse.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.v2.RemoveFulfillmentPlacesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.AddLocalInventoriesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -17318,93 +17735,98 @@ }; /** - * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. + * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2.AddLocalInventoriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2.AddLocalInventoriesResponse} AddLocalInventoriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesResponse.decodeDelimited = function decodeDelimited(reader) { + AddLocalInventoriesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveFulfillmentPlacesResponse message. + * Verifies an AddLocalInventoriesResponse message. * @function verify - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2.AddLocalInventoriesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveFulfillmentPlacesResponse.verify = function verify(message) { + AddLocalInventoriesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** - * Creates a RemoveFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AddLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2.AddLocalInventoriesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2.AddLocalInventoriesResponse} AddLocalInventoriesResponse */ - RemoveFulfillmentPlacesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse) + AddLocalInventoriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.AddLocalInventoriesResponse) return object; - return new $root.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse(); + return new $root.google.cloud.retail.v2.AddLocalInventoriesResponse(); }; /** - * Creates a plain object from a RemoveFulfillmentPlacesResponse message. Also converts values to other types if specified. + * Creates a plain object from an AddLocalInventoriesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2.AddLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2.RemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse + * @param {google.cloud.retail.v2.AddLocalInventoriesResponse} message AddLocalInventoriesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveFulfillmentPlacesResponse.toObject = function toObject() { + AddLocalInventoriesResponse.toObject = function toObject() { return {}; }; /** - * Converts this RemoveFulfillmentPlacesResponse to JSON. + * Converts this AddLocalInventoriesResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2.AddLocalInventoriesResponse * @instance * @returns {Object.} JSON object */ - RemoveFulfillmentPlacesResponse.prototype.toJSON = function toJSON() { + AddLocalInventoriesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RemoveFulfillmentPlacesResponse; + return AddLocalInventoriesResponse; })(); - v2.PurgeMetadata = (function() { + v2.RemoveLocalInventoriesRequest = (function() { /** - * Properties of a PurgeMetadata. + * Properties of a RemoveLocalInventoriesRequest. * @memberof google.cloud.retail.v2 - * @interface IPurgeMetadata + * @interface IRemoveLocalInventoriesRequest + * @property {string|null} [product] RemoveLocalInventoriesRequest product + * @property {Array.|null} [placeIds] RemoveLocalInventoriesRequest placeIds + * @property {google.protobuf.ITimestamp|null} [removeTime] RemoveLocalInventoriesRequest removeTime + * @property {boolean|null} [allowMissing] RemoveLocalInventoriesRequest allowMissing */ /** - * Constructs a new PurgeMetadata. + * Constructs a new RemoveLocalInventoriesRequest. * @memberof google.cloud.retail.v2 - * @classdesc Represents a PurgeMetadata. - * @implements IPurgeMetadata + * @classdesc Represents a RemoveLocalInventoriesRequest. + * @implements IRemoveLocalInventoriesRequest * @constructor - * @param {google.cloud.retail.v2.IPurgeMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2.IRemoveLocalInventoriesRequest=} [properties] Properties to set */ - function PurgeMetadata(properties) { + function RemoveLocalInventoriesRequest(properties) { + this.placeIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17412,63 +17834,118 @@ } /** - * Creates a new PurgeMetadata instance using the specified properties. + * RemoveLocalInventoriesRequest product. + * @member {string} product + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesRequest + * @instance + */ + RemoveLocalInventoriesRequest.prototype.product = ""; + + /** + * RemoveLocalInventoriesRequest placeIds. + * @member {Array.} placeIds + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesRequest + * @instance + */ + RemoveLocalInventoriesRequest.prototype.placeIds = $util.emptyArray; + + /** + * RemoveLocalInventoriesRequest removeTime. + * @member {google.protobuf.ITimestamp|null|undefined} removeTime + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesRequest + * @instance + */ + RemoveLocalInventoriesRequest.prototype.removeTime = null; + + /** + * RemoveLocalInventoriesRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesRequest + * @instance + */ + RemoveLocalInventoriesRequest.prototype.allowMissing = false; + + /** + * Creates a new RemoveLocalInventoriesRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2.PurgeMetadata + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2.IPurgeMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2.PurgeMetadata} PurgeMetadata instance + * @param {google.cloud.retail.v2.IRemoveLocalInventoriesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest instance */ - PurgeMetadata.create = function create(properties) { - return new PurgeMetadata(properties); + RemoveLocalInventoriesRequest.create = function create(properties) { + return new RemoveLocalInventoriesRequest(properties); }; /** - * Encodes the specified PurgeMetadata message. Does not implicitly {@link google.cloud.retail.v2.PurgeMetadata.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2.RemoveLocalInventoriesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2.PurgeMetadata + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2.IPurgeMetadata} message PurgeMetadata message or plain object to encode + * @param {google.cloud.retail.v2.IRemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeMetadata.encode = function encode(message, writer) { + RemoveLocalInventoriesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); + if (message.placeIds != null && message.placeIds.length) + for (var i = 0; i < message.placeIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.placeIds[i]); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + if (message.removeTime != null && Object.hasOwnProperty.call(message, "removeTime")) + $root.google.protobuf.Timestamp.encode(message.removeTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified PurgeMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeMetadata.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveLocalInventoriesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2.PurgeMetadata + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2.IPurgeMetadata} message PurgeMetadata message or plain object to encode + * @param {google.cloud.retail.v2.IRemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeMetadata.encodeDelimited = function encodeDelimited(message, writer) { + RemoveLocalInventoriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PurgeMetadata message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2.PurgeMetadata + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.PurgeMetadata} PurgeMetadata + * @returns {google.cloud.retail.v2.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeMetadata.decode = function decode(reader, length) { + RemoveLocalInventoriesRequest.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.v2.PurgeMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.RemoveLocalInventoriesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.product = reader.string(); + break; + case 2: + if (!(message.placeIds && message.placeIds.length)) + message.placeIds = []; + message.placeIds.push(reader.string()); + break; + case 5: + message.removeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.allowMissing = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -17478,96 +17955,149 @@ }; /** - * Decodes a PurgeMetadata message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2.PurgeMetadata + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.PurgeMetadata} PurgeMetadata + * @returns {google.cloud.retail.v2.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeMetadata.decodeDelimited = function decodeDelimited(reader) { + RemoveLocalInventoriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PurgeMetadata message. + * Verifies a RemoveLocalInventoriesRequest message. * @function verify - * @memberof google.cloud.retail.v2.PurgeMetadata + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PurgeMetadata.verify = function verify(message) { + RemoveLocalInventoriesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + if (message.placeIds != null && message.hasOwnProperty("placeIds")) { + if (!Array.isArray(message.placeIds)) + return "placeIds: array expected"; + for (var i = 0; i < message.placeIds.length; ++i) + if (!$util.isString(message.placeIds[i])) + return "placeIds: string[] expected"; + } + if (message.removeTime != null && message.hasOwnProperty("removeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.removeTime); + if (error) + return "removeTime." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a PurgeMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2.PurgeMetadata + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.PurgeMetadata} PurgeMetadata + * @returns {google.cloud.retail.v2.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest */ - PurgeMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.PurgeMetadata) + RemoveLocalInventoriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.RemoveLocalInventoriesRequest) return object; - return new $root.google.cloud.retail.v2.PurgeMetadata(); + var message = new $root.google.cloud.retail.v2.RemoveLocalInventoriesRequest(); + if (object.product != null) + message.product = String(object.product); + if (object.placeIds) { + if (!Array.isArray(object.placeIds)) + throw TypeError(".google.cloud.retail.v2.RemoveLocalInventoriesRequest.placeIds: array expected"); + message.placeIds = []; + for (var i = 0; i < object.placeIds.length; ++i) + message.placeIds[i] = String(object.placeIds[i]); + } + if (object.removeTime != null) { + if (typeof object.removeTime !== "object") + throw TypeError(".google.cloud.retail.v2.RemoveLocalInventoriesRequest.removeTime: object expected"); + message.removeTime = $root.google.protobuf.Timestamp.fromObject(object.removeTime); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; }; /** - * Creates a plain object from a PurgeMetadata message. Also converts values to other types if specified. + * Creates a plain object from a RemoveLocalInventoriesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2.PurgeMetadata + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2.PurgeMetadata} message PurgeMetadata + * @param {google.cloud.retail.v2.RemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PurgeMetadata.toObject = function toObject() { - return {}; + RemoveLocalInventoriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.placeIds = []; + if (options.defaults) { + object.product = ""; + object.allowMissing = false; + object.removeTime = null; + } + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + if (message.placeIds && message.placeIds.length) { + object.placeIds = []; + for (var j = 0; j < message.placeIds.length; ++j) + object.placeIds[j] = message.placeIds[j]; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.removeTime != null && message.hasOwnProperty("removeTime")) + object.removeTime = $root.google.protobuf.Timestamp.toObject(message.removeTime, options); + return object; }; /** - * Converts this PurgeMetadata to JSON. + * Converts this RemoveLocalInventoriesRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2.PurgeMetadata + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesRequest * @instance * @returns {Object.} JSON object */ - PurgeMetadata.prototype.toJSON = function toJSON() { + RemoveLocalInventoriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PurgeMetadata; + return RemoveLocalInventoriesRequest; })(); - v2.PurgeUserEventsRequest = (function() { + v2.RemoveLocalInventoriesMetadata = (function() { /** - * Properties of a PurgeUserEventsRequest. + * Properties of a RemoveLocalInventoriesMetadata. * @memberof google.cloud.retail.v2 - * @interface IPurgeUserEventsRequest - * @property {string|null} [parent] PurgeUserEventsRequest parent - * @property {string|null} [filter] PurgeUserEventsRequest filter - * @property {boolean|null} [force] PurgeUserEventsRequest force + * @interface IRemoveLocalInventoriesMetadata */ /** - * Constructs a new PurgeUserEventsRequest. + * Constructs a new RemoveLocalInventoriesMetadata. * @memberof google.cloud.retail.v2 - * @classdesc Represents a PurgeUserEventsRequest. - * @implements IPurgeUserEventsRequest + * @classdesc Represents a RemoveLocalInventoriesMetadata. + * @implements IRemoveLocalInventoriesMetadata * @constructor - * @param {google.cloud.retail.v2.IPurgeUserEventsRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2.IRemoveLocalInventoriesMetadata=} [properties] Properties to set */ - function PurgeUserEventsRequest(properties) { + function RemoveLocalInventoriesMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17575,102 +18105,63 @@ } /** - * PurgeUserEventsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest - * @instance - */ - PurgeUserEventsRequest.prototype.parent = ""; - - /** - * PurgeUserEventsRequest filter. - * @member {string} filter - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest - * @instance - */ - PurgeUserEventsRequest.prototype.filter = ""; - - /** - * PurgeUserEventsRequest force. - * @member {boolean} force - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest - * @instance - */ - PurgeUserEventsRequest.prototype.force = false; - - /** - * Creates a new PurgeUserEventsRequest instance using the specified properties. + * Creates a new RemoveLocalInventoriesMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2.IPurgeUserEventsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2.PurgeUserEventsRequest} PurgeUserEventsRequest instance + * @param {google.cloud.retail.v2.IRemoveLocalInventoriesMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata instance */ - PurgeUserEventsRequest.create = function create(properties) { - return new PurgeUserEventsRequest(properties); + RemoveLocalInventoriesMetadata.create = function create(properties) { + return new RemoveLocalInventoriesMetadata(properties); }; /** - * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsRequest.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2.RemoveLocalInventoriesMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {google.cloud.retail.v2.IRemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsRequest.encode = function encode(message, writer) { + RemoveLocalInventoriesMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); return writer; }; /** - * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsRequest.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveLocalInventoriesMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {google.cloud.retail.v2.IRemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + RemoveLocalInventoriesMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.PurgeUserEventsRequest} PurgeUserEventsRequest + * @returns {google.cloud.retail.v2.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeUserEventsRequest.decode = function decode(reader, length) { + RemoveLocalInventoriesMetadata.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.v2.PurgeUserEventsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.RemoveLocalInventoriesMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.force = reader.bool(); - break; default: reader.skipType(tag & 7); break; @@ -17680,124 +18171,93 @@ }; /** - * Decodes a PurgeUserEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.PurgeUserEventsRequest} PurgeUserEventsRequest + * @returns {google.cloud.retail.v2.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { + RemoveLocalInventoriesMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PurgeUserEventsRequest message. + * Verifies a RemoveLocalInventoriesMetadata message. * @function verify - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PurgeUserEventsRequest.verify = function verify(message) { + RemoveLocalInventoriesMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; return null; }; /** - * Creates a PurgeUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.PurgeUserEventsRequest} PurgeUserEventsRequest + * @returns {google.cloud.retail.v2.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata */ - PurgeUserEventsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.PurgeUserEventsRequest) + RemoveLocalInventoriesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.RemoveLocalInventoriesMetadata) return object; - var message = new $root.google.cloud.retail.v2.PurgeUserEventsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.force != null) - message.force = Boolean(object.force); - return message; + return new $root.google.cloud.retail.v2.RemoveLocalInventoriesMetadata(); }; /** - * Creates a plain object from a PurgeUserEventsRequest message. Also converts values to other types if specified. + * Creates a plain object from a RemoveLocalInventoriesMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2.PurgeUserEventsRequest} message PurgeUserEventsRequest + * @param {google.cloud.retail.v2.RemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PurgeUserEventsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.force = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - return object; + RemoveLocalInventoriesMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this PurgeUserEventsRequest to JSON. + * Converts this RemoveLocalInventoriesMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesMetadata * @instance * @returns {Object.} JSON object */ - PurgeUserEventsRequest.prototype.toJSON = function toJSON() { + RemoveLocalInventoriesMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PurgeUserEventsRequest; + return RemoveLocalInventoriesMetadata; })(); - v2.PurgeUserEventsResponse = (function() { + v2.RemoveLocalInventoriesResponse = (function() { /** - * Properties of a PurgeUserEventsResponse. + * Properties of a RemoveLocalInventoriesResponse. * @memberof google.cloud.retail.v2 - * @interface IPurgeUserEventsResponse - * @property {number|Long|null} [purgedEventsCount] PurgeUserEventsResponse purgedEventsCount + * @interface IRemoveLocalInventoriesResponse */ /** - * Constructs a new PurgeUserEventsResponse. + * Constructs a new RemoveLocalInventoriesResponse. * @memberof google.cloud.retail.v2 - * @classdesc Represents a PurgeUserEventsResponse. - * @implements IPurgeUserEventsResponse + * @classdesc Represents a RemoveLocalInventoriesResponse. + * @implements IRemoveLocalInventoriesResponse * @constructor - * @param {google.cloud.retail.v2.IPurgeUserEventsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2.IRemoveLocalInventoriesResponse=} [properties] Properties to set */ - function PurgeUserEventsResponse(properties) { + function RemoveLocalInventoriesResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17805,76 +18265,63 @@ } /** - * PurgeUserEventsResponse purgedEventsCount. - * @member {number|Long} purgedEventsCount - * @memberof google.cloud.retail.v2.PurgeUserEventsResponse - * @instance - */ - PurgeUserEventsResponse.prototype.purgedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new PurgeUserEventsResponse instance using the specified properties. + * Creates a new RemoveLocalInventoriesResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2.IPurgeUserEventsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2.PurgeUserEventsResponse} PurgeUserEventsResponse instance + * @param {google.cloud.retail.v2.IRemoveLocalInventoriesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse instance */ - PurgeUserEventsResponse.create = function create(properties) { - return new PurgeUserEventsResponse(properties); + RemoveLocalInventoriesResponse.create = function create(properties) { + return new RemoveLocalInventoriesResponse(properties); }; /** - * Encodes the specified PurgeUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsResponse.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2.RemoveLocalInventoriesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2.IPurgeUserEventsResponse} message PurgeUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2.IRemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsResponse.encode = function encode(message, writer) { + RemoveLocalInventoriesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.purgedEventsCount != null && Object.hasOwnProperty.call(message, "purgedEventsCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.purgedEventsCount); return writer; }; /** - * Encodes the specified PurgeUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsResponse.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveLocalInventoriesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2.IPurgeUserEventsResponse} message PurgeUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2.IRemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + RemoveLocalInventoriesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PurgeUserEventsResponse message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.PurgeUserEventsResponse} PurgeUserEventsResponse + * @returns {google.cloud.retail.v2.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeUserEventsResponse.decode = function decode(reader, length) { + RemoveLocalInventoriesResponse.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.v2.PurgeUserEventsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.RemoveLocalInventoriesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.purgedEventsCount = reader.int64(); - break; default: reader.skipType(tag & 7); break; @@ -17884,209 +18331,99 @@ }; /** - * Decodes a PurgeUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.PurgeUserEventsResponse} PurgeUserEventsResponse + * @returns {google.cloud.retail.v2.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { + RemoveLocalInventoriesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PurgeUserEventsResponse message. + * Verifies a RemoveLocalInventoriesResponse message. * @function verify - * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PurgeUserEventsResponse.verify = function verify(message) { + RemoveLocalInventoriesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.purgedEventsCount != null && message.hasOwnProperty("purgedEventsCount")) - if (!$util.isInteger(message.purgedEventsCount) && !(message.purgedEventsCount && $util.isInteger(message.purgedEventsCount.low) && $util.isInteger(message.purgedEventsCount.high))) - return "purgedEventsCount: integer|Long expected"; return null; }; /** - * Creates a PurgeUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.PurgeUserEventsResponse} PurgeUserEventsResponse + * @returns {google.cloud.retail.v2.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse */ - PurgeUserEventsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.PurgeUserEventsResponse) + RemoveLocalInventoriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.RemoveLocalInventoriesResponse) return object; - var message = new $root.google.cloud.retail.v2.PurgeUserEventsResponse(); - if (object.purgedEventsCount != null) - if ($util.Long) - (message.purgedEventsCount = $util.Long.fromValue(object.purgedEventsCount)).unsigned = false; - else if (typeof object.purgedEventsCount === "string") - message.purgedEventsCount = parseInt(object.purgedEventsCount, 10); - else if (typeof object.purgedEventsCount === "number") - message.purgedEventsCount = object.purgedEventsCount; - else if (typeof object.purgedEventsCount === "object") - message.purgedEventsCount = new $util.LongBits(object.purgedEventsCount.low >>> 0, object.purgedEventsCount.high >>> 0).toNumber(); - return message; + return new $root.google.cloud.retail.v2.RemoveLocalInventoriesResponse(); }; /** - * Creates a plain object from a PurgeUserEventsResponse message. Also converts values to other types if specified. + * Creates a plain object from a RemoveLocalInventoriesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2.PurgeUserEventsResponse} message PurgeUserEventsResponse + * @param {google.cloud.retail.v2.RemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PurgeUserEventsResponse.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.purgedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.purgedEventsCount = options.longs === String ? "0" : 0; - if (message.purgedEventsCount != null && message.hasOwnProperty("purgedEventsCount")) - if (typeof message.purgedEventsCount === "number") - object.purgedEventsCount = options.longs === String ? String(message.purgedEventsCount) : message.purgedEventsCount; - else - object.purgedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.purgedEventsCount) : options.longs === Number ? new $util.LongBits(message.purgedEventsCount.low >>> 0, message.purgedEventsCount.high >>> 0).toNumber() : message.purgedEventsCount; - return object; + RemoveLocalInventoriesResponse.toObject = function toObject() { + return {}; }; /** - * Converts this PurgeUserEventsResponse to JSON. + * Converts this RemoveLocalInventoriesResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2.RemoveLocalInventoriesResponse * @instance * @returns {Object.} JSON object */ - PurgeUserEventsResponse.prototype.toJSON = function toJSON() { + RemoveLocalInventoriesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PurgeUserEventsResponse; - })(); - - v2.SearchService = (function() { - - /** - * Constructs a new SearchService service. - * @memberof google.cloud.retail.v2 - * @classdesc Represents a SearchService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function SearchService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (SearchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SearchService; - - /** - * Creates new SearchService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.retail.v2.SearchService - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {SearchService} RPC service. Useful where requests and/or responses are streamed. - */ - SearchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.retail.v2.SearchService#search}. - * @memberof google.cloud.retail.v2.SearchService - * @typedef SearchCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2.SearchResponse} [response] SearchResponse - */ - - /** - * Calls Search. - * @function search - * @memberof google.cloud.retail.v2.SearchService - * @instance - * @param {google.cloud.retail.v2.ISearchRequest} request SearchRequest message or plain object - * @param {google.cloud.retail.v2.SearchService.SearchCallback} callback Node-style callback called with the error, if any, and SearchResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SearchService.prototype.search = function search(request, callback) { - return this.rpcCall(search, $root.google.cloud.retail.v2.SearchRequest, $root.google.cloud.retail.v2.SearchResponse, request, callback); - }, "name", { value: "Search" }); - - /** - * Calls Search. - * @function search - * @memberof google.cloud.retail.v2.SearchService - * @instance - * @param {google.cloud.retail.v2.ISearchRequest} request SearchRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return SearchService; + return RemoveLocalInventoriesResponse; })(); - v2.SearchRequest = (function() { + v2.RemoveFulfillmentPlacesRequest = (function() { /** - * Properties of a SearchRequest. + * Properties of a RemoveFulfillmentPlacesRequest. * @memberof google.cloud.retail.v2 - * @interface ISearchRequest - * @property {string|null} [placement] SearchRequest placement - * @property {string|null} [branch] SearchRequest branch - * @property {string|null} [query] SearchRequest query - * @property {string|null} [visitorId] SearchRequest visitorId - * @property {google.cloud.retail.v2.IUserInfo|null} [userInfo] SearchRequest userInfo - * @property {number|null} [pageSize] SearchRequest pageSize - * @property {string|null} [pageToken] SearchRequest pageToken - * @property {number|null} [offset] SearchRequest offset - * @property {string|null} [filter] SearchRequest filter - * @property {string|null} [canonicalFilter] SearchRequest canonicalFilter - * @property {string|null} [orderBy] SearchRequest orderBy - * @property {Array.|null} [facetSpecs] SearchRequest facetSpecs - * @property {google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec|null} [dynamicFacetSpec] SearchRequest dynamicFacetSpec - * @property {google.cloud.retail.v2.SearchRequest.IBoostSpec|null} [boostSpec] SearchRequest boostSpec - * @property {google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec|null} [queryExpansionSpec] SearchRequest queryExpansionSpec - * @property {Array.|null} [variantRollupKeys] SearchRequest variantRollupKeys - * @property {Array.|null} [pageCategories] SearchRequest pageCategories - * @property {google.cloud.retail.v2.SearchRequest.SearchMode|null} [searchMode] SearchRequest searchMode + * @interface IRemoveFulfillmentPlacesRequest + * @property {string|null} [product] RemoveFulfillmentPlacesRequest product + * @property {string|null} [type] RemoveFulfillmentPlacesRequest type + * @property {Array.|null} [placeIds] RemoveFulfillmentPlacesRequest placeIds + * @property {google.protobuf.ITimestamp|null} [removeTime] RemoveFulfillmentPlacesRequest removeTime + * @property {boolean|null} [allowMissing] RemoveFulfillmentPlacesRequest allowMissing */ /** - * Constructs a new SearchRequest. + * Constructs a new RemoveFulfillmentPlacesRequest. * @memberof google.cloud.retail.v2 - * @classdesc Represents a SearchRequest. - * @implements ISearchRequest + * @classdesc Represents a RemoveFulfillmentPlacesRequest. + * @implements IRemoveFulfillmentPlacesRequest * @constructor - * @param {google.cloud.retail.v2.ISearchRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesRequest=} [properties] Properties to set */ - function SearchRequest(properties) { - this.facetSpecs = []; - this.variantRollupKeys = []; - this.pageCategories = []; + function RemoveFulfillmentPlacesRequest(properties) { + this.placeIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18094,306 +18431,355 @@ } /** - * SearchRequest placement. - * @member {string} placement - * @memberof google.cloud.retail.v2.SearchRequest + * RemoveFulfillmentPlacesRequest product. + * @member {string} product + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest * @instance */ - SearchRequest.prototype.placement = ""; + RemoveFulfillmentPlacesRequest.prototype.product = ""; /** - * SearchRequest branch. - * @member {string} branch - * @memberof google.cloud.retail.v2.SearchRequest + * RemoveFulfillmentPlacesRequest type. + * @member {string} type + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest * @instance */ - SearchRequest.prototype.branch = ""; + RemoveFulfillmentPlacesRequest.prototype.type = ""; /** - * SearchRequest query. - * @member {string} query - * @memberof google.cloud.retail.v2.SearchRequest + * RemoveFulfillmentPlacesRequest placeIds. + * @member {Array.} placeIds + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest * @instance */ - SearchRequest.prototype.query = ""; + RemoveFulfillmentPlacesRequest.prototype.placeIds = $util.emptyArray; /** - * SearchRequest visitorId. - * @member {string} visitorId - * @memberof google.cloud.retail.v2.SearchRequest + * RemoveFulfillmentPlacesRequest removeTime. + * @member {google.protobuf.ITimestamp|null|undefined} removeTime + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest * @instance */ - SearchRequest.prototype.visitorId = ""; + RemoveFulfillmentPlacesRequest.prototype.removeTime = null; /** - * SearchRequest userInfo. - * @member {google.cloud.retail.v2.IUserInfo|null|undefined} userInfo - * @memberof google.cloud.retail.v2.SearchRequest + * RemoveFulfillmentPlacesRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest * @instance */ - SearchRequest.prototype.userInfo = null; + RemoveFulfillmentPlacesRequest.prototype.allowMissing = false; /** - * SearchRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.retail.v2.SearchRequest - * @instance + * Creates a new RemoveFulfillmentPlacesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @static + * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest instance */ - SearchRequest.prototype.pageSize = 0; + RemoveFulfillmentPlacesRequest.create = function create(properties) { + return new RemoveFulfillmentPlacesRequest(properties); + }; /** - * SearchRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.retail.v2.SearchRequest - * @instance + * Encodes the specified RemoveFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @static + * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - SearchRequest.prototype.pageToken = ""; + RemoveFulfillmentPlacesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.placeIds != null && message.placeIds.length) + for (var i = 0; i < message.placeIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.placeIds[i]); + if (message.removeTime != null && Object.hasOwnProperty.call(message, "removeTime")) + $root.google.protobuf.Timestamp.encode(message.removeTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + return writer; + }; /** - * SearchRequest offset. - * @member {number} offset - * @memberof google.cloud.retail.v2.SearchRequest - * @instance + * Encodes the specified RemoveFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @static + * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - SearchRequest.prototype.offset = 0; + RemoveFulfillmentPlacesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * SearchRequest filter. - * @member {string} filter - * @memberof google.cloud.retail.v2.SearchRequest - * @instance + * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchRequest.prototype.filter = ""; + RemoveFulfillmentPlacesRequest.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.v2.RemoveFulfillmentPlacesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.product = reader.string(); + break; + case 2: + message.type = reader.string(); + break; + case 3: + if (!(message.placeIds && message.placeIds.length)) + message.placeIds = []; + message.placeIds.push(reader.string()); + break; + case 4: + message.removeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.allowMissing = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * SearchRequest canonicalFilter. - * @member {string} canonicalFilter - * @memberof google.cloud.retail.v2.SearchRequest - * @instance + * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchRequest.prototype.canonicalFilter = ""; + RemoveFulfillmentPlacesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * SearchRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.retail.v2.SearchRequest - * @instance + * Verifies a RemoveFulfillmentPlacesRequest message. + * @function verify + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchRequest.prototype.orderBy = ""; + RemoveFulfillmentPlacesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.placeIds != null && message.hasOwnProperty("placeIds")) { + if (!Array.isArray(message.placeIds)) + return "placeIds: array expected"; + for (var i = 0; i < message.placeIds.length; ++i) + if (!$util.isString(message.placeIds[i])) + return "placeIds: string[] expected"; + } + if (message.removeTime != null && message.hasOwnProperty("removeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.removeTime); + if (error) + return "removeTime." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; /** - * SearchRequest facetSpecs. - * @member {Array.} facetSpecs - * @memberof google.cloud.retail.v2.SearchRequest - * @instance + * Creates a RemoveFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest */ - SearchRequest.prototype.facetSpecs = $util.emptyArray; + RemoveFulfillmentPlacesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest) + return object; + var message = new $root.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest(); + if (object.product != null) + message.product = String(object.product); + if (object.type != null) + message.type = String(object.type); + if (object.placeIds) { + if (!Array.isArray(object.placeIds)) + throw TypeError(".google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.placeIds: array expected"); + message.placeIds = []; + for (var i = 0; i < object.placeIds.length; ++i) + message.placeIds[i] = String(object.placeIds[i]); + } + if (object.removeTime != null) { + if (typeof object.removeTime !== "object") + throw TypeError(".google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.removeTime: object expected"); + message.removeTime = $root.google.protobuf.Timestamp.fromObject(object.removeTime); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; /** - * SearchRequest dynamicFacetSpec. - * @member {google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec|null|undefined} dynamicFacetSpec - * @memberof google.cloud.retail.v2.SearchRequest - * @instance + * Creates a plain object from a RemoveFulfillmentPlacesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest + * @static + * @param {google.cloud.retail.v2.RemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - SearchRequest.prototype.dynamicFacetSpec = null; + RemoveFulfillmentPlacesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.placeIds = []; + if (options.defaults) { + object.product = ""; + object.type = ""; + object.removeTime = null; + object.allowMissing = false; + } + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.placeIds && message.placeIds.length) { + object.placeIds = []; + for (var j = 0; j < message.placeIds.length; ++j) + object.placeIds[j] = message.placeIds[j]; + } + if (message.removeTime != null && message.hasOwnProperty("removeTime")) + object.removeTime = $root.google.protobuf.Timestamp.toObject(message.removeTime, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; /** - * SearchRequest boostSpec. - * @member {google.cloud.retail.v2.SearchRequest.IBoostSpec|null|undefined} boostSpec - * @memberof google.cloud.retail.v2.SearchRequest + * Converts this RemoveFulfillmentPlacesRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesRequest * @instance + * @returns {Object.} JSON object */ - SearchRequest.prototype.boostSpec = null; + RemoveFulfillmentPlacesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * SearchRequest queryExpansionSpec. - * @member {google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec|null|undefined} queryExpansionSpec - * @memberof google.cloud.retail.v2.SearchRequest - * @instance - */ - SearchRequest.prototype.queryExpansionSpec = null; + return RemoveFulfillmentPlacesRequest; + })(); - /** - * SearchRequest variantRollupKeys. - * @member {Array.} variantRollupKeys - * @memberof google.cloud.retail.v2.SearchRequest - * @instance - */ - SearchRequest.prototype.variantRollupKeys = $util.emptyArray; + v2.RemoveFulfillmentPlacesMetadata = (function() { /** - * SearchRequest pageCategories. - * @member {Array.} pageCategories - * @memberof google.cloud.retail.v2.SearchRequest - * @instance + * Properties of a RemoveFulfillmentPlacesMetadata. + * @memberof google.cloud.retail.v2 + * @interface IRemoveFulfillmentPlacesMetadata */ - SearchRequest.prototype.pageCategories = $util.emptyArray; /** - * SearchRequest searchMode. - * @member {google.cloud.retail.v2.SearchRequest.SearchMode} searchMode - * @memberof google.cloud.retail.v2.SearchRequest - * @instance + * Constructs a new RemoveFulfillmentPlacesMetadata. + * @memberof google.cloud.retail.v2 + * @classdesc Represents a RemoveFulfillmentPlacesMetadata. + * @implements IRemoveFulfillmentPlacesMetadata + * @constructor + * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesMetadata=} [properties] Properties to set */ - SearchRequest.prototype.searchMode = 0; + function RemoveFulfillmentPlacesMetadata(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]]; + } /** - * Creates a new SearchRequest instance using the specified properties. + * Creates a new RemoveFulfillmentPlacesMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2.SearchRequest + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2.ISearchRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2.SearchRequest} SearchRequest instance + * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata instance */ - SearchRequest.create = function create(properties) { - return new SearchRequest(properties); + RemoveFulfillmentPlacesMetadata.create = function create(properties) { + return new RemoveFulfillmentPlacesMetadata(properties); }; /** - * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.verify|verify} messages. + * Encodes the specified RemoveFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2.SearchRequest + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2.ISearchRequest} message SearchRequest message or plain object to encode + * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchRequest.encode = function encode(message, writer) { + RemoveFulfillmentPlacesMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.placement); - if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.branch); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); - if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.visitorId); - if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) - $root.google.cloud.retail.v2.UserInfo.encode(message.userInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.offset); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.orderBy); - if (message.facetSpecs != null && message.facetSpecs.length) - for (var i = 0; i < message.facetSpecs.length; ++i) - $root.google.cloud.retail.v2.SearchRequest.FacetSpec.encode(message.facetSpecs[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.boostSpec != null && Object.hasOwnProperty.call(message, "boostSpec")) - $root.google.cloud.retail.v2.SearchRequest.BoostSpec.encode(message.boostSpec, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.queryExpansionSpec != null && Object.hasOwnProperty.call(message, "queryExpansionSpec")) - $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.encode(message.queryExpansionSpec, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.variantRollupKeys != null && message.variantRollupKeys.length) - for (var i = 0; i < message.variantRollupKeys.length; ++i) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.variantRollupKeys[i]); - if (message.dynamicFacetSpec != null && Object.hasOwnProperty.call(message, "dynamicFacetSpec")) - $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.encode(message.dynamicFacetSpec, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.pageCategories != null && message.pageCategories.length) - for (var i = 0; i < message.pageCategories.length; ++i) - writer.uint32(/* id 23, wireType 2 =*/186).string(message.pageCategories[i]); - if (message.canonicalFilter != null && Object.hasOwnProperty.call(message, "canonicalFilter")) - writer.uint32(/* id 28, wireType 2 =*/226).string(message.canonicalFilter); - if (message.searchMode != null && Object.hasOwnProperty.call(message, "searchMode")) - writer.uint32(/* id 31, wireType 0 =*/248).int32(message.searchMode); return writer; }; /** - * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.verify|verify} messages. + * Encodes the specified RemoveFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2.SearchRequest + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2.ISearchRequest} message SearchRequest message or plain object to encode + * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchRequest.encodeDelimited = function encodeDelimited(message, writer) { + RemoveFulfillmentPlacesMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchRequest message from the specified reader or buffer. + * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2.SearchRequest + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.SearchRequest} SearchRequest + * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchRequest.decode = function decode(reader, length) { + RemoveFulfillmentPlacesMetadata.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.v2.SearchRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.placement = reader.string(); - break; - case 2: - message.branch = reader.string(); - break; - case 3: - message.query = reader.string(); - break; - case 4: - message.visitorId = reader.string(); - break; - case 5: - message.userInfo = $root.google.cloud.retail.v2.UserInfo.decode(reader, reader.uint32()); - break; - case 7: - message.pageSize = reader.int32(); - break; - case 8: - message.pageToken = reader.string(); - break; - case 9: - message.offset = reader.int32(); - break; - case 10: - message.filter = reader.string(); - break; - case 28: - message.canonicalFilter = reader.string(); - break; - case 11: - message.orderBy = reader.string(); - break; - case 12: - if (!(message.facetSpecs && message.facetSpecs.length)) - message.facetSpecs = []; - message.facetSpecs.push($root.google.cloud.retail.v2.SearchRequest.FacetSpec.decode(reader, reader.uint32())); - break; - case 21: - message.dynamicFacetSpec = $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.decode(reader, reader.uint32()); - break; - case 13: - message.boostSpec = $root.google.cloud.retail.v2.SearchRequest.BoostSpec.decode(reader, reader.uint32()); - break; - case 14: - message.queryExpansionSpec = $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.decode(reader, reader.uint32()); - break; - case 17: - if (!(message.variantRollupKeys && message.variantRollupKeys.length)) - message.variantRollupKeys = []; - message.variantRollupKeys.push(reader.string()); - break; - case 23: - if (!(message.pageCategories && message.pageCategories.length)) - message.pageCategories = []; - message.pageCategories.push(reader.string()); - break; - case 31: - message.searchMode = reader.int32(); - break; default: reader.skipType(tag & 7); break; @@ -18403,1900 +18789,936 @@ }; /** - * Decodes a SearchRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2.SearchRequest + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.SearchRequest} SearchRequest + * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchRequest.decodeDelimited = function decodeDelimited(reader) { + RemoveFulfillmentPlacesMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchRequest message. + * Verifies a RemoveFulfillmentPlacesMetadata message. * @function verify - * @memberof google.cloud.retail.v2.SearchRequest + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchRequest.verify = function verify(message) { + RemoveFulfillmentPlacesMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.placement != null && message.hasOwnProperty("placement")) - if (!$util.isString(message.placement)) - return "placement: string expected"; - if (message.branch != null && message.hasOwnProperty("branch")) - if (!$util.isString(message.branch)) - return "branch: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: string expected"; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - if (!$util.isString(message.visitorId)) - return "visitorId: string expected"; - if (message.userInfo != null && message.hasOwnProperty("userInfo")) { - var error = $root.google.cloud.retail.v2.UserInfo.verify(message.userInfo); - if (error) - return "userInfo." + error; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset)) - return "offset: integer expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) - if (!$util.isString(message.canonicalFilter)) - return "canonicalFilter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.facetSpecs != null && message.hasOwnProperty("facetSpecs")) { - if (!Array.isArray(message.facetSpecs)) - return "facetSpecs: array expected"; - for (var i = 0; i < message.facetSpecs.length; ++i) { - var error = $root.google.cloud.retail.v2.SearchRequest.FacetSpec.verify(message.facetSpecs[i]); - if (error) - return "facetSpecs." + error; - } - } - if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) { - var error = $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.verify(message.dynamicFacetSpec); - if (error) - return "dynamicFacetSpec." + error; - } - if (message.boostSpec != null && message.hasOwnProperty("boostSpec")) { - var error = $root.google.cloud.retail.v2.SearchRequest.BoostSpec.verify(message.boostSpec); - if (error) - return "boostSpec." + error; - } - if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) { - var error = $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.verify(message.queryExpansionSpec); - if (error) - return "queryExpansionSpec." + error; - } - if (message.variantRollupKeys != null && message.hasOwnProperty("variantRollupKeys")) { - if (!Array.isArray(message.variantRollupKeys)) - return "variantRollupKeys: array expected"; - for (var i = 0; i < message.variantRollupKeys.length; ++i) - if (!$util.isString(message.variantRollupKeys[i])) - return "variantRollupKeys: string[] expected"; - } - if (message.pageCategories != null && message.hasOwnProperty("pageCategories")) { - if (!Array.isArray(message.pageCategories)) - return "pageCategories: array expected"; - for (var i = 0; i < message.pageCategories.length; ++i) - if (!$util.isString(message.pageCategories[i])) - return "pageCategories: string[] expected"; - } - if (message.searchMode != null && message.hasOwnProperty("searchMode")) - switch (message.searchMode) { - default: - return "searchMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } return null; }; /** - * Creates a SearchRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2.SearchRequest + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.SearchRequest} SearchRequest + * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata */ - SearchRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.SearchRequest) - return object; - var message = new $root.google.cloud.retail.v2.SearchRequest(); - if (object.placement != null) - message.placement = String(object.placement); - if (object.branch != null) - message.branch = String(object.branch); - if (object.query != null) - message.query = String(object.query); - if (object.visitorId != null) - message.visitorId = String(object.visitorId); - if (object.userInfo != null) { - if (typeof object.userInfo !== "object") - throw TypeError(".google.cloud.retail.v2.SearchRequest.userInfo: object expected"); - message.userInfo = $root.google.cloud.retail.v2.UserInfo.fromObject(object.userInfo); - } - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.offset != null) - message.offset = object.offset | 0; - if (object.filter != null) - message.filter = String(object.filter); - if (object.canonicalFilter != null) - message.canonicalFilter = String(object.canonicalFilter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.facetSpecs) { - if (!Array.isArray(object.facetSpecs)) - throw TypeError(".google.cloud.retail.v2.SearchRequest.facetSpecs: array expected"); - message.facetSpecs = []; - for (var i = 0; i < object.facetSpecs.length; ++i) { - if (typeof object.facetSpecs[i] !== "object") - throw TypeError(".google.cloud.retail.v2.SearchRequest.facetSpecs: object expected"); - message.facetSpecs[i] = $root.google.cloud.retail.v2.SearchRequest.FacetSpec.fromObject(object.facetSpecs[i]); - } - } - if (object.dynamicFacetSpec != null) { - if (typeof object.dynamicFacetSpec !== "object") - throw TypeError(".google.cloud.retail.v2.SearchRequest.dynamicFacetSpec: object expected"); - message.dynamicFacetSpec = $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.fromObject(object.dynamicFacetSpec); - } - if (object.boostSpec != null) { - if (typeof object.boostSpec !== "object") - throw TypeError(".google.cloud.retail.v2.SearchRequest.boostSpec: object expected"); - message.boostSpec = $root.google.cloud.retail.v2.SearchRequest.BoostSpec.fromObject(object.boostSpec); - } - if (object.queryExpansionSpec != null) { - if (typeof object.queryExpansionSpec !== "object") - throw TypeError(".google.cloud.retail.v2.SearchRequest.queryExpansionSpec: object expected"); - message.queryExpansionSpec = $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.fromObject(object.queryExpansionSpec); - } - if (object.variantRollupKeys) { - if (!Array.isArray(object.variantRollupKeys)) - throw TypeError(".google.cloud.retail.v2.SearchRequest.variantRollupKeys: array expected"); - message.variantRollupKeys = []; - for (var i = 0; i < object.variantRollupKeys.length; ++i) - message.variantRollupKeys[i] = String(object.variantRollupKeys[i]); - } - if (object.pageCategories) { - if (!Array.isArray(object.pageCategories)) - throw TypeError(".google.cloud.retail.v2.SearchRequest.pageCategories: array expected"); - message.pageCategories = []; - for (var i = 0; i < object.pageCategories.length; ++i) - message.pageCategories[i] = String(object.pageCategories[i]); - } - switch (object.searchMode) { - case "SEARCH_MODE_UNSPECIFIED": - case 0: - message.searchMode = 0; - break; - case "PRODUCT_SEARCH_ONLY": - case 1: - message.searchMode = 1; - break; - case "FACETED_SEARCH_ONLY": - case 2: - message.searchMode = 2; - break; - } - return message; + RemoveFulfillmentPlacesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata) + return object; + return new $root.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata(); }; /** - * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. + * Creates a plain object from a RemoveFulfillmentPlacesMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2.SearchRequest + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2.SearchRequest} message SearchRequest + * @param {google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.facetSpecs = []; - object.variantRollupKeys = []; - object.pageCategories = []; - } - if (options.defaults) { - object.placement = ""; - object.branch = ""; - object.query = ""; - object.visitorId = ""; - object.userInfo = null; - object.pageSize = 0; - object.pageToken = ""; - object.offset = 0; - object.filter = ""; - object.orderBy = ""; - object.boostSpec = null; - object.queryExpansionSpec = null; - object.dynamicFacetSpec = null; - object.canonicalFilter = ""; - object.searchMode = options.enums === String ? "SEARCH_MODE_UNSPECIFIED" : 0; - } - if (message.placement != null && message.hasOwnProperty("placement")) - object.placement = message.placement; - if (message.branch != null && message.hasOwnProperty("branch")) - object.branch = message.branch; - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - object.visitorId = message.visitorId; - if (message.userInfo != null && message.hasOwnProperty("userInfo")) - object.userInfo = $root.google.cloud.retail.v2.UserInfo.toObject(message.userInfo, options); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = message.offset; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.facetSpecs && message.facetSpecs.length) { - object.facetSpecs = []; - for (var j = 0; j < message.facetSpecs.length; ++j) - object.facetSpecs[j] = $root.google.cloud.retail.v2.SearchRequest.FacetSpec.toObject(message.facetSpecs[j], options); - } - if (message.boostSpec != null && message.hasOwnProperty("boostSpec")) - object.boostSpec = $root.google.cloud.retail.v2.SearchRequest.BoostSpec.toObject(message.boostSpec, options); - if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) - object.queryExpansionSpec = $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.toObject(message.queryExpansionSpec, options); - if (message.variantRollupKeys && message.variantRollupKeys.length) { - object.variantRollupKeys = []; - for (var j = 0; j < message.variantRollupKeys.length; ++j) - object.variantRollupKeys[j] = message.variantRollupKeys[j]; - } - if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) - object.dynamicFacetSpec = $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.toObject(message.dynamicFacetSpec, options); - if (message.pageCategories && message.pageCategories.length) { - object.pageCategories = []; - for (var j = 0; j < message.pageCategories.length; ++j) - object.pageCategories[j] = message.pageCategories[j]; - } - if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) - object.canonicalFilter = message.canonicalFilter; - if (message.searchMode != null && message.hasOwnProperty("searchMode")) - object.searchMode = options.enums === String ? $root.google.cloud.retail.v2.SearchRequest.SearchMode[message.searchMode] : message.searchMode; - return object; + RemoveFulfillmentPlacesMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this SearchRequest to JSON. + * Converts this RemoveFulfillmentPlacesMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2.SearchRequest + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata * @instance * @returns {Object.} JSON object */ - SearchRequest.prototype.toJSON = function toJSON() { + RemoveFulfillmentPlacesMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - SearchRequest.FacetSpec = (function() { + return RemoveFulfillmentPlacesMetadata; + })(); - /** - * Properties of a FacetSpec. - * @memberof google.cloud.retail.v2.SearchRequest - * @interface IFacetSpec - * @property {google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey|null} [facetKey] FacetSpec facetKey - * @property {number|null} [limit] FacetSpec limit - * @property {Array.|null} [excludedFilterKeys] FacetSpec excludedFilterKeys - * @property {boolean|null} [enableDynamicPosition] FacetSpec enableDynamicPosition - */ + v2.RemoveFulfillmentPlacesResponse = (function() { - /** - * Constructs a new FacetSpec. - * @memberof google.cloud.retail.v2.SearchRequest - * @classdesc Represents a FacetSpec. - * @implements IFacetSpec - * @constructor - * @param {google.cloud.retail.v2.SearchRequest.IFacetSpec=} [properties] Properties to set - */ - function FacetSpec(properties) { - this.excludedFilterKeys = []; - 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]]; - } + /** + * Properties of a RemoveFulfillmentPlacesResponse. + * @memberof google.cloud.retail.v2 + * @interface IRemoveFulfillmentPlacesResponse + */ - /** - * FacetSpec facetKey. - * @member {google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey|null|undefined} facetKey - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec - * @instance - */ - FacetSpec.prototype.facetKey = null; + /** + * Constructs a new RemoveFulfillmentPlacesResponse. + * @memberof google.cloud.retail.v2 + * @classdesc Represents a RemoveFulfillmentPlacesResponse. + * @implements IRemoveFulfillmentPlacesResponse + * @constructor + * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesResponse=} [properties] Properties to set + */ + function RemoveFulfillmentPlacesResponse(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]]; + } - /** - * FacetSpec limit. - * @member {number} limit - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec - * @instance - */ - FacetSpec.prototype.limit = 0; + /** + * Creates a new RemoveFulfillmentPlacesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @static + * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse instance + */ + RemoveFulfillmentPlacesResponse.create = function create(properties) { + return new RemoveFulfillmentPlacesResponse(properties); + }; - /** - * FacetSpec excludedFilterKeys. - * @member {Array.} excludedFilterKeys - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec - * @instance - */ - FacetSpec.prototype.excludedFilterKeys = $util.emptyArray; + /** + * Encodes the specified RemoveFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @static + * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveFulfillmentPlacesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * FacetSpec enableDynamicPosition. - * @member {boolean} enableDynamicPosition - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec - * @instance - */ - FacetSpec.prototype.enableDynamicPosition = false; + /** + * Encodes the specified RemoveFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @static + * @param {google.cloud.retail.v2.IRemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveFulfillmentPlacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new FacetSpec instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.IFacetSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2.SearchRequest.FacetSpec} FacetSpec instance - */ - FacetSpec.create = function create(properties) { - return new FacetSpec(properties); - }; + /** + * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveFulfillmentPlacesResponse.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.v2.RemoveFulfillmentPlacesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified FacetSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.FacetSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.IFacetSpec} message FacetSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.facetKey != null && Object.hasOwnProperty.call(message, "facetKey")) - $root.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.encode(message.facetKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.limit); - if (message.excludedFilterKeys != null && message.excludedFilterKeys.length) - for (var i = 0; i < message.excludedFilterKeys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.excludedFilterKeys[i]); - if (message.enableDynamicPosition != null && Object.hasOwnProperty.call(message, "enableDynamicPosition")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableDynamicPosition); - return writer; - }; + /** + * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveFulfillmentPlacesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified FacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.FacetSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.IFacetSpec} message FacetSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies a RemoveFulfillmentPlacesResponse message. + * @function verify + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveFulfillmentPlacesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - /** - * Decodes a FacetSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.SearchRequest.FacetSpec} FacetSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetSpec.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.v2.SearchRequest.FacetSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.facetKey = $root.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.decode(reader, reader.uint32()); - break; - case 2: - message.limit = reader.int32(); - break; - case 3: - if (!(message.excludedFilterKeys && message.excludedFilterKeys.length)) - message.excludedFilterKeys = []; - message.excludedFilterKeys.push(reader.string()); - break; - case 4: - message.enableDynamicPosition = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a RemoveFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + */ + RemoveFulfillmentPlacesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse) + return object; + return new $root.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse(); + }; - /** - * Decodes a FacetSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.SearchRequest.FacetSpec} FacetSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from a RemoveFulfillmentPlacesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @static + * @param {google.cloud.retail.v2.RemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveFulfillmentPlacesResponse.toObject = function toObject() { + return {}; + }; - /** - * Verifies a FacetSpec message. - * @function verify - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FacetSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.facetKey != null && message.hasOwnProperty("facetKey")) { - var error = $root.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.verify(message.facetKey); - if (error) - return "facetKey." + error; - } - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit)) - return "limit: integer expected"; - if (message.excludedFilterKeys != null && message.hasOwnProperty("excludedFilterKeys")) { - if (!Array.isArray(message.excludedFilterKeys)) - return "excludedFilterKeys: array expected"; - for (var i = 0; i < message.excludedFilterKeys.length; ++i) - if (!$util.isString(message.excludedFilterKeys[i])) - return "excludedFilterKeys: string[] expected"; - } - if (message.enableDynamicPosition != null && message.hasOwnProperty("enableDynamicPosition")) - if (typeof message.enableDynamicPosition !== "boolean") - return "enableDynamicPosition: boolean expected"; - return null; - }; + /** + * Converts this RemoveFulfillmentPlacesResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.RemoveFulfillmentPlacesResponse + * @instance + * @returns {Object.} JSON object + */ + RemoveFulfillmentPlacesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a FacetSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.SearchRequest.FacetSpec} FacetSpec - */ - FacetSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.SearchRequest.FacetSpec) - return object; - var message = new $root.google.cloud.retail.v2.SearchRequest.FacetSpec(); - if (object.facetKey != null) { - if (typeof object.facetKey !== "object") - throw TypeError(".google.cloud.retail.v2.SearchRequest.FacetSpec.facetKey: object expected"); - message.facetKey = $root.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.fromObject(object.facetKey); - } - if (object.limit != null) - message.limit = object.limit | 0; - if (object.excludedFilterKeys) { - if (!Array.isArray(object.excludedFilterKeys)) - throw TypeError(".google.cloud.retail.v2.SearchRequest.FacetSpec.excludedFilterKeys: array expected"); - message.excludedFilterKeys = []; - for (var i = 0; i < object.excludedFilterKeys.length; ++i) - message.excludedFilterKeys[i] = String(object.excludedFilterKeys[i]); - } - if (object.enableDynamicPosition != null) - message.enableDynamicPosition = Boolean(object.enableDynamicPosition); - return message; - }; + return RemoveFulfillmentPlacesResponse; + })(); - /** - * Creates a plain object from a FacetSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.FacetSpec} message FacetSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FacetSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.excludedFilterKeys = []; - if (options.defaults) { - object.facetKey = null; - object.limit = 0; - object.enableDynamicPosition = false; - } - if (message.facetKey != null && message.hasOwnProperty("facetKey")) - object.facetKey = $root.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.toObject(message.facetKey, options); - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = message.limit; - if (message.excludedFilterKeys && message.excludedFilterKeys.length) { - object.excludedFilterKeys = []; - for (var j = 0; j < message.excludedFilterKeys.length; ++j) - object.excludedFilterKeys[j] = message.excludedFilterKeys[j]; - } - if (message.enableDynamicPosition != null && message.hasOwnProperty("enableDynamicPosition")) - object.enableDynamicPosition = message.enableDynamicPosition; - return object; - }; + v2.PurgeMetadata = (function() { - /** - * Converts this FacetSpec to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec - * @instance - * @returns {Object.} JSON object - */ - FacetSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Properties of a PurgeMetadata. + * @memberof google.cloud.retail.v2 + * @interface IPurgeMetadata + */ - FacetSpec.FacetKey = (function() { + /** + * Constructs a new PurgeMetadata. + * @memberof google.cloud.retail.v2 + * @classdesc Represents a PurgeMetadata. + * @implements IPurgeMetadata + * @constructor + * @param {google.cloud.retail.v2.IPurgeMetadata=} [properties] Properties to set + */ + function PurgeMetadata(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]]; + } - /** - * Properties of a FacetKey. - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec - * @interface IFacetKey - * @property {string|null} [key] FacetKey key - * @property {Array.|null} [intervals] FacetKey intervals - * @property {Array.|null} [restrictedValues] FacetKey restrictedValues - * @property {Array.|null} [prefixes] FacetKey prefixes - * @property {Array.|null} [contains] FacetKey contains - * @property {string|null} [orderBy] FacetKey orderBy - * @property {string|null} [query] FacetKey query - */ + /** + * Creates a new PurgeMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.PurgeMetadata + * @static + * @param {google.cloud.retail.v2.IPurgeMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2.PurgeMetadata} PurgeMetadata instance + */ + PurgeMetadata.create = function create(properties) { + return new PurgeMetadata(properties); + }; - /** - * Constructs a new FacetKey. - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec - * @classdesc Represents a FacetKey. - * @implements IFacetKey - * @constructor - * @param {google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey=} [properties] Properties to set - */ - function FacetKey(properties) { - this.intervals = []; - this.restrictedValues = []; - this.prefixes = []; - this.contains = []; - 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]]; - } + /** + * Encodes the specified PurgeMetadata message. Does not implicitly {@link google.cloud.retail.v2.PurgeMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.PurgeMetadata + * @static + * @param {google.cloud.retail.v2.IPurgeMetadata} message PurgeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * FacetKey key. - * @member {string} key - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.key = ""; + /** + * Encodes the specified PurgeMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.PurgeMetadata + * @static + * @param {google.cloud.retail.v2.IPurgeMetadata} message PurgeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * FacetKey intervals. - * @member {Array.} intervals - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.intervals = $util.emptyArray; + /** + * Decodes a PurgeMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.PurgeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.PurgeMetadata} PurgeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeMetadata.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.v2.PurgeMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * FacetKey restrictedValues. - * @member {Array.} restrictedValues - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.restrictedValues = $util.emptyArray; + /** + * Decodes a PurgeMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.PurgeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.PurgeMetadata} PurgeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * FacetKey prefixes. - * @member {Array.} prefixes - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.prefixes = $util.emptyArray; + /** + * Verifies a PurgeMetadata message. + * @function verify + * @memberof google.cloud.retail.v2.PurgeMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurgeMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - /** - * FacetKey contains. - * @member {Array.} contains - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.contains = $util.emptyArray; + /** + * Creates a PurgeMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.PurgeMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.PurgeMetadata} PurgeMetadata + */ + PurgeMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.PurgeMetadata) + return object; + return new $root.google.cloud.retail.v2.PurgeMetadata(); + }; - /** - * FacetKey orderBy. - * @member {string} orderBy - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.orderBy = ""; + /** + * Creates a plain object from a PurgeMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.PurgeMetadata + * @static + * @param {google.cloud.retail.v2.PurgeMetadata} message PurgeMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurgeMetadata.toObject = function toObject() { + return {}; + }; - /** - * FacetKey query. - * @member {string} query - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.query = ""; + /** + * Converts this PurgeMetadata to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.PurgeMetadata + * @instance + * @returns {Object.} JSON object + */ + PurgeMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new FacetKey instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey - * @static - * @param {google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey=} [properties] Properties to set - * @returns {google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey} FacetKey instance - */ - FacetKey.create = function create(properties) { - return new FacetKey(properties); - }; + return PurgeMetadata; + })(); - /** - * Encodes the specified FacetKey message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey - * @static - * @param {google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey} message FacetKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); - if (message.intervals != null && message.intervals.length) - for (var i = 0; i < message.intervals.length; ++i) - $root.google.cloud.retail.v2.Interval.encode(message.intervals[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.restrictedValues != null && message.restrictedValues.length) - for (var i = 0; i < message.restrictedValues.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.restrictedValues[i]); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.query); - if (message.prefixes != null && message.prefixes.length) - for (var i = 0; i < message.prefixes.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.prefixes[i]); - if (message.contains != null && message.contains.length) - for (var i = 0; i < message.contains.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.contains[i]); - return writer; - }; + v2.PurgeUserEventsRequest = (function() { - /** - * Encodes the specified FacetKey message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey - * @static - * @param {google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey} message FacetKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a PurgeUserEventsRequest. + * @memberof google.cloud.retail.v2 + * @interface IPurgeUserEventsRequest + * @property {string|null} [parent] PurgeUserEventsRequest parent + * @property {string|null} [filter] PurgeUserEventsRequest filter + * @property {boolean|null} [force] PurgeUserEventsRequest force + */ - /** - * Decodes a FacetKey message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey} FacetKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetKey.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.v2.SearchRequest.FacetSpec.FacetKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - if (!(message.intervals && message.intervals.length)) - message.intervals = []; - message.intervals.push($root.google.cloud.retail.v2.Interval.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.restrictedValues && message.restrictedValues.length)) - message.restrictedValues = []; - message.restrictedValues.push(reader.string()); - break; - case 8: - if (!(message.prefixes && message.prefixes.length)) - message.prefixes = []; - message.prefixes.push(reader.string()); - break; - case 9: - if (!(message.contains && message.contains.length)) - message.contains = []; - message.contains.push(reader.string()); - break; - case 4: - message.orderBy = reader.string(); - break; - case 5: - message.query = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Constructs a new PurgeUserEventsRequest. + * @memberof google.cloud.retail.v2 + * @classdesc Represents a PurgeUserEventsRequest. + * @implements IPurgeUserEventsRequest + * @constructor + * @param {google.cloud.retail.v2.IPurgeUserEventsRequest=} [properties] Properties to set + */ + function PurgeUserEventsRequest(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]]; + } - /** - * Decodes a FacetKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey} FacetKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * PurgeUserEventsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @instance + */ + PurgeUserEventsRequest.prototype.parent = ""; - /** - * Verifies a FacetKey message. - * @function verify - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FacetKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; - if (message.intervals != null && message.hasOwnProperty("intervals")) { - if (!Array.isArray(message.intervals)) - return "intervals: array expected"; - for (var i = 0; i < message.intervals.length; ++i) { - var error = $root.google.cloud.retail.v2.Interval.verify(message.intervals[i]); - if (error) - return "intervals." + error; - } - } - if (message.restrictedValues != null && message.hasOwnProperty("restrictedValues")) { - if (!Array.isArray(message.restrictedValues)) - return "restrictedValues: array expected"; - for (var i = 0; i < message.restrictedValues.length; ++i) - if (!$util.isString(message.restrictedValues[i])) - return "restrictedValues: string[] expected"; - } - if (message.prefixes != null && message.hasOwnProperty("prefixes")) { - if (!Array.isArray(message.prefixes)) - return "prefixes: array expected"; - for (var i = 0; i < message.prefixes.length; ++i) - if (!$util.isString(message.prefixes[i])) - return "prefixes: string[] expected"; - } - if (message.contains != null && message.hasOwnProperty("contains")) { - if (!Array.isArray(message.contains)) - return "contains: array expected"; - for (var i = 0; i < message.contains.length; ++i) - if (!$util.isString(message.contains[i])) - return "contains: string[] expected"; - } - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: string expected"; - return null; - }; + /** + * PurgeUserEventsRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @instance + */ + PurgeUserEventsRequest.prototype.filter = ""; - /** - * Creates a FacetKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey} FacetKey - */ - FacetKey.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey) - return object; - var message = new $root.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey(); - if (object.key != null) - message.key = String(object.key); - if (object.intervals) { - if (!Array.isArray(object.intervals)) - throw TypeError(".google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals: array expected"); - message.intervals = []; - for (var i = 0; i < object.intervals.length; ++i) { - if (typeof object.intervals[i] !== "object") - throw TypeError(".google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals: object expected"); - message.intervals[i] = $root.google.cloud.retail.v2.Interval.fromObject(object.intervals[i]); - } - } - if (object.restrictedValues) { - if (!Array.isArray(object.restrictedValues)) - throw TypeError(".google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restrictedValues: array expected"); - message.restrictedValues = []; - for (var i = 0; i < object.restrictedValues.length; ++i) - message.restrictedValues[i] = String(object.restrictedValues[i]); - } - if (object.prefixes) { - if (!Array.isArray(object.prefixes)) - throw TypeError(".google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.prefixes: array expected"); - message.prefixes = []; - for (var i = 0; i < object.prefixes.length; ++i) - message.prefixes[i] = String(object.prefixes[i]); - } - if (object.contains) { - if (!Array.isArray(object.contains)) - throw TypeError(".google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.contains: array expected"); - message.contains = []; - for (var i = 0; i < object.contains.length; ++i) - message.contains[i] = String(object.contains[i]); - } - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.query != null) - message.query = String(object.query); - return message; - }; - - /** - * Creates a plain object from a FacetKey message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey - * @static - * @param {google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey} message FacetKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FacetKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.intervals = []; - object.restrictedValues = []; - object.prefixes = []; - object.contains = []; - } - if (options.defaults) { - object.key = ""; - object.orderBy = ""; - object.query = ""; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.intervals && message.intervals.length) { - object.intervals = []; - for (var j = 0; j < message.intervals.length; ++j) - object.intervals[j] = $root.google.cloud.retail.v2.Interval.toObject(message.intervals[j], options); - } - if (message.restrictedValues && message.restrictedValues.length) { - object.restrictedValues = []; - for (var j = 0; j < message.restrictedValues.length; ++j) - object.restrictedValues[j] = message.restrictedValues[j]; - } - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.prefixes && message.prefixes.length) { - object.prefixes = []; - for (var j = 0; j < message.prefixes.length; ++j) - object.prefixes[j] = message.prefixes[j]; - } - if (message.contains && message.contains.length) { - object.contains = []; - for (var j = 0; j < message.contains.length; ++j) - object.contains[j] = message.contains[j]; - } - return object; - }; - - /** - * Converts this FacetKey to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey - * @instance - * @returns {Object.} JSON object - */ - FacetKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FacetKey; - })(); - - return FacetSpec; - })(); - - SearchRequest.DynamicFacetSpec = (function() { - - /** - * Properties of a DynamicFacetSpec. - * @memberof google.cloud.retail.v2.SearchRequest - * @interface IDynamicFacetSpec - * @property {google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode|null} [mode] DynamicFacetSpec mode - */ - - /** - * Constructs a new DynamicFacetSpec. - * @memberof google.cloud.retail.v2.SearchRequest - * @classdesc Represents a DynamicFacetSpec. - * @implements IDynamicFacetSpec - * @constructor - * @param {google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec=} [properties] Properties to set - */ - function DynamicFacetSpec(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]]; - } - - /** - * DynamicFacetSpec mode. - * @member {google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode} mode - * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec - * @instance - */ - DynamicFacetSpec.prototype.mode = 0; - - /** - * Creates a new DynamicFacetSpec instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2.SearchRequest.DynamicFacetSpec} DynamicFacetSpec instance - */ - DynamicFacetSpec.create = function create(properties) { - return new DynamicFacetSpec(properties); - }; - - /** - * Encodes the specified DynamicFacetSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec} message DynamicFacetSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DynamicFacetSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); - return writer; - }; - - /** - * Encodes the specified DynamicFacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec} message DynamicFacetSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DynamicFacetSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * PurgeUserEventsRequest force. + * @member {boolean} force + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @instance + */ + PurgeUserEventsRequest.prototype.force = false; - /** - * Decodes a DynamicFacetSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.SearchRequest.DynamicFacetSpec} DynamicFacetSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DynamicFacetSpec.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.v2.SearchRequest.DynamicFacetSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.mode = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new PurgeUserEventsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @static + * @param {google.cloud.retail.v2.IPurgeUserEventsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2.PurgeUserEventsRequest} PurgeUserEventsRequest instance + */ + PurgeUserEventsRequest.create = function create(properties) { + return new PurgeUserEventsRequest(properties); + }; - /** - * Decodes a DynamicFacetSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.SearchRequest.DynamicFacetSpec} DynamicFacetSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DynamicFacetSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @static + * @param {google.cloud.retail.v2.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeUserEventsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + return writer; + }; - /** - * Verifies a DynamicFacetSpec message. - * @function verify - * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DynamicFacetSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mode != null && message.hasOwnProperty("mode")) - switch (message.mode) { - default: - return "mode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; + /** + * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @static + * @param {google.cloud.retail.v2.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a DynamicFacetSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.SearchRequest.DynamicFacetSpec} DynamicFacetSpec - */ - DynamicFacetSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec) - return object; - var message = new $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec(); - switch (object.mode) { - case "MODE_UNSPECIFIED": - case 0: - message.mode = 0; - break; - case "DISABLED": + /** + * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.PurgeUserEventsRequest} PurgeUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeUserEventsRequest.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.v2.PurgeUserEventsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { case 1: - message.mode = 1; + message.parent = reader.string(); break; - case "ENABLED": case 2: - message.mode = 2; + message.filter = reader.string(); + break; + case 3: + message.force = reader.bool(); + break; + default: + reader.skipType(tag & 7); break; } - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a DynamicFacetSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.DynamicFacetSpec} message DynamicFacetSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DynamicFacetSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; - if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode[message.mode] : message.mode; + /** + * Decodes a PurgeUserEventsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.PurgeUserEventsRequest} PurgeUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurgeUserEventsRequest message. + * @function verify + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurgeUserEventsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a PurgeUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.PurgeUserEventsRequest} PurgeUserEventsRequest + */ + PurgeUserEventsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.PurgeUserEventsRequest) return object; - }; + var message = new $root.google.cloud.retail.v2.PurgeUserEventsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; - /** - * Converts this DynamicFacetSpec to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec - * @instance - * @returns {Object.} JSON object - */ - DynamicFacetSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a PurgeUserEventsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @static + * @param {google.cloud.retail.v2.PurgeUserEventsRequest} message PurgeUserEventsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurgeUserEventsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.force = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; - /** - * Mode enum. - * @name google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode - * @enum {number} - * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value - * @property {number} DISABLED=1 DISABLED value - * @property {number} ENABLED=2 ENABLED value - */ - DynamicFacetSpec.Mode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DISABLED"] = 1; - values[valuesById[2] = "ENABLED"] = 2; - return values; - })(); + /** + * Converts this PurgeUserEventsRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @instance + * @returns {Object.} JSON object + */ + PurgeUserEventsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return DynamicFacetSpec; - })(); + return PurgeUserEventsRequest; + })(); - SearchRequest.BoostSpec = (function() { + v2.PurgeUserEventsResponse = (function() { - /** - * Properties of a BoostSpec. - * @memberof google.cloud.retail.v2.SearchRequest - * @interface IBoostSpec - * @property {Array.|null} [conditionBoostSpecs] BoostSpec conditionBoostSpecs - */ + /** + * Properties of a PurgeUserEventsResponse. + * @memberof google.cloud.retail.v2 + * @interface IPurgeUserEventsResponse + * @property {number|Long|null} [purgedEventsCount] PurgeUserEventsResponse purgedEventsCount + */ - /** - * Constructs a new BoostSpec. - * @memberof google.cloud.retail.v2.SearchRequest - * @classdesc Represents a BoostSpec. - * @implements IBoostSpec - * @constructor - * @param {google.cloud.retail.v2.SearchRequest.IBoostSpec=} [properties] Properties to set - */ - function BoostSpec(properties) { - this.conditionBoostSpecs = []; - 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]]; - } + /** + * Constructs a new PurgeUserEventsResponse. + * @memberof google.cloud.retail.v2 + * @classdesc Represents a PurgeUserEventsResponse. + * @implements IPurgeUserEventsResponse + * @constructor + * @param {google.cloud.retail.v2.IPurgeUserEventsResponse=} [properties] Properties to set + */ + function PurgeUserEventsResponse(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]]; + } - /** - * BoostSpec conditionBoostSpecs. - * @member {Array.} conditionBoostSpecs - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec - * @instance - */ - BoostSpec.prototype.conditionBoostSpecs = $util.emptyArray; + /** + * PurgeUserEventsResponse purgedEventsCount. + * @member {number|Long} purgedEventsCount + * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @instance + */ + PurgeUserEventsResponse.prototype.purgedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Creates a new BoostSpec instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.IBoostSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2.SearchRequest.BoostSpec} BoostSpec instance - */ - BoostSpec.create = function create(properties) { - return new BoostSpec(properties); - }; + /** + * Creates a new PurgeUserEventsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @static + * @param {google.cloud.retail.v2.IPurgeUserEventsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2.PurgeUserEventsResponse} PurgeUserEventsResponse instance + */ + PurgeUserEventsResponse.create = function create(properties) { + return new PurgeUserEventsResponse(properties); + }; - /** - * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.BoostSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.IBoostSpec} message BoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.conditionBoostSpecs != null && message.conditionBoostSpecs.length) - for (var i = 0; i < message.conditionBoostSpecs.length; ++i) - $root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.encode(message.conditionBoostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified PurgeUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @static + * @param {google.cloud.retail.v2.IPurgeUserEventsResponse} message PurgeUserEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeUserEventsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.purgedEventsCount != null && Object.hasOwnProperty.call(message, "purgedEventsCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.purgedEventsCount); + return writer; + }; - /** - * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.BoostSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.IBoostSpec} message BoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified PurgeUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @static + * @param {google.cloud.retail.v2.IPurgeUserEventsResponse} message PurgeUserEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a BoostSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.SearchRequest.BoostSpec} BoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostSpec.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.v2.SearchRequest.BoostSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.conditionBoostSpecs && message.conditionBoostSpecs.length)) - message.conditionBoostSpecs = []; - message.conditionBoostSpecs.push($root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a PurgeUserEventsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.PurgeUserEventsResponse} PurgeUserEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeUserEventsResponse.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.v2.PurgeUserEventsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.purgedEventsCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a BoostSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.SearchRequest.BoostSpec} BoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a BoostSpec message. - * @function verify - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoostSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.conditionBoostSpecs != null && message.hasOwnProperty("conditionBoostSpecs")) { - if (!Array.isArray(message.conditionBoostSpecs)) - return "conditionBoostSpecs: array expected"; - for (var i = 0; i < message.conditionBoostSpecs.length; ++i) { - var error = $root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.verify(message.conditionBoostSpecs[i]); - if (error) - return "conditionBoostSpecs." + error; - } - } - return null; - }; + /** + * Decodes a PurgeUserEventsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.PurgeUserEventsResponse} PurgeUserEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.SearchRequest.BoostSpec} BoostSpec - */ - BoostSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.SearchRequest.BoostSpec) - return object; - var message = new $root.google.cloud.retail.v2.SearchRequest.BoostSpec(); - if (object.conditionBoostSpecs) { - if (!Array.isArray(object.conditionBoostSpecs)) - throw TypeError(".google.cloud.retail.v2.SearchRequest.BoostSpec.conditionBoostSpecs: array expected"); - message.conditionBoostSpecs = []; - for (var i = 0; i < object.conditionBoostSpecs.length; ++i) { - if (typeof object.conditionBoostSpecs[i] !== "object") - throw TypeError(".google.cloud.retail.v2.SearchRequest.BoostSpec.conditionBoostSpecs: object expected"); - message.conditionBoostSpecs[i] = $root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.fromObject(object.conditionBoostSpecs[i]); - } - } - return message; - }; + /** + * Verifies a PurgeUserEventsResponse message. + * @function verify + * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurgeUserEventsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.purgedEventsCount != null && message.hasOwnProperty("purgedEventsCount")) + if (!$util.isInteger(message.purgedEventsCount) && !(message.purgedEventsCount && $util.isInteger(message.purgedEventsCount.low) && $util.isInteger(message.purgedEventsCount.high))) + return "purgedEventsCount: integer|Long expected"; + return null; + }; - /** - * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.BoostSpec} message BoostSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoostSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.conditionBoostSpecs = []; - if (message.conditionBoostSpecs && message.conditionBoostSpecs.length) { - object.conditionBoostSpecs = []; - for (var j = 0; j < message.conditionBoostSpecs.length; ++j) - object.conditionBoostSpecs[j] = $root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.toObject(message.conditionBoostSpecs[j], options); - } + /** + * Creates a PurgeUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.PurgeUserEventsResponse} PurgeUserEventsResponse + */ + PurgeUserEventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.PurgeUserEventsResponse) return object; - }; + var message = new $root.google.cloud.retail.v2.PurgeUserEventsResponse(); + if (object.purgedEventsCount != null) + if ($util.Long) + (message.purgedEventsCount = $util.Long.fromValue(object.purgedEventsCount)).unsigned = false; + else if (typeof object.purgedEventsCount === "string") + message.purgedEventsCount = parseInt(object.purgedEventsCount, 10); + else if (typeof object.purgedEventsCount === "number") + message.purgedEventsCount = object.purgedEventsCount; + else if (typeof object.purgedEventsCount === "object") + message.purgedEventsCount = new $util.LongBits(object.purgedEventsCount.low >>> 0, object.purgedEventsCount.high >>> 0).toNumber(); + return message; + }; - /** - * Converts this BoostSpec to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec - * @instance - * @returns {Object.} JSON object - */ - BoostSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a PurgeUserEventsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @static + * @param {google.cloud.retail.v2.PurgeUserEventsResponse} message PurgeUserEventsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurgeUserEventsResponse.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.purgedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.purgedEventsCount = options.longs === String ? "0" : 0; + if (message.purgedEventsCount != null && message.hasOwnProperty("purgedEventsCount")) + if (typeof message.purgedEventsCount === "number") + object.purgedEventsCount = options.longs === String ? String(message.purgedEventsCount) : message.purgedEventsCount; + else + object.purgedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.purgedEventsCount) : options.longs === Number ? new $util.LongBits(message.purgedEventsCount.low >>> 0, message.purgedEventsCount.high >>> 0).toNumber() : message.purgedEventsCount; + return object; + }; - BoostSpec.ConditionBoostSpec = (function() { + /** + * Converts this PurgeUserEventsResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.PurgeUserEventsResponse + * @instance + * @returns {Object.} JSON object + */ + PurgeUserEventsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a ConditionBoostSpec. - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec - * @interface IConditionBoostSpec - * @property {string|null} [condition] ConditionBoostSpec condition - * @property {number|null} [boost] ConditionBoostSpec boost - */ + return PurgeUserEventsResponse; + })(); - /** - * Constructs a new ConditionBoostSpec. - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec - * @classdesc Represents a ConditionBoostSpec. - * @implements IConditionBoostSpec - * @constructor - * @param {google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec=} [properties] Properties to set - */ - function ConditionBoostSpec(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]]; - } + v2.SearchService = (function() { - /** - * ConditionBoostSpec condition. - * @member {string} condition - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec - * @instance - */ - ConditionBoostSpec.prototype.condition = ""; + /** + * Constructs a new SearchService service. + * @memberof google.cloud.retail.v2 + * @classdesc Represents a SearchService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function SearchService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * ConditionBoostSpec boost. - * @member {number} boost - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec - * @instance - */ - ConditionBoostSpec.prototype.boost = 0; + (SearchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SearchService; - /** - * Creates a new ConditionBoostSpec instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec instance - */ - ConditionBoostSpec.create = function create(properties) { - return new ConditionBoostSpec(properties); - }; + /** + * Creates new SearchService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2.SearchService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {SearchService} RPC service. Useful where requests and/or responses are streamed. + */ + SearchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConditionBoostSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); - if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); - return writer; - }; + /** + * Callback as used by {@link google.cloud.retail.v2.SearchService#search}. + * @memberof google.cloud.retail.v2.SearchService + * @typedef SearchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2.SearchResponse} [response] SearchResponse + */ - /** - * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConditionBoostSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConditionBoostSpec.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.v2.SearchRequest.BoostSpec.ConditionBoostSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.condition = reader.string(); - break; - case 2: - message.boost = reader.float(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConditionBoostSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConditionBoostSpec message. - * @function verify - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConditionBoostSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.condition != null && message.hasOwnProperty("condition")) - if (!$util.isString(message.condition)) - return "condition: string expected"; - if (message.boost != null && message.hasOwnProperty("boost")) - if (typeof message.boost !== "number") - return "boost: number expected"; - return null; - }; - - /** - * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec - */ - ConditionBoostSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec) - return object; - var message = new $root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec(); - if (object.condition != null) - message.condition = String(object.condition); - if (object.boost != null) - message.boost = Number(object.boost); - return message; - }; - - /** - * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec} message ConditionBoostSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConditionBoostSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.condition = ""; - object.boost = 0; - } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = message.condition; - if (message.boost != null && message.hasOwnProperty("boost")) - object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; - return object; - }; - - /** - * Converts this ConditionBoostSpec to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec - * @instance - * @returns {Object.} JSON object - */ - ConditionBoostSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConditionBoostSpec; - })(); - - return BoostSpec; - })(); - - SearchRequest.QueryExpansionSpec = (function() { - - /** - * Properties of a QueryExpansionSpec. - * @memberof google.cloud.retail.v2.SearchRequest - * @interface IQueryExpansionSpec - * @property {google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition|null} [condition] QueryExpansionSpec condition - * @property {boolean|null} [pinUnexpandedResults] QueryExpansionSpec pinUnexpandedResults - */ - - /** - * Constructs a new QueryExpansionSpec. - * @memberof google.cloud.retail.v2.SearchRequest - * @classdesc Represents a QueryExpansionSpec. - * @implements IQueryExpansionSpec - * @constructor - * @param {google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set - */ - function QueryExpansionSpec(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]]; - } - - /** - * QueryExpansionSpec condition. - * @member {google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition} condition - * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec - * @instance - */ - QueryExpansionSpec.prototype.condition = 0; - - /** - * QueryExpansionSpec pinUnexpandedResults. - * @member {boolean} pinUnexpandedResults - * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec - * @instance - */ - QueryExpansionSpec.prototype.pinUnexpandedResults = false; - - /** - * Creates a new QueryExpansionSpec instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2.SearchRequest.QueryExpansionSpec} QueryExpansionSpec instance - */ - QueryExpansionSpec.create = function create(properties) { - return new QueryExpansionSpec(properties); - }; - - /** - * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryExpansionSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.condition); - if (message.pinUnexpandedResults != null && Object.hasOwnProperty.call(message, "pinUnexpandedResults")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.pinUnexpandedResults); - return writer; - }; - - /** - * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryExpansionSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryExpansionSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.SearchRequest.QueryExpansionSpec} QueryExpansionSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryExpansionSpec.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.v2.SearchRequest.QueryExpansionSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.condition = reader.int32(); - break; - case 2: - message.pinUnexpandedResults = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.SearchRequest.QueryExpansionSpec} QueryExpansionSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryExpansionSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryExpansionSpec message. - * @function verify - * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryExpansionSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.condition != null && message.hasOwnProperty("condition")) - switch (message.condition) { - default: - return "condition: enum value expected"; - case 0: - case 1: - case 3: - break; - } - if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) - if (typeof message.pinUnexpandedResults !== "boolean") - return "pinUnexpandedResults: boolean expected"; - return null; - }; - - /** - * Creates a QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.SearchRequest.QueryExpansionSpec} QueryExpansionSpec - */ - QueryExpansionSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec) - return object; - var message = new $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec(); - switch (object.condition) { - case "CONDITION_UNSPECIFIED": - case 0: - message.condition = 0; - break; - case "DISABLED": - case 1: - message.condition = 1; - break; - case "AUTO": - case 3: - message.condition = 3; - break; - } - if (object.pinUnexpandedResults != null) - message.pinUnexpandedResults = Boolean(object.pinUnexpandedResults); - return message; - }; - - /** - * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec - * @static - * @param {google.cloud.retail.v2.SearchRequest.QueryExpansionSpec} message QueryExpansionSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryExpansionSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.condition = options.enums === String ? "CONDITION_UNSPECIFIED" : 0; - object.pinUnexpandedResults = false; - } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = options.enums === String ? $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition[message.condition] : message.condition; - if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) - object.pinUnexpandedResults = message.pinUnexpandedResults; - return object; - }; - - /** - * Converts this QueryExpansionSpec to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec - * @instance - * @returns {Object.} JSON object - */ - QueryExpansionSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Condition enum. - * @name google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition - * @enum {number} - * @property {number} CONDITION_UNSPECIFIED=0 CONDITION_UNSPECIFIED value - * @property {number} DISABLED=1 DISABLED value - * @property {number} AUTO=3 AUTO value - */ - QueryExpansionSpec.Condition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONDITION_UNSPECIFIED"] = 0; - values[valuesById[1] = "DISABLED"] = 1; - values[valuesById[3] = "AUTO"] = 3; - return values; - })(); - - return QueryExpansionSpec; - })(); + /** + * Calls Search. + * @function search + * @memberof google.cloud.retail.v2.SearchService + * @instance + * @param {google.cloud.retail.v2.ISearchRequest} request SearchRequest message or plain object + * @param {google.cloud.retail.v2.SearchService.SearchCallback} callback Node-style callback called with the error, if any, and SearchResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SearchService.prototype.search = function search(request, callback) { + return this.rpcCall(search, $root.google.cloud.retail.v2.SearchRequest, $root.google.cloud.retail.v2.SearchResponse, request, callback); + }, "name", { value: "Search" }); /** - * SearchMode enum. - * @name google.cloud.retail.v2.SearchRequest.SearchMode - * @enum {number} - * @property {number} SEARCH_MODE_UNSPECIFIED=0 SEARCH_MODE_UNSPECIFIED value - * @property {number} PRODUCT_SEARCH_ONLY=1 PRODUCT_SEARCH_ONLY value - * @property {number} FACETED_SEARCH_ONLY=2 FACETED_SEARCH_ONLY value + * Calls Search. + * @function search + * @memberof google.cloud.retail.v2.SearchService + * @instance + * @param {google.cloud.retail.v2.ISearchRequest} request SearchRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - SearchRequest.SearchMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEARCH_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRODUCT_SEARCH_ONLY"] = 1; - values[valuesById[2] = "FACETED_SEARCH_ONLY"] = 2; - return values; - })(); - return SearchRequest; + return SearchService; })(); - v2.SearchResponse = (function() { + v2.SearchRequest = (function() { /** - * Properties of a SearchResponse. + * Properties of a SearchRequest. * @memberof google.cloud.retail.v2 - * @interface ISearchResponse - * @property {Array.|null} [results] SearchResponse results - * @property {Array.|null} [facets] SearchResponse facets - * @property {number|null} [totalSize] SearchResponse totalSize - * @property {string|null} [correctedQuery] SearchResponse correctedQuery - * @property {string|null} [attributionToken] SearchResponse attributionToken - * @property {string|null} [nextPageToken] SearchResponse nextPageToken - * @property {google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo|null} [queryExpansionInfo] SearchResponse queryExpansionInfo - * @property {string|null} [redirectUri] SearchResponse redirectUri + * @interface ISearchRequest + * @property {string|null} [placement] SearchRequest placement + * @property {string|null} [branch] SearchRequest branch + * @property {string|null} [query] SearchRequest query + * @property {string|null} [visitorId] SearchRequest visitorId + * @property {google.cloud.retail.v2.IUserInfo|null} [userInfo] SearchRequest userInfo + * @property {number|null} [pageSize] SearchRequest pageSize + * @property {string|null} [pageToken] SearchRequest pageToken + * @property {number|null} [offset] SearchRequest offset + * @property {string|null} [filter] SearchRequest filter + * @property {string|null} [canonicalFilter] SearchRequest canonicalFilter + * @property {string|null} [orderBy] SearchRequest orderBy + * @property {Array.|null} [facetSpecs] SearchRequest facetSpecs + * @property {google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec|null} [dynamicFacetSpec] SearchRequest dynamicFacetSpec + * @property {google.cloud.retail.v2.SearchRequest.IBoostSpec|null} [boostSpec] SearchRequest boostSpec + * @property {google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec|null} [queryExpansionSpec] SearchRequest queryExpansionSpec + * @property {Array.|null} [variantRollupKeys] SearchRequest variantRollupKeys + * @property {Array.|null} [pageCategories] SearchRequest pageCategories + * @property {google.cloud.retail.v2.SearchRequest.SearchMode|null} [searchMode] SearchRequest searchMode + * @property {google.cloud.retail.v2.SearchRequest.IPersonalizationSpec|null} [personalizationSpec] SearchRequest personalizationSpec */ /** - * Constructs a new SearchResponse. + * Constructs a new SearchRequest. * @memberof google.cloud.retail.v2 - * @classdesc Represents a SearchResponse. - * @implements ISearchResponse + * @classdesc Represents a SearchRequest. + * @implements ISearchRequest * @constructor - * @param {google.cloud.retail.v2.ISearchResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2.ISearchRequest=} [properties] Properties to set */ - function SearchResponse(properties) { - this.results = []; - this.facets = []; + function SearchRequest(properties) { + this.facetSpecs = []; + this.variantRollupKeys = []; + this.pageCategories = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20304,172 +19726,318 @@ } /** - * SearchResponse results. - * @member {Array.} results - * @memberof google.cloud.retail.v2.SearchResponse + * SearchRequest placement. + * @member {string} placement + * @memberof google.cloud.retail.v2.SearchRequest * @instance */ - SearchResponse.prototype.results = $util.emptyArray; + SearchRequest.prototype.placement = ""; /** - * SearchResponse facets. - * @member {Array.} facets - * @memberof google.cloud.retail.v2.SearchResponse + * SearchRequest branch. + * @member {string} branch + * @memberof google.cloud.retail.v2.SearchRequest * @instance */ - SearchResponse.prototype.facets = $util.emptyArray; + SearchRequest.prototype.branch = ""; /** - * SearchResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.retail.v2.SearchResponse + * SearchRequest query. + * @member {string} query + * @memberof google.cloud.retail.v2.SearchRequest * @instance */ - SearchResponse.prototype.totalSize = 0; + SearchRequest.prototype.query = ""; /** - * SearchResponse correctedQuery. - * @member {string} correctedQuery - * @memberof google.cloud.retail.v2.SearchResponse + * SearchRequest visitorId. + * @member {string} visitorId + * @memberof google.cloud.retail.v2.SearchRequest * @instance */ - SearchResponse.prototype.correctedQuery = ""; + SearchRequest.prototype.visitorId = ""; /** - * SearchResponse attributionToken. - * @member {string} attributionToken - * @memberof google.cloud.retail.v2.SearchResponse + * SearchRequest userInfo. + * @member {google.cloud.retail.v2.IUserInfo|null|undefined} userInfo + * @memberof google.cloud.retail.v2.SearchRequest * @instance */ - SearchResponse.prototype.attributionToken = ""; + SearchRequest.prototype.userInfo = null; /** - * SearchResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.retail.v2.SearchResponse + * SearchRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.retail.v2.SearchRequest * @instance */ - SearchResponse.prototype.nextPageToken = ""; + SearchRequest.prototype.pageSize = 0; /** - * SearchResponse queryExpansionInfo. - * @member {google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo|null|undefined} queryExpansionInfo - * @memberof google.cloud.retail.v2.SearchResponse + * SearchRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.retail.v2.SearchRequest * @instance */ - SearchResponse.prototype.queryExpansionInfo = null; + SearchRequest.prototype.pageToken = ""; /** - * SearchResponse redirectUri. - * @member {string} redirectUri - * @memberof google.cloud.retail.v2.SearchResponse + * SearchRequest offset. + * @member {number} offset + * @memberof google.cloud.retail.v2.SearchRequest * @instance */ - SearchResponse.prototype.redirectUri = ""; + SearchRequest.prototype.offset = 0; /** - * Creates a new SearchResponse instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2.SearchResponse - * @static - * @param {google.cloud.retail.v2.ISearchResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2.SearchResponse} SearchResponse instance + * SearchRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2.SearchRequest + * @instance */ - SearchResponse.create = function create(properties) { - return new SearchResponse(properties); - }; + SearchRequest.prototype.filter = ""; /** - * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2.SearchResponse - * @static - * @param {google.cloud.retail.v2.ISearchResponse} message SearchResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * SearchRequest canonicalFilter. + * @member {string} canonicalFilter + * @memberof google.cloud.retail.v2.SearchRequest + * @instance */ - SearchResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.results != null && message.results.length) - for (var i = 0; i < message.results.length; ++i) - $root.google.cloud.retail.v2.SearchResponse.SearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.facets != null && message.facets.length) - for (var i = 0; i < message.facets.length; ++i) - $root.google.cloud.retail.v2.SearchResponse.Facet.encode(message.facets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); - if (message.correctedQuery != null && Object.hasOwnProperty.call(message, "correctedQuery")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.correctedQuery); - if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.attributionToken); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.nextPageToken); - if (message.queryExpansionInfo != null && Object.hasOwnProperty.call(message, "queryExpansionInfo")) - $root.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.encode(message.queryExpansionInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.redirectUri != null && Object.hasOwnProperty.call(message, "redirectUri")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.redirectUri); + SearchRequest.prototype.canonicalFilter = ""; + + /** + * SearchRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.retail.v2.SearchRequest + * @instance + */ + SearchRequest.prototype.orderBy = ""; + + /** + * SearchRequest facetSpecs. + * @member {Array.} facetSpecs + * @memberof google.cloud.retail.v2.SearchRequest + * @instance + */ + SearchRequest.prototype.facetSpecs = $util.emptyArray; + + /** + * SearchRequest dynamicFacetSpec. + * @member {google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec|null|undefined} dynamicFacetSpec + * @memberof google.cloud.retail.v2.SearchRequest + * @instance + */ + SearchRequest.prototype.dynamicFacetSpec = null; + + /** + * SearchRequest boostSpec. + * @member {google.cloud.retail.v2.SearchRequest.IBoostSpec|null|undefined} boostSpec + * @memberof google.cloud.retail.v2.SearchRequest + * @instance + */ + SearchRequest.prototype.boostSpec = null; + + /** + * SearchRequest queryExpansionSpec. + * @member {google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec|null|undefined} queryExpansionSpec + * @memberof google.cloud.retail.v2.SearchRequest + * @instance + */ + SearchRequest.prototype.queryExpansionSpec = null; + + /** + * SearchRequest variantRollupKeys. + * @member {Array.} variantRollupKeys + * @memberof google.cloud.retail.v2.SearchRequest + * @instance + */ + SearchRequest.prototype.variantRollupKeys = $util.emptyArray; + + /** + * SearchRequest pageCategories. + * @member {Array.} pageCategories + * @memberof google.cloud.retail.v2.SearchRequest + * @instance + */ + SearchRequest.prototype.pageCategories = $util.emptyArray; + + /** + * SearchRequest searchMode. + * @member {google.cloud.retail.v2.SearchRequest.SearchMode} searchMode + * @memberof google.cloud.retail.v2.SearchRequest + * @instance + */ + SearchRequest.prototype.searchMode = 0; + + /** + * SearchRequest personalizationSpec. + * @member {google.cloud.retail.v2.SearchRequest.IPersonalizationSpec|null|undefined} personalizationSpec + * @memberof google.cloud.retail.v2.SearchRequest + * @instance + */ + SearchRequest.prototype.personalizationSpec = null; + + /** + * Creates a new SearchRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.SearchRequest + * @static + * @param {google.cloud.retail.v2.ISearchRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2.SearchRequest} SearchRequest instance + */ + SearchRequest.create = function create(properties) { + return new SearchRequest(properties); + }; + + /** + * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.SearchRequest + * @static + * @param {google.cloud.retail.v2.ISearchRequest} message SearchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.placement); + if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.branch); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); + if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.visitorId); + if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) + $root.google.cloud.retail.v2.UserInfo.encode(message.userInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.offset); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.orderBy); + if (message.facetSpecs != null && message.facetSpecs.length) + for (var i = 0; i < message.facetSpecs.length; ++i) + $root.google.cloud.retail.v2.SearchRequest.FacetSpec.encode(message.facetSpecs[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.boostSpec != null && Object.hasOwnProperty.call(message, "boostSpec")) + $root.google.cloud.retail.v2.SearchRequest.BoostSpec.encode(message.boostSpec, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.queryExpansionSpec != null && Object.hasOwnProperty.call(message, "queryExpansionSpec")) + $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.encode(message.queryExpansionSpec, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.variantRollupKeys != null && message.variantRollupKeys.length) + for (var i = 0; i < message.variantRollupKeys.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.variantRollupKeys[i]); + if (message.dynamicFacetSpec != null && Object.hasOwnProperty.call(message, "dynamicFacetSpec")) + $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.encode(message.dynamicFacetSpec, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.pageCategories != null && message.pageCategories.length) + for (var i = 0; i < message.pageCategories.length; ++i) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.pageCategories[i]); + if (message.canonicalFilter != null && Object.hasOwnProperty.call(message, "canonicalFilter")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.canonicalFilter); + if (message.searchMode != null && Object.hasOwnProperty.call(message, "searchMode")) + writer.uint32(/* id 31, wireType 0 =*/248).int32(message.searchMode); + if (message.personalizationSpec != null && Object.hasOwnProperty.call(message, "personalizationSpec")) + $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.encode(message.personalizationSpec, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); return writer; }; /** - * Encodes the specified SearchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.verify|verify} messages. + * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2.SearchResponse + * @memberof google.cloud.retail.v2.SearchRequest * @static - * @param {google.cloud.retail.v2.ISearchResponse} message SearchResponse message or plain object to encode + * @param {google.cloud.retail.v2.ISearchRequest} message SearchRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchResponse.encodeDelimited = function encodeDelimited(message, writer) { + SearchRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchResponse message from the specified reader or buffer. + * Decodes a SearchRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2.SearchResponse + * @memberof google.cloud.retail.v2.SearchRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.SearchResponse} SearchResponse + * @returns {google.cloud.retail.v2.SearchRequest} SearchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchResponse.decode = function decode(reader, length) { + SearchRequest.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.v2.SearchResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.SearchRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.results && message.results.length)) - message.results = []; - message.results.push($root.google.cloud.retail.v2.SearchResponse.SearchResult.decode(reader, reader.uint32())); + message.placement = reader.string(); break; case 2: - if (!(message.facets && message.facets.length)) - message.facets = []; - message.facets.push($root.google.cloud.retail.v2.SearchResponse.Facet.decode(reader, reader.uint32())); + message.branch = reader.string(); break; case 3: - message.totalSize = reader.int32(); + message.query = reader.string(); break; case 4: - message.correctedQuery = reader.string(); + message.visitorId = reader.string(); break; case 5: - message.attributionToken = reader.string(); - break; - case 6: - message.nextPageToken = reader.string(); + message.userInfo = $root.google.cloud.retail.v2.UserInfo.decode(reader, reader.uint32()); break; case 7: - message.queryExpansionInfo = $root.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); + break; + case 8: + message.pageToken = reader.string(); + break; + case 9: + message.offset = reader.int32(); break; case 10: - message.redirectUri = reader.string(); + message.filter = reader.string(); + break; + case 28: + message.canonicalFilter = reader.string(); + break; + case 11: + message.orderBy = reader.string(); + break; + case 12: + if (!(message.facetSpecs && message.facetSpecs.length)) + message.facetSpecs = []; + message.facetSpecs.push($root.google.cloud.retail.v2.SearchRequest.FacetSpec.decode(reader, reader.uint32())); + break; + case 21: + message.dynamicFacetSpec = $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.decode(reader, reader.uint32()); + break; + case 13: + message.boostSpec = $root.google.cloud.retail.v2.SearchRequest.BoostSpec.decode(reader, reader.uint32()); + break; + case 14: + message.queryExpansionSpec = $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.decode(reader, reader.uint32()); + break; + case 17: + if (!(message.variantRollupKeys && message.variantRollupKeys.length)) + message.variantRollupKeys = []; + message.variantRollupKeys.push(reader.string()); + break; + case 23: + if (!(message.pageCategories && message.pageCategories.length)) + message.pageCategories = []; + message.pageCategories.push(reader.string()); + break; + case 31: + message.searchMode = reader.int32(); + break; + case 32: + message.personalizationSpec = $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -20480,208 +20048,339 @@ }; /** - * Decodes a SearchResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2.SearchResponse + * @memberof google.cloud.retail.v2.SearchRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.SearchResponse} SearchResponse + * @returns {google.cloud.retail.v2.SearchRequest} SearchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchResponse.decodeDelimited = function decodeDelimited(reader) { + SearchRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchResponse message. + * Verifies a SearchRequest message. * @function verify - * @memberof google.cloud.retail.v2.SearchResponse + * @memberof google.cloud.retail.v2.SearchRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchResponse.verify = function verify(message) { + SearchRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.results != null && message.hasOwnProperty("results")) { - if (!Array.isArray(message.results)) - return "results: array expected"; - for (var i = 0; i < message.results.length; ++i) { - var error = $root.google.cloud.retail.v2.SearchResponse.SearchResult.verify(message.results[i]); - if (error) - return "results." + error; - } + if (message.placement != null && message.hasOwnProperty("placement")) + if (!$util.isString(message.placement)) + return "placement: string expected"; + if (message.branch != null && message.hasOwnProperty("branch")) + if (!$util.isString(message.branch)) + return "branch: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + if (!$util.isString(message.visitorId)) + return "visitorId: string expected"; + if (message.userInfo != null && message.hasOwnProperty("userInfo")) { + var error = $root.google.cloud.retail.v2.UserInfo.verify(message.userInfo); + if (error) + return "userInfo." + error; } - if (message.facets != null && message.hasOwnProperty("facets")) { - if (!Array.isArray(message.facets)) - return "facets: array expected"; - for (var i = 0; i < message.facets.length; ++i) { - var error = $root.google.cloud.retail.v2.SearchResponse.Facet.verify(message.facets[i]); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) + if (!$util.isString(message.canonicalFilter)) + return "canonicalFilter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.facetSpecs != null && message.hasOwnProperty("facetSpecs")) { + if (!Array.isArray(message.facetSpecs)) + return "facetSpecs: array expected"; + for (var i = 0; i < message.facetSpecs.length; ++i) { + var error = $root.google.cloud.retail.v2.SearchRequest.FacetSpec.verify(message.facetSpecs[i]); if (error) - return "facets." + error; + return "facetSpecs." + error; } } - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; - if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) - if (!$util.isString(message.correctedQuery)) - return "correctedQuery: string expected"; - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - if (!$util.isString(message.attributionToken)) - return "attributionToken: string expected"; - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.queryExpansionInfo != null && message.hasOwnProperty("queryExpansionInfo")) { - var error = $root.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.verify(message.queryExpansionInfo); + if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) { + var error = $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.verify(message.dynamicFacetSpec); if (error) - return "queryExpansionInfo." + error; + return "dynamicFacetSpec." + error; + } + if (message.boostSpec != null && message.hasOwnProperty("boostSpec")) { + var error = $root.google.cloud.retail.v2.SearchRequest.BoostSpec.verify(message.boostSpec); + if (error) + return "boostSpec." + error; + } + if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) { + var error = $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.verify(message.queryExpansionSpec); + if (error) + return "queryExpansionSpec." + error; + } + if (message.variantRollupKeys != null && message.hasOwnProperty("variantRollupKeys")) { + if (!Array.isArray(message.variantRollupKeys)) + return "variantRollupKeys: array expected"; + for (var i = 0; i < message.variantRollupKeys.length; ++i) + if (!$util.isString(message.variantRollupKeys[i])) + return "variantRollupKeys: string[] expected"; + } + if (message.pageCategories != null && message.hasOwnProperty("pageCategories")) { + if (!Array.isArray(message.pageCategories)) + return "pageCategories: array expected"; + for (var i = 0; i < message.pageCategories.length; ++i) + if (!$util.isString(message.pageCategories[i])) + return "pageCategories: string[] expected"; + } + if (message.searchMode != null && message.hasOwnProperty("searchMode")) + switch (message.searchMode) { + default: + return "searchMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) { + var error = $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.verify(message.personalizationSpec); + if (error) + return "personalizationSpec." + error; } - if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) - if (!$util.isString(message.redirectUri)) - return "redirectUri: string expected"; return null; }; /** - * Creates a SearchResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2.SearchResponse + * @memberof google.cloud.retail.v2.SearchRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.SearchResponse} SearchResponse + * @returns {google.cloud.retail.v2.SearchRequest} SearchRequest */ - SearchResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.SearchResponse) + SearchRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.SearchRequest) return object; - var message = new $root.google.cloud.retail.v2.SearchResponse(); - if (object.results) { - if (!Array.isArray(object.results)) - throw TypeError(".google.cloud.retail.v2.SearchResponse.results: array expected"); - message.results = []; - for (var i = 0; i < object.results.length; ++i) { - if (typeof object.results[i] !== "object") - throw TypeError(".google.cloud.retail.v2.SearchResponse.results: object expected"); - message.results[i] = $root.google.cloud.retail.v2.SearchResponse.SearchResult.fromObject(object.results[i]); - } + var message = new $root.google.cloud.retail.v2.SearchRequest(); + if (object.placement != null) + message.placement = String(object.placement); + if (object.branch != null) + message.branch = String(object.branch); + if (object.query != null) + message.query = String(object.query); + if (object.visitorId != null) + message.visitorId = String(object.visitorId); + if (object.userInfo != null) { + if (typeof object.userInfo !== "object") + throw TypeError(".google.cloud.retail.v2.SearchRequest.userInfo: object expected"); + message.userInfo = $root.google.cloud.retail.v2.UserInfo.fromObject(object.userInfo); } - if (object.facets) { - if (!Array.isArray(object.facets)) - throw TypeError(".google.cloud.retail.v2.SearchResponse.facets: array expected"); - message.facets = []; - for (var i = 0; i < object.facets.length; ++i) { - if (typeof object.facets[i] !== "object") - throw TypeError(".google.cloud.retail.v2.SearchResponse.facets: object expected"); - message.facets[i] = $root.google.cloud.retail.v2.SearchResponse.Facet.fromObject(object.facets[i]); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.offset != null) + message.offset = object.offset | 0; + if (object.filter != null) + message.filter = String(object.filter); + if (object.canonicalFilter != null) + message.canonicalFilter = String(object.canonicalFilter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.facetSpecs) { + if (!Array.isArray(object.facetSpecs)) + throw TypeError(".google.cloud.retail.v2.SearchRequest.facetSpecs: array expected"); + message.facetSpecs = []; + for (var i = 0; i < object.facetSpecs.length; ++i) { + if (typeof object.facetSpecs[i] !== "object") + throw TypeError(".google.cloud.retail.v2.SearchRequest.facetSpecs: object expected"); + message.facetSpecs[i] = $root.google.cloud.retail.v2.SearchRequest.FacetSpec.fromObject(object.facetSpecs[i]); } } - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; - if (object.correctedQuery != null) - message.correctedQuery = String(object.correctedQuery); - if (object.attributionToken != null) - message.attributionToken = String(object.attributionToken); - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.queryExpansionInfo != null) { - if (typeof object.queryExpansionInfo !== "object") - throw TypeError(".google.cloud.retail.v2.SearchResponse.queryExpansionInfo: object expected"); - message.queryExpansionInfo = $root.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.fromObject(object.queryExpansionInfo); + if (object.dynamicFacetSpec != null) { + if (typeof object.dynamicFacetSpec !== "object") + throw TypeError(".google.cloud.retail.v2.SearchRequest.dynamicFacetSpec: object expected"); + message.dynamicFacetSpec = $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.fromObject(object.dynamicFacetSpec); + } + if (object.boostSpec != null) { + if (typeof object.boostSpec !== "object") + throw TypeError(".google.cloud.retail.v2.SearchRequest.boostSpec: object expected"); + message.boostSpec = $root.google.cloud.retail.v2.SearchRequest.BoostSpec.fromObject(object.boostSpec); + } + if (object.queryExpansionSpec != null) { + if (typeof object.queryExpansionSpec !== "object") + throw TypeError(".google.cloud.retail.v2.SearchRequest.queryExpansionSpec: object expected"); + message.queryExpansionSpec = $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.fromObject(object.queryExpansionSpec); + } + if (object.variantRollupKeys) { + if (!Array.isArray(object.variantRollupKeys)) + throw TypeError(".google.cloud.retail.v2.SearchRequest.variantRollupKeys: array expected"); + message.variantRollupKeys = []; + for (var i = 0; i < object.variantRollupKeys.length; ++i) + message.variantRollupKeys[i] = String(object.variantRollupKeys[i]); + } + if (object.pageCategories) { + if (!Array.isArray(object.pageCategories)) + throw TypeError(".google.cloud.retail.v2.SearchRequest.pageCategories: array expected"); + message.pageCategories = []; + for (var i = 0; i < object.pageCategories.length; ++i) + message.pageCategories[i] = String(object.pageCategories[i]); + } + switch (object.searchMode) { + case "SEARCH_MODE_UNSPECIFIED": + case 0: + message.searchMode = 0; + break; + case "PRODUCT_SEARCH_ONLY": + case 1: + message.searchMode = 1; + break; + case "FACETED_SEARCH_ONLY": + case 2: + message.searchMode = 2; + break; + } + if (object.personalizationSpec != null) { + if (typeof object.personalizationSpec !== "object") + throw TypeError(".google.cloud.retail.v2.SearchRequest.personalizationSpec: object expected"); + message.personalizationSpec = $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.fromObject(object.personalizationSpec); } - if (object.redirectUri != null) - message.redirectUri = String(object.redirectUri); return message; }; /** - * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. + * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2.SearchResponse + * @memberof google.cloud.retail.v2.SearchRequest * @static - * @param {google.cloud.retail.v2.SearchResponse} message SearchResponse + * @param {google.cloud.retail.v2.SearchRequest} message SearchRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchResponse.toObject = function toObject(message, options) { + SearchRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { - object.results = []; - object.facets = []; + object.facetSpecs = []; + object.variantRollupKeys = []; + object.pageCategories = []; } if (options.defaults) { - object.totalSize = 0; - object.correctedQuery = ""; - object.attributionToken = ""; - object.nextPageToken = ""; - object.queryExpansionInfo = null; - object.redirectUri = ""; - } - if (message.results && message.results.length) { - object.results = []; - for (var j = 0; j < message.results.length; ++j) - object.results[j] = $root.google.cloud.retail.v2.SearchResponse.SearchResult.toObject(message.results[j], options); - } - if (message.facets && message.facets.length) { - object.facets = []; - for (var j = 0; j < message.facets.length; ++j) - object.facets[j] = $root.google.cloud.retail.v2.SearchResponse.Facet.toObject(message.facets[j], options); + object.placement = ""; + object.branch = ""; + object.query = ""; + object.visitorId = ""; + object.userInfo = null; + object.pageSize = 0; + object.pageToken = ""; + object.offset = 0; + object.filter = ""; + object.orderBy = ""; + object.boostSpec = null; + object.queryExpansionSpec = null; + object.dynamicFacetSpec = null; + object.canonicalFilter = ""; + object.searchMode = options.enums === String ? "SEARCH_MODE_UNSPECIFIED" : 0; + object.personalizationSpec = null; } - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; - if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) - object.correctedQuery = message.correctedQuery; - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - object.attributionToken = message.attributionToken; - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.queryExpansionInfo != null && message.hasOwnProperty("queryExpansionInfo")) - object.queryExpansionInfo = $root.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.toObject(message.queryExpansionInfo, options); - if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) - object.redirectUri = message.redirectUri; + if (message.placement != null && message.hasOwnProperty("placement")) + object.placement = message.placement; + if (message.branch != null && message.hasOwnProperty("branch")) + object.branch = message.branch; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + object.visitorId = message.visitorId; + if (message.userInfo != null && message.hasOwnProperty("userInfo")) + object.userInfo = $root.google.cloud.retail.v2.UserInfo.toObject(message.userInfo, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.facetSpecs && message.facetSpecs.length) { + object.facetSpecs = []; + for (var j = 0; j < message.facetSpecs.length; ++j) + object.facetSpecs[j] = $root.google.cloud.retail.v2.SearchRequest.FacetSpec.toObject(message.facetSpecs[j], options); + } + if (message.boostSpec != null && message.hasOwnProperty("boostSpec")) + object.boostSpec = $root.google.cloud.retail.v2.SearchRequest.BoostSpec.toObject(message.boostSpec, options); + if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) + object.queryExpansionSpec = $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.toObject(message.queryExpansionSpec, options); + if (message.variantRollupKeys && message.variantRollupKeys.length) { + object.variantRollupKeys = []; + for (var j = 0; j < message.variantRollupKeys.length; ++j) + object.variantRollupKeys[j] = message.variantRollupKeys[j]; + } + if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) + object.dynamicFacetSpec = $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.toObject(message.dynamicFacetSpec, options); + if (message.pageCategories && message.pageCategories.length) { + object.pageCategories = []; + for (var j = 0; j < message.pageCategories.length; ++j) + object.pageCategories[j] = message.pageCategories[j]; + } + if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) + object.canonicalFilter = message.canonicalFilter; + if (message.searchMode != null && message.hasOwnProperty("searchMode")) + object.searchMode = options.enums === String ? $root.google.cloud.retail.v2.SearchRequest.SearchMode[message.searchMode] : message.searchMode; + if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) + object.personalizationSpec = $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.toObject(message.personalizationSpec, options); return object; }; /** - * Converts this SearchResponse to JSON. + * Converts this SearchRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2.SearchResponse + * @memberof google.cloud.retail.v2.SearchRequest * @instance * @returns {Object.} JSON object */ - SearchResponse.prototype.toJSON = function toJSON() { + SearchRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - SearchResponse.SearchResult = (function() { + SearchRequest.FacetSpec = (function() { /** - * Properties of a SearchResult. - * @memberof google.cloud.retail.v2.SearchResponse - * @interface ISearchResult - * @property {string|null} [id] SearchResult id - * @property {google.cloud.retail.v2.IProduct|null} [product] SearchResult product - * @property {number|null} [matchingVariantCount] SearchResult matchingVariantCount - * @property {Object.|null} [matchingVariantFields] SearchResult matchingVariantFields - * @property {Object.|null} [variantRollupValues] SearchResult variantRollupValues + * Properties of a FacetSpec. + * @memberof google.cloud.retail.v2.SearchRequest + * @interface IFacetSpec + * @property {google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey|null} [facetKey] FacetSpec facetKey + * @property {number|null} [limit] FacetSpec limit + * @property {Array.|null} [excludedFilterKeys] FacetSpec excludedFilterKeys + * @property {boolean|null} [enableDynamicPosition] FacetSpec enableDynamicPosition */ /** - * Constructs a new SearchResult. - * @memberof google.cloud.retail.v2.SearchResponse - * @classdesc Represents a SearchResult. - * @implements ISearchResult + * Constructs a new FacetSpec. + * @memberof google.cloud.retail.v2.SearchRequest + * @classdesc Represents a FacetSpec. + * @implements IFacetSpec * @constructor - * @param {google.cloud.retail.v2.SearchResponse.ISearchResult=} [properties] Properties to set + * @param {google.cloud.retail.v2.SearchRequest.IFacetSpec=} [properties] Properties to set */ - function SearchResult(properties) { - this.matchingVariantFields = {}; - this.variantRollupValues = {}; + function FacetSpec(properties) { + this.excludedFilterKeys = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20689,171 +20388,117 @@ } /** - * SearchResult id. - * @member {string} id - * @memberof google.cloud.retail.v2.SearchResponse.SearchResult - * @instance - */ - SearchResult.prototype.id = ""; - - /** - * SearchResult product. - * @member {google.cloud.retail.v2.IProduct|null|undefined} product - * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * FacetSpec facetKey. + * @member {google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey|null|undefined} facetKey + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec * @instance */ - SearchResult.prototype.product = null; + FacetSpec.prototype.facetKey = null; /** - * SearchResult matchingVariantCount. - * @member {number} matchingVariantCount - * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * FacetSpec limit. + * @member {number} limit + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec * @instance */ - SearchResult.prototype.matchingVariantCount = 0; + FacetSpec.prototype.limit = 0; /** - * SearchResult matchingVariantFields. - * @member {Object.} matchingVariantFields - * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * FacetSpec excludedFilterKeys. + * @member {Array.} excludedFilterKeys + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec * @instance */ - SearchResult.prototype.matchingVariantFields = $util.emptyObject; + FacetSpec.prototype.excludedFilterKeys = $util.emptyArray; /** - * SearchResult variantRollupValues. - * @member {Object.} variantRollupValues - * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * FacetSpec enableDynamicPosition. + * @member {boolean} enableDynamicPosition + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec * @instance */ - SearchResult.prototype.variantRollupValues = $util.emptyObject; + FacetSpec.prototype.enableDynamicPosition = false; /** - * Creates a new SearchResult instance using the specified properties. + * Creates a new FacetSpec instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec * @static - * @param {google.cloud.retail.v2.SearchResponse.ISearchResult=} [properties] Properties to set - * @returns {google.cloud.retail.v2.SearchResponse.SearchResult} SearchResult instance + * @param {google.cloud.retail.v2.SearchRequest.IFacetSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2.SearchRequest.FacetSpec} FacetSpec instance */ - SearchResult.create = function create(properties) { - return new SearchResult(properties); + FacetSpec.create = function create(properties) { + return new FacetSpec(properties); }; /** - * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.SearchResult.verify|verify} messages. + * Encodes the specified FacetSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.FacetSpec.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec * @static - * @param {google.cloud.retail.v2.SearchResponse.ISearchResult} message SearchResult message or plain object to encode + * @param {google.cloud.retail.v2.SearchRequest.IFacetSpec} message FacetSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchResult.encode = function encode(message, writer) { + FacetSpec.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - $root.google.cloud.retail.v2.Product.encode(message.product, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.matchingVariantCount != null && Object.hasOwnProperty.call(message, "matchingVariantCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.matchingVariantCount); - if (message.matchingVariantFields != null && Object.hasOwnProperty.call(message, "matchingVariantFields")) - for (var keys = Object.keys(message.matchingVariantFields), 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.protobuf.FieldMask.encode(message.matchingVariantFields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.variantRollupValues != null && Object.hasOwnProperty.call(message, "variantRollupValues")) - for (var keys = Object.keys(message.variantRollupValues), i = 0; i < keys.length; ++i) { - 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.facetKey != null && Object.hasOwnProperty.call(message, "facetKey")) + $root.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.encode(message.facetKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.limit); + if (message.excludedFilterKeys != null && message.excludedFilterKeys.length) + for (var i = 0; i < message.excludedFilterKeys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.excludedFilterKeys[i]); + if (message.enableDynamicPosition != null && Object.hasOwnProperty.call(message, "enableDynamicPosition")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableDynamicPosition); return writer; }; /** - * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.SearchResult.verify|verify} messages. + * Encodes the specified FacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.FacetSpec.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec * @static - * @param {google.cloud.retail.v2.SearchResponse.ISearchResult} message SearchResult message or plain object to encode + * @param {google.cloud.retail.v2.SearchRequest.IFacetSpec} message FacetSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchResult.encodeDelimited = function encodeDelimited(message, writer) { + FacetSpec.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchResult message from the specified reader or buffer. + * Decodes a FacetSpec message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.SearchResponse.SearchResult} SearchResult + * @returns {google.cloud.retail.v2.SearchRequest.FacetSpec} FacetSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchResult.decode = function decode(reader, length) { + FacetSpec.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.v2.SearchResponse.SearchResult(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.SearchRequest.FacetSpec(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.string(); + message.facetKey = $root.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.decode(reader, reader.uint32()); break; case 2: - message.product = $root.google.cloud.retail.v2.Product.decode(reader, reader.uint32()); + message.limit = reader.int32(); break; case 3: - message.matchingVariantCount = reader.int32(); + if (!(message.excludedFilterKeys && message.excludedFilterKeys.length)) + message.excludedFilterKeys = []; + message.excludedFilterKeys.push(reader.string()); break; case 4: - if (message.matchingVariantFields === $util.emptyObject) - message.matchingVariantFields = {}; - 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.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.matchingVariantFields[key] = value; - break; - case 5: - if (message.variantRollupValues === $util.emptyObject) - message.variantRollupValues = {}; - 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.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.variantRollupValues[key] = value; + message.enableDynamicPosition = reader.bool(); break; default: reader.skipType(tag & 7); @@ -20864,553 +20509,323 @@ }; /** - * Decodes a SearchResult message from the specified reader or buffer, length delimited. + * Decodes a FacetSpec message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.SearchResponse.SearchResult} SearchResult + * @returns {google.cloud.retail.v2.SearchRequest.FacetSpec} FacetSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchResult.decodeDelimited = function decodeDelimited(reader) { + FacetSpec.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchResult message. + * Verifies a FacetSpec message. * @function verify - * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchResult.verify = function verify(message) { + FacetSpec.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.product != null && message.hasOwnProperty("product")) { - var error = $root.google.cloud.retail.v2.Product.verify(message.product); + if (message.facetKey != null && message.hasOwnProperty("facetKey")) { + var error = $root.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.verify(message.facetKey); if (error) - return "product." + error; - } - if (message.matchingVariantCount != null && message.hasOwnProperty("matchingVariantCount")) - if (!$util.isInteger(message.matchingVariantCount)) - return "matchingVariantCount: integer expected"; - if (message.matchingVariantFields != null && message.hasOwnProperty("matchingVariantFields")) { - if (!$util.isObject(message.matchingVariantFields)) - return "matchingVariantFields: object expected"; - var key = Object.keys(message.matchingVariantFields); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.FieldMask.verify(message.matchingVariantFields[key[i]]); - if (error) - return "matchingVariantFields." + error; - } + return "facetKey." + error; } - if (message.variantRollupValues != null && message.hasOwnProperty("variantRollupValues")) { - if (!$util.isObject(message.variantRollupValues)) - return "variantRollupValues: object expected"; - var key = Object.keys(message.variantRollupValues); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.variantRollupValues[key[i]]); - if (error) - return "variantRollupValues." + error; - } + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.excludedFilterKeys != null && message.hasOwnProperty("excludedFilterKeys")) { + if (!Array.isArray(message.excludedFilterKeys)) + return "excludedFilterKeys: array expected"; + for (var i = 0; i < message.excludedFilterKeys.length; ++i) + if (!$util.isString(message.excludedFilterKeys[i])) + return "excludedFilterKeys: string[] expected"; } + if (message.enableDynamicPosition != null && message.hasOwnProperty("enableDynamicPosition")) + if (typeof message.enableDynamicPosition !== "boolean") + return "enableDynamicPosition: boolean expected"; return null; }; /** - * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. + * Creates a FacetSpec message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.SearchResponse.SearchResult} SearchResult + * @returns {google.cloud.retail.v2.SearchRequest.FacetSpec} FacetSpec */ - SearchResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.SearchResponse.SearchResult) + FacetSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.SearchRequest.FacetSpec) return object; - var message = new $root.google.cloud.retail.v2.SearchResponse.SearchResult(); - if (object.id != null) - message.id = String(object.id); - if (object.product != null) { - if (typeof object.product !== "object") - throw TypeError(".google.cloud.retail.v2.SearchResponse.SearchResult.product: object expected"); - message.product = $root.google.cloud.retail.v2.Product.fromObject(object.product); - } - if (object.matchingVariantCount != null) - message.matchingVariantCount = object.matchingVariantCount | 0; - if (object.matchingVariantFields) { - if (typeof object.matchingVariantFields !== "object") - throw TypeError(".google.cloud.retail.v2.SearchResponse.SearchResult.matchingVariantFields: object expected"); - message.matchingVariantFields = {}; - for (var keys = Object.keys(object.matchingVariantFields), i = 0; i < keys.length; ++i) { - if (typeof object.matchingVariantFields[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2.SearchResponse.SearchResult.matchingVariantFields: object expected"); - message.matchingVariantFields[keys[i]] = $root.google.protobuf.FieldMask.fromObject(object.matchingVariantFields[keys[i]]); - } + var message = new $root.google.cloud.retail.v2.SearchRequest.FacetSpec(); + if (object.facetKey != null) { + if (typeof object.facetKey !== "object") + throw TypeError(".google.cloud.retail.v2.SearchRequest.FacetSpec.facetKey: object expected"); + message.facetKey = $root.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.fromObject(object.facetKey); } - if (object.variantRollupValues) { - if (typeof object.variantRollupValues !== "object") - throw TypeError(".google.cloud.retail.v2.SearchResponse.SearchResult.variantRollupValues: object expected"); - message.variantRollupValues = {}; - for (var keys = Object.keys(object.variantRollupValues), i = 0; i < keys.length; ++i) { - if (typeof object.variantRollupValues[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2.SearchResponse.SearchResult.variantRollupValues: object expected"); - message.variantRollupValues[keys[i]] = $root.google.protobuf.Value.fromObject(object.variantRollupValues[keys[i]]); - } + if (object.limit != null) + message.limit = object.limit | 0; + if (object.excludedFilterKeys) { + if (!Array.isArray(object.excludedFilterKeys)) + throw TypeError(".google.cloud.retail.v2.SearchRequest.FacetSpec.excludedFilterKeys: array expected"); + message.excludedFilterKeys = []; + for (var i = 0; i < object.excludedFilterKeys.length; ++i) + message.excludedFilterKeys[i] = String(object.excludedFilterKeys[i]); } + if (object.enableDynamicPosition != null) + message.enableDynamicPosition = Boolean(object.enableDynamicPosition); return message; }; /** - * Creates a plain object from a SearchResult message. Also converts values to other types if specified. + * Creates a plain object from a FacetSpec message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec * @static - * @param {google.cloud.retail.v2.SearchResponse.SearchResult} message SearchResult + * @param {google.cloud.retail.v2.SearchRequest.FacetSpec} message FacetSpec * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchResult.toObject = function toObject(message, options) { + FacetSpec.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) { - object.matchingVariantFields = {}; - object.variantRollupValues = {}; - } + if (options.arrays || options.defaults) + object.excludedFilterKeys = []; if (options.defaults) { - object.id = ""; - object.product = null; - object.matchingVariantCount = 0; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.product != null && message.hasOwnProperty("product")) - object.product = $root.google.cloud.retail.v2.Product.toObject(message.product, options); - if (message.matchingVariantCount != null && message.hasOwnProperty("matchingVariantCount")) - object.matchingVariantCount = message.matchingVariantCount; - var keys2; - if (message.matchingVariantFields && (keys2 = Object.keys(message.matchingVariantFields)).length) { - object.matchingVariantFields = {}; - for (var j = 0; j < keys2.length; ++j) - object.matchingVariantFields[keys2[j]] = $root.google.protobuf.FieldMask.toObject(message.matchingVariantFields[keys2[j]], options); + object.facetKey = null; + object.limit = 0; + object.enableDynamicPosition = false; } - if (message.variantRollupValues && (keys2 = Object.keys(message.variantRollupValues)).length) { - object.variantRollupValues = {}; - for (var j = 0; j < keys2.length; ++j) - object.variantRollupValues[keys2[j]] = $root.google.protobuf.Value.toObject(message.variantRollupValues[keys2[j]], options); + if (message.facetKey != null && message.hasOwnProperty("facetKey")) + object.facetKey = $root.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.toObject(message.facetKey, options); + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.excludedFilterKeys && message.excludedFilterKeys.length) { + object.excludedFilterKeys = []; + for (var j = 0; j < message.excludedFilterKeys.length; ++j) + object.excludedFilterKeys[j] = message.excludedFilterKeys[j]; } + if (message.enableDynamicPosition != null && message.hasOwnProperty("enableDynamicPosition")) + object.enableDynamicPosition = message.enableDynamicPosition; return object; }; /** - * Converts this SearchResult to JSON. + * Converts this FacetSpec to JSON. * @function toJSON - * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec * @instance * @returns {Object.} JSON object */ - SearchResult.prototype.toJSON = function toJSON() { + FacetSpec.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SearchResult; - })(); - - SearchResponse.Facet = (function() { + FacetSpec.FacetKey = (function() { - /** - * Properties of a Facet. - * @memberof google.cloud.retail.v2.SearchResponse - * @interface IFacet - * @property {string|null} [key] Facet key - * @property {Array.|null} [values] Facet values - * @property {boolean|null} [dynamicFacet] Facet dynamicFacet - */ + /** + * Properties of a FacetKey. + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec + * @interface IFacetKey + * @property {string|null} [key] FacetKey key + * @property {Array.|null} [intervals] FacetKey intervals + * @property {Array.|null} [restrictedValues] FacetKey restrictedValues + * @property {Array.|null} [prefixes] FacetKey prefixes + * @property {Array.|null} [contains] FacetKey contains + * @property {string|null} [orderBy] FacetKey orderBy + * @property {string|null} [query] FacetKey query + */ - /** - * Constructs a new Facet. - * @memberof google.cloud.retail.v2.SearchResponse - * @classdesc Represents a Facet. - * @implements IFacet - * @constructor - * @param {google.cloud.retail.v2.SearchResponse.IFacet=} [properties] Properties to set - */ - function Facet(properties) { - this.values = []; - 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]]; - } + /** + * Constructs a new FacetKey. + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec + * @classdesc Represents a FacetKey. + * @implements IFacetKey + * @constructor + * @param {google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey=} [properties] Properties to set + */ + function FacetKey(properties) { + this.intervals = []; + this.restrictedValues = []; + this.prefixes = []; + this.contains = []; + 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]]; + } - /** - * Facet key. - * @member {string} key - * @memberof google.cloud.retail.v2.SearchResponse.Facet - * @instance - */ - Facet.prototype.key = ""; + /** + * FacetKey key. + * @member {string} key + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.key = ""; - /** - * Facet values. - * @member {Array.} values - * @memberof google.cloud.retail.v2.SearchResponse.Facet - * @instance - */ - Facet.prototype.values = $util.emptyArray; + /** + * FacetKey intervals. + * @member {Array.} intervals + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.intervals = $util.emptyArray; - /** - * Facet dynamicFacet. - * @member {boolean} dynamicFacet - * @memberof google.cloud.retail.v2.SearchResponse.Facet - * @instance - */ - Facet.prototype.dynamicFacet = false; - - /** - * Creates a new Facet instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2.SearchResponse.Facet - * @static - * @param {google.cloud.retail.v2.SearchResponse.IFacet=} [properties] Properties to set - * @returns {google.cloud.retail.v2.SearchResponse.Facet} Facet instance - */ - Facet.create = function create(properties) { - return new Facet(properties); - }; - - /** - * Encodes the specified Facet message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.Facet.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2.SearchResponse.Facet - * @static - * @param {google.cloud.retail.v2.SearchResponse.IFacet} message Facet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Facet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.encode(message.values[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.dynamicFacet != null && Object.hasOwnProperty.call(message, "dynamicFacet")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.dynamicFacet); - return writer; - }; - - /** - * Encodes the specified Facet message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.Facet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2.SearchResponse.Facet - * @static - * @param {google.cloud.retail.v2.SearchResponse.IFacet} message Facet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Facet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Facet message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2.SearchResponse.Facet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.SearchResponse.Facet} Facet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Facet.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.v2.SearchResponse.Facet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.decode(reader, reader.uint32())); - break; - case 3: - message.dynamicFacet = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Facet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2.SearchResponse.Facet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.SearchResponse.Facet} Facet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Facet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Facet message. - * @function verify - * @memberof google.cloud.retail.v2.SearchResponse.Facet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Facet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.verify(message.values[i]); - if (error) - return "values." + error; - } - } - if (message.dynamicFacet != null && message.hasOwnProperty("dynamicFacet")) - if (typeof message.dynamicFacet !== "boolean") - return "dynamicFacet: boolean expected"; - return null; - }; - - /** - * Creates a Facet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2.SearchResponse.Facet - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.SearchResponse.Facet} Facet - */ - Facet.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.SearchResponse.Facet) - return object; - var message = new $root.google.cloud.retail.v2.SearchResponse.Facet(); - if (object.key != null) - message.key = String(object.key); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.retail.v2.SearchResponse.Facet.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.cloud.retail.v2.SearchResponse.Facet.values: object expected"); - message.values[i] = $root.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.fromObject(object.values[i]); - } - } - if (object.dynamicFacet != null) - message.dynamicFacet = Boolean(object.dynamicFacet); - return message; - }; - - /** - * Creates a plain object from a Facet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2.SearchResponse.Facet - * @static - * @param {google.cloud.retail.v2.SearchResponse.Facet} message Facet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Facet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (options.defaults) { - object.key = ""; - object.dynamicFacet = false; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.toObject(message.values[j], options); - } - if (message.dynamicFacet != null && message.hasOwnProperty("dynamicFacet")) - object.dynamicFacet = message.dynamicFacet; - return object; - }; - - /** - * Converts this Facet to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2.SearchResponse.Facet - * @instance - * @returns {Object.} JSON object - */ - Facet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - Facet.FacetValue = (function() { - - /** - * Properties of a FacetValue. - * @memberof google.cloud.retail.v2.SearchResponse.Facet - * @interface IFacetValue - * @property {string|null} [value] FacetValue value - * @property {google.cloud.retail.v2.IInterval|null} [interval] FacetValue interval - * @property {number|Long|null} [count] FacetValue count - */ - - /** - * Constructs a new FacetValue. - * @memberof google.cloud.retail.v2.SearchResponse.Facet - * @classdesc Represents a FacetValue. - * @implements IFacetValue - * @constructor - * @param {google.cloud.retail.v2.SearchResponse.Facet.IFacetValue=} [properties] Properties to set - */ - function FacetValue(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]]; - } + /** + * FacetKey restrictedValues. + * @member {Array.} restrictedValues + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.restrictedValues = $util.emptyArray; /** - * FacetValue value. - * @member {string|null|undefined} value - * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * FacetKey prefixes. + * @member {Array.} prefixes + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey * @instance */ - FacetValue.prototype.value = null; + FacetKey.prototype.prefixes = $util.emptyArray; /** - * FacetValue interval. - * @member {google.cloud.retail.v2.IInterval|null|undefined} interval - * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * FacetKey contains. + * @member {Array.} contains + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey * @instance */ - FacetValue.prototype.interval = null; + FacetKey.prototype.contains = $util.emptyArray; /** - * FacetValue count. - * @member {number|Long} count - * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * FacetKey orderBy. + * @member {string} orderBy + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey * @instance */ - FacetValue.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + FacetKey.prototype.orderBy = ""; /** - * FacetValue facetValue. - * @member {"value"|"interval"|undefined} facetValue - * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * FacetKey query. + * @member {string} query + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey * @instance */ - Object.defineProperty(FacetValue.prototype, "facetValue", { - get: $util.oneOfGetter($oneOfFields = ["value", "interval"]), - set: $util.oneOfSetter($oneOfFields) - }); + FacetKey.prototype.query = ""; /** - * Creates a new FacetValue instance using the specified properties. + * Creates a new FacetKey instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey * @static - * @param {google.cloud.retail.v2.SearchResponse.Facet.IFacetValue=} [properties] Properties to set - * @returns {google.cloud.retail.v2.SearchResponse.Facet.FacetValue} FacetValue instance + * @param {google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey=} [properties] Properties to set + * @returns {google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey} FacetKey instance */ - FacetValue.create = function create(properties) { - return new FacetValue(properties); + FacetKey.create = function create(properties) { + return new FacetKey(properties); }; /** - * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.Facet.FacetValue.verify|verify} messages. + * Encodes the specified FacetKey message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey * @static - * @param {google.cloud.retail.v2.SearchResponse.Facet.IFacetValue} message FacetValue message or plain object to encode + * @param {google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey} message FacetKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FacetValue.encode = function encode(message, writer) { + FacetKey.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) - $root.google.cloud.retail.v2.Interval.encode(message.interval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.count); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.intervals != null && message.intervals.length) + for (var i = 0; i < message.intervals.length; ++i) + $root.google.cloud.retail.v2.Interval.encode(message.intervals[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.restrictedValues != null && message.restrictedValues.length) + for (var i = 0; i < message.restrictedValues.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.restrictedValues[i]); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.query); + if (message.prefixes != null && message.prefixes.length) + for (var i = 0; i < message.prefixes.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.prefixes[i]); + if (message.contains != null && message.contains.length) + for (var i = 0; i < message.contains.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.contains[i]); return writer; }; /** - * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.Facet.FacetValue.verify|verify} messages. + * Encodes the specified FacetKey message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey * @static - * @param {google.cloud.retail.v2.SearchResponse.Facet.IFacetValue} message FacetValue message or plain object to encode + * @param {google.cloud.retail.v2.SearchRequest.FacetSpec.IFacetKey} message FacetKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FacetValue.encodeDelimited = function encodeDelimited(message, writer) { + FacetKey.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FacetValue message from the specified reader or buffer. + * Decodes a FacetKey message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.SearchResponse.Facet.FacetValue} FacetValue + * @returns {google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey} FacetKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FacetValue.decode = function decode(reader, length) { + FacetKey.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.v2.SearchResponse.Facet.FacetValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.value = reader.string(); + message.key = reader.string(); break; case 2: - message.interval = $root.google.cloud.retail.v2.Interval.decode(reader, reader.uint32()); + if (!(message.intervals && message.intervals.length)) + message.intervals = []; + message.intervals.push($root.google.cloud.retail.v2.Interval.decode(reader, reader.uint32())); break; case 3: - message.count = reader.int64(); + if (!(message.restrictedValues && message.restrictedValues.length)) + message.restrictedValues = []; + message.restrictedValues.push(reader.string()); + break; + case 8: + if (!(message.prefixes && message.prefixes.length)) + message.prefixes = []; + message.prefixes.push(reader.string()); + break; + case 9: + if (!(message.contains && message.contains.length)) + message.contains = []; + message.contains.push(reader.string()); + break; + case 4: + message.orderBy = reader.string(); + break; + case 5: + message.query = reader.string(); break; default: reader.skipType(tag & 7); @@ -21421,158 +20836,214 @@ }; /** - * Decodes a FacetValue message from the specified reader or buffer, length delimited. + * Decodes a FacetKey message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.SearchResponse.Facet.FacetValue} FacetValue + * @returns {google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey} FacetKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FacetValue.decodeDelimited = function decodeDelimited(reader) { + FacetKey.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FacetValue message. + * Verifies a FacetKey message. * @function verify - * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FacetValue.verify = function verify(message) { + FacetKey.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.value != null && message.hasOwnProperty("value")) { - properties.facetValue = 1; - if (!$util.isString(message.value)) - return "value: string expected"; - } - if (message.interval != null && message.hasOwnProperty("interval")) { - if (properties.facetValue === 1) - return "facetValue: multiple values"; - properties.facetValue = 1; - { - var error = $root.google.cloud.retail.v2.Interval.verify(message.interval); + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.intervals != null && message.hasOwnProperty("intervals")) { + if (!Array.isArray(message.intervals)) + return "intervals: array expected"; + for (var i = 0; i < message.intervals.length; ++i) { + var error = $root.google.cloud.retail.v2.Interval.verify(message.intervals[i]); if (error) - return "interval." + error; + return "intervals." + error; } } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; + if (message.restrictedValues != null && message.hasOwnProperty("restrictedValues")) { + if (!Array.isArray(message.restrictedValues)) + return "restrictedValues: array expected"; + for (var i = 0; i < message.restrictedValues.length; ++i) + if (!$util.isString(message.restrictedValues[i])) + return "restrictedValues: string[] expected"; + } + if (message.prefixes != null && message.hasOwnProperty("prefixes")) { + if (!Array.isArray(message.prefixes)) + return "prefixes: array expected"; + for (var i = 0; i < message.prefixes.length; ++i) + if (!$util.isString(message.prefixes[i])) + return "prefixes: string[] expected"; + } + if (message.contains != null && message.hasOwnProperty("contains")) { + if (!Array.isArray(message.contains)) + return "contains: array expected"; + for (var i = 0; i < message.contains.length; ++i) + if (!$util.isString(message.contains[i])) + return "contains: string[] expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; return null; }; /** - * Creates a FacetValue message from a plain object. Also converts values to their respective internal types. + * Creates a FacetKey message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.SearchResponse.Facet.FacetValue} FacetValue + * @returns {google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey} FacetKey */ - FacetValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.SearchResponse.Facet.FacetValue) + FacetKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey) return object; - var message = new $root.google.cloud.retail.v2.SearchResponse.Facet.FacetValue(); - if (object.value != null) - message.value = String(object.value); - if (object.interval != null) { - if (typeof object.interval !== "object") - throw TypeError(".google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval: object expected"); - message.interval = $root.google.cloud.retail.v2.Interval.fromObject(object.interval); + var message = new $root.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey(); + if (object.key != null) + message.key = String(object.key); + if (object.intervals) { + if (!Array.isArray(object.intervals)) + throw TypeError(".google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals: array expected"); + message.intervals = []; + for (var i = 0; i < object.intervals.length; ++i) { + if (typeof object.intervals[i] !== "object") + throw TypeError(".google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals: object expected"); + message.intervals[i] = $root.google.cloud.retail.v2.Interval.fromObject(object.intervals[i]); + } } - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + if (object.restrictedValues) { + if (!Array.isArray(object.restrictedValues)) + throw TypeError(".google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.restrictedValues: array expected"); + message.restrictedValues = []; + for (var i = 0; i < object.restrictedValues.length; ++i) + message.restrictedValues[i] = String(object.restrictedValues[i]); + } + if (object.prefixes) { + if (!Array.isArray(object.prefixes)) + throw TypeError(".google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.prefixes: array expected"); + message.prefixes = []; + for (var i = 0; i < object.prefixes.length; ++i) + message.prefixes[i] = String(object.prefixes[i]); + } + if (object.contains) { + if (!Array.isArray(object.contains)) + throw TypeError(".google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.contains: array expected"); + message.contains = []; + for (var i = 0; i < object.contains.length; ++i) + message.contains[i] = String(object.contains[i]); + } + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.query != null) + message.query = String(object.query); return message; }; /** - * Creates a plain object from a FacetValue message. Also converts values to other types if specified. + * Creates a plain object from a FacetKey message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey * @static - * @param {google.cloud.retail.v2.SearchResponse.Facet.FacetValue} message FacetValue + * @param {google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey} message FacetKey * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FacetValue.toObject = function toObject(message, options) { + FacetKey.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.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) { - object.value = message.value; - if (options.oneofs) - object.facetValue = "value"; + if (options.arrays || options.defaults) { + object.intervals = []; + object.restrictedValues = []; + object.prefixes = []; + object.contains = []; } - if (message.interval != null && message.hasOwnProperty("interval")) { - object.interval = $root.google.cloud.retail.v2.Interval.toObject(message.interval, options); - if (options.oneofs) - object.facetValue = "interval"; + if (options.defaults) { + object.key = ""; + object.orderBy = ""; + object.query = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.intervals && message.intervals.length) { + object.intervals = []; + for (var j = 0; j < message.intervals.length; ++j) + object.intervals[j] = $root.google.cloud.retail.v2.Interval.toObject(message.intervals[j], options); + } + if (message.restrictedValues && message.restrictedValues.length) { + object.restrictedValues = []; + for (var j = 0; j < message.restrictedValues.length; ++j) + object.restrictedValues[j] = message.restrictedValues[j]; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.prefixes && message.prefixes.length) { + object.prefixes = []; + for (var j = 0; j < message.prefixes.length; ++j) + object.prefixes[j] = message.prefixes[j]; + } + if (message.contains && message.contains.length) { + object.contains = []; + for (var j = 0; j < message.contains.length; ++j) + object.contains[j] = message.contains[j]; } - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; return object; }; /** - * Converts this FacetValue to JSON. + * Converts this FacetKey to JSON. * @function toJSON - * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @memberof google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey * @instance * @returns {Object.} JSON object */ - FacetValue.prototype.toJSON = function toJSON() { + FacetKey.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FacetValue; + return FacetKey; })(); - return Facet; + return FacetSpec; })(); - SearchResponse.QueryExpansionInfo = (function() { + SearchRequest.DynamicFacetSpec = (function() { /** - * Properties of a QueryExpansionInfo. - * @memberof google.cloud.retail.v2.SearchResponse - * @interface IQueryExpansionInfo - * @property {boolean|null} [expandedQuery] QueryExpansionInfo expandedQuery - * @property {number|Long|null} [pinnedResultCount] QueryExpansionInfo pinnedResultCount + * Properties of a DynamicFacetSpec. + * @memberof google.cloud.retail.v2.SearchRequest + * @interface IDynamicFacetSpec + * @property {google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode|null} [mode] DynamicFacetSpec mode */ /** - * Constructs a new QueryExpansionInfo. - * @memberof google.cloud.retail.v2.SearchResponse - * @classdesc Represents a QueryExpansionInfo. - * @implements IQueryExpansionInfo + * Constructs a new DynamicFacetSpec. + * @memberof google.cloud.retail.v2.SearchRequest + * @classdesc Represents a DynamicFacetSpec. + * @implements IDynamicFacetSpec * @constructor - * @param {google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo=} [properties] Properties to set + * @param {google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec=} [properties] Properties to set */ - function QueryExpansionInfo(properties) { + function DynamicFacetSpec(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21580,88 +21051,75 @@ } /** - * QueryExpansionInfo expandedQuery. - * @member {boolean} expandedQuery - * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo - * @instance - */ - QueryExpansionInfo.prototype.expandedQuery = false; - - /** - * QueryExpansionInfo pinnedResultCount. - * @member {number|Long} pinnedResultCount - * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * DynamicFacetSpec mode. + * @member {google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode} mode + * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec * @instance */ - QueryExpansionInfo.prototype.pinnedResultCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + DynamicFacetSpec.prototype.mode = 0; /** - * Creates a new QueryExpansionInfo instance using the specified properties. + * Creates a new DynamicFacetSpec instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec * @static - * @param {google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo=} [properties] Properties to set - * @returns {google.cloud.retail.v2.SearchResponse.QueryExpansionInfo} QueryExpansionInfo instance + * @param {google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2.SearchRequest.DynamicFacetSpec} DynamicFacetSpec instance */ - QueryExpansionInfo.create = function create(properties) { - return new QueryExpansionInfo(properties); + DynamicFacetSpec.create = function create(properties) { + return new DynamicFacetSpec(properties); }; /** - * Encodes the specified QueryExpansionInfo message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.verify|verify} messages. + * Encodes the specified DynamicFacetSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec * @static - * @param {google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo} message QueryExpansionInfo message or plain object to encode + * @param {google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec} message DynamicFacetSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryExpansionInfo.encode = function encode(message, writer) { + DynamicFacetSpec.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.expandedQuery != null && Object.hasOwnProperty.call(message, "expandedQuery")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandedQuery); - if (message.pinnedResultCount != null && Object.hasOwnProperty.call(message, "pinnedResultCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.pinnedResultCount); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); return writer; }; /** - * Encodes the specified QueryExpansionInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.verify|verify} messages. + * Encodes the specified DynamicFacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec * @static - * @param {google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo} message QueryExpansionInfo message or plain object to encode + * @param {google.cloud.retail.v2.SearchRequest.IDynamicFacetSpec} message DynamicFacetSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryExpansionInfo.encodeDelimited = function encodeDelimited(message, writer) { + DynamicFacetSpec.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QueryExpansionInfo message from the specified reader or buffer. + * Decodes a DynamicFacetSpec message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.SearchResponse.QueryExpansionInfo} QueryExpansionInfo + * @returns {google.cloud.retail.v2.SearchRequest.DynamicFacetSpec} DynamicFacetSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryExpansionInfo.decode = function decode(reader, length) { + DynamicFacetSpec.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.v2.SearchResponse.QueryExpansionInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.expandedQuery = reader.bool(); - break; - case 2: - message.pinnedResultCount = reader.int64(); + message.mode = reader.int32(); break; default: reader.skipType(tag & 7); @@ -21672,551 +21130,1097 @@ }; /** - * Decodes a QueryExpansionInfo message from the specified reader or buffer, length delimited. + * Decodes a DynamicFacetSpec message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.SearchResponse.QueryExpansionInfo} QueryExpansionInfo + * @returns {google.cloud.retail.v2.SearchRequest.DynamicFacetSpec} DynamicFacetSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryExpansionInfo.decodeDelimited = function decodeDelimited(reader) { + DynamicFacetSpec.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QueryExpansionInfo message. + * Verifies a DynamicFacetSpec message. * @function verify - * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QueryExpansionInfo.verify = function verify(message) { + DynamicFacetSpec.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.expandedQuery != null && message.hasOwnProperty("expandedQuery")) - if (typeof message.expandedQuery !== "boolean") - return "expandedQuery: boolean expected"; - if (message.pinnedResultCount != null && message.hasOwnProperty("pinnedResultCount")) - if (!$util.isInteger(message.pinnedResultCount) && !(message.pinnedResultCount && $util.isInteger(message.pinnedResultCount.low) && $util.isInteger(message.pinnedResultCount.high))) - return "pinnedResultCount: integer|Long expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a QueryExpansionInfo message from a plain object. Also converts values to their respective internal types. + * Creates a DynamicFacetSpec message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.SearchResponse.QueryExpansionInfo} QueryExpansionInfo + * @returns {google.cloud.retail.v2.SearchRequest.DynamicFacetSpec} DynamicFacetSpec */ - QueryExpansionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) + DynamicFacetSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec) return object; - var message = new $root.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo(); - if (object.expandedQuery != null) - message.expandedQuery = Boolean(object.expandedQuery); - if (object.pinnedResultCount != null) - if ($util.Long) - (message.pinnedResultCount = $util.Long.fromValue(object.pinnedResultCount)).unsigned = false; - else if (typeof object.pinnedResultCount === "string") - message.pinnedResultCount = parseInt(object.pinnedResultCount, 10); - else if (typeof object.pinnedResultCount === "number") - message.pinnedResultCount = object.pinnedResultCount; - else if (typeof object.pinnedResultCount === "object") - message.pinnedResultCount = new $util.LongBits(object.pinnedResultCount.low >>> 0, object.pinnedResultCount.high >>> 0).toNumber(); + var message = new $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec(); + switch (object.mode) { + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "DISABLED": + case 1: + message.mode = 1; + break; + case "ENABLED": + case 2: + message.mode = 2; + break; + } return message; }; /** - * Creates a plain object from a QueryExpansionInfo message. Also converts values to other types if specified. + * Creates a plain object from a DynamicFacetSpec message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec * @static - * @param {google.cloud.retail.v2.SearchResponse.QueryExpansionInfo} message QueryExpansionInfo + * @param {google.cloud.retail.v2.SearchRequest.DynamicFacetSpec} message DynamicFacetSpec * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryExpansionInfo.toObject = function toObject(message, options) { + DynamicFacetSpec.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.expandedQuery = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.pinnedResultCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.pinnedResultCount = options.longs === String ? "0" : 0; - } - if (message.expandedQuery != null && message.hasOwnProperty("expandedQuery")) - object.expandedQuery = message.expandedQuery; - if (message.pinnedResultCount != null && message.hasOwnProperty("pinnedResultCount")) - if (typeof message.pinnedResultCount === "number") - object.pinnedResultCount = options.longs === String ? String(message.pinnedResultCount) : message.pinnedResultCount; - else - object.pinnedResultCount = options.longs === String ? $util.Long.prototype.toString.call(message.pinnedResultCount) : options.longs === Number ? new $util.LongBits(message.pinnedResultCount.low >>> 0, message.pinnedResultCount.high >>> 0).toNumber() : message.pinnedResultCount; + if (options.defaults) + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode[message.mode] : message.mode; return object; }; /** - * Converts this QueryExpansionInfo to JSON. + * Converts this DynamicFacetSpec to JSON. * @function toJSON - * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @memberof google.cloud.retail.v2.SearchRequest.DynamicFacetSpec * @instance * @returns {Object.} JSON object */ - QueryExpansionInfo.prototype.toJSON = function toJSON() { + DynamicFacetSpec.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return QueryExpansionInfo; - })(); + /** + * Mode enum. + * @name google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} ENABLED=2 ENABLED value + */ + DynamicFacetSpec.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[2] = "ENABLED"] = 2; + return values; + })(); - return SearchResponse; - })(); + return DynamicFacetSpec; + })(); - v2.UserEventService = (function() { + SearchRequest.BoostSpec = (function() { - /** - * Constructs a new UserEventService service. - * @memberof google.cloud.retail.v2 - * @classdesc Represents a UserEventService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function UserEventService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } + /** + * Properties of a BoostSpec. + * @memberof google.cloud.retail.v2.SearchRequest + * @interface IBoostSpec + * @property {Array.|null} [conditionBoostSpecs] BoostSpec conditionBoostSpecs + * @property {boolean|null} [skipBoostSpecValidation] BoostSpec skipBoostSpecValidation + */ - (UserEventService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = UserEventService; + /** + * Constructs a new BoostSpec. + * @memberof google.cloud.retail.v2.SearchRequest + * @classdesc Represents a BoostSpec. + * @implements IBoostSpec + * @constructor + * @param {google.cloud.retail.v2.SearchRequest.IBoostSpec=} [properties] Properties to set + */ + function BoostSpec(properties) { + this.conditionBoostSpecs = []; + 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]]; + } - /** - * Creates new UserEventService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.retail.v2.UserEventService - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {UserEventService} RPC service. Useful where requests and/or responses are streamed. - */ - UserEventService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + /** + * BoostSpec conditionBoostSpecs. + * @member {Array.} conditionBoostSpecs + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec + * @instance + */ + BoostSpec.prototype.conditionBoostSpecs = $util.emptyArray; - /** - * Callback as used by {@link google.cloud.retail.v2.UserEventService#writeUserEvent}. - * @memberof google.cloud.retail.v2.UserEventService - * @typedef WriteUserEventCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2.UserEvent} [response] UserEvent - */ + /** + * BoostSpec skipBoostSpecValidation. + * @member {boolean|null|undefined} skipBoostSpecValidation + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec + * @instance + */ + BoostSpec.prototype.skipBoostSpecValidation = null; - /** - * Calls WriteUserEvent. - * @function writeUserEvent - * @memberof google.cloud.retail.v2.UserEventService - * @instance - * @param {google.cloud.retail.v2.IWriteUserEventRequest} request WriteUserEventRequest message or plain object - * @param {google.cloud.retail.v2.UserEventService.WriteUserEventCallback} callback Node-style callback called with the error, if any, and UserEvent - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UserEventService.prototype.writeUserEvent = function writeUserEvent(request, callback) { - return this.rpcCall(writeUserEvent, $root.google.cloud.retail.v2.WriteUserEventRequest, $root.google.cloud.retail.v2.UserEvent, request, callback); - }, "name", { value: "WriteUserEvent" }); + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Calls WriteUserEvent. - * @function writeUserEvent - * @memberof google.cloud.retail.v2.UserEventService - * @instance - * @param {google.cloud.retail.v2.IWriteUserEventRequest} request WriteUserEventRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * BoostSpec _skipBoostSpecValidation. + * @member {"skipBoostSpecValidation"|undefined} _skipBoostSpecValidation + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec + * @instance + */ + Object.defineProperty(BoostSpec.prototype, "_skipBoostSpecValidation", { + get: $util.oneOfGetter($oneOfFields = ["skipBoostSpecValidation"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Callback as used by {@link google.cloud.retail.v2.UserEventService#collectUserEvent}. - * @memberof google.cloud.retail.v2.UserEventService - * @typedef CollectUserEventCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.api.HttpBody} [response] HttpBody - */ + /** + * Creates a new BoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec + * @static + * @param {google.cloud.retail.v2.SearchRequest.IBoostSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2.SearchRequest.BoostSpec} BoostSpec instance + */ + BoostSpec.create = function create(properties) { + return new BoostSpec(properties); + }; - /** - * Calls CollectUserEvent. - * @function collectUserEvent - * @memberof google.cloud.retail.v2.UserEventService - * @instance - * @param {google.cloud.retail.v2.ICollectUserEventRequest} request CollectUserEventRequest message or plain object - * @param {google.cloud.retail.v2.UserEventService.CollectUserEventCallback} callback Node-style callback called with the error, if any, and HttpBody - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UserEventService.prototype.collectUserEvent = function collectUserEvent(request, callback) { - return this.rpcCall(collectUserEvent, $root.google.cloud.retail.v2.CollectUserEventRequest, $root.google.api.HttpBody, request, callback); - }, "name", { value: "CollectUserEvent" }); + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.BoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec + * @static + * @param {google.cloud.retail.v2.SearchRequest.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditionBoostSpecs != null && message.conditionBoostSpecs.length) + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) + $root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.encode(message.conditionBoostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.skipBoostSpecValidation != null && Object.hasOwnProperty.call(message, "skipBoostSpecValidation")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.skipBoostSpecValidation); + return writer; + }; - /** - * Calls CollectUserEvent. - * @function collectUserEvent - * @memberof google.cloud.retail.v2.UserEventService - * @instance - * @param {google.cloud.retail.v2.ICollectUserEventRequest} request CollectUserEventRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.BoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec + * @static + * @param {google.cloud.retail.v2.SearchRequest.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Callback as used by {@link google.cloud.retail.v2.UserEventService#purgeUserEvents}. - * @memberof google.cloud.retail.v2.UserEventService - * @typedef PurgeUserEventsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.SearchRequest.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.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.v2.SearchRequest.BoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.conditionBoostSpecs && message.conditionBoostSpecs.length)) + message.conditionBoostSpecs = []; + message.conditionBoostSpecs.push($root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); + break; + case 2: + message.skipBoostSpecValidation = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Calls PurgeUserEvents. - * @function purgeUserEvents - * @memberof google.cloud.retail.v2.UserEventService - * @instance - * @param {google.cloud.retail.v2.IPurgeUserEventsRequest} request PurgeUserEventsRequest message or plain object - * @param {google.cloud.retail.v2.UserEventService.PurgeUserEventsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UserEventService.prototype.purgeUserEvents = function purgeUserEvents(request, callback) { - return this.rpcCall(purgeUserEvents, $root.google.cloud.retail.v2.PurgeUserEventsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "PurgeUserEvents" }); + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.SearchRequest.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Calls PurgeUserEvents. - * @function purgeUserEvents - * @memberof google.cloud.retail.v2.UserEventService - * @instance - * @param {google.cloud.retail.v2.IPurgeUserEventsRequest} request PurgeUserEventsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Verifies a BoostSpec message. + * @function verify + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.conditionBoostSpecs != null && message.hasOwnProperty("conditionBoostSpecs")) { + if (!Array.isArray(message.conditionBoostSpecs)) + return "conditionBoostSpecs: array expected"; + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) { + var error = $root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.verify(message.conditionBoostSpecs[i]); + if (error) + return "conditionBoostSpecs." + error; + } + } + if (message.skipBoostSpecValidation != null && message.hasOwnProperty("skipBoostSpecValidation")) { + properties._skipBoostSpecValidation = 1; + if (typeof message.skipBoostSpecValidation !== "boolean") + return "skipBoostSpecValidation: boolean expected"; + } + return null; + }; - /** - * Callback as used by {@link google.cloud.retail.v2.UserEventService#importUserEvents}. - * @memberof google.cloud.retail.v2.UserEventService - * @typedef ImportUserEventsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.SearchRequest.BoostSpec} BoostSpec + */ + BoostSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.SearchRequest.BoostSpec) + return object; + var message = new $root.google.cloud.retail.v2.SearchRequest.BoostSpec(); + if (object.conditionBoostSpecs) { + if (!Array.isArray(object.conditionBoostSpecs)) + throw TypeError(".google.cloud.retail.v2.SearchRequest.BoostSpec.conditionBoostSpecs: array expected"); + message.conditionBoostSpecs = []; + for (var i = 0; i < object.conditionBoostSpecs.length; ++i) { + if (typeof object.conditionBoostSpecs[i] !== "object") + throw TypeError(".google.cloud.retail.v2.SearchRequest.BoostSpec.conditionBoostSpecs: object expected"); + message.conditionBoostSpecs[i] = $root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.fromObject(object.conditionBoostSpecs[i]); + } + } + if (object.skipBoostSpecValidation != null) + message.skipBoostSpecValidation = Boolean(object.skipBoostSpecValidation); + return message; + }; - /** - * Calls ImportUserEvents. - * @function importUserEvents - * @memberof google.cloud.retail.v2.UserEventService - * @instance - * @param {google.cloud.retail.v2.IImportUserEventsRequest} request ImportUserEventsRequest message or plain object - * @param {google.cloud.retail.v2.UserEventService.ImportUserEventsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UserEventService.prototype.importUserEvents = function importUserEvents(request, callback) { - return this.rpcCall(importUserEvents, $root.google.cloud.retail.v2.ImportUserEventsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportUserEvents" }); + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec + * @static + * @param {google.cloud.retail.v2.SearchRequest.BoostSpec} message BoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditionBoostSpecs = []; + if (message.conditionBoostSpecs && message.conditionBoostSpecs.length) { + object.conditionBoostSpecs = []; + for (var j = 0; j < message.conditionBoostSpecs.length; ++j) + object.conditionBoostSpecs[j] = $root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.toObject(message.conditionBoostSpecs[j], options); + } + if (message.skipBoostSpecValidation != null && message.hasOwnProperty("skipBoostSpecValidation")) { + object.skipBoostSpecValidation = message.skipBoostSpecValidation; + if (options.oneofs) + object._skipBoostSpecValidation = "skipBoostSpecValidation"; + } + return object; + }; - /** - * Calls ImportUserEvents. - * @function importUserEvents - * @memberof google.cloud.retail.v2.UserEventService - * @instance - * @param {google.cloud.retail.v2.IImportUserEventsRequest} request ImportUserEventsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Converts this BoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec + * @instance + * @returns {Object.} JSON object + */ + BoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Callback as used by {@link google.cloud.retail.v2.UserEventService#rejoinUserEvents}. - * @memberof google.cloud.retail.v2.UserEventService - * @typedef RejoinUserEventsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + BoostSpec.ConditionBoostSpec = (function() { - /** - * Calls RejoinUserEvents. - * @function rejoinUserEvents - * @memberof google.cloud.retail.v2.UserEventService - * @instance - * @param {google.cloud.retail.v2.IRejoinUserEventsRequest} request RejoinUserEventsRequest message or plain object - * @param {google.cloud.retail.v2.UserEventService.RejoinUserEventsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UserEventService.prototype.rejoinUserEvents = function rejoinUserEvents(request, callback) { - return this.rpcCall(rejoinUserEvents, $root.google.cloud.retail.v2.RejoinUserEventsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RejoinUserEvents" }); + /** + * Properties of a ConditionBoostSpec. + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec + * @interface IConditionBoostSpec + * @property {string|null} [condition] ConditionBoostSpec condition + * @property {number|null} [boost] ConditionBoostSpec boost + */ - /** - * Calls RejoinUserEvents. - * @function rejoinUserEvents - * @memberof google.cloud.retail.v2.UserEventService - * @instance - * @param {google.cloud.retail.v2.IRejoinUserEventsRequest} request RejoinUserEventsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Constructs a new ConditionBoostSpec. + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec + * @classdesc Represents a ConditionBoostSpec. + * @implements IConditionBoostSpec + * @constructor + * @param {google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + */ + function ConditionBoostSpec(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]]; + } - return UserEventService; - })(); + /** + * ConditionBoostSpec condition. + * @member {string} condition + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.condition = ""; - v2.WriteUserEventRequest = (function() { + /** + * ConditionBoostSpec boost. + * @member {number} boost + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.boost = 0; - /** - * Properties of a WriteUserEventRequest. - * @memberof google.cloud.retail.v2 - * @interface IWriteUserEventRequest - * @property {string|null} [parent] WriteUserEventRequest parent - * @property {google.cloud.retail.v2.IUserEvent|null} [userEvent] WriteUserEventRequest userEvent - */ + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec instance + */ + ConditionBoostSpec.create = function create(properties) { + return new ConditionBoostSpec(properties); + }; - /** - * Constructs a new WriteUserEventRequest. - * @memberof google.cloud.retail.v2 - * @classdesc Represents a WriteUserEventRequest. - * @implements IWriteUserEventRequest - * @constructor - * @param {google.cloud.retail.v2.IWriteUserEventRequest=} [properties] Properties to set - */ - function WriteUserEventRequest(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]]; - } + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + return writer; + }; - /** - * WriteUserEventRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2.WriteUserEventRequest - * @instance - */ - WriteUserEventRequest.prototype.parent = ""; + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.retail.v2.SearchRequest.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * WriteUserEventRequest userEvent. - * @member {google.cloud.retail.v2.IUserEvent|null|undefined} userEvent - * @memberof google.cloud.retail.v2.WriteUserEventRequest - * @instance - */ - WriteUserEventRequest.prototype.userEvent = null; + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.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.v2.SearchRequest.BoostSpec.ConditionBoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.condition = reader.string(); + break; + case 2: + message.boost = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new WriteUserEventRequest instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2.WriteUserEventRequest - * @static - * @param {google.cloud.retail.v2.IWriteUserEventRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2.WriteUserEventRequest} WriteUserEventRequest instance - */ - WriteUserEventRequest.create = function create(properties) { - return new WriteUserEventRequest(properties); - }; + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified WriteUserEventRequest message. Does not implicitly {@link google.cloud.retail.v2.WriteUserEventRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2.WriteUserEventRequest - * @static - * @param {google.cloud.retail.v2.IWriteUserEventRequest} message WriteUserEventRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WriteUserEventRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.userEvent != null && Object.hasOwnProperty.call(message, "userEvent")) - $root.google.cloud.retail.v2.UserEvent.encode(message.userEvent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Verifies a ConditionBoostSpec message. + * @function verify + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionBoostSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + return null; + }; - /** - * Encodes the specified WriteUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.WriteUserEventRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2.WriteUserEventRequest - * @static - * @param {google.cloud.retail.v2.IWriteUserEventRequest} message WriteUserEventRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WriteUserEventRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + */ + ConditionBoostSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec) + return object; + var message = new $root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec(); + if (object.condition != null) + message.condition = String(object.condition); + if (object.boost != null) + message.boost = Number(object.boost); + return message; + }; - /** - * Decodes a WriteUserEventRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2.WriteUserEventRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.WriteUserEventRequest} WriteUserEventRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WriteUserEventRequest.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.v2.WriteUserEventRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.userEvent = $root.google.cloud.retail.v2.UserEvent.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec} message ConditionBoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionBoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.condition = ""; + object.boost = 0; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + return object; + }; - /** - * Decodes a WriteUserEventRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2.WriteUserEventRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.WriteUserEventRequest} WriteUserEventRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WriteUserEventRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this ConditionBoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec + * @instance + * @returns {Object.} JSON object + */ + ConditionBoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a WriteUserEventRequest message. - * @function verify - * @memberof google.cloud.retail.v2.WriteUserEventRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WriteUserEventRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.userEvent != null && message.hasOwnProperty("userEvent")) { - var error = $root.google.cloud.retail.v2.UserEvent.verify(message.userEvent); - if (error) - return "userEvent." + error; - } - return null; - }; + return ConditionBoostSpec; + })(); - /** - * Creates a WriteUserEventRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2.WriteUserEventRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.WriteUserEventRequest} WriteUserEventRequest - */ - WriteUserEventRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.WriteUserEventRequest) - return object; - var message = new $root.google.cloud.retail.v2.WriteUserEventRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.userEvent != null) { - if (typeof object.userEvent !== "object") - throw TypeError(".google.cloud.retail.v2.WriteUserEventRequest.userEvent: object expected"); - message.userEvent = $root.google.cloud.retail.v2.UserEvent.fromObject(object.userEvent); - } - return message; - }; + return BoostSpec; + })(); - /** - * Creates a plain object from a WriteUserEventRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2.WriteUserEventRequest - * @static - * @param {google.cloud.retail.v2.WriteUserEventRequest} message WriteUserEventRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WriteUserEventRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.userEvent = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.userEvent != null && message.hasOwnProperty("userEvent")) - object.userEvent = $root.google.cloud.retail.v2.UserEvent.toObject(message.userEvent, options); - return object; - }; + SearchRequest.QueryExpansionSpec = (function() { - /** - * Converts this WriteUserEventRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2.WriteUserEventRequest - * @instance - * @returns {Object.} JSON object - */ - WriteUserEventRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Properties of a QueryExpansionSpec. + * @memberof google.cloud.retail.v2.SearchRequest + * @interface IQueryExpansionSpec + * @property {google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition|null} [condition] QueryExpansionSpec condition + * @property {boolean|null} [pinUnexpandedResults] QueryExpansionSpec pinUnexpandedResults + */ - return WriteUserEventRequest; + /** + * Constructs a new QueryExpansionSpec. + * @memberof google.cloud.retail.v2.SearchRequest + * @classdesc Represents a QueryExpansionSpec. + * @implements IQueryExpansionSpec + * @constructor + * @param {google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set + */ + function QueryExpansionSpec(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]]; + } + + /** + * QueryExpansionSpec condition. + * @member {google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition} condition + * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec + * @instance + */ + QueryExpansionSpec.prototype.condition = 0; + + /** + * QueryExpansionSpec pinUnexpandedResults. + * @member {boolean} pinUnexpandedResults + * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec + * @instance + */ + QueryExpansionSpec.prototype.pinUnexpandedResults = false; + + /** + * Creates a new QueryExpansionSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec + * @static + * @param {google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2.SearchRequest.QueryExpansionSpec} QueryExpansionSpec instance + */ + QueryExpansionSpec.create = function create(properties) { + return new QueryExpansionSpec(properties); + }; + + /** + * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec + * @static + * @param {google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryExpansionSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.condition); + if (message.pinUnexpandedResults != null && Object.hasOwnProperty.call(message, "pinUnexpandedResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.pinUnexpandedResults); + return writer; + }; + + /** + * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec + * @static + * @param {google.cloud.retail.v2.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryExpansionSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryExpansionSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.SearchRequest.QueryExpansionSpec} QueryExpansionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryExpansionSpec.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.v2.SearchRequest.QueryExpansionSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.condition = reader.int32(); + break; + case 2: + message.pinUnexpandedResults = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.SearchRequest.QueryExpansionSpec} QueryExpansionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryExpansionSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryExpansionSpec message. + * @function verify + * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryExpansionSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + switch (message.condition) { + default: + return "condition: enum value expected"; + case 0: + case 1: + case 3: + break; + } + if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) + if (typeof message.pinUnexpandedResults !== "boolean") + return "pinUnexpandedResults: boolean expected"; + return null; + }; + + /** + * Creates a QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.SearchRequest.QueryExpansionSpec} QueryExpansionSpec + */ + QueryExpansionSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec) + return object; + var message = new $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec(); + switch (object.condition) { + case "CONDITION_UNSPECIFIED": + case 0: + message.condition = 0; + break; + case "DISABLED": + case 1: + message.condition = 1; + break; + case "AUTO": + case 3: + message.condition = 3; + break; + } + if (object.pinUnexpandedResults != null) + message.pinUnexpandedResults = Boolean(object.pinUnexpandedResults); + return message; + }; + + /** + * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec + * @static + * @param {google.cloud.retail.v2.SearchRequest.QueryExpansionSpec} message QueryExpansionSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryExpansionSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.condition = options.enums === String ? "CONDITION_UNSPECIFIED" : 0; + object.pinUnexpandedResults = false; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = options.enums === String ? $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition[message.condition] : message.condition; + if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) + object.pinUnexpandedResults = message.pinUnexpandedResults; + return object; + }; + + /** + * Converts this QueryExpansionSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.SearchRequest.QueryExpansionSpec + * @instance + * @returns {Object.} JSON object + */ + QueryExpansionSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Condition enum. + * @name google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition + * @enum {number} + * @property {number} CONDITION_UNSPECIFIED=0 CONDITION_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} AUTO=3 AUTO value + */ + QueryExpansionSpec.Condition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONDITION_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[3] = "AUTO"] = 3; + return values; + })(); + + return QueryExpansionSpec; + })(); + + SearchRequest.PersonalizationSpec = (function() { + + /** + * Properties of a PersonalizationSpec. + * @memberof google.cloud.retail.v2.SearchRequest + * @interface IPersonalizationSpec + * @property {google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode|null} [mode] PersonalizationSpec mode + */ + + /** + * Constructs a new PersonalizationSpec. + * @memberof google.cloud.retail.v2.SearchRequest + * @classdesc Represents a PersonalizationSpec. + * @implements IPersonalizationSpec + * @constructor + * @param {google.cloud.retail.v2.SearchRequest.IPersonalizationSpec=} [properties] Properties to set + */ + function PersonalizationSpec(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]]; + } + + /** + * PersonalizationSpec mode. + * @member {google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode} mode + * @memberof google.cloud.retail.v2.SearchRequest.PersonalizationSpec + * @instance + */ + PersonalizationSpec.prototype.mode = 0; + + /** + * Creates a new PersonalizationSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.SearchRequest.PersonalizationSpec + * @static + * @param {google.cloud.retail.v2.SearchRequest.IPersonalizationSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2.SearchRequest.PersonalizationSpec} PersonalizationSpec instance + */ + PersonalizationSpec.create = function create(properties) { + return new PersonalizationSpec(properties); + }; + + /** + * Encodes the specified PersonalizationSpec message. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.PersonalizationSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.SearchRequest.PersonalizationSpec + * @static + * @param {google.cloud.retail.v2.SearchRequest.IPersonalizationSpec} message PersonalizationSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalizationSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + return writer; + }; + + /** + * Encodes the specified PersonalizationSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchRequest.PersonalizationSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.SearchRequest.PersonalizationSpec + * @static + * @param {google.cloud.retail.v2.SearchRequest.IPersonalizationSpec} message PersonalizationSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalizationSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonalizationSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.SearchRequest.PersonalizationSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.SearchRequest.PersonalizationSpec} PersonalizationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalizationSpec.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.v2.SearchRequest.PersonalizationSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PersonalizationSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.SearchRequest.PersonalizationSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.SearchRequest.PersonalizationSpec} PersonalizationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalizationSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonalizationSpec message. + * @function verify + * @memberof google.cloud.retail.v2.SearchRequest.PersonalizationSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonalizationSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a PersonalizationSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.SearchRequest.PersonalizationSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.SearchRequest.PersonalizationSpec} PersonalizationSpec + */ + PersonalizationSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec) + return object; + var message = new $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec(); + switch (object.mode) { + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "AUTO": + case 1: + message.mode = 1; + break; + case "DISABLED": + case 2: + message.mode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a PersonalizationSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.SearchRequest.PersonalizationSpec + * @static + * @param {google.cloud.retail.v2.SearchRequest.PersonalizationSpec} message PersonalizationSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonalizationSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode[message.mode] : message.mode; + return object; + }; + + /** + * Converts this PersonalizationSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.SearchRequest.PersonalizationSpec + * @instance + * @returns {Object.} JSON object + */ + PersonalizationSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Mode enum. + * @name google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} AUTO=1 AUTO value + * @property {number} DISABLED=2 DISABLED value + */ + PersonalizationSpec.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTO"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + return values; + })(); + + return PersonalizationSpec; + })(); + + /** + * SearchMode enum. + * @name google.cloud.retail.v2.SearchRequest.SearchMode + * @enum {number} + * @property {number} SEARCH_MODE_UNSPECIFIED=0 SEARCH_MODE_UNSPECIFIED value + * @property {number} PRODUCT_SEARCH_ONLY=1 PRODUCT_SEARCH_ONLY value + * @property {number} FACETED_SEARCH_ONLY=2 FACETED_SEARCH_ONLY value + */ + SearchRequest.SearchMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEARCH_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRODUCT_SEARCH_ONLY"] = 1; + values[valuesById[2] = "FACETED_SEARCH_ONLY"] = 2; + return values; + })(); + + return SearchRequest; })(); - v2.CollectUserEventRequest = (function() { + v2.SearchResponse = (function() { /** - * Properties of a CollectUserEventRequest. + * Properties of a SearchResponse. * @memberof google.cloud.retail.v2 - * @interface ICollectUserEventRequest - * @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 + * @interface ISearchResponse + * @property {Array.|null} [results] SearchResponse results + * @property {Array.|null} [facets] SearchResponse facets + * @property {number|null} [totalSize] SearchResponse totalSize + * @property {string|null} [correctedQuery] SearchResponse correctedQuery + * @property {string|null} [attributionToken] SearchResponse attributionToken + * @property {string|null} [nextPageToken] SearchResponse nextPageToken + * @property {google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo|null} [queryExpansionInfo] SearchResponse queryExpansionInfo + * @property {string|null} [redirectUri] SearchResponse redirectUri + * @property {Array.|null} [appliedControls] SearchResponse appliedControls + * @property {Array.|null} [invalidConditionBoostSpecs] SearchResponse invalidConditionBoostSpecs */ /** - * Constructs a new CollectUserEventRequest. + * Constructs a new SearchResponse. * @memberof google.cloud.retail.v2 - * @classdesc Represents a CollectUserEventRequest. - * @implements ICollectUserEventRequest + * @classdesc Represents a SearchResponse. + * @implements ISearchResponse * @constructor - * @param {google.cloud.retail.v2.ICollectUserEventRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2.ISearchResponse=} [properties] Properties to set */ - function CollectUserEventRequest(properties) { + function SearchResponse(properties) { + this.results = []; + this.facets = []; + this.appliedControls = []; + this.invalidConditionBoostSpecs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22224,354 +22228,204 @@ } /** - * CollectUserEventRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2.CollectUserEventRequest + * SearchResponse results. + * @member {Array.} results + * @memberof google.cloud.retail.v2.SearchResponse * @instance */ - CollectUserEventRequest.prototype.parent = ""; + SearchResponse.prototype.results = $util.emptyArray; /** - * CollectUserEventRequest userEvent. - * @member {string} userEvent - * @memberof google.cloud.retail.v2.CollectUserEventRequest + * SearchResponse facets. + * @member {Array.} facets + * @memberof google.cloud.retail.v2.SearchResponse * @instance */ - CollectUserEventRequest.prototype.userEvent = ""; + SearchResponse.prototype.facets = $util.emptyArray; /** - * CollectUserEventRequest uri. - * @member {string} uri - * @memberof google.cloud.retail.v2.CollectUserEventRequest + * SearchResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.retail.v2.SearchResponse * @instance */ - CollectUserEventRequest.prototype.uri = ""; + SearchResponse.prototype.totalSize = 0; /** - * CollectUserEventRequest ets. - * @member {number|Long} ets - * @memberof google.cloud.retail.v2.CollectUserEventRequest + * SearchResponse correctedQuery. + * @member {string} correctedQuery + * @memberof google.cloud.retail.v2.SearchResponse * @instance */ - CollectUserEventRequest.prototype.ets = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + SearchResponse.prototype.correctedQuery = ""; /** - * Creates a new CollectUserEventRequest instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2.CollectUserEventRequest - * @static - * @param {google.cloud.retail.v2.ICollectUserEventRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2.CollectUserEventRequest} CollectUserEventRequest instance + * SearchResponse attributionToken. + * @member {string} attributionToken + * @memberof google.cloud.retail.v2.SearchResponse + * @instance */ - CollectUserEventRequest.create = function create(properties) { - return new CollectUserEventRequest(properties); - }; + SearchResponse.prototype.attributionToken = ""; /** - * Encodes the specified CollectUserEventRequest message. Does not implicitly {@link google.cloud.retail.v2.CollectUserEventRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2.CollectUserEventRequest - * @static - * @param {google.cloud.retail.v2.ICollectUserEventRequest} message CollectUserEventRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * SearchResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.retail.v2.SearchResponse + * @instance */ - CollectUserEventRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.userEvent != null && Object.hasOwnProperty.call(message, "userEvent")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.userEvent); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - 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); - return writer; - }; - - /** - * Encodes the specified CollectUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.CollectUserEventRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2.CollectUserEventRequest - * @static - * @param {google.cloud.retail.v2.ICollectUserEventRequest} message CollectUserEventRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CollectUserEventRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CollectUserEventRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2.CollectUserEventRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.CollectUserEventRequest} CollectUserEventRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CollectUserEventRequest.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.v2.CollectUserEventRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.userEvent = reader.string(); - break; - case 3: - message.uri = reader.string(); - break; - case 4: - message.ets = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CollectUserEventRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2.CollectUserEventRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.CollectUserEventRequest} CollectUserEventRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CollectUserEventRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CollectUserEventRequest message. - * @function verify - * @memberof google.cloud.retail.v2.CollectUserEventRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CollectUserEventRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.userEvent != null && message.hasOwnProperty("userEvent")) - if (!$util.isString(message.userEvent)) - return "userEvent: string expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - 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"; - return null; - }; - - /** - * Creates a CollectUserEventRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2.CollectUserEventRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.CollectUserEventRequest} CollectUserEventRequest - */ - CollectUserEventRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.CollectUserEventRequest) - return object; - var message = new $root.google.cloud.retail.v2.CollectUserEventRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.userEvent != null) - message.userEvent = String(object.userEvent); - if (object.uri != null) - message.uri = String(object.uri); - if (object.ets != null) - if ($util.Long) - (message.ets = $util.Long.fromValue(object.ets)).unsigned = false; - else if (typeof object.ets === "string") - message.ets = parseInt(object.ets, 10); - else if (typeof object.ets === "number") - message.ets = object.ets; - else if (typeof object.ets === "object") - message.ets = new $util.LongBits(object.ets.low >>> 0, object.ets.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a CollectUserEventRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2.CollectUserEventRequest - * @static - * @param {google.cloud.retail.v2.CollectUserEventRequest} message CollectUserEventRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CollectUserEventRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.userEvent = ""; - object.uri = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.ets = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.ets = options.longs === String ? "0" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.userEvent != null && message.hasOwnProperty("userEvent")) - object.userEvent = message.userEvent; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - if (message.ets != null && message.hasOwnProperty("ets")) - if (typeof message.ets === "number") - 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; - return object; - }; + SearchResponse.prototype.nextPageToken = ""; /** - * Converts this CollectUserEventRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2.CollectUserEventRequest + * SearchResponse queryExpansionInfo. + * @member {google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo|null|undefined} queryExpansionInfo + * @memberof google.cloud.retail.v2.SearchResponse * @instance - * @returns {Object.} JSON object - */ - CollectUserEventRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CollectUserEventRequest; - })(); - - v2.RejoinUserEventsRequest = (function() { - - /** - * Properties of a RejoinUserEventsRequest. - * @memberof google.cloud.retail.v2 - * @interface IRejoinUserEventsRequest - * @property {string|null} [parent] RejoinUserEventsRequest parent - * @property {google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope|null} [userEventRejoinScope] RejoinUserEventsRequest userEventRejoinScope */ + SearchResponse.prototype.queryExpansionInfo = null; /** - * Constructs a new RejoinUserEventsRequest. - * @memberof google.cloud.retail.v2 - * @classdesc Represents a RejoinUserEventsRequest. - * @implements IRejoinUserEventsRequest - * @constructor - * @param {google.cloud.retail.v2.IRejoinUserEventsRequest=} [properties] Properties to set + * SearchResponse redirectUri. + * @member {string} redirectUri + * @memberof google.cloud.retail.v2.SearchResponse + * @instance */ - function RejoinUserEventsRequest(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]]; - } + SearchResponse.prototype.redirectUri = ""; /** - * RejoinUserEventsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * SearchResponse appliedControls. + * @member {Array.} appliedControls + * @memberof google.cloud.retail.v2.SearchResponse * @instance */ - RejoinUserEventsRequest.prototype.parent = ""; + SearchResponse.prototype.appliedControls = $util.emptyArray; /** - * RejoinUserEventsRequest userEventRejoinScope. - * @member {google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope} userEventRejoinScope - * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * SearchResponse invalidConditionBoostSpecs. + * @member {Array.} invalidConditionBoostSpecs + * @memberof google.cloud.retail.v2.SearchResponse * @instance */ - RejoinUserEventsRequest.prototype.userEventRejoinScope = 0; + SearchResponse.prototype.invalidConditionBoostSpecs = $util.emptyArray; /** - * Creates a new RejoinUserEventsRequest instance using the specified properties. + * Creates a new SearchResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @memberof google.cloud.retail.v2.SearchResponse * @static - * @param {google.cloud.retail.v2.IRejoinUserEventsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2.RejoinUserEventsRequest} RejoinUserEventsRequest instance + * @param {google.cloud.retail.v2.ISearchResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2.SearchResponse} SearchResponse instance */ - RejoinUserEventsRequest.create = function create(properties) { - return new RejoinUserEventsRequest(properties); + SearchResponse.create = function create(properties) { + return new SearchResponse(properties); }; /** - * Encodes the specified RejoinUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsRequest.verify|verify} messages. + * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @memberof google.cloud.retail.v2.SearchResponse * @static - * @param {google.cloud.retail.v2.IRejoinUserEventsRequest} message RejoinUserEventsRequest message or plain object to encode + * @param {google.cloud.retail.v2.ISearchResponse} message SearchResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RejoinUserEventsRequest.encode = function encode(message, writer) { + SearchResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.userEventRejoinScope != null && Object.hasOwnProperty.call(message, "userEventRejoinScope")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.userEventRejoinScope); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.retail.v2.SearchResponse.SearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.facets != null && message.facets.length) + for (var i = 0; i < message.facets.length; ++i) + $root.google.cloud.retail.v2.SearchResponse.Facet.encode(message.facets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + if (message.correctedQuery != null && Object.hasOwnProperty.call(message, "correctedQuery")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.correctedQuery); + if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.attributionToken); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.nextPageToken); + if (message.queryExpansionInfo != null && Object.hasOwnProperty.call(message, "queryExpansionInfo")) + $root.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.encode(message.queryExpansionInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.redirectUri != null && Object.hasOwnProperty.call(message, "redirectUri")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.redirectUri); + if (message.appliedControls != null && message.appliedControls.length) + for (var i = 0; i < message.appliedControls.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.appliedControls[i]); + if (message.invalidConditionBoostSpecs != null && message.invalidConditionBoostSpecs.length) + for (var i = 0; i < message.invalidConditionBoostSpecs.length; ++i) + $root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.encode(message.invalidConditionBoostSpecs[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); return writer; }; /** - * Encodes the specified RejoinUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsRequest.verify|verify} messages. + * Encodes the specified SearchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @memberof google.cloud.retail.v2.SearchResponse * @static - * @param {google.cloud.retail.v2.IRejoinUserEventsRequest} message RejoinUserEventsRequest message or plain object to encode + * @param {google.cloud.retail.v2.ISearchResponse} message SearchResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RejoinUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + SearchResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RejoinUserEventsRequest message from the specified reader or buffer. + * Decodes a SearchResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @memberof google.cloud.retail.v2.SearchResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.RejoinUserEventsRequest} RejoinUserEventsRequest + * @returns {google.cloud.retail.v2.SearchResponse} SearchResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RejoinUserEventsRequest.decode = function decode(reader, length) { + SearchResponse.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.v2.RejoinUserEventsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.SearchResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.retail.v2.SearchResponse.SearchResult.decode(reader, reader.uint32())); break; case 2: - message.userEventRejoinScope = reader.int32(); + if (!(message.facets && message.facets.length)) + message.facets = []; + message.facets.push($root.google.cloud.retail.v2.SearchResponse.Facet.decode(reader, reader.uint32())); + break; + case 3: + message.totalSize = reader.int32(); + break; + case 4: + message.correctedQuery = reader.string(); + break; + case 5: + message.attributionToken = reader.string(); + break; + case 6: + message.nextPageToken = reader.string(); + break; + case 7: + message.queryExpansionInfo = $root.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.decode(reader, reader.uint32()); + break; + case 10: + message.redirectUri = reader.string(); + break; + case 12: + if (!(message.appliedControls && message.appliedControls.length)) + message.appliedControls = []; + message.appliedControls.push(reader.string()); + break; + case 14: + if (!(message.invalidConditionBoostSpecs && message.invalidConditionBoostSpecs.length)) + message.invalidConditionBoostSpecs = []; + message.invalidConditionBoostSpecs.push($root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -22582,1366 +22436,1660 @@ }; /** - * Decodes a RejoinUserEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @memberof google.cloud.retail.v2.SearchResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.RejoinUserEventsRequest} RejoinUserEventsRequest + * @returns {google.cloud.retail.v2.SearchResponse} SearchResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RejoinUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { + SearchResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RejoinUserEventsRequest message. + * Verifies a SearchResponse message. * @function verify - * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @memberof google.cloud.retail.v2.SearchResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RejoinUserEventsRequest.verify = function verify(message) { + SearchResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.userEventRejoinScope != null && message.hasOwnProperty("userEventRejoinScope")) - switch (message.userEventRejoinScope) { - default: - return "userEventRejoinScope: enum value expected"; - case 0: - case 1: - case 2: - break; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.retail.v2.SearchResponse.SearchResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.facets != null && message.hasOwnProperty("facets")) { + if (!Array.isArray(message.facets)) + return "facets: array expected"; + for (var i = 0; i < message.facets.length; ++i) { + var error = $root.google.cloud.retail.v2.SearchResponse.Facet.verify(message.facets[i]); + if (error) + return "facets." + error; + } + } + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) + if (!$util.isString(message.correctedQuery)) + return "correctedQuery: string expected"; + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + if (!$util.isString(message.attributionToken)) + return "attributionToken: string expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.queryExpansionInfo != null && message.hasOwnProperty("queryExpansionInfo")) { + var error = $root.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.verify(message.queryExpansionInfo); + if (error) + return "queryExpansionInfo." + error; + } + if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) + if (!$util.isString(message.redirectUri)) + return "redirectUri: string expected"; + if (message.appliedControls != null && message.hasOwnProperty("appliedControls")) { + if (!Array.isArray(message.appliedControls)) + return "appliedControls: array expected"; + for (var i = 0; i < message.appliedControls.length; ++i) + if (!$util.isString(message.appliedControls[i])) + return "appliedControls: string[] expected"; + } + if (message.invalidConditionBoostSpecs != null && message.hasOwnProperty("invalidConditionBoostSpecs")) { + if (!Array.isArray(message.invalidConditionBoostSpecs)) + return "invalidConditionBoostSpecs: array expected"; + for (var i = 0; i < message.invalidConditionBoostSpecs.length; ++i) { + var error = $root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.verify(message.invalidConditionBoostSpecs[i]); + if (error) + return "invalidConditionBoostSpecs." + error; } + } return null; }; /** - * Creates a RejoinUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @memberof google.cloud.retail.v2.SearchResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.RejoinUserEventsRequest} RejoinUserEventsRequest + * @returns {google.cloud.retail.v2.SearchResponse} SearchResponse */ - RejoinUserEventsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.RejoinUserEventsRequest) + SearchResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.SearchResponse) return object; - var message = new $root.google.cloud.retail.v2.RejoinUserEventsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - switch (object.userEventRejoinScope) { - case "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED": - case 0: - message.userEventRejoinScope = 0; - break; - case "JOINED_EVENTS": - case 1: - message.userEventRejoinScope = 1; - break; - case "UNJOINED_EVENTS": - case 2: - message.userEventRejoinScope = 2; - break; + var message = new $root.google.cloud.retail.v2.SearchResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.retail.v2.SearchResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.retail.v2.SearchResponse.results: object expected"); + message.results[i] = $root.google.cloud.retail.v2.SearchResponse.SearchResult.fromObject(object.results[i]); + } + } + if (object.facets) { + if (!Array.isArray(object.facets)) + throw TypeError(".google.cloud.retail.v2.SearchResponse.facets: array expected"); + message.facets = []; + for (var i = 0; i < object.facets.length; ++i) { + if (typeof object.facets[i] !== "object") + throw TypeError(".google.cloud.retail.v2.SearchResponse.facets: object expected"); + message.facets[i] = $root.google.cloud.retail.v2.SearchResponse.Facet.fromObject(object.facets[i]); + } + } + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + if (object.correctedQuery != null) + message.correctedQuery = String(object.correctedQuery); + if (object.attributionToken != null) + message.attributionToken = String(object.attributionToken); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.queryExpansionInfo != null) { + if (typeof object.queryExpansionInfo !== "object") + throw TypeError(".google.cloud.retail.v2.SearchResponse.queryExpansionInfo: object expected"); + message.queryExpansionInfo = $root.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.fromObject(object.queryExpansionInfo); + } + if (object.redirectUri != null) + message.redirectUri = String(object.redirectUri); + if (object.appliedControls) { + if (!Array.isArray(object.appliedControls)) + throw TypeError(".google.cloud.retail.v2.SearchResponse.appliedControls: array expected"); + message.appliedControls = []; + for (var i = 0; i < object.appliedControls.length; ++i) + message.appliedControls[i] = String(object.appliedControls[i]); + } + if (object.invalidConditionBoostSpecs) { + if (!Array.isArray(object.invalidConditionBoostSpecs)) + throw TypeError(".google.cloud.retail.v2.SearchResponse.invalidConditionBoostSpecs: array expected"); + message.invalidConditionBoostSpecs = []; + for (var i = 0; i < object.invalidConditionBoostSpecs.length; ++i) { + if (typeof object.invalidConditionBoostSpecs[i] !== "object") + throw TypeError(".google.cloud.retail.v2.SearchResponse.invalidConditionBoostSpecs: object expected"); + message.invalidConditionBoostSpecs[i] = $root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.fromObject(object.invalidConditionBoostSpecs[i]); + } } return message; }; /** - * Creates a plain object from a RejoinUserEventsRequest message. Also converts values to other types if specified. + * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @memberof google.cloud.retail.v2.SearchResponse * @static - * @param {google.cloud.retail.v2.RejoinUserEventsRequest} message RejoinUserEventsRequest + * @param {google.cloud.retail.v2.SearchResponse} message SearchResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RejoinUserEventsRequest.toObject = function toObject(message, options) { + SearchResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.results = []; + object.facets = []; + object.appliedControls = []; + object.invalidConditionBoostSpecs = []; + } if (options.defaults) { - object.parent = ""; - object.userEventRejoinScope = options.enums === String ? "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED" : 0; + object.totalSize = 0; + object.correctedQuery = ""; + object.attributionToken = ""; + object.nextPageToken = ""; + object.queryExpansionInfo = null; + object.redirectUri = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.userEventRejoinScope != null && message.hasOwnProperty("userEventRejoinScope")) - object.userEventRejoinScope = options.enums === String ? $root.google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope[message.userEventRejoinScope] : message.userEventRejoinScope; - return object; - }; - - /** - * Converts this RejoinUserEventsRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2.RejoinUserEventsRequest - * @instance - * @returns {Object.} JSON object - */ - RejoinUserEventsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * UserEventRejoinScope enum. - * @name google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope - * @enum {number} - * @property {number} USER_EVENT_REJOIN_SCOPE_UNSPECIFIED=0 USER_EVENT_REJOIN_SCOPE_UNSPECIFIED value - * @property {number} JOINED_EVENTS=1 JOINED_EVENTS value - * @property {number} UNJOINED_EVENTS=2 UNJOINED_EVENTS value - */ - RejoinUserEventsRequest.UserEventRejoinScope = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "JOINED_EVENTS"] = 1; - values[valuesById[2] = "UNJOINED_EVENTS"] = 2; - return values; - })(); - - return RejoinUserEventsRequest; - })(); - - v2.RejoinUserEventsResponse = (function() { - - /** - * Properties of a RejoinUserEventsResponse. - * @memberof google.cloud.retail.v2 - * @interface IRejoinUserEventsResponse - * @property {number|Long|null} [rejoinedUserEventsCount] RejoinUserEventsResponse rejoinedUserEventsCount - */ - - /** - * Constructs a new RejoinUserEventsResponse. - * @memberof google.cloud.retail.v2 - * @classdesc Represents a RejoinUserEventsResponse. - * @implements IRejoinUserEventsResponse - * @constructor - * @param {google.cloud.retail.v2.IRejoinUserEventsResponse=} [properties] Properties to set - */ - function RejoinUserEventsResponse(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]]; - } - - /** - * RejoinUserEventsResponse rejoinedUserEventsCount. - * @member {number|Long} rejoinedUserEventsCount - * @memberof google.cloud.retail.v2.RejoinUserEventsResponse - * @instance - */ - RejoinUserEventsResponse.prototype.rejoinedUserEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new RejoinUserEventsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2.RejoinUserEventsResponse - * @static - * @param {google.cloud.retail.v2.IRejoinUserEventsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2.RejoinUserEventsResponse} RejoinUserEventsResponse instance - */ - RejoinUserEventsResponse.create = function create(properties) { - return new RejoinUserEventsResponse(properties); - }; - - /** - * Encodes the specified RejoinUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2.RejoinUserEventsResponse - * @static - * @param {google.cloud.retail.v2.IRejoinUserEventsResponse} message RejoinUserEventsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RejoinUserEventsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rejoinedUserEventsCount != null && Object.hasOwnProperty.call(message, "rejoinedUserEventsCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.rejoinedUserEventsCount); - return writer; - }; - - /** - * Encodes the specified RejoinUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2.RejoinUserEventsResponse - * @static - * @param {google.cloud.retail.v2.IRejoinUserEventsResponse} message RejoinUserEventsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RejoinUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RejoinUserEventsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2.RejoinUserEventsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.RejoinUserEventsResponse} RejoinUserEventsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RejoinUserEventsResponse.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.v2.RejoinUserEventsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.rejoinedUserEventsCount = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.retail.v2.SearchResponse.SearchResult.toObject(message.results[j], options); + } + if (message.facets && message.facets.length) { + object.facets = []; + for (var j = 0; j < message.facets.length; ++j) + object.facets[j] = $root.google.cloud.retail.v2.SearchResponse.Facet.toObject(message.facets[j], options); + } + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) + object.correctedQuery = message.correctedQuery; + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + object.attributionToken = message.attributionToken; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.queryExpansionInfo != null && message.hasOwnProperty("queryExpansionInfo")) + object.queryExpansionInfo = $root.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.toObject(message.queryExpansionInfo, options); + if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) + object.redirectUri = message.redirectUri; + if (message.appliedControls && message.appliedControls.length) { + object.appliedControls = []; + for (var j = 0; j < message.appliedControls.length; ++j) + object.appliedControls[j] = message.appliedControls[j]; + } + if (message.invalidConditionBoostSpecs && message.invalidConditionBoostSpecs.length) { + object.invalidConditionBoostSpecs = []; + for (var j = 0; j < message.invalidConditionBoostSpecs.length; ++j) + object.invalidConditionBoostSpecs[j] = $root.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.toObject(message.invalidConditionBoostSpecs[j], options); } - return message; - }; - - /** - * Decodes a RejoinUserEventsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2.RejoinUserEventsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.RejoinUserEventsResponse} RejoinUserEventsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RejoinUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RejoinUserEventsResponse message. - * @function verify - * @memberof google.cloud.retail.v2.RejoinUserEventsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RejoinUserEventsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rejoinedUserEventsCount != null && message.hasOwnProperty("rejoinedUserEventsCount")) - if (!$util.isInteger(message.rejoinedUserEventsCount) && !(message.rejoinedUserEventsCount && $util.isInteger(message.rejoinedUserEventsCount.low) && $util.isInteger(message.rejoinedUserEventsCount.high))) - return "rejoinedUserEventsCount: integer|Long expected"; - return null; - }; - - /** - * Creates a RejoinUserEventsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2.RejoinUserEventsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.RejoinUserEventsResponse} RejoinUserEventsResponse - */ - RejoinUserEventsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.RejoinUserEventsResponse) - return object; - var message = new $root.google.cloud.retail.v2.RejoinUserEventsResponse(); - if (object.rejoinedUserEventsCount != null) - if ($util.Long) - (message.rejoinedUserEventsCount = $util.Long.fromValue(object.rejoinedUserEventsCount)).unsigned = false; - else if (typeof object.rejoinedUserEventsCount === "string") - message.rejoinedUserEventsCount = parseInt(object.rejoinedUserEventsCount, 10); - else if (typeof object.rejoinedUserEventsCount === "number") - message.rejoinedUserEventsCount = object.rejoinedUserEventsCount; - else if (typeof object.rejoinedUserEventsCount === "object") - message.rejoinedUserEventsCount = new $util.LongBits(object.rejoinedUserEventsCount.low >>> 0, object.rejoinedUserEventsCount.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a RejoinUserEventsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2.RejoinUserEventsResponse - * @static - * @param {google.cloud.retail.v2.RejoinUserEventsResponse} message RejoinUserEventsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RejoinUserEventsResponse.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.rejoinedUserEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.rejoinedUserEventsCount = options.longs === String ? "0" : 0; - if (message.rejoinedUserEventsCount != null && message.hasOwnProperty("rejoinedUserEventsCount")) - if (typeof message.rejoinedUserEventsCount === "number") - object.rejoinedUserEventsCount = options.longs === String ? String(message.rejoinedUserEventsCount) : message.rejoinedUserEventsCount; - else - object.rejoinedUserEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.rejoinedUserEventsCount) : options.longs === Number ? new $util.LongBits(message.rejoinedUserEventsCount.low >>> 0, message.rejoinedUserEventsCount.high >>> 0).toNumber() : message.rejoinedUserEventsCount; return object; }; /** - * Converts this RejoinUserEventsResponse to JSON. + * Converts this SearchResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2.RejoinUserEventsResponse + * @memberof google.cloud.retail.v2.SearchResponse * @instance * @returns {Object.} JSON object */ - RejoinUserEventsResponse.prototype.toJSON = function toJSON() { + SearchResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RejoinUserEventsResponse; - })(); - - v2.RejoinUserEventsMetadata = (function() { - - /** - * Properties of a RejoinUserEventsMetadata. - * @memberof google.cloud.retail.v2 - * @interface IRejoinUserEventsMetadata - */ - - /** - * Constructs a new RejoinUserEventsMetadata. - * @memberof google.cloud.retail.v2 - * @classdesc Represents a RejoinUserEventsMetadata. - * @implements IRejoinUserEventsMetadata - * @constructor - * @param {google.cloud.retail.v2.IRejoinUserEventsMetadata=} [properties] Properties to set - */ - function RejoinUserEventsMetadata(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]]; - } - - /** - * Creates a new RejoinUserEventsMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata - * @static - * @param {google.cloud.retail.v2.IRejoinUserEventsMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2.RejoinUserEventsMetadata} RejoinUserEventsMetadata instance - */ - RejoinUserEventsMetadata.create = function create(properties) { - return new RejoinUserEventsMetadata(properties); - }; - - /** - * Encodes the specified RejoinUserEventsMetadata message. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata - * @static - * @param {google.cloud.retail.v2.IRejoinUserEventsMetadata} message RejoinUserEventsMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RejoinUserEventsMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; + SearchResponse.SearchResult = (function() { - /** - * Encodes the specified RejoinUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata - * @static - * @param {google.cloud.retail.v2.IRejoinUserEventsMetadata} message RejoinUserEventsMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RejoinUserEventsMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a SearchResult. + * @memberof google.cloud.retail.v2.SearchResponse + * @interface ISearchResult + * @property {string|null} [id] SearchResult id + * @property {google.cloud.retail.v2.IProduct|null} [product] SearchResult product + * @property {number|null} [matchingVariantCount] SearchResult matchingVariantCount + * @property {Object.|null} [matchingVariantFields] SearchResult matchingVariantFields + * @property {Object.|null} [variantRollupValues] SearchResult variantRollupValues + */ - /** - * Decodes a RejoinUserEventsMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.RejoinUserEventsMetadata} RejoinUserEventsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RejoinUserEventsMetadata.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.v2.RejoinUserEventsMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } + /** + * Constructs a new SearchResult. + * @memberof google.cloud.retail.v2.SearchResponse + * @classdesc Represents a SearchResult. + * @implements ISearchResult + * @constructor + * @param {google.cloud.retail.v2.SearchResponse.ISearchResult=} [properties] Properties to set + */ + function SearchResult(properties) { + this.matchingVariantFields = {}; + this.variantRollupValues = {}; + 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]]; } - return message; - }; - - /** - * Decodes a RejoinUserEventsMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2.RejoinUserEventsMetadata} RejoinUserEventsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RejoinUserEventsMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RejoinUserEventsMetadata message. - * @function verify - * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RejoinUserEventsMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - /** - * Creates a RejoinUserEventsMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2.RejoinUserEventsMetadata} RejoinUserEventsMetadata - */ - RejoinUserEventsMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2.RejoinUserEventsMetadata) - return object; - return new $root.google.cloud.retail.v2.RejoinUserEventsMetadata(); - }; + /** + * SearchResult id. + * @member {string} id + * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.id = ""; - /** - * Creates a plain object from a RejoinUserEventsMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata - * @static - * @param {google.cloud.retail.v2.RejoinUserEventsMetadata} message RejoinUserEventsMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RejoinUserEventsMetadata.toObject = function toObject() { - return {}; - }; + /** + * SearchResult product. + * @member {google.cloud.retail.v2.IProduct|null|undefined} product + * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.product = null; - /** - * Converts this RejoinUserEventsMetadata to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata - * @instance - * @returns {Object.} JSON object - */ - RejoinUserEventsMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * SearchResult matchingVariantCount. + * @member {number} matchingVariantCount + * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.matchingVariantCount = 0; - return RejoinUserEventsMetadata; - })(); + /** + * SearchResult matchingVariantFields. + * @member {Object.} matchingVariantFields + * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.matchingVariantFields = $util.emptyObject; - return v2; - })(); + /** + * SearchResult variantRollupValues. + * @member {Object.} variantRollupValues + * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.variantRollupValues = $util.emptyObject; - retail.v2alpha = (function() { + /** + * Creates a new SearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @static + * @param {google.cloud.retail.v2.SearchResponse.ISearchResult=} [properties] Properties to set + * @returns {google.cloud.retail.v2.SearchResponse.SearchResult} SearchResult instance + */ + SearchResult.create = function create(properties) { + return new SearchResult(properties); + }; - /** - * Namespace v2alpha. - * @memberof google.cloud.retail - * @namespace - */ - var v2alpha = {}; + /** + * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.SearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @static + * @param {google.cloud.retail.v2.SearchResponse.ISearchResult} message SearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + $root.google.cloud.retail.v2.Product.encode(message.product, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.matchingVariantCount != null && Object.hasOwnProperty.call(message, "matchingVariantCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.matchingVariantCount); + if (message.matchingVariantFields != null && Object.hasOwnProperty.call(message, "matchingVariantFields")) + for (var keys = Object.keys(message.matchingVariantFields), 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.protobuf.FieldMask.encode(message.matchingVariantFields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.variantRollupValues != null && Object.hasOwnProperty.call(message, "variantRollupValues")) + for (var keys = Object.keys(message.variantRollupValues), i = 0; i < keys.length; ++i) { + 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(); + } + return writer; + }; - v2alpha.ProductLevelConfig = (function() { + /** + * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.SearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @static + * @param {google.cloud.retail.v2.SearchResponse.ISearchResult} message SearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Properties of a ProductLevelConfig. - * @memberof google.cloud.retail.v2alpha - * @interface IProductLevelConfig - * @property {string|null} [ingestionProductType] ProductLevelConfig ingestionProductType - * @property {string|null} [merchantCenterProductIdField] ProductLevelConfig merchantCenterProductIdField - */ - - /** - * Constructs a new ProductLevelConfig. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ProductLevelConfig. - * @implements IProductLevelConfig - * @constructor - * @param {google.cloud.retail.v2alpha.IProductLevelConfig=} [properties] Properties to set - */ - function ProductLevelConfig(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]]; - } - - /** - * ProductLevelConfig ingestionProductType. - * @member {string} ingestionProductType - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig - * @instance - */ - ProductLevelConfig.prototype.ingestionProductType = ""; - - /** - * ProductLevelConfig merchantCenterProductIdField. - * @member {string} merchantCenterProductIdField - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig - * @instance - */ - ProductLevelConfig.prototype.merchantCenterProductIdField = ""; - - /** - * Creates a new ProductLevelConfig instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig - * @static - * @param {google.cloud.retail.v2alpha.IProductLevelConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ProductLevelConfig} ProductLevelConfig instance - */ - ProductLevelConfig.create = function create(properties) { - return new ProductLevelConfig(properties); - }; - - /** - * Encodes the specified ProductLevelConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductLevelConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig - * @static - * @param {google.cloud.retail.v2alpha.IProductLevelConfig} message ProductLevelConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProductLevelConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ingestionProductType != null && Object.hasOwnProperty.call(message, "ingestionProductType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ingestionProductType); - if (message.merchantCenterProductIdField != null && Object.hasOwnProperty.call(message, "merchantCenterProductIdField")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.merchantCenterProductIdField); - return writer; - }; + /** + * Decodes a SearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.SearchResponse.SearchResult} SearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResult.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.v2.SearchResponse.SearchResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.product = $root.google.cloud.retail.v2.Product.decode(reader, reader.uint32()); + break; + case 3: + message.matchingVariantCount = reader.int32(); + break; + case 4: + if (message.matchingVariantFields === $util.emptyObject) + message.matchingVariantFields = {}; + 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.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.matchingVariantFields[key] = value; + break; + case 5: + if (message.variantRollupValues === $util.emptyObject) + message.variantRollupValues = {}; + 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.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.variantRollupValues[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified ProductLevelConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductLevelConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig - * @static - * @param {google.cloud.retail.v2alpha.IProductLevelConfig} message ProductLevelConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProductLevelConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a SearchResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.SearchResponse.SearchResult} SearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a ProductLevelConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig - * @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.ProductLevelConfig} ProductLevelConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProductLevelConfig.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.ProductLevelConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ingestionProductType = reader.string(); - break; - case 2: - message.merchantCenterProductIdField = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Verifies a SearchResult message. + * @function verify + * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.retail.v2.Product.verify(message.product); + if (error) + return "product." + error; } - } - return message; - }; - - /** - * Decodes a ProductLevelConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ProductLevelConfig} ProductLevelConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProductLevelConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (message.matchingVariantCount != null && message.hasOwnProperty("matchingVariantCount")) + if (!$util.isInteger(message.matchingVariantCount)) + return "matchingVariantCount: integer expected"; + if (message.matchingVariantFields != null && message.hasOwnProperty("matchingVariantFields")) { + if (!$util.isObject(message.matchingVariantFields)) + return "matchingVariantFields: object expected"; + var key = Object.keys(message.matchingVariantFields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.FieldMask.verify(message.matchingVariantFields[key[i]]); + if (error) + return "matchingVariantFields." + error; + } + } + if (message.variantRollupValues != null && message.hasOwnProperty("variantRollupValues")) { + if (!$util.isObject(message.variantRollupValues)) + return "variantRollupValues: object expected"; + var key = Object.keys(message.variantRollupValues); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.variantRollupValues[key[i]]); + if (error) + return "variantRollupValues." + error; + } + } + return null; + }; - /** - * Verifies a ProductLevelConfig message. - * @function verify - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProductLevelConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ingestionProductType != null && message.hasOwnProperty("ingestionProductType")) - if (!$util.isString(message.ingestionProductType)) - return "ingestionProductType: string expected"; - if (message.merchantCenterProductIdField != null && message.hasOwnProperty("merchantCenterProductIdField")) - if (!$util.isString(message.merchantCenterProductIdField)) - return "merchantCenterProductIdField: string expected"; - return null; - }; + /** + * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.SearchResponse.SearchResult} SearchResult + */ + SearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.SearchResponse.SearchResult) + return object; + var message = new $root.google.cloud.retail.v2.SearchResponse.SearchResult(); + if (object.id != null) + message.id = String(object.id); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.retail.v2.SearchResponse.SearchResult.product: object expected"); + message.product = $root.google.cloud.retail.v2.Product.fromObject(object.product); + } + if (object.matchingVariantCount != null) + message.matchingVariantCount = object.matchingVariantCount | 0; + if (object.matchingVariantFields) { + if (typeof object.matchingVariantFields !== "object") + throw TypeError(".google.cloud.retail.v2.SearchResponse.SearchResult.matchingVariantFields: object expected"); + message.matchingVariantFields = {}; + for (var keys = Object.keys(object.matchingVariantFields), i = 0; i < keys.length; ++i) { + if (typeof object.matchingVariantFields[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2.SearchResponse.SearchResult.matchingVariantFields: object expected"); + message.matchingVariantFields[keys[i]] = $root.google.protobuf.FieldMask.fromObject(object.matchingVariantFields[keys[i]]); + } + } + if (object.variantRollupValues) { + if (typeof object.variantRollupValues !== "object") + throw TypeError(".google.cloud.retail.v2.SearchResponse.SearchResult.variantRollupValues: object expected"); + message.variantRollupValues = {}; + for (var keys = Object.keys(object.variantRollupValues), i = 0; i < keys.length; ++i) { + if (typeof object.variantRollupValues[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2.SearchResponse.SearchResult.variantRollupValues: object expected"); + message.variantRollupValues[keys[i]] = $root.google.protobuf.Value.fromObject(object.variantRollupValues[keys[i]]); + } + } + return message; + }; - /** - * Creates a ProductLevelConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ProductLevelConfig} ProductLevelConfig - */ - ProductLevelConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ProductLevelConfig) + /** + * Creates a plain object from a SearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @static + * @param {google.cloud.retail.v2.SearchResponse.SearchResult} message SearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.matchingVariantFields = {}; + object.variantRollupValues = {}; + } + if (options.defaults) { + object.id = ""; + object.product = null; + object.matchingVariantCount = 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.retail.v2.Product.toObject(message.product, options); + if (message.matchingVariantCount != null && message.hasOwnProperty("matchingVariantCount")) + object.matchingVariantCount = message.matchingVariantCount; + var keys2; + if (message.matchingVariantFields && (keys2 = Object.keys(message.matchingVariantFields)).length) { + object.matchingVariantFields = {}; + for (var j = 0; j < keys2.length; ++j) + object.matchingVariantFields[keys2[j]] = $root.google.protobuf.FieldMask.toObject(message.matchingVariantFields[keys2[j]], options); + } + if (message.variantRollupValues && (keys2 = Object.keys(message.variantRollupValues)).length) { + object.variantRollupValues = {}; + for (var j = 0; j < keys2.length; ++j) + object.variantRollupValues[keys2[j]] = $root.google.protobuf.Value.toObject(message.variantRollupValues[keys2[j]], options); + } return object; - var message = new $root.google.cloud.retail.v2alpha.ProductLevelConfig(); - if (object.ingestionProductType != null) - message.ingestionProductType = String(object.ingestionProductType); - if (object.merchantCenterProductIdField != null) - message.merchantCenterProductIdField = String(object.merchantCenterProductIdField); - return message; - }; + }; - /** - * Creates a plain object from a ProductLevelConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig - * @static - * @param {google.cloud.retail.v2alpha.ProductLevelConfig} message ProductLevelConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProductLevelConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.ingestionProductType = ""; - object.merchantCenterProductIdField = ""; - } - if (message.ingestionProductType != null && message.hasOwnProperty("ingestionProductType")) - object.ingestionProductType = message.ingestionProductType; - if (message.merchantCenterProductIdField != null && message.hasOwnProperty("merchantCenterProductIdField")) - object.merchantCenterProductIdField = message.merchantCenterProductIdField; - return object; - }; + /** + * Converts this SearchResult to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.SearchResponse.SearchResult + * @instance + * @returns {Object.} JSON object + */ + SearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ProductLevelConfig to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig - * @instance - * @returns {Object.} JSON object - */ - ProductLevelConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return SearchResult; + })(); - return ProductLevelConfig; - })(); + SearchResponse.Facet = (function() { - v2alpha.MerchantCenterLink = (function() { + /** + * Properties of a Facet. + * @memberof google.cloud.retail.v2.SearchResponse + * @interface IFacet + * @property {string|null} [key] Facet key + * @property {Array.|null} [values] Facet values + * @property {boolean|null} [dynamicFacet] Facet dynamicFacet + */ - /** - * Properties of a MerchantCenterLink. - * @memberof google.cloud.retail.v2alpha - * @interface IMerchantCenterLink - * @property {number|Long|null} [merchantCenterAccountId] MerchantCenterLink merchantCenterAccountId - * @property {string|null} [branchId] MerchantCenterLink branchId - * @property {Array.|null} [destinations] MerchantCenterLink destinations - * @property {string|null} [regionCode] MerchantCenterLink regionCode - * @property {string|null} [languageCode] MerchantCenterLink languageCode - */ + /** + * Constructs a new Facet. + * @memberof google.cloud.retail.v2.SearchResponse + * @classdesc Represents a Facet. + * @implements IFacet + * @constructor + * @param {google.cloud.retail.v2.SearchResponse.IFacet=} [properties] Properties to set + */ + function Facet(properties) { + this.values = []; + 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]]; + } - /** - * Constructs a new MerchantCenterLink. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a MerchantCenterLink. - * @implements IMerchantCenterLink - * @constructor - * @param {google.cloud.retail.v2alpha.IMerchantCenterLink=} [properties] Properties to set - */ - function MerchantCenterLink(properties) { - this.destinations = []; - 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]]; - } + /** + * Facet key. + * @member {string} key + * @memberof google.cloud.retail.v2.SearchResponse.Facet + * @instance + */ + Facet.prototype.key = ""; - /** - * MerchantCenterLink merchantCenterAccountId. - * @member {number|Long} merchantCenterAccountId - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @instance - */ - MerchantCenterLink.prototype.merchantCenterAccountId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Facet values. + * @member {Array.} values + * @memberof google.cloud.retail.v2.SearchResponse.Facet + * @instance + */ + Facet.prototype.values = $util.emptyArray; - /** - * MerchantCenterLink branchId. - * @member {string} branchId - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @instance - */ - MerchantCenterLink.prototype.branchId = ""; + /** + * Facet dynamicFacet. + * @member {boolean} dynamicFacet + * @memberof google.cloud.retail.v2.SearchResponse.Facet + * @instance + */ + Facet.prototype.dynamicFacet = false; - /** - * MerchantCenterLink destinations. - * @member {Array.} destinations - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @instance - */ - MerchantCenterLink.prototype.destinations = $util.emptyArray; - - /** - * MerchantCenterLink regionCode. - * @member {string} regionCode - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @instance - */ - MerchantCenterLink.prototype.regionCode = ""; + /** + * Creates a new Facet instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.SearchResponse.Facet + * @static + * @param {google.cloud.retail.v2.SearchResponse.IFacet=} [properties] Properties to set + * @returns {google.cloud.retail.v2.SearchResponse.Facet} Facet instance + */ + Facet.create = function create(properties) { + return new Facet(properties); + }; - /** - * MerchantCenterLink languageCode. - * @member {string} languageCode - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @instance - */ - MerchantCenterLink.prototype.languageCode = ""; + /** + * Encodes the specified Facet message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.Facet.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.SearchResponse.Facet + * @static + * @param {google.cloud.retail.v2.SearchResponse.IFacet} message Facet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Facet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.encode(message.values[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dynamicFacet != null && Object.hasOwnProperty.call(message, "dynamicFacet")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.dynamicFacet); + return writer; + }; - /** - * Creates a new MerchantCenterLink instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterLink=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.MerchantCenterLink} MerchantCenterLink instance - */ - MerchantCenterLink.create = function create(properties) { - return new MerchantCenterLink(properties); - }; + /** + * Encodes the specified Facet message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.Facet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.SearchResponse.Facet + * @static + * @param {google.cloud.retail.v2.SearchResponse.IFacet} message Facet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Facet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified MerchantCenterLink message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLink.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterLink} message MerchantCenterLink message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerchantCenterLink.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.merchantCenterAccountId != null && Object.hasOwnProperty.call(message, "merchantCenterAccountId")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.merchantCenterAccountId); - if (message.branchId != null && Object.hasOwnProperty.call(message, "branchId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.branchId); - if (message.destinations != null && message.destinations.length) - for (var i = 0; i < message.destinations.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.destinations[i]); - if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) - 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); - return writer; - }; + /** + * Decodes a Facet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.SearchResponse.Facet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.SearchResponse.Facet} Facet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Facet.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.v2.SearchResponse.Facet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.decode(reader, reader.uint32())); + break; + case 3: + message.dynamicFacet = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified MerchantCenterLink message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLink.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterLink} message MerchantCenterLink message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerchantCenterLink.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a Facet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.SearchResponse.Facet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.SearchResponse.Facet} Facet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Facet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a MerchantCenterLink message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @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.MerchantCenterLink} MerchantCenterLink - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerchantCenterLink.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.MerchantCenterLink(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.merchantCenterAccountId = reader.int64(); - break; - case 2: - message.branchId = reader.string(); - break; - case 3: - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - message.destinations.push(reader.string()); - break; - case 4: - message.regionCode = reader.string(); - break; - case 5: - message.languageCode = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Verifies a Facet message. + * @function verify + * @memberof google.cloud.retail.v2.SearchResponse.Facet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Facet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.verify(message.values[i]); + if (error) + return "values." + error; + } } - } - return message; - }; - - /** - * Decodes a MerchantCenterLink message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.MerchantCenterLink} MerchantCenterLink - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerchantCenterLink.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (message.dynamicFacet != null && message.hasOwnProperty("dynamicFacet")) + if (typeof message.dynamicFacet !== "boolean") + return "dynamicFacet: boolean expected"; + return null; + }; - /** - * Verifies a MerchantCenterLink message. - * @function verify - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MerchantCenterLink.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.merchantCenterAccountId != null && message.hasOwnProperty("merchantCenterAccountId")) - if (!$util.isInteger(message.merchantCenterAccountId) && !(message.merchantCenterAccountId && $util.isInteger(message.merchantCenterAccountId.low) && $util.isInteger(message.merchantCenterAccountId.high))) - return "merchantCenterAccountId: integer|Long expected"; - if (message.branchId != null && message.hasOwnProperty("branchId")) - if (!$util.isString(message.branchId)) - return "branchId: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - if (!$util.isString(message.destinations[i])) - return "destinations: string[] expected"; - } - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - if (!$util.isString(message.regionCode)) - return "regionCode: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - return null; - }; + /** + * Creates a Facet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.SearchResponse.Facet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.SearchResponse.Facet} Facet + */ + Facet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.SearchResponse.Facet) + return object; + var message = new $root.google.cloud.retail.v2.SearchResponse.Facet(); + if (object.key != null) + message.key = String(object.key); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.retail.v2.SearchResponse.Facet.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.cloud.retail.v2.SearchResponse.Facet.values: object expected"); + message.values[i] = $root.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.fromObject(object.values[i]); + } + } + if (object.dynamicFacet != null) + message.dynamicFacet = Boolean(object.dynamicFacet); + return message; + }; - /** - * Creates a MerchantCenterLink message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.MerchantCenterLink} MerchantCenterLink - */ - MerchantCenterLink.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.MerchantCenterLink) + /** + * Creates a plain object from a Facet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.SearchResponse.Facet + * @static + * @param {google.cloud.retail.v2.SearchResponse.Facet} message Facet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Facet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) { + object.key = ""; + object.dynamicFacet = false; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.toObject(message.values[j], options); + } + if (message.dynamicFacet != null && message.hasOwnProperty("dynamicFacet")) + object.dynamicFacet = message.dynamicFacet; return object; - var message = new $root.google.cloud.retail.v2alpha.MerchantCenterLink(); - if (object.merchantCenterAccountId != null) - if ($util.Long) - (message.merchantCenterAccountId = $util.Long.fromValue(object.merchantCenterAccountId)).unsigned = false; - else if (typeof object.merchantCenterAccountId === "string") - message.merchantCenterAccountId = parseInt(object.merchantCenterAccountId, 10); - else if (typeof object.merchantCenterAccountId === "number") - message.merchantCenterAccountId = object.merchantCenterAccountId; - else if (typeof object.merchantCenterAccountId === "object") - message.merchantCenterAccountId = new $util.LongBits(object.merchantCenterAccountId.low >>> 0, object.merchantCenterAccountId.high >>> 0).toNumber(); - if (object.branchId != null) - message.branchId = String(object.branchId); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLink.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - message.destinations[i] = String(object.destinations[i]); - } - if (object.regionCode != null) - message.regionCode = String(object.regionCode); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - return message; - }; + }; - /** - * Creates a plain object from a MerchantCenterLink message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @static - * @param {google.cloud.retail.v2alpha.MerchantCenterLink} message MerchantCenterLink - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MerchantCenterLink.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.merchantCenterAccountId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.merchantCenterAccountId = options.longs === String ? "0" : 0; - object.branchId = ""; - object.regionCode = ""; - object.languageCode = ""; - } - if (message.merchantCenterAccountId != null && message.hasOwnProperty("merchantCenterAccountId")) - if (typeof message.merchantCenterAccountId === "number") - object.merchantCenterAccountId = options.longs === String ? String(message.merchantCenterAccountId) : message.merchantCenterAccountId; - else - object.merchantCenterAccountId = options.longs === String ? $util.Long.prototype.toString.call(message.merchantCenterAccountId) : options.longs === Number ? new $util.LongBits(message.merchantCenterAccountId.low >>> 0, message.merchantCenterAccountId.high >>> 0).toNumber() : message.merchantCenterAccountId; - if (message.branchId != null && message.hasOwnProperty("branchId")) - object.branchId = message.branchId; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = message.destinations[j]; - } - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - object.regionCode = message.regionCode; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - return object; - }; + /** + * Converts this Facet to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.SearchResponse.Facet + * @instance + * @returns {Object.} JSON object + */ + Facet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this MerchantCenterLink to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @instance - * @returns {Object.} JSON object - */ - MerchantCenterLink.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Facet.FacetValue = (function() { - return MerchantCenterLink; - })(); + /** + * Properties of a FacetValue. + * @memberof google.cloud.retail.v2.SearchResponse.Facet + * @interface IFacetValue + * @property {string|null} [value] FacetValue value + * @property {google.cloud.retail.v2.IInterval|null} [interval] FacetValue interval + * @property {number|Long|null} [count] FacetValue count + */ - v2alpha.MerchantCenterLinkingConfig = (function() { + /** + * Constructs a new FacetValue. + * @memberof google.cloud.retail.v2.SearchResponse.Facet + * @classdesc Represents a FacetValue. + * @implements IFacetValue + * @constructor + * @param {google.cloud.retail.v2.SearchResponse.Facet.IFacetValue=} [properties] Properties to set + */ + function FacetValue(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]]; + } - /** - * Properties of a MerchantCenterLinkingConfig. - * @memberof google.cloud.retail.v2alpha - * @interface IMerchantCenterLinkingConfig - * @property {Array.|null} [links] MerchantCenterLinkingConfig links - */ + /** + * FacetValue value. + * @member {string|null|undefined} value + * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @instance + */ + FacetValue.prototype.value = null; - /** - * Constructs a new MerchantCenterLinkingConfig. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a MerchantCenterLinkingConfig. - * @implements IMerchantCenterLinkingConfig - * @constructor - * @param {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig=} [properties] Properties to set - */ - function MerchantCenterLinkingConfig(properties) { - this.links = []; - 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]]; - } + /** + * FacetValue interval. + * @member {google.cloud.retail.v2.IInterval|null|undefined} interval + * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @instance + */ + FacetValue.prototype.interval = null; - /** - * MerchantCenterLinkingConfig links. - * @member {Array.} links - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @instance - */ - MerchantCenterLinkingConfig.prototype.links = $util.emptyArray; + /** + * FacetValue count. + * @member {number|Long} count + * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @instance + */ + FacetValue.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Creates a new MerchantCenterLinkingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig instance - */ - MerchantCenterLinkingConfig.create = function create(properties) { - return new MerchantCenterLinkingConfig(properties); - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Encodes the specified MerchantCenterLinkingConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig} message MerchantCenterLinkingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerchantCenterLinkingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.links != null && message.links.length) - for (var i = 0; i < message.links.length; ++i) - $root.google.cloud.retail.v2alpha.MerchantCenterLink.encode(message.links[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * FacetValue facetValue. + * @member {"value"|"interval"|undefined} facetValue + * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @instance + */ + Object.defineProperty(FacetValue.prototype, "facetValue", { + get: $util.oneOfGetter($oneOfFields = ["value", "interval"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Encodes the specified MerchantCenterLinkingConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig} message MerchantCenterLinkingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerchantCenterLinkingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new FacetValue instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @static + * @param {google.cloud.retail.v2.SearchResponse.Facet.IFacetValue=} [properties] Properties to set + * @returns {google.cloud.retail.v2.SearchResponse.Facet.FacetValue} FacetValue instance + */ + FacetValue.create = function create(properties) { + return new FacetValue(properties); + }; - /** - * Decodes a MerchantCenterLinkingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @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.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerchantCenterLinkingConfig.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.MerchantCenterLinkingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.links && message.links.length)) - message.links = []; - message.links.push($root.google.cloud.retail.v2alpha.MerchantCenterLink.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.Facet.FacetValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @static + * @param {google.cloud.retail.v2.SearchResponse.Facet.IFacetValue} message FacetValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + $root.google.cloud.retail.v2.Interval.encode(message.interval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.count); + return writer; + }; - /** - * Decodes a MerchantCenterLinkingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerchantCenterLinkingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.Facet.FacetValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @static + * @param {google.cloud.retail.v2.SearchResponse.Facet.IFacetValue} message FacetValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a MerchantCenterLinkingConfig message. - * @function verify - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MerchantCenterLinkingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.links != null && message.hasOwnProperty("links")) { - if (!Array.isArray(message.links)) - return "links: array expected"; - for (var i = 0; i < message.links.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.MerchantCenterLink.verify(message.links[i]); - if (error) - return "links." + error; - } - } - return null; - }; + /** + * Decodes a FacetValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.SearchResponse.Facet.FacetValue} FacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetValue.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.v2.SearchResponse.Facet.FacetValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.string(); + break; + case 2: + message.interval = $root.google.cloud.retail.v2.Interval.decode(reader, reader.uint32()); + break; + case 3: + message.count = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a MerchantCenterLinkingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig - */ - MerchantCenterLinkingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig) - return object; - var message = new $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig(); - if (object.links) { - if (!Array.isArray(object.links)) - throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.links: array expected"); - message.links = []; - for (var i = 0; i < object.links.length; ++i) { - if (typeof object.links[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.links: object expected"); - message.links[i] = $root.google.cloud.retail.v2alpha.MerchantCenterLink.fromObject(object.links[i]); - } - } - return message; - }; + /** + * Decodes a FacetValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.SearchResponse.Facet.FacetValue} FacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a MerchantCenterLinkingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @static - * @param {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} message MerchantCenterLinkingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MerchantCenterLinkingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.links = []; - if (message.links && message.links.length) { - object.links = []; - for (var j = 0; j < message.links.length; ++j) - object.links[j] = $root.google.cloud.retail.v2alpha.MerchantCenterLink.toObject(message.links[j], options); - } - return object; - }; + /** + * Verifies a FacetValue message. + * @function verify + * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) { + properties.facetValue = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + if (message.interval != null && message.hasOwnProperty("interval")) { + if (properties.facetValue === 1) + return "facetValue: multiple values"; + properties.facetValue = 1; + { + var error = $root.google.cloud.retail.v2.Interval.verify(message.interval); + if (error) + return "interval." + error; + } + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; - /** - * Converts this MerchantCenterLinkingConfig to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @instance - * @returns {Object.} JSON object - */ - MerchantCenterLinkingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a FacetValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.SearchResponse.Facet.FacetValue} FacetValue + */ + FacetValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.SearchResponse.Facet.FacetValue) + return object; + var message = new $root.google.cloud.retail.v2.SearchResponse.Facet.FacetValue(); + if (object.value != null) + message.value = String(object.value); + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval: object expected"); + message.interval = $root.google.cloud.retail.v2.Interval.fromObject(object.interval); + } + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; - return MerchantCenterLinkingConfig; - })(); + /** + * Creates a plain object from a FacetValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @static + * @param {google.cloud.retail.v2.SearchResponse.Facet.FacetValue} message FacetValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetValue.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.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object.facetValue = "value"; + } + if (message.interval != null && message.hasOwnProperty("interval")) { + object.interval = $root.google.cloud.retail.v2.Interval.toObject(message.interval, options); + if (options.oneofs) + object.facetValue = "interval"; + } + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; - v2alpha.Catalog = (function() { + /** + * Converts this FacetValue to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.SearchResponse.Facet.FacetValue + * @instance + * @returns {Object.} JSON object + */ + FacetValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a Catalog. - * @memberof google.cloud.retail.v2alpha - * @interface ICatalog - * @property {string|null} [name] Catalog name - * @property {string|null} [displayName] Catalog displayName - * @property {google.cloud.retail.v2alpha.IProductLevelConfig|null} [productLevelConfig] Catalog productLevelConfig - * @property {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig|null} [merchantCenterLinkingConfig] Catalog merchantCenterLinkingConfig - */ + return FacetValue; + })(); - /** - * Constructs a new Catalog. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a Catalog. - * @implements ICatalog - * @constructor - * @param {google.cloud.retail.v2alpha.ICatalog=} [properties] Properties to set - */ - function Catalog(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]]; - } + return Facet; + })(); - /** - * Catalog name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.Catalog - * @instance - */ - Catalog.prototype.name = ""; + SearchResponse.QueryExpansionInfo = (function() { - /** - * Catalog displayName. - * @member {string} displayName - * @memberof google.cloud.retail.v2alpha.Catalog - * @instance - */ - Catalog.prototype.displayName = ""; + /** + * Properties of a QueryExpansionInfo. + * @memberof google.cloud.retail.v2.SearchResponse + * @interface IQueryExpansionInfo + * @property {boolean|null} [expandedQuery] QueryExpansionInfo expandedQuery + * @property {number|Long|null} [pinnedResultCount] QueryExpansionInfo pinnedResultCount + */ - /** - * Catalog productLevelConfig. - * @member {google.cloud.retail.v2alpha.IProductLevelConfig|null|undefined} productLevelConfig - * @memberof google.cloud.retail.v2alpha.Catalog - * @instance - */ - Catalog.prototype.productLevelConfig = null; + /** + * Constructs a new QueryExpansionInfo. + * @memberof google.cloud.retail.v2.SearchResponse + * @classdesc Represents a QueryExpansionInfo. + * @implements IQueryExpansionInfo + * @constructor + * @param {google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo=} [properties] Properties to set + */ + function QueryExpansionInfo(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]]; + } - /** - * Catalog merchantCenterLinkingConfig. - * @member {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig|null|undefined} merchantCenterLinkingConfig - * @memberof google.cloud.retail.v2alpha.Catalog - * @instance - */ - Catalog.prototype.merchantCenterLinkingConfig = null; + /** + * QueryExpansionInfo expandedQuery. + * @member {boolean} expandedQuery + * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @instance + */ + QueryExpansionInfo.prototype.expandedQuery = false; - /** - * Creates a new Catalog instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Catalog - * @static - * @param {google.cloud.retail.v2alpha.ICatalog=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Catalog} Catalog instance - */ - Catalog.create = function create(properties) { - return new Catalog(properties); - }; + /** + * QueryExpansionInfo pinnedResultCount. + * @member {number|Long} pinnedResultCount + * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @instance + */ + QueryExpansionInfo.prototype.pinnedResultCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Encodes the specified Catalog message. Does not implicitly {@link google.cloud.retail.v2alpha.Catalog.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Catalog - * @static - * @param {google.cloud.retail.v2alpha.ICatalog} message Catalog message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Catalog.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.productLevelConfig != null && Object.hasOwnProperty.call(message, "productLevelConfig")) - $root.google.cloud.retail.v2alpha.ProductLevelConfig.encode(message.productLevelConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.merchantCenterLinkingConfig != null && Object.hasOwnProperty.call(message, "merchantCenterLinkingConfig")) - $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.encode(message.merchantCenterLinkingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; + /** + * Creates a new QueryExpansionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @static + * @param {google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo=} [properties] Properties to set + * @returns {google.cloud.retail.v2.SearchResponse.QueryExpansionInfo} QueryExpansionInfo instance + */ + QueryExpansionInfo.create = function create(properties) { + return new QueryExpansionInfo(properties); + }; - /** - * Encodes the specified Catalog message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Catalog.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Catalog + /** + * Encodes the specified QueryExpansionInfo message. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @static + * @param {google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo} message QueryExpansionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryExpansionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expandedQuery != null && Object.hasOwnProperty.call(message, "expandedQuery")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandedQuery); + if (message.pinnedResultCount != null && Object.hasOwnProperty.call(message, "pinnedResultCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.pinnedResultCount); + return writer; + }; + + /** + * Encodes the specified QueryExpansionInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @static + * @param {google.cloud.retail.v2.SearchResponse.IQueryExpansionInfo} message QueryExpansionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryExpansionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryExpansionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.SearchResponse.QueryExpansionInfo} QueryExpansionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryExpansionInfo.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.v2.SearchResponse.QueryExpansionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expandedQuery = reader.bool(); + break; + case 2: + message.pinnedResultCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryExpansionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.SearchResponse.QueryExpansionInfo} QueryExpansionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryExpansionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryExpansionInfo message. + * @function verify + * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryExpansionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expandedQuery != null && message.hasOwnProperty("expandedQuery")) + if (typeof message.expandedQuery !== "boolean") + return "expandedQuery: boolean expected"; + if (message.pinnedResultCount != null && message.hasOwnProperty("pinnedResultCount")) + if (!$util.isInteger(message.pinnedResultCount) && !(message.pinnedResultCount && $util.isInteger(message.pinnedResultCount.low) && $util.isInteger(message.pinnedResultCount.high))) + return "pinnedResultCount: integer|Long expected"; + return null; + }; + + /** + * Creates a QueryExpansionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.SearchResponse.QueryExpansionInfo} QueryExpansionInfo + */ + QueryExpansionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) + return object; + var message = new $root.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo(); + if (object.expandedQuery != null) + message.expandedQuery = Boolean(object.expandedQuery); + if (object.pinnedResultCount != null) + if ($util.Long) + (message.pinnedResultCount = $util.Long.fromValue(object.pinnedResultCount)).unsigned = false; + else if (typeof object.pinnedResultCount === "string") + message.pinnedResultCount = parseInt(object.pinnedResultCount, 10); + else if (typeof object.pinnedResultCount === "number") + message.pinnedResultCount = object.pinnedResultCount; + else if (typeof object.pinnedResultCount === "object") + message.pinnedResultCount = new $util.LongBits(object.pinnedResultCount.low >>> 0, object.pinnedResultCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a QueryExpansionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @static + * @param {google.cloud.retail.v2.SearchResponse.QueryExpansionInfo} message QueryExpansionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryExpansionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expandedQuery = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.pinnedResultCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.pinnedResultCount = options.longs === String ? "0" : 0; + } + if (message.expandedQuery != null && message.hasOwnProperty("expandedQuery")) + object.expandedQuery = message.expandedQuery; + if (message.pinnedResultCount != null && message.hasOwnProperty("pinnedResultCount")) + if (typeof message.pinnedResultCount === "number") + object.pinnedResultCount = options.longs === String ? String(message.pinnedResultCount) : message.pinnedResultCount; + else + object.pinnedResultCount = options.longs === String ? $util.Long.prototype.toString.call(message.pinnedResultCount) : options.longs === Number ? new $util.LongBits(message.pinnedResultCount.low >>> 0, message.pinnedResultCount.high >>> 0).toNumber() : message.pinnedResultCount; + return object; + }; + + /** + * Converts this QueryExpansionInfo to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.SearchResponse.QueryExpansionInfo + * @instance + * @returns {Object.} JSON object + */ + QueryExpansionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryExpansionInfo; + })(); + + return SearchResponse; + })(); + + v2.UserEventService = (function() { + + /** + * Constructs a new UserEventService service. + * @memberof google.cloud.retail.v2 + * @classdesc Represents a UserEventService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function UserEventService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (UserEventService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = UserEventService; + + /** + * Creates new UserEventService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2.UserEventService * @static - * @param {google.cloud.retail.v2alpha.ICatalog} message Catalog message or plain object to encode + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {UserEventService} RPC service. Useful where requests and/or responses are streamed. + */ + UserEventService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.retail.v2.UserEventService#writeUserEvent}. + * @memberof google.cloud.retail.v2.UserEventService + * @typedef WriteUserEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2.UserEvent} [response] UserEvent + */ + + /** + * Calls WriteUserEvent. + * @function writeUserEvent + * @memberof google.cloud.retail.v2.UserEventService + * @instance + * @param {google.cloud.retail.v2.IWriteUserEventRequest} request WriteUserEventRequest message or plain object + * @param {google.cloud.retail.v2.UserEventService.WriteUserEventCallback} callback Node-style callback called with the error, if any, and UserEvent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserEventService.prototype.writeUserEvent = function writeUserEvent(request, callback) { + return this.rpcCall(writeUserEvent, $root.google.cloud.retail.v2.WriteUserEventRequest, $root.google.cloud.retail.v2.UserEvent, request, callback); + }, "name", { value: "WriteUserEvent" }); + + /** + * Calls WriteUserEvent. + * @function writeUserEvent + * @memberof google.cloud.retail.v2.UserEventService + * @instance + * @param {google.cloud.retail.v2.IWriteUserEventRequest} request WriteUserEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2.UserEventService#collectUserEvent}. + * @memberof google.cloud.retail.v2.UserEventService + * @typedef CollectUserEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.HttpBody} [response] HttpBody + */ + + /** + * Calls CollectUserEvent. + * @function collectUserEvent + * @memberof google.cloud.retail.v2.UserEventService + * @instance + * @param {google.cloud.retail.v2.ICollectUserEventRequest} request CollectUserEventRequest message or plain object + * @param {google.cloud.retail.v2.UserEventService.CollectUserEventCallback} callback Node-style callback called with the error, if any, and HttpBody + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserEventService.prototype.collectUserEvent = function collectUserEvent(request, callback) { + return this.rpcCall(collectUserEvent, $root.google.cloud.retail.v2.CollectUserEventRequest, $root.google.api.HttpBody, request, callback); + }, "name", { value: "CollectUserEvent" }); + + /** + * Calls CollectUserEvent. + * @function collectUserEvent + * @memberof google.cloud.retail.v2.UserEventService + * @instance + * @param {google.cloud.retail.v2.ICollectUserEventRequest} request CollectUserEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2.UserEventService#purgeUserEvents}. + * @memberof google.cloud.retail.v2.UserEventService + * @typedef PurgeUserEventsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls PurgeUserEvents. + * @function purgeUserEvents + * @memberof google.cloud.retail.v2.UserEventService + * @instance + * @param {google.cloud.retail.v2.IPurgeUserEventsRequest} request PurgeUserEventsRequest message or plain object + * @param {google.cloud.retail.v2.UserEventService.PurgeUserEventsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserEventService.prototype.purgeUserEvents = function purgeUserEvents(request, callback) { + return this.rpcCall(purgeUserEvents, $root.google.cloud.retail.v2.PurgeUserEventsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PurgeUserEvents" }); + + /** + * Calls PurgeUserEvents. + * @function purgeUserEvents + * @memberof google.cloud.retail.v2.UserEventService + * @instance + * @param {google.cloud.retail.v2.IPurgeUserEventsRequest} request PurgeUserEventsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2.UserEventService#importUserEvents}. + * @memberof google.cloud.retail.v2.UserEventService + * @typedef ImportUserEventsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportUserEvents. + * @function importUserEvents + * @memberof google.cloud.retail.v2.UserEventService + * @instance + * @param {google.cloud.retail.v2.IImportUserEventsRequest} request ImportUserEventsRequest message or plain object + * @param {google.cloud.retail.v2.UserEventService.ImportUserEventsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserEventService.prototype.importUserEvents = function importUserEvents(request, callback) { + return this.rpcCall(importUserEvents, $root.google.cloud.retail.v2.ImportUserEventsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportUserEvents" }); + + /** + * Calls ImportUserEvents. + * @function importUserEvents + * @memberof google.cloud.retail.v2.UserEventService + * @instance + * @param {google.cloud.retail.v2.IImportUserEventsRequest} request ImportUserEventsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2.UserEventService#rejoinUserEvents}. + * @memberof google.cloud.retail.v2.UserEventService + * @typedef RejoinUserEventsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RejoinUserEvents. + * @function rejoinUserEvents + * @memberof google.cloud.retail.v2.UserEventService + * @instance + * @param {google.cloud.retail.v2.IRejoinUserEventsRequest} request RejoinUserEventsRequest message or plain object + * @param {google.cloud.retail.v2.UserEventService.RejoinUserEventsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserEventService.prototype.rejoinUserEvents = function rejoinUserEvents(request, callback) { + return this.rpcCall(rejoinUserEvents, $root.google.cloud.retail.v2.RejoinUserEventsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RejoinUserEvents" }); + + /** + * Calls RejoinUserEvents. + * @function rejoinUserEvents + * @memberof google.cloud.retail.v2.UserEventService + * @instance + * @param {google.cloud.retail.v2.IRejoinUserEventsRequest} request RejoinUserEventsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return UserEventService; + })(); + + v2.WriteUserEventRequest = (function() { + + /** + * Properties of a WriteUserEventRequest. + * @memberof google.cloud.retail.v2 + * @interface IWriteUserEventRequest + * @property {string|null} [parent] WriteUserEventRequest parent + * @property {google.cloud.retail.v2.IUserEvent|null} [userEvent] WriteUserEventRequest userEvent + */ + + /** + * Constructs a new WriteUserEventRequest. + * @memberof google.cloud.retail.v2 + * @classdesc Represents a WriteUserEventRequest. + * @implements IWriteUserEventRequest + * @constructor + * @param {google.cloud.retail.v2.IWriteUserEventRequest=} [properties] Properties to set + */ + function WriteUserEventRequest(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]]; + } + + /** + * WriteUserEventRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2.WriteUserEventRequest + * @instance + */ + WriteUserEventRequest.prototype.parent = ""; + + /** + * WriteUserEventRequest userEvent. + * @member {google.cloud.retail.v2.IUserEvent|null|undefined} userEvent + * @memberof google.cloud.retail.v2.WriteUserEventRequest + * @instance + */ + WriteUserEventRequest.prototype.userEvent = null; + + /** + * Creates a new WriteUserEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.WriteUserEventRequest + * @static + * @param {google.cloud.retail.v2.IWriteUserEventRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2.WriteUserEventRequest} WriteUserEventRequest instance + */ + WriteUserEventRequest.create = function create(properties) { + return new WriteUserEventRequest(properties); + }; + + /** + * Encodes the specified WriteUserEventRequest message. Does not implicitly {@link google.cloud.retail.v2.WriteUserEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.WriteUserEventRequest + * @static + * @param {google.cloud.retail.v2.IWriteUserEventRequest} message WriteUserEventRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Catalog.encodeDelimited = function encodeDelimited(message, writer) { + WriteUserEventRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.userEvent != null && Object.hasOwnProperty.call(message, "userEvent")) + $root.google.cloud.retail.v2.UserEvent.encode(message.userEvent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WriteUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.WriteUserEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.WriteUserEventRequest + * @static + * @param {google.cloud.retail.v2.IWriteUserEventRequest} message WriteUserEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteUserEventRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Catalog message from the specified reader or buffer. + * Decodes a WriteUserEventRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Catalog + * @memberof google.cloud.retail.v2.WriteUserEventRequest * @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.Catalog} Catalog + * @returns {google.cloud.retail.v2.WriteUserEventRequest} WriteUserEventRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Catalog.decode = function decode(reader, length) { + WriteUserEventRequest.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.Catalog(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.WriteUserEventRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); break; case 2: - message.displayName = reader.string(); - break; - case 4: - message.productLevelConfig = $root.google.cloud.retail.v2alpha.ProductLevelConfig.decode(reader, reader.uint32()); - break; - case 6: - message.merchantCenterLinkingConfig = $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.decode(reader, reader.uint32()); + message.userEvent = $root.google.cloud.retail.v2.UserEvent.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -23952,161 +24100,124 @@ }; /** - * Decodes a Catalog message from the specified reader or buffer, length delimited. + * Decodes a WriteUserEventRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Catalog + * @memberof google.cloud.retail.v2.WriteUserEventRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Catalog} Catalog + * @returns {google.cloud.retail.v2.WriteUserEventRequest} WriteUserEventRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Catalog.decodeDelimited = function decodeDelimited(reader) { + WriteUserEventRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Catalog message. + * Verifies a WriteUserEventRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.Catalog + * @memberof google.cloud.retail.v2.WriteUserEventRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Catalog.verify = function verify(message) { + WriteUserEventRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.productLevelConfig != null && message.hasOwnProperty("productLevelConfig")) { - var error = $root.google.cloud.retail.v2alpha.ProductLevelConfig.verify(message.productLevelConfig); - if (error) - return "productLevelConfig." + error; - } - if (message.merchantCenterLinkingConfig != null && message.hasOwnProperty("merchantCenterLinkingConfig")) { - var error = $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.verify(message.merchantCenterLinkingConfig); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.userEvent != null && message.hasOwnProperty("userEvent")) { + var error = $root.google.cloud.retail.v2.UserEvent.verify(message.userEvent); if (error) - return "merchantCenterLinkingConfig." + error; + return "userEvent." + error; } return null; }; /** - * Creates a Catalog message from a plain object. Also converts values to their respective internal types. + * Creates a WriteUserEventRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Catalog + * @memberof google.cloud.retail.v2.WriteUserEventRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Catalog} Catalog + * @returns {google.cloud.retail.v2.WriteUserEventRequest} WriteUserEventRequest */ - Catalog.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Catalog) + WriteUserEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.WriteUserEventRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.Catalog(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.productLevelConfig != null) { - if (typeof object.productLevelConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Catalog.productLevelConfig: object expected"); - message.productLevelConfig = $root.google.cloud.retail.v2alpha.ProductLevelConfig.fromObject(object.productLevelConfig); - } - if (object.merchantCenterLinkingConfig != null) { - if (typeof object.merchantCenterLinkingConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Catalog.merchantCenterLinkingConfig: object expected"); - message.merchantCenterLinkingConfig = $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.fromObject(object.merchantCenterLinkingConfig); + var message = new $root.google.cloud.retail.v2.WriteUserEventRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.userEvent != null) { + if (typeof object.userEvent !== "object") + throw TypeError(".google.cloud.retail.v2.WriteUserEventRequest.userEvent: object expected"); + message.userEvent = $root.google.cloud.retail.v2.UserEvent.fromObject(object.userEvent); } return message; }; /** - * Creates a plain object from a Catalog message. Also converts values to other types if specified. + * Creates a plain object from a WriteUserEventRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Catalog + * @memberof google.cloud.retail.v2.WriteUserEventRequest * @static - * @param {google.cloud.retail.v2alpha.Catalog} message Catalog + * @param {google.cloud.retail.v2.WriteUserEventRequest} message WriteUserEventRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Catalog.toObject = function toObject(message, options) { + WriteUserEventRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.productLevelConfig = null; - object.merchantCenterLinkingConfig = null; + object.parent = ""; + object.userEvent = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.productLevelConfig != null && message.hasOwnProperty("productLevelConfig")) - object.productLevelConfig = $root.google.cloud.retail.v2alpha.ProductLevelConfig.toObject(message.productLevelConfig, options); - if (message.merchantCenterLinkingConfig != null && message.hasOwnProperty("merchantCenterLinkingConfig")) - object.merchantCenterLinkingConfig = $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.toObject(message.merchantCenterLinkingConfig, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.userEvent != null && message.hasOwnProperty("userEvent")) + object.userEvent = $root.google.cloud.retail.v2.UserEvent.toObject(message.userEvent, options); return object; }; /** - * Converts this Catalog to JSON. + * Converts this WriteUserEventRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.Catalog + * @memberof google.cloud.retail.v2.WriteUserEventRequest * @instance * @returns {Object.} JSON object */ - Catalog.prototype.toJSON = function toJSON() { + WriteUserEventRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Catalog; - })(); - - /** - * SolutionType enum. - * @name google.cloud.retail.v2alpha.SolutionType - * @enum {number} - * @property {number} SOLUTION_TYPE_UNSPECIFIED=0 SOLUTION_TYPE_UNSPECIFIED value - * @property {number} SOLUTION_TYPE_RECOMMENDATION=1 SOLUTION_TYPE_RECOMMENDATION value - * @property {number} SOLUTION_TYPE_SEARCH=2 SOLUTION_TYPE_SEARCH value - */ - v2alpha.SolutionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SOLUTION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SOLUTION_TYPE_RECOMMENDATION"] = 1; - values[valuesById[2] = "SOLUTION_TYPE_SEARCH"] = 2; - return values; + return WriteUserEventRequest; })(); - v2alpha.Condition = (function() { + v2.CollectUserEventRequest = (function() { /** - * Properties of a Condition. - * @memberof google.cloud.retail.v2alpha - * @interface ICondition - * @property {Array.|null} [queryTerms] Condition queryTerms - * @property {Array.|null} [activeTimeRange] Condition activeTimeRange + * Properties of a CollectUserEventRequest. + * @memberof google.cloud.retail.v2 + * @interface ICollectUserEventRequest + * @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 */ /** - * Constructs a new Condition. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a Condition. - * @implements ICondition + * Constructs a new CollectUserEventRequest. + * @memberof google.cloud.retail.v2 + * @classdesc Represents a CollectUserEventRequest. + * @implements ICollectUserEventRequest * @constructor - * @param {google.cloud.retail.v2alpha.ICondition=} [properties] Properties to set + * @param {google.cloud.retail.v2.ICollectUserEventRequest=} [properties] Properties to set */ - function Condition(properties) { - this.queryTerms = []; - this.activeTimeRange = []; + function CollectUserEventRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24114,94 +24225,114 @@ } /** - * Condition queryTerms. - * @member {Array.} queryTerms - * @memberof google.cloud.retail.v2alpha.Condition + * CollectUserEventRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2.CollectUserEventRequest * @instance */ - Condition.prototype.queryTerms = $util.emptyArray; + CollectUserEventRequest.prototype.parent = ""; /** - * Condition activeTimeRange. - * @member {Array.} activeTimeRange - * @memberof google.cloud.retail.v2alpha.Condition + * CollectUserEventRequest userEvent. + * @member {string} userEvent + * @memberof google.cloud.retail.v2.CollectUserEventRequest * @instance */ - Condition.prototype.activeTimeRange = $util.emptyArray; + CollectUserEventRequest.prototype.userEvent = ""; /** - * Creates a new Condition instance using the specified properties. + * CollectUserEventRequest uri. + * @member {string} uri + * @memberof google.cloud.retail.v2.CollectUserEventRequest + * @instance + */ + CollectUserEventRequest.prototype.uri = ""; + + /** + * CollectUserEventRequest ets. + * @member {number|Long} ets + * @memberof google.cloud.retail.v2.CollectUserEventRequest + * @instance + */ + CollectUserEventRequest.prototype.ets = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new CollectUserEventRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.Condition + * @memberof google.cloud.retail.v2.CollectUserEventRequest * @static - * @param {google.cloud.retail.v2alpha.ICondition=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Condition} Condition instance + * @param {google.cloud.retail.v2.ICollectUserEventRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2.CollectUserEventRequest} CollectUserEventRequest instance */ - Condition.create = function create(properties) { - return new Condition(properties); + CollectUserEventRequest.create = function create(properties) { + return new CollectUserEventRequest(properties); }; /** - * Encodes the specified Condition message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.verify|verify} messages. + * Encodes the specified CollectUserEventRequest message. Does not implicitly {@link google.cloud.retail.v2.CollectUserEventRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.Condition + * @memberof google.cloud.retail.v2.CollectUserEventRequest * @static - * @param {google.cloud.retail.v2alpha.ICondition} message Condition message or plain object to encode + * @param {google.cloud.retail.v2.ICollectUserEventRequest} message CollectUserEventRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Condition.encode = function encode(message, writer) { + CollectUserEventRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.queryTerms != null && message.queryTerms.length) - for (var i = 0; i < message.queryTerms.length; ++i) - $root.google.cloud.retail.v2alpha.Condition.QueryTerm.encode(message.queryTerms[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.activeTimeRange != null && message.activeTimeRange.length) - for (var i = 0; i < message.activeTimeRange.length; ++i) - $root.google.cloud.retail.v2alpha.Condition.TimeRange.encode(message.activeTimeRange[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.userEvent != null && Object.hasOwnProperty.call(message, "userEvent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userEvent); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + 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); return writer; }; /** - * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.verify|verify} messages. + * Encodes the specified CollectUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.CollectUserEventRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Condition + * @memberof google.cloud.retail.v2.CollectUserEventRequest * @static - * @param {google.cloud.retail.v2alpha.ICondition} message Condition message or plain object to encode + * @param {google.cloud.retail.v2.ICollectUserEventRequest} message CollectUserEventRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Condition.encodeDelimited = function encodeDelimited(message, writer) { + CollectUserEventRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Condition message from the specified reader or buffer. + * Decodes a CollectUserEventRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Condition + * @memberof google.cloud.retail.v2.CollectUserEventRequest * @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.Condition} Condition + * @returns {google.cloud.retail.v2.CollectUserEventRequest} CollectUserEventRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Condition.decode = function decode(reader, length) { + CollectUserEventRequest.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.Condition(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.CollectUserEventRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.queryTerms && message.queryTerms.length)) - message.queryTerms = []; - message.queryTerms.push($root.google.cloud.retail.v2alpha.Condition.QueryTerm.decode(reader, reader.uint32())); + message.parent = reader.string(); + break; + case 2: + message.userEvent = reader.string(); break; case 3: - if (!(message.activeTimeRange && message.activeTimeRange.length)) - message.activeTimeRange = []; - message.activeTimeRange.push($root.google.cloud.retail.v2alpha.Condition.TimeRange.decode(reader, reader.uint32())); + message.uri = reader.string(); + break; + case 4: + message.ets = reader.int64(); break; default: reader.skipType(tag & 7); @@ -24212,588 +24343,390 @@ }; /** - * Decodes a Condition message from the specified reader or buffer, length delimited. + * Decodes a CollectUserEventRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Condition + * @memberof google.cloud.retail.v2.CollectUserEventRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Condition} Condition + * @returns {google.cloud.retail.v2.CollectUserEventRequest} CollectUserEventRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Condition.decodeDelimited = function decodeDelimited(reader) { + CollectUserEventRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Condition message. + * Verifies a CollectUserEventRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.Condition + * @memberof google.cloud.retail.v2.CollectUserEventRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Condition.verify = function verify(message) { + CollectUserEventRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { - if (!Array.isArray(message.queryTerms)) - return "queryTerms: array expected"; - for (var i = 0; i < message.queryTerms.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Condition.QueryTerm.verify(message.queryTerms[i]); - if (error) - return "queryTerms." + error; - } - } - if (message.activeTimeRange != null && message.hasOwnProperty("activeTimeRange")) { - if (!Array.isArray(message.activeTimeRange)) - return "activeTimeRange: array expected"; - for (var i = 0; i < message.activeTimeRange.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Condition.TimeRange.verify(message.activeTimeRange[i]); - if (error) - return "activeTimeRange." + error; - } - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.userEvent != null && message.hasOwnProperty("userEvent")) + if (!$util.isString(message.userEvent)) + return "userEvent: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + 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"; return null; }; /** - * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * Creates a CollectUserEventRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Condition + * @memberof google.cloud.retail.v2.CollectUserEventRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Condition} Condition + * @returns {google.cloud.retail.v2.CollectUserEventRequest} CollectUserEventRequest */ - Condition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Condition) + CollectUserEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.CollectUserEventRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.Condition(); - if (object.queryTerms) { - if (!Array.isArray(object.queryTerms)) - throw TypeError(".google.cloud.retail.v2alpha.Condition.queryTerms: array expected"); - message.queryTerms = []; - for (var i = 0; i < object.queryTerms.length; ++i) { - if (typeof object.queryTerms[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Condition.queryTerms: object expected"); - message.queryTerms[i] = $root.google.cloud.retail.v2alpha.Condition.QueryTerm.fromObject(object.queryTerms[i]); - } - } - if (object.activeTimeRange) { - if (!Array.isArray(object.activeTimeRange)) - throw TypeError(".google.cloud.retail.v2alpha.Condition.activeTimeRange: array expected"); - message.activeTimeRange = []; - for (var i = 0; i < object.activeTimeRange.length; ++i) { - if (typeof object.activeTimeRange[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Condition.activeTimeRange: object expected"); - message.activeTimeRange[i] = $root.google.cloud.retail.v2alpha.Condition.TimeRange.fromObject(object.activeTimeRange[i]); - } - } + var message = new $root.google.cloud.retail.v2.CollectUserEventRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.userEvent != null) + message.userEvent = String(object.userEvent); + if (object.uri != null) + message.uri = String(object.uri); + if (object.ets != null) + if ($util.Long) + (message.ets = $util.Long.fromValue(object.ets)).unsigned = false; + else if (typeof object.ets === "string") + message.ets = parseInt(object.ets, 10); + else if (typeof object.ets === "number") + message.ets = object.ets; + else if (typeof object.ets === "object") + message.ets = new $util.LongBits(object.ets.low >>> 0, object.ets.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a Condition message. Also converts values to other types if specified. + * Creates a plain object from a CollectUserEventRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Condition + * @memberof google.cloud.retail.v2.CollectUserEventRequest * @static - * @param {google.cloud.retail.v2alpha.Condition} message Condition + * @param {google.cloud.retail.v2.CollectUserEventRequest} message CollectUserEventRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Condition.toObject = function toObject(message, options) { + CollectUserEventRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.queryTerms = []; - object.activeTimeRange = []; - } - if (message.queryTerms && message.queryTerms.length) { - object.queryTerms = []; - for (var j = 0; j < message.queryTerms.length; ++j) - object.queryTerms[j] = $root.google.cloud.retail.v2alpha.Condition.QueryTerm.toObject(message.queryTerms[j], options); - } - if (message.activeTimeRange && message.activeTimeRange.length) { - object.activeTimeRange = []; - for (var j = 0; j < message.activeTimeRange.length; ++j) - object.activeTimeRange[j] = $root.google.cloud.retail.v2alpha.Condition.TimeRange.toObject(message.activeTimeRange[j], options); + if (options.defaults) { + object.parent = ""; + object.userEvent = ""; + object.uri = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.ets = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.ets = options.longs === String ? "0" : 0; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.userEvent != null && message.hasOwnProperty("userEvent")) + object.userEvent = message.userEvent; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.ets != null && message.hasOwnProperty("ets")) + if (typeof message.ets === "number") + 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; return object; }; /** - * Converts this Condition to JSON. + * Converts this CollectUserEventRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.Condition + * @memberof google.cloud.retail.v2.CollectUserEventRequest * @instance * @returns {Object.} JSON object */ - Condition.prototype.toJSON = function toJSON() { + CollectUserEventRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - Condition.QueryTerm = (function() { + return CollectUserEventRequest; + })(); - /** - * Properties of a QueryTerm. - * @memberof google.cloud.retail.v2alpha.Condition - * @interface IQueryTerm - * @property {string|null} [value] QueryTerm value - * @property {boolean|null} [fullMatch] QueryTerm fullMatch - */ + v2.RejoinUserEventsRequest = (function() { - /** - * Constructs a new QueryTerm. - * @memberof google.cloud.retail.v2alpha.Condition - * @classdesc Represents a QueryTerm. - * @implements IQueryTerm - * @constructor - * @param {google.cloud.retail.v2alpha.Condition.IQueryTerm=} [properties] Properties to set - */ - function QueryTerm(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]]; - } + /** + * Properties of a RejoinUserEventsRequest. + * @memberof google.cloud.retail.v2 + * @interface IRejoinUserEventsRequest + * @property {string|null} [parent] RejoinUserEventsRequest parent + * @property {google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope|null} [userEventRejoinScope] RejoinUserEventsRequest userEventRejoinScope + */ - /** - * QueryTerm value. - * @member {string} value - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm - * @instance - */ - QueryTerm.prototype.value = ""; + /** + * Constructs a new RejoinUserEventsRequest. + * @memberof google.cloud.retail.v2 + * @classdesc Represents a RejoinUserEventsRequest. + * @implements IRejoinUserEventsRequest + * @constructor + * @param {google.cloud.retail.v2.IRejoinUserEventsRequest=} [properties] Properties to set + */ + function RejoinUserEventsRequest(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]]; + } - /** - * QueryTerm fullMatch. - * @member {boolean} fullMatch - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm - * @instance - */ - QueryTerm.prototype.fullMatch = false; + /** + * RejoinUserEventsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @instance + */ + RejoinUserEventsRequest.prototype.parent = ""; - /** - * Creates a new QueryTerm instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm - * @static - * @param {google.cloud.retail.v2alpha.Condition.IQueryTerm=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Condition.QueryTerm} QueryTerm instance - */ - QueryTerm.create = function create(properties) { - return new QueryTerm(properties); - }; + /** + * RejoinUserEventsRequest userEventRejoinScope. + * @member {google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope} userEventRejoinScope + * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @instance + */ + RejoinUserEventsRequest.prototype.userEventRejoinScope = 0; - /** - * Encodes the specified QueryTerm message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.QueryTerm.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm - * @static - * @param {google.cloud.retail.v2alpha.Condition.IQueryTerm} message QueryTerm message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTerm.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - if (message.fullMatch != null && Object.hasOwnProperty.call(message, "fullMatch")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullMatch); - return writer; - }; + /** + * Creates a new RejoinUserEventsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @static + * @param {google.cloud.retail.v2.IRejoinUserEventsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2.RejoinUserEventsRequest} RejoinUserEventsRequest instance + */ + RejoinUserEventsRequest.create = function create(properties) { + return new RejoinUserEventsRequest(properties); + }; - /** - * Encodes the specified QueryTerm message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.QueryTerm.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm - * @static - * @param {google.cloud.retail.v2alpha.Condition.IQueryTerm} message QueryTerm message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTerm.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified RejoinUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @static + * @param {google.cloud.retail.v2.IRejoinUserEventsRequest} message RejoinUserEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RejoinUserEventsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.userEventRejoinScope != null && Object.hasOwnProperty.call(message, "userEventRejoinScope")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.userEventRejoinScope); + return writer; + }; - /** - * Decodes a QueryTerm message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm - * @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.Condition.QueryTerm} QueryTerm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTerm.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.Condition.QueryTerm(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.string(); - break; - case 2: - message.fullMatch = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryTerm message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Condition.QueryTerm} QueryTerm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTerm.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryTerm message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryTerm.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - if (message.fullMatch != null && message.hasOwnProperty("fullMatch")) - if (typeof message.fullMatch !== "boolean") - return "fullMatch: boolean expected"; - return null; - }; - - /** - * Creates a QueryTerm message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Condition.QueryTerm} QueryTerm - */ - QueryTerm.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Condition.QueryTerm) - return object; - var message = new $root.google.cloud.retail.v2alpha.Condition.QueryTerm(); - if (object.value != null) - message.value = String(object.value); - if (object.fullMatch != null) - message.fullMatch = Boolean(object.fullMatch); - return message; - }; + /** + * Encodes the specified RejoinUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @static + * @param {google.cloud.retail.v2.IRejoinUserEventsRequest} message RejoinUserEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RejoinUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from a QueryTerm message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm - * @static - * @param {google.cloud.retail.v2alpha.Condition.QueryTerm} message QueryTerm - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryTerm.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.fullMatch = false; + /** + * Decodes a RejoinUserEventsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.RejoinUserEventsRequest} RejoinUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RejoinUserEventsRequest.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.v2.RejoinUserEventsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.userEventRejoinScope = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.fullMatch != null && message.hasOwnProperty("fullMatch")) - object.fullMatch = message.fullMatch; - return object; - }; - - /** - * Converts this QueryTerm to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm - * @instance - * @returns {Object.} JSON object - */ - QueryTerm.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryTerm; - })(); - - Condition.TimeRange = (function() { - - /** - * Properties of a TimeRange. - * @memberof google.cloud.retail.v2alpha.Condition - * @interface ITimeRange - * @property {google.protobuf.ITimestamp|null} [startTime] TimeRange startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TimeRange endTime - */ - - /** - * Constructs a new TimeRange. - * @memberof google.cloud.retail.v2alpha.Condition - * @classdesc Represents a TimeRange. - * @implements ITimeRange - * @constructor - * @param {google.cloud.retail.v2alpha.Condition.ITimeRange=} [properties] Properties to set - */ - function TimeRange(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]]; } + return message; + }; - /** - * TimeRange startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange - * @instance - */ - TimeRange.prototype.startTime = null; - - /** - * TimeRange endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange - * @instance - */ - TimeRange.prototype.endTime = null; - - /** - * Creates a new TimeRange instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange - * @static - * @param {google.cloud.retail.v2alpha.Condition.ITimeRange=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Condition.TimeRange} TimeRange instance - */ - TimeRange.create = function create(properties) { - return new TimeRange(properties); - }; - - /** - * Encodes the specified TimeRange message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.TimeRange.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange - * @static - * @param {google.cloud.retail.v2alpha.Condition.ITimeRange} message TimeRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TimeRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.TimeRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange - * @static - * @param {google.cloud.retail.v2alpha.Condition.ITimeRange} message TimeRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TimeRange message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange - * @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.Condition.TimeRange} TimeRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeRange.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.Condition.TimeRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TimeRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Condition.TimeRange} TimeRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TimeRange message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimeRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - return null; - }; + /** + * Decodes a RejoinUserEventsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.RejoinUserEventsRequest} RejoinUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RejoinUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a TimeRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Condition.TimeRange} TimeRange - */ - TimeRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Condition.TimeRange) - return object; - var message = new $root.google.cloud.retail.v2alpha.Condition.TimeRange(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Condition.TimeRange.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Condition.TimeRange.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + /** + * Verifies a RejoinUserEventsRequest message. + * @function verify + * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RejoinUserEventsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.userEventRejoinScope != null && message.hasOwnProperty("userEventRejoinScope")) + switch (message.userEventRejoinScope) { + default: + return "userEventRejoinScope: enum value expected"; + case 0: + case 1: + case 2: + break; } - return message; - }; + return null; + }; - /** - * Creates a plain object from a TimeRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange - * @static - * @param {google.cloud.retail.v2alpha.Condition.TimeRange} message TimeRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimeRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startTime = null; - object.endTime = null; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + /** + * Creates a RejoinUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.RejoinUserEventsRequest} RejoinUserEventsRequest + */ + RejoinUserEventsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.RejoinUserEventsRequest) return object; - }; + var message = new $root.google.cloud.retail.v2.RejoinUserEventsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.userEventRejoinScope) { + case "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED": + case 0: + message.userEventRejoinScope = 0; + break; + case "JOINED_EVENTS": + case 1: + message.userEventRejoinScope = 1; + break; + case "UNJOINED_EVENTS": + case 2: + message.userEventRejoinScope = 2; + break; + } + return message; + }; - /** - * Converts this TimeRange to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange - * @instance - * @returns {Object.} JSON object - */ - TimeRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a RejoinUserEventsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @static + * @param {google.cloud.retail.v2.RejoinUserEventsRequest} message RejoinUserEventsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RejoinUserEventsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.userEventRejoinScope = options.enums === String ? "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.userEventRejoinScope != null && message.hasOwnProperty("userEventRejoinScope")) + object.userEventRejoinScope = options.enums === String ? $root.google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope[message.userEventRejoinScope] : message.userEventRejoinScope; + return object; + }; - return TimeRange; + /** + * Converts this RejoinUserEventsRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.RejoinUserEventsRequest + * @instance + * @returns {Object.} JSON object + */ + RejoinUserEventsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * UserEventRejoinScope enum. + * @name google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope + * @enum {number} + * @property {number} USER_EVENT_REJOIN_SCOPE_UNSPECIFIED=0 USER_EVENT_REJOIN_SCOPE_UNSPECIFIED value + * @property {number} JOINED_EVENTS=1 JOINED_EVENTS value + * @property {number} UNJOINED_EVENTS=2 UNJOINED_EVENTS value + */ + RejoinUserEventsRequest.UserEventRejoinScope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOINED_EVENTS"] = 1; + values[valuesById[2] = "UNJOINED_EVENTS"] = 2; + return values; })(); - return Condition; + return RejoinUserEventsRequest; })(); - v2alpha.Rule = (function() { + v2.RejoinUserEventsResponse = (function() { /** - * Properties of a Rule. - * @memberof google.cloud.retail.v2alpha - * @interface IRule - * @property {google.cloud.retail.v2alpha.Rule.IBoostAction|null} [boostAction] Rule boostAction - * @property {google.cloud.retail.v2alpha.Rule.IRedirectAction|null} [redirectAction] Rule redirectAction - * @property {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction|null} [onewaySynonymsAction] Rule onewaySynonymsAction - * @property {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction|null} [doNotAssociateAction] Rule doNotAssociateAction - * @property {google.cloud.retail.v2alpha.Rule.IReplacementAction|null} [replacementAction] Rule replacementAction - * @property {google.cloud.retail.v2alpha.Rule.IIgnoreAction|null} [ignoreAction] Rule ignoreAction - * @property {google.cloud.retail.v2alpha.Rule.IFilterAction|null} [filterAction] Rule filterAction - * @property {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction|null} [twowaySynonymsAction] Rule twowaySynonymsAction - * @property {google.cloud.retail.v2alpha.ICondition|null} [condition] Rule condition + * Properties of a RejoinUserEventsResponse. + * @memberof google.cloud.retail.v2 + * @interface IRejoinUserEventsResponse + * @property {number|Long|null} [rejoinedUserEventsCount] RejoinUserEventsResponse rejoinedUserEventsCount */ /** - * Constructs a new Rule. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a Rule. - * @implements IRule + * Constructs a new RejoinUserEventsResponse. + * @memberof google.cloud.retail.v2 + * @classdesc Represents a RejoinUserEventsResponse. + * @implements IRejoinUserEventsResponse * @constructor - * @param {google.cloud.retail.v2alpha.IRule=} [properties] Properties to set + * @param {google.cloud.retail.v2.IRejoinUserEventsResponse=} [properties] Properties to set */ - function Rule(properties) { + function RejoinUserEventsResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24801,194 +24734,263 @@ } /** - * Rule boostAction. - * @member {google.cloud.retail.v2alpha.Rule.IBoostAction|null|undefined} boostAction - * @memberof google.cloud.retail.v2alpha.Rule - * @instance - */ - Rule.prototype.boostAction = null; - - /** - * Rule redirectAction. - * @member {google.cloud.retail.v2alpha.Rule.IRedirectAction|null|undefined} redirectAction - * @memberof google.cloud.retail.v2alpha.Rule + * RejoinUserEventsResponse rejoinedUserEventsCount. + * @member {number|Long} rejoinedUserEventsCount + * @memberof google.cloud.retail.v2.RejoinUserEventsResponse * @instance */ - Rule.prototype.redirectAction = null; + RejoinUserEventsResponse.prototype.rejoinedUserEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Rule onewaySynonymsAction. - * @member {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction|null|undefined} onewaySynonymsAction - * @memberof google.cloud.retail.v2alpha.Rule - * @instance + * Creates a new RejoinUserEventsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.RejoinUserEventsResponse + * @static + * @param {google.cloud.retail.v2.IRejoinUserEventsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2.RejoinUserEventsResponse} RejoinUserEventsResponse instance */ - Rule.prototype.onewaySynonymsAction = null; + RejoinUserEventsResponse.create = function create(properties) { + return new RejoinUserEventsResponse(properties); + }; /** - * Rule doNotAssociateAction. - * @member {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction|null|undefined} doNotAssociateAction - * @memberof google.cloud.retail.v2alpha.Rule - * @instance + * Encodes the specified RejoinUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.RejoinUserEventsResponse + * @static + * @param {google.cloud.retail.v2.IRejoinUserEventsResponse} message RejoinUserEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Rule.prototype.doNotAssociateAction = null; + RejoinUserEventsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rejoinedUserEventsCount != null && Object.hasOwnProperty.call(message, "rejoinedUserEventsCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.rejoinedUserEventsCount); + return writer; + }; /** - * Rule replacementAction. - * @member {google.cloud.retail.v2alpha.Rule.IReplacementAction|null|undefined} replacementAction - * @memberof google.cloud.retail.v2alpha.Rule - * @instance + * Encodes the specified RejoinUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.RejoinUserEventsResponse + * @static + * @param {google.cloud.retail.v2.IRejoinUserEventsResponse} message RejoinUserEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Rule.prototype.replacementAction = null; + RejoinUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Rule ignoreAction. - * @member {google.cloud.retail.v2alpha.Rule.IIgnoreAction|null|undefined} ignoreAction - * @memberof google.cloud.retail.v2alpha.Rule - * @instance + * Decodes a RejoinUserEventsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.RejoinUserEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.RejoinUserEventsResponse} RejoinUserEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Rule.prototype.ignoreAction = null; + RejoinUserEventsResponse.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.v2.RejoinUserEventsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rejoinedUserEventsCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Rule filterAction. - * @member {google.cloud.retail.v2alpha.Rule.IFilterAction|null|undefined} filterAction - * @memberof google.cloud.retail.v2alpha.Rule - * @instance + * Decodes a RejoinUserEventsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.RejoinUserEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.RejoinUserEventsResponse} RejoinUserEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Rule.prototype.filterAction = null; + RejoinUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Rule twowaySynonymsAction. - * @member {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction|null|undefined} twowaySynonymsAction - * @memberof google.cloud.retail.v2alpha.Rule - * @instance + * Verifies a RejoinUserEventsResponse message. + * @function verify + * @memberof google.cloud.retail.v2.RejoinUserEventsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Rule.prototype.twowaySynonymsAction = null; + RejoinUserEventsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rejoinedUserEventsCount != null && message.hasOwnProperty("rejoinedUserEventsCount")) + if (!$util.isInteger(message.rejoinedUserEventsCount) && !(message.rejoinedUserEventsCount && $util.isInteger(message.rejoinedUserEventsCount.low) && $util.isInteger(message.rejoinedUserEventsCount.high))) + return "rejoinedUserEventsCount: integer|Long expected"; + return null; + }; /** - * Rule condition. - * @member {google.cloud.retail.v2alpha.ICondition|null|undefined} condition - * @memberof google.cloud.retail.v2alpha.Rule - * @instance + * Creates a RejoinUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.RejoinUserEventsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.RejoinUserEventsResponse} RejoinUserEventsResponse */ - Rule.prototype.condition = null; + RejoinUserEventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.RejoinUserEventsResponse) + return object; + var message = new $root.google.cloud.retail.v2.RejoinUserEventsResponse(); + if (object.rejoinedUserEventsCount != null) + if ($util.Long) + (message.rejoinedUserEventsCount = $util.Long.fromValue(object.rejoinedUserEventsCount)).unsigned = false; + else if (typeof object.rejoinedUserEventsCount === "string") + message.rejoinedUserEventsCount = parseInt(object.rejoinedUserEventsCount, 10); + else if (typeof object.rejoinedUserEventsCount === "number") + message.rejoinedUserEventsCount = object.rejoinedUserEventsCount; + else if (typeof object.rejoinedUserEventsCount === "object") + message.rejoinedUserEventsCount = new $util.LongBits(object.rejoinedUserEventsCount.low >>> 0, object.rejoinedUserEventsCount.high >>> 0).toNumber(); + return message; + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Creates a plain object from a RejoinUserEventsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.RejoinUserEventsResponse + * @static + * @param {google.cloud.retail.v2.RejoinUserEventsResponse} message RejoinUserEventsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RejoinUserEventsResponse.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.rejoinedUserEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rejoinedUserEventsCount = options.longs === String ? "0" : 0; + if (message.rejoinedUserEventsCount != null && message.hasOwnProperty("rejoinedUserEventsCount")) + if (typeof message.rejoinedUserEventsCount === "number") + object.rejoinedUserEventsCount = options.longs === String ? String(message.rejoinedUserEventsCount) : message.rejoinedUserEventsCount; + else + object.rejoinedUserEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.rejoinedUserEventsCount) : options.longs === Number ? new $util.LongBits(message.rejoinedUserEventsCount.low >>> 0, message.rejoinedUserEventsCount.high >>> 0).toNumber() : message.rejoinedUserEventsCount; + return object; + }; /** - * Rule action. - * @member {"boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"|undefined} action - * @memberof google.cloud.retail.v2alpha.Rule + * Converts this RejoinUserEventsResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.RejoinUserEventsResponse * @instance + * @returns {Object.} JSON object */ - Object.defineProperty(Rule.prototype, "action", { - get: $util.oneOfGetter($oneOfFields = ["boostAction", "redirectAction", "onewaySynonymsAction", "doNotAssociateAction", "replacementAction", "ignoreAction", "filterAction", "twowaySynonymsAction"]), - set: $util.oneOfSetter($oneOfFields) - }); + RejoinUserEventsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RejoinUserEventsResponse; + })(); + + v2.RejoinUserEventsMetadata = (function() { /** - * Creates a new Rule instance using the specified properties. + * Properties of a RejoinUserEventsMetadata. + * @memberof google.cloud.retail.v2 + * @interface IRejoinUserEventsMetadata + */ + + /** + * Constructs a new RejoinUserEventsMetadata. + * @memberof google.cloud.retail.v2 + * @classdesc Represents a RejoinUserEventsMetadata. + * @implements IRejoinUserEventsMetadata + * @constructor + * @param {google.cloud.retail.v2.IRejoinUserEventsMetadata=} [properties] Properties to set + */ + function RejoinUserEventsMetadata(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]]; + } + + /** + * Creates a new RejoinUserEventsMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.Rule + * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata * @static - * @param {google.cloud.retail.v2alpha.IRule=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule} Rule instance + * @param {google.cloud.retail.v2.IRejoinUserEventsMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2.RejoinUserEventsMetadata} RejoinUserEventsMetadata instance */ - Rule.create = function create(properties) { - return new Rule(properties); + RejoinUserEventsMetadata.create = function create(properties) { + return new RejoinUserEventsMetadata(properties); }; /** - * Encodes the specified Rule message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.verify|verify} messages. + * Encodes the specified RejoinUserEventsMetadata message. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.Rule + * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata * @static - * @param {google.cloud.retail.v2alpha.IRule} message Rule message or plain object to encode + * @param {google.cloud.retail.v2.IRejoinUserEventsMetadata} message RejoinUserEventsMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Rule.encode = function encode(message, writer) { + RejoinUserEventsMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.cloud.retail.v2alpha.Condition.encode(message.condition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.boostAction != null && Object.hasOwnProperty.call(message, "boostAction")) - $root.google.cloud.retail.v2alpha.Rule.BoostAction.encode(message.boostAction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.redirectAction != null && Object.hasOwnProperty.call(message, "redirectAction")) - $root.google.cloud.retail.v2alpha.Rule.RedirectAction.encode(message.redirectAction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.onewaySynonymsAction != null && Object.hasOwnProperty.call(message, "onewaySynonymsAction")) - $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.encode(message.onewaySynonymsAction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.doNotAssociateAction != null && Object.hasOwnProperty.call(message, "doNotAssociateAction")) - $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.encode(message.doNotAssociateAction, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.replacementAction != null && Object.hasOwnProperty.call(message, "replacementAction")) - $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.encode(message.replacementAction, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.ignoreAction != null && Object.hasOwnProperty.call(message, "ignoreAction")) - $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.encode(message.ignoreAction, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.filterAction != null && Object.hasOwnProperty.call(message, "filterAction")) - $root.google.cloud.retail.v2alpha.Rule.FilterAction.encode(message.filterAction, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.twowaySynonymsAction != null && Object.hasOwnProperty.call(message, "twowaySynonymsAction")) - $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.encode(message.twowaySynonymsAction, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; /** - * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.verify|verify} messages. + * Encodes the specified RejoinUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.RejoinUserEventsMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule + * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata * @static - * @param {google.cloud.retail.v2alpha.IRule} message Rule message or plain object to encode + * @param {google.cloud.retail.v2.IRejoinUserEventsMetadata} message RejoinUserEventsMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Rule.encodeDelimited = function encodeDelimited(message, writer) { + RejoinUserEventsMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Rule message from the specified reader or buffer. + * Decodes a RejoinUserEventsMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Rule + * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata * @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.Rule} Rule + * @returns {google.cloud.retail.v2.RejoinUserEventsMetadata} RejoinUserEventsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Rule.decode = function decode(reader, length) { + RejoinUserEventsMetadata.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.Rule(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.RejoinUserEventsMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.boostAction = $root.google.cloud.retail.v2alpha.Rule.BoostAction.decode(reader, reader.uint32()); - break; - case 3: - message.redirectAction = $root.google.cloud.retail.v2alpha.Rule.RedirectAction.decode(reader, reader.uint32()); - break; - case 6: - message.onewaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.decode(reader, reader.uint32()); - break; - case 7: - message.doNotAssociateAction = $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.decode(reader, reader.uint32()); - break; - case 8: - message.replacementAction = $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.decode(reader, reader.uint32()); - break; - case 9: - message.ignoreAction = $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.decode(reader, reader.uint32()); - break; - case 10: - message.filterAction = $root.google.cloud.retail.v2alpha.Rule.FilterAction.decode(reader, reader.uint32()); - break; - case 11: - message.twowaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.decode(reader, reader.uint32()); - break; - case 1: - message.condition = $root.google.cloud.retail.v2alpha.Condition.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -24998,1451 +25000,1450 @@ }; /** - * Decodes a Rule message from the specified reader or buffer, length delimited. + * Decodes a RejoinUserEventsMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule + * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule} Rule + * @returns {google.cloud.retail.v2.RejoinUserEventsMetadata} RejoinUserEventsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Rule.decodeDelimited = function decodeDelimited(reader) { + RejoinUserEventsMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Rule message. + * Verifies a RejoinUserEventsMetadata message. * @function verify - * @memberof google.cloud.retail.v2alpha.Rule + * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Rule.verify = function verify(message) { + RejoinUserEventsMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.boostAction != null && message.hasOwnProperty("boostAction")) { - properties.action = 1; - { - var error = $root.google.cloud.retail.v2alpha.Rule.BoostAction.verify(message.boostAction); - if (error) - return "boostAction." + error; - } - } - if (message.redirectAction != null && message.hasOwnProperty("redirectAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2alpha.Rule.RedirectAction.verify(message.redirectAction); - if (error) - return "redirectAction." + error; - } - } - if (message.onewaySynonymsAction != null && message.hasOwnProperty("onewaySynonymsAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify(message.onewaySynonymsAction); - if (error) - return "onewaySynonymsAction." + error; - } - } - if (message.doNotAssociateAction != null && message.hasOwnProperty("doNotAssociateAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify(message.doNotAssociateAction); - if (error) - return "doNotAssociateAction." + error; - } - } - if (message.replacementAction != null && message.hasOwnProperty("replacementAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.verify(message.replacementAction); - if (error) - return "replacementAction." + error; - } - } - if (message.ignoreAction != null && message.hasOwnProperty("ignoreAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.verify(message.ignoreAction); - if (error) - return "ignoreAction." + error; - } - } - if (message.filterAction != null && message.hasOwnProperty("filterAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2alpha.Rule.FilterAction.verify(message.filterAction); - if (error) - return "filterAction." + error; - } - } - if (message.twowaySynonymsAction != null && message.hasOwnProperty("twowaySynonymsAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify(message.twowaySynonymsAction); - if (error) - return "twowaySynonymsAction." + error; - } - } - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.cloud.retail.v2alpha.Condition.verify(message.condition); - if (error) - return "condition." + error; - } return null; }; /** - * Creates a Rule message from a plain object. Also converts values to their respective internal types. + * Creates a RejoinUserEventsMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule + * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule} Rule + * @returns {google.cloud.retail.v2.RejoinUserEventsMetadata} RejoinUserEventsMetadata */ - Rule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule) + RejoinUserEventsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.RejoinUserEventsMetadata) return object; - var message = new $root.google.cloud.retail.v2alpha.Rule(); - if (object.boostAction != null) { - if (typeof object.boostAction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.boostAction: object expected"); - message.boostAction = $root.google.cloud.retail.v2alpha.Rule.BoostAction.fromObject(object.boostAction); - } - if (object.redirectAction != null) { - if (typeof object.redirectAction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.redirectAction: object expected"); - message.redirectAction = $root.google.cloud.retail.v2alpha.Rule.RedirectAction.fromObject(object.redirectAction); - } - if (object.onewaySynonymsAction != null) { - if (typeof object.onewaySynonymsAction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.onewaySynonymsAction: object expected"); - message.onewaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.fromObject(object.onewaySynonymsAction); - } - if (object.doNotAssociateAction != null) { - if (typeof object.doNotAssociateAction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.doNotAssociateAction: object expected"); - message.doNotAssociateAction = $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.fromObject(object.doNotAssociateAction); - } - if (object.replacementAction != null) { - if (typeof object.replacementAction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.replacementAction: object expected"); - message.replacementAction = $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.fromObject(object.replacementAction); - } - if (object.ignoreAction != null) { - if (typeof object.ignoreAction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.ignoreAction: object expected"); - message.ignoreAction = $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.fromObject(object.ignoreAction); - } - if (object.filterAction != null) { - if (typeof object.filterAction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.filterAction: object expected"); - message.filterAction = $root.google.cloud.retail.v2alpha.Rule.FilterAction.fromObject(object.filterAction); - } - if (object.twowaySynonymsAction != null) { - if (typeof object.twowaySynonymsAction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.twowaySynonymsAction: object expected"); - message.twowaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.fromObject(object.twowaySynonymsAction); - } - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.condition: object expected"); - message.condition = $root.google.cloud.retail.v2alpha.Condition.fromObject(object.condition); - } - return message; + return new $root.google.cloud.retail.v2.RejoinUserEventsMetadata(); }; /** - * Creates a plain object from a Rule message. Also converts values to other types if specified. + * Creates a plain object from a RejoinUserEventsMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule + * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata * @static - * @param {google.cloud.retail.v2alpha.Rule} message Rule + * @param {google.cloud.retail.v2.RejoinUserEventsMetadata} message RejoinUserEventsMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Rule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.condition = null; - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.cloud.retail.v2alpha.Condition.toObject(message.condition, options); - if (message.boostAction != null && message.hasOwnProperty("boostAction")) { - object.boostAction = $root.google.cloud.retail.v2alpha.Rule.BoostAction.toObject(message.boostAction, options); - if (options.oneofs) - object.action = "boostAction"; - } - if (message.redirectAction != null && message.hasOwnProperty("redirectAction")) { - object.redirectAction = $root.google.cloud.retail.v2alpha.Rule.RedirectAction.toObject(message.redirectAction, options); - if (options.oneofs) - object.action = "redirectAction"; - } - if (message.onewaySynonymsAction != null && message.hasOwnProperty("onewaySynonymsAction")) { - object.onewaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.toObject(message.onewaySynonymsAction, options); - if (options.oneofs) - object.action = "onewaySynonymsAction"; - } - if (message.doNotAssociateAction != null && message.hasOwnProperty("doNotAssociateAction")) { - object.doNotAssociateAction = $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.toObject(message.doNotAssociateAction, options); - if (options.oneofs) - object.action = "doNotAssociateAction"; - } - if (message.replacementAction != null && message.hasOwnProperty("replacementAction")) { - object.replacementAction = $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.toObject(message.replacementAction, options); - if (options.oneofs) - object.action = "replacementAction"; - } - if (message.ignoreAction != null && message.hasOwnProperty("ignoreAction")) { - object.ignoreAction = $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.toObject(message.ignoreAction, options); - if (options.oneofs) - object.action = "ignoreAction"; - } - if (message.filterAction != null && message.hasOwnProperty("filterAction")) { - object.filterAction = $root.google.cloud.retail.v2alpha.Rule.FilterAction.toObject(message.filterAction, options); - if (options.oneofs) - object.action = "filterAction"; - } - if (message.twowaySynonymsAction != null && message.hasOwnProperty("twowaySynonymsAction")) { - object.twowaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.toObject(message.twowaySynonymsAction, options); - if (options.oneofs) - object.action = "twowaySynonymsAction"; - } - return object; + RejoinUserEventsMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this Rule to JSON. + * Converts this RejoinUserEventsMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule + * @memberof google.cloud.retail.v2.RejoinUserEventsMetadata * @instance * @returns {Object.} JSON object */ - Rule.prototype.toJSON = function toJSON() { + RejoinUserEventsMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - Rule.BoostAction = (function() { + return RejoinUserEventsMetadata; + })(); - /** - * Properties of a BoostAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @interface IBoostAction - * @property {number|null} [boost] BoostAction boost - * @property {string|null} [productsFilter] BoostAction productsFilter - */ + return v2; + })(); - /** - * Constructs a new BoostAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @classdesc Represents a BoostAction. - * @implements IBoostAction - * @constructor - * @param {google.cloud.retail.v2alpha.Rule.IBoostAction=} [properties] Properties to set - */ - function BoostAction(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]]; - } + retail.v2alpha = (function() { - /** - * BoostAction boost. - * @member {number} boost - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction - * @instance - */ - BoostAction.prototype.boost = 0; + /** + * Namespace v2alpha. + * @memberof google.cloud.retail + * @namespace + */ + var v2alpha = {}; - /** - * BoostAction productsFilter. - * @member {string} productsFilter - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction - * @instance - */ - BoostAction.prototype.productsFilter = ""; + v2alpha.ProductLevelConfig = (function() { - /** - * Creates a new BoostAction instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IBoostAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule.BoostAction} BoostAction instance - */ - BoostAction.create = function create(properties) { - return new BoostAction(properties); - }; + /** + * Properties of a ProductLevelConfig. + * @memberof google.cloud.retail.v2alpha + * @interface IProductLevelConfig + * @property {string|null} [ingestionProductType] ProductLevelConfig ingestionProductType + * @property {string|null} [merchantCenterProductIdField] ProductLevelConfig merchantCenterProductIdField + */ - /** - * Encodes the specified BoostAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.BoostAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IBoostAction} message BoostAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.boost); - if (message.productsFilter != null && Object.hasOwnProperty.call(message, "productsFilter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.productsFilter); - return writer; - }; + /** + * Constructs a new ProductLevelConfig. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a ProductLevelConfig. + * @implements IProductLevelConfig + * @constructor + * @param {google.cloud.retail.v2alpha.IProductLevelConfig=} [properties] Properties to set + */ + function ProductLevelConfig(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]]; + } - /** - * Encodes the specified BoostAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.BoostAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IBoostAction} message BoostAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ProductLevelConfig ingestionProductType. + * @member {string} ingestionProductType + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @instance + */ + ProductLevelConfig.prototype.ingestionProductType = ""; - /** - * Decodes a BoostAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction - * @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.Rule.BoostAction} BoostAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostAction.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.Rule.BoostAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.boost = reader.float(); - break; - case 2: - message.productsFilter = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ProductLevelConfig merchantCenterProductIdField. + * @member {string} merchantCenterProductIdField + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @instance + */ + ProductLevelConfig.prototype.merchantCenterProductIdField = ""; - /** - * Decodes a BoostAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule.BoostAction} BoostAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new ProductLevelConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @static + * @param {google.cloud.retail.v2alpha.IProductLevelConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ProductLevelConfig} ProductLevelConfig instance + */ + ProductLevelConfig.create = function create(properties) { + return new ProductLevelConfig(properties); + }; - /** - * Verifies a BoostAction message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoostAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.boost != null && message.hasOwnProperty("boost")) - if (typeof message.boost !== "number") - return "boost: number expected"; - if (message.productsFilter != null && message.hasOwnProperty("productsFilter")) - if (!$util.isString(message.productsFilter)) - return "productsFilter: string expected"; - return null; - }; + /** + * Encodes the specified ProductLevelConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductLevelConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @static + * @param {google.cloud.retail.v2alpha.IProductLevelConfig} message ProductLevelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductLevelConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ingestionProductType != null && Object.hasOwnProperty.call(message, "ingestionProductType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ingestionProductType); + if (message.merchantCenterProductIdField != null && Object.hasOwnProperty.call(message, "merchantCenterProductIdField")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.merchantCenterProductIdField); + return writer; + }; - /** - * Creates a BoostAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule.BoostAction} BoostAction - */ - BoostAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule.BoostAction) - return object; - var message = new $root.google.cloud.retail.v2alpha.Rule.BoostAction(); - if (object.boost != null) - message.boost = Number(object.boost); - if (object.productsFilter != null) - message.productsFilter = String(object.productsFilter); - return message; - }; + /** + * Encodes the specified ProductLevelConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductLevelConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @static + * @param {google.cloud.retail.v2alpha.IProductLevelConfig} message ProductLevelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductLevelConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from a BoostAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.BoostAction} message BoostAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoostAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.boost = 0; - object.productsFilter = ""; + /** + * Decodes a ProductLevelConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @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.ProductLevelConfig} ProductLevelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductLevelConfig.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.ProductLevelConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ingestionProductType = reader.string(); + break; + case 2: + message.merchantCenterProductIdField = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.boost != null && message.hasOwnProperty("boost")) - object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; - if (message.productsFilter != null && message.hasOwnProperty("productsFilter")) - object.productsFilter = message.productsFilter; - return object; - }; - - /** - * Converts this BoostAction to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction - * @instance - * @returns {Object.} JSON object - */ - BoostAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + } + return message; + }; - return BoostAction; - })(); + /** + * Decodes a ProductLevelConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.ProductLevelConfig} ProductLevelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductLevelConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - Rule.FilterAction = (function() { + /** + * Verifies a ProductLevelConfig message. + * @function verify + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductLevelConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ingestionProductType != null && message.hasOwnProperty("ingestionProductType")) + if (!$util.isString(message.ingestionProductType)) + return "ingestionProductType: string expected"; + if (message.merchantCenterProductIdField != null && message.hasOwnProperty("merchantCenterProductIdField")) + if (!$util.isString(message.merchantCenterProductIdField)) + return "merchantCenterProductIdField: string expected"; + return null; + }; - /** - * Properties of a FilterAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @interface IFilterAction - * @property {string|null} [filter] FilterAction filter - */ + /** + * Creates a ProductLevelConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.ProductLevelConfig} ProductLevelConfig + */ + ProductLevelConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ProductLevelConfig) + return object; + var message = new $root.google.cloud.retail.v2alpha.ProductLevelConfig(); + if (object.ingestionProductType != null) + message.ingestionProductType = String(object.ingestionProductType); + if (object.merchantCenterProductIdField != null) + message.merchantCenterProductIdField = String(object.merchantCenterProductIdField); + return message; + }; - /** - * Constructs a new FilterAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @classdesc Represents a FilterAction. - * @implements IFilterAction - * @constructor - * @param {google.cloud.retail.v2alpha.Rule.IFilterAction=} [properties] Properties to set - */ - function FilterAction(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]]; + /** + * Creates a plain object from a ProductLevelConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @static + * @param {google.cloud.retail.v2alpha.ProductLevelConfig} message ProductLevelConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductLevelConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ingestionProductType = ""; + object.merchantCenterProductIdField = ""; } + if (message.ingestionProductType != null && message.hasOwnProperty("ingestionProductType")) + object.ingestionProductType = message.ingestionProductType; + if (message.merchantCenterProductIdField != null && message.hasOwnProperty("merchantCenterProductIdField")) + object.merchantCenterProductIdField = message.merchantCenterProductIdField; + return object; + }; - /** - * FilterAction filter. - * @member {string} filter - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction - * @instance - */ - FilterAction.prototype.filter = ""; - - /** - * Creates a new FilterAction instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IFilterAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule.FilterAction} FilterAction instance - */ - FilterAction.create = function create(properties) { - return new FilterAction(properties); - }; + /** + * Converts this ProductLevelConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @instance + * @returns {Object.} JSON object + */ + ProductLevelConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified FilterAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.FilterAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IFilterAction} message FilterAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FilterAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - return writer; - }; + return ProductLevelConfig; + })(); - /** - * Encodes the specified FilterAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.FilterAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IFilterAction} message FilterAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FilterAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + v2alpha.MerchantCenterLink = (function() { - /** - * Decodes a FilterAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction - * @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.Rule.FilterAction} FilterAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FilterAction.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.Rule.FilterAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.filter = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of a MerchantCenterLink. + * @memberof google.cloud.retail.v2alpha + * @interface IMerchantCenterLink + * @property {number|Long|null} [merchantCenterAccountId] MerchantCenterLink merchantCenterAccountId + * @property {string|null} [branchId] MerchantCenterLink branchId + * @property {Array.|null} [destinations] MerchantCenterLink destinations + * @property {string|null} [regionCode] MerchantCenterLink regionCode + * @property {string|null} [languageCode] MerchantCenterLink languageCode + */ - /** - * Decodes a FilterAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule.FilterAction} FilterAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FilterAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Constructs a new MerchantCenterLink. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a MerchantCenterLink. + * @implements IMerchantCenterLink + * @constructor + * @param {google.cloud.retail.v2alpha.IMerchantCenterLink=} [properties] Properties to set + */ + function MerchantCenterLink(properties) { + this.destinations = []; + 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]]; + } - /** - * Verifies a FilterAction message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FilterAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - return null; - }; + /** + * MerchantCenterLink merchantCenterAccountId. + * @member {number|Long} merchantCenterAccountId + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @instance + */ + MerchantCenterLink.prototype.merchantCenterAccountId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Creates a FilterAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule.FilterAction} FilterAction - */ - FilterAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule.FilterAction) - return object; - var message = new $root.google.cloud.retail.v2alpha.Rule.FilterAction(); - if (object.filter != null) - message.filter = String(object.filter); - return message; - }; + /** + * MerchantCenterLink branchId. + * @member {string} branchId + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @instance + */ + MerchantCenterLink.prototype.branchId = ""; - /** - * Creates a plain object from a FilterAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.FilterAction} message FilterAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FilterAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.filter = ""; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - return object; - }; + /** + * MerchantCenterLink destinations. + * @member {Array.} destinations + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @instance + */ + MerchantCenterLink.prototype.destinations = $util.emptyArray; - /** - * Converts this FilterAction to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction - * @instance - * @returns {Object.} JSON object - */ - FilterAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * MerchantCenterLink regionCode. + * @member {string} regionCode + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @instance + */ + MerchantCenterLink.prototype.regionCode = ""; - return FilterAction; - })(); + /** + * MerchantCenterLink languageCode. + * @member {string} languageCode + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @instance + */ + MerchantCenterLink.prototype.languageCode = ""; - Rule.RedirectAction = (function() { + /** + * Creates a new MerchantCenterLink instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @static + * @param {google.cloud.retail.v2alpha.IMerchantCenterLink=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.MerchantCenterLink} MerchantCenterLink instance + */ + MerchantCenterLink.create = function create(properties) { + return new MerchantCenterLink(properties); + }; - /** - * Properties of a RedirectAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @interface IRedirectAction - * @property {string|null} [redirectUri] RedirectAction redirectUri - */ + /** + * Encodes the specified MerchantCenterLink message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLink.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @static + * @param {google.cloud.retail.v2alpha.IMerchantCenterLink} message MerchantCenterLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MerchantCenterLink.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.merchantCenterAccountId != null && Object.hasOwnProperty.call(message, "merchantCenterAccountId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.merchantCenterAccountId); + if (message.branchId != null && Object.hasOwnProperty.call(message, "branchId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.branchId); + if (message.destinations != null && message.destinations.length) + for (var i = 0; i < message.destinations.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.destinations[i]); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + 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); + return writer; + }; - /** - * Constructs a new RedirectAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @classdesc Represents a RedirectAction. - * @implements IRedirectAction - * @constructor - * @param {google.cloud.retail.v2alpha.Rule.IRedirectAction=} [properties] Properties to set - */ - function RedirectAction(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]]; + /** + * Encodes the specified MerchantCenterLink message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLink.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @static + * @param {google.cloud.retail.v2alpha.IMerchantCenterLink} message MerchantCenterLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MerchantCenterLink.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MerchantCenterLink message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @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.MerchantCenterLink} MerchantCenterLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MerchantCenterLink.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.MerchantCenterLink(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.merchantCenterAccountId = reader.int64(); + break; + case 2: + message.branchId = reader.string(); + break; + case 3: + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + message.destinations.push(reader.string()); + break; + case 4: + message.regionCode = reader.string(); + break; + case 5: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } + return message; + }; - /** - * RedirectAction redirectUri. - * @member {string} redirectUri - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction - * @instance - */ - RedirectAction.prototype.redirectUri = ""; + /** + * Decodes a MerchantCenterLink message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.MerchantCenterLink} MerchantCenterLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MerchantCenterLink.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new RedirectAction instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IRedirectAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule.RedirectAction} RedirectAction instance - */ - RedirectAction.create = function create(properties) { - return new RedirectAction(properties); - }; + /** + * Verifies a MerchantCenterLink message. + * @function verify + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MerchantCenterLink.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.merchantCenterAccountId != null && message.hasOwnProperty("merchantCenterAccountId")) + if (!$util.isInteger(message.merchantCenterAccountId) && !(message.merchantCenterAccountId && $util.isInteger(message.merchantCenterAccountId.low) && $util.isInteger(message.merchantCenterAccountId.high))) + return "merchantCenterAccountId: integer|Long expected"; + if (message.branchId != null && message.hasOwnProperty("branchId")) + if (!$util.isString(message.branchId)) + return "branchId: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + if (!$util.isString(message.destinations[i])) + return "destinations: string[] expected"; + } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; - /** - * Encodes the specified RedirectAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RedirectAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IRedirectAction} message RedirectAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RedirectAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.redirectUri != null && Object.hasOwnProperty.call(message, "redirectUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.redirectUri); - return writer; - }; + /** + * Creates a MerchantCenterLink message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.MerchantCenterLink} MerchantCenterLink + */ + MerchantCenterLink.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.MerchantCenterLink) + return object; + var message = new $root.google.cloud.retail.v2alpha.MerchantCenterLink(); + if (object.merchantCenterAccountId != null) + if ($util.Long) + (message.merchantCenterAccountId = $util.Long.fromValue(object.merchantCenterAccountId)).unsigned = false; + else if (typeof object.merchantCenterAccountId === "string") + message.merchantCenterAccountId = parseInt(object.merchantCenterAccountId, 10); + else if (typeof object.merchantCenterAccountId === "number") + message.merchantCenterAccountId = object.merchantCenterAccountId; + else if (typeof object.merchantCenterAccountId === "object") + message.merchantCenterAccountId = new $util.LongBits(object.merchantCenterAccountId.low >>> 0, object.merchantCenterAccountId.high >>> 0).toNumber(); + if (object.branchId != null) + message.branchId = String(object.branchId); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLink.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + message.destinations[i] = String(object.destinations[i]); + } + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; - /** - * Encodes the specified RedirectAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RedirectAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IRedirectAction} message RedirectAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RedirectAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a MerchantCenterLink message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @static + * @param {google.cloud.retail.v2alpha.MerchantCenterLink} message MerchantCenterLink + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MerchantCenterLink.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.merchantCenterAccountId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.merchantCenterAccountId = options.longs === String ? "0" : 0; + object.branchId = ""; + object.regionCode = ""; + object.languageCode = ""; + } + if (message.merchantCenterAccountId != null && message.hasOwnProperty("merchantCenterAccountId")) + if (typeof message.merchantCenterAccountId === "number") + object.merchantCenterAccountId = options.longs === String ? String(message.merchantCenterAccountId) : message.merchantCenterAccountId; + else + object.merchantCenterAccountId = options.longs === String ? $util.Long.prototype.toString.call(message.merchantCenterAccountId) : options.longs === Number ? new $util.LongBits(message.merchantCenterAccountId.low >>> 0, message.merchantCenterAccountId.high >>> 0).toNumber() : message.merchantCenterAccountId; + if (message.branchId != null && message.hasOwnProperty("branchId")) + object.branchId = message.branchId; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = message.destinations[j]; + } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; - /** - * Decodes a RedirectAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction - * @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.Rule.RedirectAction} RedirectAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RedirectAction.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.Rule.RedirectAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.redirectUri = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this MerchantCenterLink to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @instance + * @returns {Object.} JSON object + */ + MerchantCenterLink.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a RedirectAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule.RedirectAction} RedirectAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RedirectAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return MerchantCenterLink; + })(); - /** - * Verifies a RedirectAction message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RedirectAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) - if (!$util.isString(message.redirectUri)) - return "redirectUri: string expected"; - return null; - }; + v2alpha.MerchantCenterLinkingConfig = (function() { - /** - * Creates a RedirectAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule.RedirectAction} RedirectAction - */ - RedirectAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule.RedirectAction) - return object; - var message = new $root.google.cloud.retail.v2alpha.Rule.RedirectAction(); - if (object.redirectUri != null) - message.redirectUri = String(object.redirectUri); - return message; - }; + /** + * Properties of a MerchantCenterLinkingConfig. + * @memberof google.cloud.retail.v2alpha + * @interface IMerchantCenterLinkingConfig + * @property {Array.|null} [links] MerchantCenterLinkingConfig links + */ - /** - * Creates a plain object from a RedirectAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.RedirectAction} message RedirectAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RedirectAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.redirectUri = ""; - if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) - object.redirectUri = message.redirectUri; - return object; - }; + /** + * Constructs a new MerchantCenterLinkingConfig. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a MerchantCenterLinkingConfig. + * @implements IMerchantCenterLinkingConfig + * @constructor + * @param {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig=} [properties] Properties to set + */ + function MerchantCenterLinkingConfig(properties) { + this.links = []; + 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]]; + } - /** - * Converts this RedirectAction to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction - * @instance - * @returns {Object.} JSON object - */ - RedirectAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * MerchantCenterLinkingConfig links. + * @member {Array.} links + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig + * @instance + */ + MerchantCenterLinkingConfig.prototype.links = $util.emptyArray; - return RedirectAction; - })(); + /** + * Creates a new MerchantCenterLinkingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig + * @static + * @param {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig instance + */ + MerchantCenterLinkingConfig.create = function create(properties) { + return new MerchantCenterLinkingConfig(properties); + }; - Rule.TwowaySynonymsAction = (function() { + /** + * Encodes the specified MerchantCenterLinkingConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig + * @static + * @param {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig} message MerchantCenterLinkingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MerchantCenterLinkingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.links != null && message.links.length) + for (var i = 0; i < message.links.length; ++i) + $root.google.cloud.retail.v2alpha.MerchantCenterLink.encode(message.links[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * Properties of a TwowaySynonymsAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @interface ITwowaySynonymsAction - * @property {Array.|null} [synonyms] TwowaySynonymsAction synonyms - */ + /** + * Encodes the specified MerchantCenterLinkingConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig + * @static + * @param {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig} message MerchantCenterLinkingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MerchantCenterLinkingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new TwowaySynonymsAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @classdesc Represents a TwowaySynonymsAction. - * @implements ITwowaySynonymsAction - * @constructor - * @param {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction=} [properties] Properties to set - */ - function TwowaySynonymsAction(properties) { - this.synonyms = []; - 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]]; + /** + * Decodes a MerchantCenterLinkingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig + * @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.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MerchantCenterLinkingConfig.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.MerchantCenterLinkingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.links && message.links.length)) + message.links = []; + message.links.push($root.google.cloud.retail.v2alpha.MerchantCenterLink.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } } + return message; + }; - /** - * TwowaySynonymsAction synonyms. - * @member {Array.} synonyms - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @instance - */ - TwowaySynonymsAction.prototype.synonyms = $util.emptyArray; - - /** - * Creates a new TwowaySynonymsAction instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} TwowaySynonymsAction instance - */ - TwowaySynonymsAction.create = function create(properties) { - return new TwowaySynonymsAction(properties); - }; - - /** - * Encodes the specified TwowaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction} message TwowaySynonymsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TwowaySynonymsAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.synonyms != null && message.synonyms.length) - for (var i = 0; i < message.synonyms.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.synonyms[i]); - return writer; - }; - - /** - * Encodes the specified TwowaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction} message TwowaySynonymsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TwowaySynonymsAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a MerchantCenterLinkingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MerchantCenterLinkingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a TwowaySynonymsAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @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.Rule.TwowaySynonymsAction} TwowaySynonymsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TwowaySynonymsAction.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.Rule.TwowaySynonymsAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.synonyms && message.synonyms.length)) - message.synonyms = []; - message.synonyms.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Verifies a MerchantCenterLinkingConfig message. + * @function verify + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MerchantCenterLinkingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.links != null && message.hasOwnProperty("links")) { + if (!Array.isArray(message.links)) + return "links: array expected"; + for (var i = 0; i < message.links.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.MerchantCenterLink.verify(message.links[i]); + if (error) + return "links." + error; } - return message; - }; - - /** - * Decodes a TwowaySynonymsAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} TwowaySynonymsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TwowaySynonymsAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return null; + }; - /** - * Verifies a TwowaySynonymsAction message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TwowaySynonymsAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.synonyms != null && message.hasOwnProperty("synonyms")) { - if (!Array.isArray(message.synonyms)) - return "synonyms: array expected"; - for (var i = 0; i < message.synonyms.length; ++i) - if (!$util.isString(message.synonyms[i])) - return "synonyms: string[] expected"; + /** + * Creates a MerchantCenterLinkingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig + */ + MerchantCenterLinkingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig) + return object; + var message = new $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig(); + if (object.links) { + if (!Array.isArray(object.links)) + throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.links: array expected"); + message.links = []; + for (var i = 0; i < object.links.length; ++i) { + if (typeof object.links[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.links: object expected"); + message.links[i] = $root.google.cloud.retail.v2alpha.MerchantCenterLink.fromObject(object.links[i]); } - return null; - }; + } + return message; + }; - /** - * Creates a TwowaySynonymsAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} TwowaySynonymsAction - */ - TwowaySynonymsAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) - return object; - var message = new $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction(); - if (object.synonyms) { - if (!Array.isArray(object.synonyms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.synonyms: array expected"); - message.synonyms = []; - for (var i = 0; i < object.synonyms.length; ++i) - message.synonyms[i] = String(object.synonyms[i]); - } - return message; - }; + /** + * Creates a plain object from a MerchantCenterLinkingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig + * @static + * @param {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} message MerchantCenterLinkingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MerchantCenterLinkingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.links = []; + if (message.links && message.links.length) { + object.links = []; + for (var j = 0; j < message.links.length; ++j) + object.links[j] = $root.google.cloud.retail.v2alpha.MerchantCenterLink.toObject(message.links[j], options); + } + return object; + }; - /** - * Creates a plain object from a TwowaySynonymsAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} message TwowaySynonymsAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TwowaySynonymsAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.synonyms = []; - if (message.synonyms && message.synonyms.length) { - object.synonyms = []; - for (var j = 0; j < message.synonyms.length; ++j) - object.synonyms[j] = message.synonyms[j]; - } - return object; - }; + /** + * Converts this MerchantCenterLinkingConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig + * @instance + * @returns {Object.} JSON object + */ + MerchantCenterLinkingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this TwowaySynonymsAction to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @instance - * @returns {Object.} JSON object - */ - TwowaySynonymsAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return MerchantCenterLinkingConfig; + })(); - return TwowaySynonymsAction; - })(); + v2alpha.Catalog = (function() { - Rule.OnewaySynonymsAction = (function() { + /** + * Properties of a Catalog. + * @memberof google.cloud.retail.v2alpha + * @interface ICatalog + * @property {string|null} [name] Catalog name + * @property {string|null} [displayName] Catalog displayName + * @property {google.cloud.retail.v2alpha.IProductLevelConfig|null} [productLevelConfig] Catalog productLevelConfig + * @property {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig|null} [merchantCenterLinkingConfig] Catalog merchantCenterLinkingConfig + */ - /** - * Properties of an OnewaySynonymsAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @interface IOnewaySynonymsAction - * @property {Array.|null} [queryTerms] OnewaySynonymsAction queryTerms - * @property {Array.|null} [synonyms] OnewaySynonymsAction synonyms - * @property {Array.|null} [onewayTerms] OnewaySynonymsAction onewayTerms - */ + /** + * Constructs a new Catalog. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a Catalog. + * @implements ICatalog + * @constructor + * @param {google.cloud.retail.v2alpha.ICatalog=} [properties] Properties to set + */ + function Catalog(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]]; + } - /** - * Constructs a new OnewaySynonymsAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @classdesc Represents an OnewaySynonymsAction. - * @implements IOnewaySynonymsAction - * @constructor - * @param {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction=} [properties] Properties to set - */ - function OnewaySynonymsAction(properties) { - this.queryTerms = []; - this.synonyms = []; - this.onewayTerms = []; - 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]]; - } + /** + * Catalog name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.Catalog + * @instance + */ + Catalog.prototype.name = ""; - /** - * OnewaySynonymsAction queryTerms. - * @member {Array.} queryTerms - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction - * @instance - */ - OnewaySynonymsAction.prototype.queryTerms = $util.emptyArray; + /** + * Catalog displayName. + * @member {string} displayName + * @memberof google.cloud.retail.v2alpha.Catalog + * @instance + */ + Catalog.prototype.displayName = ""; - /** - * OnewaySynonymsAction synonyms. - * @member {Array.} synonyms - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction - * @instance - */ - OnewaySynonymsAction.prototype.synonyms = $util.emptyArray; + /** + * Catalog productLevelConfig. + * @member {google.cloud.retail.v2alpha.IProductLevelConfig|null|undefined} productLevelConfig + * @memberof google.cloud.retail.v2alpha.Catalog + * @instance + */ + Catalog.prototype.productLevelConfig = null; - /** - * OnewaySynonymsAction onewayTerms. - * @member {Array.} onewayTerms - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction - * @instance - */ - OnewaySynonymsAction.prototype.onewayTerms = $util.emptyArray; + /** + * Catalog merchantCenterLinkingConfig. + * @member {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig|null|undefined} merchantCenterLinkingConfig + * @memberof google.cloud.retail.v2alpha.Catalog + * @instance + */ + Catalog.prototype.merchantCenterLinkingConfig = null; - /** - * Creates a new OnewaySynonymsAction instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} OnewaySynonymsAction instance - */ - OnewaySynonymsAction.create = function create(properties) { - return new OnewaySynonymsAction(properties); - }; + /** + * Creates a new Catalog instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Catalog + * @static + * @param {google.cloud.retail.v2alpha.ICatalog=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Catalog} Catalog instance + */ + Catalog.create = function create(properties) { + return new Catalog(properties); + }; - /** - * Encodes the specified OnewaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction} message OnewaySynonymsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OnewaySynonymsAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.onewayTerms != null && message.onewayTerms.length) - for (var i = 0; i < message.onewayTerms.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.onewayTerms[i]); - if (message.queryTerms != null && message.queryTerms.length) - for (var i = 0; i < message.queryTerms.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.queryTerms[i]); - if (message.synonyms != null && message.synonyms.length) - for (var i = 0; i < message.synonyms.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.synonyms[i]); - return writer; - }; + /** + * Encodes the specified Catalog message. Does not implicitly {@link google.cloud.retail.v2alpha.Catalog.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Catalog + * @static + * @param {google.cloud.retail.v2alpha.ICatalog} message Catalog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Catalog.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.productLevelConfig != null && Object.hasOwnProperty.call(message, "productLevelConfig")) + $root.google.cloud.retail.v2alpha.ProductLevelConfig.encode(message.productLevelConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.merchantCenterLinkingConfig != null && Object.hasOwnProperty.call(message, "merchantCenterLinkingConfig")) + $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.encode(message.merchantCenterLinkingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified OnewaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction} message OnewaySynonymsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OnewaySynonymsAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Catalog message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Catalog.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Catalog + * @static + * @param {google.cloud.retail.v2alpha.ICatalog} message Catalog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Catalog.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an OnewaySynonymsAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction - * @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.Rule.OnewaySynonymsAction} OnewaySynonymsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OnewaySynonymsAction.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.Rule.OnewaySynonymsAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: - if (!(message.queryTerms && message.queryTerms.length)) - message.queryTerms = []; - message.queryTerms.push(reader.string()); - break; - case 4: - if (!(message.synonyms && message.synonyms.length)) - message.synonyms = []; - message.synonyms.push(reader.string()); - break; - case 2: - if (!(message.onewayTerms && message.onewayTerms.length)) - message.onewayTerms = []; - message.onewayTerms.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a Catalog message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Catalog + * @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.Catalog} Catalog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Catalog.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.Catalog(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 4: + message.productLevelConfig = $root.google.cloud.retail.v2alpha.ProductLevelConfig.decode(reader, reader.uint32()); + break; + case 6: + message.merchantCenterLinkingConfig = $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes an OnewaySynonymsAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} OnewaySynonymsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OnewaySynonymsAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies an OnewaySynonymsAction message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OnewaySynonymsAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { - if (!Array.isArray(message.queryTerms)) - return "queryTerms: array expected"; - for (var i = 0; i < message.queryTerms.length; ++i) - if (!$util.isString(message.queryTerms[i])) - return "queryTerms: string[] expected"; - } - if (message.synonyms != null && message.hasOwnProperty("synonyms")) { - if (!Array.isArray(message.synonyms)) - return "synonyms: array expected"; - for (var i = 0; i < message.synonyms.length; ++i) - if (!$util.isString(message.synonyms[i])) - return "synonyms: string[] expected"; - } - if (message.onewayTerms != null && message.hasOwnProperty("onewayTerms")) { - if (!Array.isArray(message.onewayTerms)) - return "onewayTerms: array expected"; - for (var i = 0; i < message.onewayTerms.length; ++i) - if (!$util.isString(message.onewayTerms[i])) - return "onewayTerms: string[] expected"; - } - return null; - }; + /** + * Decodes a Catalog message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Catalog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Catalog} Catalog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Catalog.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates an OnewaySynonymsAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} OnewaySynonymsAction - */ - OnewaySynonymsAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) - return object; - var message = new $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction(); - if (object.queryTerms) { - if (!Array.isArray(object.queryTerms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.queryTerms: array expected"); - message.queryTerms = []; - for (var i = 0; i < object.queryTerms.length; ++i) - message.queryTerms[i] = String(object.queryTerms[i]); - } - if (object.synonyms) { - if (!Array.isArray(object.synonyms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.synonyms: array expected"); - message.synonyms = []; - for (var i = 0; i < object.synonyms.length; ++i) - message.synonyms[i] = String(object.synonyms[i]); - } - if (object.onewayTerms) { - if (!Array.isArray(object.onewayTerms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.onewayTerms: array expected"); - message.onewayTerms = []; - for (var i = 0; i < object.onewayTerms.length; ++i) - message.onewayTerms[i] = String(object.onewayTerms[i]); - } - return message; - }; + /** + * Verifies a Catalog message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Catalog + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Catalog.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.productLevelConfig != null && message.hasOwnProperty("productLevelConfig")) { + var error = $root.google.cloud.retail.v2alpha.ProductLevelConfig.verify(message.productLevelConfig); + if (error) + return "productLevelConfig." + error; + } + if (message.merchantCenterLinkingConfig != null && message.hasOwnProperty("merchantCenterLinkingConfig")) { + var error = $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.verify(message.merchantCenterLinkingConfig); + if (error) + return "merchantCenterLinkingConfig." + error; + } + return null; + }; - /** - * Creates a plain object from an OnewaySynonymsAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} message OnewaySynonymsAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OnewaySynonymsAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.onewayTerms = []; - object.queryTerms = []; - object.synonyms = []; - } - if (message.onewayTerms && message.onewayTerms.length) { - object.onewayTerms = []; - for (var j = 0; j < message.onewayTerms.length; ++j) - object.onewayTerms[j] = message.onewayTerms[j]; - } - if (message.queryTerms && message.queryTerms.length) { - object.queryTerms = []; - for (var j = 0; j < message.queryTerms.length; ++j) - object.queryTerms[j] = message.queryTerms[j]; - } - if (message.synonyms && message.synonyms.length) { - object.synonyms = []; - for (var j = 0; j < message.synonyms.length; ++j) - object.synonyms[j] = message.synonyms[j]; - } + /** + * Creates a Catalog message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Catalog + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Catalog} Catalog + */ + Catalog.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Catalog) return object; - }; + var message = new $root.google.cloud.retail.v2alpha.Catalog(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.productLevelConfig != null) { + if (typeof object.productLevelConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Catalog.productLevelConfig: object expected"); + message.productLevelConfig = $root.google.cloud.retail.v2alpha.ProductLevelConfig.fromObject(object.productLevelConfig); + } + if (object.merchantCenterLinkingConfig != null) { + if (typeof object.merchantCenterLinkingConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Catalog.merchantCenterLinkingConfig: object expected"); + message.merchantCenterLinkingConfig = $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.fromObject(object.merchantCenterLinkingConfig); + } + return message; + }; - /** - * Converts this OnewaySynonymsAction to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction - * @instance - * @returns {Object.} JSON object - */ - OnewaySynonymsAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a Catalog message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Catalog + * @static + * @param {google.cloud.retail.v2alpha.Catalog} message Catalog + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Catalog.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.productLevelConfig = null; + object.merchantCenterLinkingConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.productLevelConfig != null && message.hasOwnProperty("productLevelConfig")) + object.productLevelConfig = $root.google.cloud.retail.v2alpha.ProductLevelConfig.toObject(message.productLevelConfig, options); + if (message.merchantCenterLinkingConfig != null && message.hasOwnProperty("merchantCenterLinkingConfig")) + object.merchantCenterLinkingConfig = $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.toObject(message.merchantCenterLinkingConfig, options); + return object; + }; - return OnewaySynonymsAction; - })(); + /** + * Converts this Catalog to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Catalog + * @instance + * @returns {Object.} JSON object + */ + Catalog.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - Rule.DoNotAssociateAction = (function() { + return Catalog; + })(); - /** - * Properties of a DoNotAssociateAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @interface IDoNotAssociateAction - * @property {Array.|null} [queryTerms] DoNotAssociateAction queryTerms - * @property {Array.|null} [doNotAssociateTerms] DoNotAssociateAction doNotAssociateTerms - * @property {Array.|null} [terms] DoNotAssociateAction terms - */ + /** + * SolutionType enum. + * @name google.cloud.retail.v2alpha.SolutionType + * @enum {number} + * @property {number} SOLUTION_TYPE_UNSPECIFIED=0 SOLUTION_TYPE_UNSPECIFIED value + * @property {number} SOLUTION_TYPE_RECOMMENDATION=1 SOLUTION_TYPE_RECOMMENDATION value + * @property {number} SOLUTION_TYPE_SEARCH=2 SOLUTION_TYPE_SEARCH value + */ + v2alpha.SolutionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SOLUTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SOLUTION_TYPE_RECOMMENDATION"] = 1; + values[valuesById[2] = "SOLUTION_TYPE_SEARCH"] = 2; + return values; + })(); - /** - * Constructs a new DoNotAssociateAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @classdesc Represents a DoNotAssociateAction. - * @implements IDoNotAssociateAction - * @constructor - * @param {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction=} [properties] Properties to set - */ - function DoNotAssociateAction(properties) { - this.queryTerms = []; - this.doNotAssociateTerms = []; - this.terms = []; - 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]]; - } + v2alpha.Condition = (function() { - /** - * DoNotAssociateAction queryTerms. - * @member {Array.} queryTerms - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @instance - */ - DoNotAssociateAction.prototype.queryTerms = $util.emptyArray; + /** + * Properties of a Condition. + * @memberof google.cloud.retail.v2alpha + * @interface ICondition + * @property {Array.|null} [queryTerms] Condition queryTerms + * @property {Array.|null} [activeTimeRange] Condition activeTimeRange + */ - /** - * DoNotAssociateAction doNotAssociateTerms. - * @member {Array.} doNotAssociateTerms - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @instance - */ - DoNotAssociateAction.prototype.doNotAssociateTerms = $util.emptyArray; + /** + * Constructs a new Condition. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a Condition. + * @implements ICondition + * @constructor + * @param {google.cloud.retail.v2alpha.ICondition=} [properties] Properties to set + */ + function Condition(properties) { + this.queryTerms = []; + this.activeTimeRange = []; + 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]]; + } - /** - * DoNotAssociateAction terms. - * @member {Array.} terms - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @instance - */ - DoNotAssociateAction.prototype.terms = $util.emptyArray; + /** + * Condition queryTerms. + * @member {Array.} queryTerms + * @memberof google.cloud.retail.v2alpha.Condition + * @instance + */ + Condition.prototype.queryTerms = $util.emptyArray; - /** - * Creates a new DoNotAssociateAction instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} DoNotAssociateAction instance - */ - DoNotAssociateAction.create = function create(properties) { - return new DoNotAssociateAction(properties); - }; + /** + * Condition activeTimeRange. + * @member {Array.} activeTimeRange + * @memberof google.cloud.retail.v2alpha.Condition + * @instance + */ + Condition.prototype.activeTimeRange = $util.emptyArray; - /** - * Encodes the specified DoNotAssociateAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction} message DoNotAssociateAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoNotAssociateAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.terms != null && message.terms.length) - for (var i = 0; i < message.terms.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.terms[i]); - if (message.queryTerms != null && message.queryTerms.length) - for (var i = 0; i < message.queryTerms.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.queryTerms[i]); - if (message.doNotAssociateTerms != null && message.doNotAssociateTerms.length) - for (var i = 0; i < message.doNotAssociateTerms.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.doNotAssociateTerms[i]); + /** + * Creates a new Condition instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Condition + * @static + * @param {google.cloud.retail.v2alpha.ICondition=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Condition} Condition instance + */ + Condition.create = function create(properties) { + return new Condition(properties); + }; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Condition + * @static + * @param {google.cloud.retail.v2alpha.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryTerms != null && message.queryTerms.length) + for (var i = 0; i < message.queryTerms.length; ++i) + $root.google.cloud.retail.v2alpha.Condition.QueryTerm.encode(message.queryTerms[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.activeTimeRange != null && message.activeTimeRange.length) + for (var i = 0; i < message.activeTimeRange.length; ++i) + $root.google.cloud.retail.v2alpha.Condition.TimeRange.encode(message.activeTimeRange[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Condition + * @static + * @param {google.cloud.retail.v2alpha.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Condition + * @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.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.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.Condition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.queryTerms && message.queryTerms.length)) + message.queryTerms = []; + message.queryTerms.push($root.google.cloud.retail.v2alpha.Condition.QueryTerm.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.activeTimeRange && message.activeTimeRange.length)) + message.activeTimeRange = []; + message.activeTimeRange.push($root.google.cloud.retail.v2alpha.Condition.TimeRange.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Condition message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Condition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Condition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { + if (!Array.isArray(message.queryTerms)) + return "queryTerms: array expected"; + for (var i = 0; i < message.queryTerms.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Condition.QueryTerm.verify(message.queryTerms[i]); + if (error) + return "queryTerms." + error; + } + } + if (message.activeTimeRange != null && message.hasOwnProperty("activeTimeRange")) { + if (!Array.isArray(message.activeTimeRange)) + return "activeTimeRange: array expected"; + for (var i = 0; i < message.activeTimeRange.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Condition.TimeRange.verify(message.activeTimeRange[i]); + if (error) + return "activeTimeRange." + error; + } + } + return null; + }; + + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Condition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Condition} Condition + */ + Condition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Condition) + return object; + var message = new $root.google.cloud.retail.v2alpha.Condition(); + if (object.queryTerms) { + if (!Array.isArray(object.queryTerms)) + throw TypeError(".google.cloud.retail.v2alpha.Condition.queryTerms: array expected"); + message.queryTerms = []; + for (var i = 0; i < object.queryTerms.length; ++i) { + if (typeof object.queryTerms[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Condition.queryTerms: object expected"); + message.queryTerms[i] = $root.google.cloud.retail.v2alpha.Condition.QueryTerm.fromObject(object.queryTerms[i]); + } + } + if (object.activeTimeRange) { + if (!Array.isArray(object.activeTimeRange)) + throw TypeError(".google.cloud.retail.v2alpha.Condition.activeTimeRange: array expected"); + message.activeTimeRange = []; + for (var i = 0; i < object.activeTimeRange.length; ++i) { + if (typeof object.activeTimeRange[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Condition.activeTimeRange: object expected"); + message.activeTimeRange[i] = $root.google.cloud.retail.v2alpha.Condition.TimeRange.fromObject(object.activeTimeRange[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Condition + * @static + * @param {google.cloud.retail.v2alpha.Condition} message Condition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Condition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.queryTerms = []; + object.activeTimeRange = []; + } + if (message.queryTerms && message.queryTerms.length) { + object.queryTerms = []; + for (var j = 0; j < message.queryTerms.length; ++j) + object.queryTerms[j] = $root.google.cloud.retail.v2alpha.Condition.QueryTerm.toObject(message.queryTerms[j], options); + } + if (message.activeTimeRange && message.activeTimeRange.length) { + object.activeTimeRange = []; + for (var j = 0; j < message.activeTimeRange.length; ++j) + object.activeTimeRange[j] = $root.google.cloud.retail.v2alpha.Condition.TimeRange.toObject(message.activeTimeRange[j], options); + } + return object; + }; + + /** + * Converts this Condition to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Condition + * @instance + * @returns {Object.} JSON object + */ + Condition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Condition.QueryTerm = (function() { + + /** + * Properties of a QueryTerm. + * @memberof google.cloud.retail.v2alpha.Condition + * @interface IQueryTerm + * @property {string|null} [value] QueryTerm value + * @property {boolean|null} [fullMatch] QueryTerm fullMatch + */ + + /** + * Constructs a new QueryTerm. + * @memberof google.cloud.retail.v2alpha.Condition + * @classdesc Represents a QueryTerm. + * @implements IQueryTerm + * @constructor + * @param {google.cloud.retail.v2alpha.Condition.IQueryTerm=} [properties] Properties to set + */ + function QueryTerm(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]]; + } + + /** + * QueryTerm value. + * @member {string} value + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @instance + */ + QueryTerm.prototype.value = ""; + + /** + * QueryTerm fullMatch. + * @member {boolean} fullMatch + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @instance + */ + QueryTerm.prototype.fullMatch = false; + + /** + * Creates a new QueryTerm instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @static + * @param {google.cloud.retail.v2alpha.Condition.IQueryTerm=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Condition.QueryTerm} QueryTerm instance + */ + QueryTerm.create = function create(properties) { + return new QueryTerm(properties); + }; + + /** + * Encodes the specified QueryTerm message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.QueryTerm.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @static + * @param {google.cloud.retail.v2alpha.Condition.IQueryTerm} message QueryTerm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryTerm.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.fullMatch != null && Object.hasOwnProperty.call(message, "fullMatch")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullMatch); return writer; }; /** - * Encodes the specified DoNotAssociateAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify|verify} messages. + * Encodes the specified QueryTerm message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.QueryTerm.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm * @static - * @param {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction} message DoNotAssociateAction message or plain object to encode + * @param {google.cloud.retail.v2alpha.Condition.IQueryTerm} message QueryTerm message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DoNotAssociateAction.encodeDelimited = function encodeDelimited(message, writer) { + QueryTerm.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DoNotAssociateAction message from the specified reader or buffer. + * Decodes a QueryTerm message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm * @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.Rule.DoNotAssociateAction} DoNotAssociateAction + * @returns {google.cloud.retail.v2alpha.Condition.QueryTerm} QueryTerm * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DoNotAssociateAction.decode = function decode(reader, length) { + QueryTerm.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.Rule.DoNotAssociateAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Condition.QueryTerm(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - if (!(message.queryTerms && message.queryTerms.length)) - message.queryTerms = []; - message.queryTerms.push(reader.string()); - break; - case 3: - if (!(message.doNotAssociateTerms && message.doNotAssociateTerms.length)) - message.doNotAssociateTerms = []; - message.doNotAssociateTerms.push(reader.string()); - break; case 1: - if (!(message.terms && message.terms.length)) - message.terms = []; - message.terms.push(reader.string()); + message.value = reader.string(); + break; + case 2: + message.fullMatch = reader.bool(); break; default: reader.skipType(tag & 7); @@ -26453,163 +26454,117 @@ }; /** - * Decodes a DoNotAssociateAction message from the specified reader or buffer, length delimited. + * Decodes a QueryTerm message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} DoNotAssociateAction + * @returns {google.cloud.retail.v2alpha.Condition.QueryTerm} QueryTerm * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DoNotAssociateAction.decodeDelimited = function decodeDelimited(reader) { + QueryTerm.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DoNotAssociateAction message. + * Verifies a QueryTerm message. * @function verify - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DoNotAssociateAction.verify = function verify(message) { + QueryTerm.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { - if (!Array.isArray(message.queryTerms)) - return "queryTerms: array expected"; - for (var i = 0; i < message.queryTerms.length; ++i) - if (!$util.isString(message.queryTerms[i])) - return "queryTerms: string[] expected"; - } - if (message.doNotAssociateTerms != null && message.hasOwnProperty("doNotAssociateTerms")) { - if (!Array.isArray(message.doNotAssociateTerms)) - return "doNotAssociateTerms: array expected"; - for (var i = 0; i < message.doNotAssociateTerms.length; ++i) - if (!$util.isString(message.doNotAssociateTerms[i])) - return "doNotAssociateTerms: string[] expected"; - } - if (message.terms != null && message.hasOwnProperty("terms")) { - if (!Array.isArray(message.terms)) - return "terms: array expected"; - for (var i = 0; i < message.terms.length; ++i) - if (!$util.isString(message.terms[i])) - return "terms: string[] expected"; - } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.fullMatch != null && message.hasOwnProperty("fullMatch")) + if (typeof message.fullMatch !== "boolean") + return "fullMatch: boolean expected"; return null; }; /** - * Creates a DoNotAssociateAction message from a plain object. Also converts values to their respective internal types. + * Creates a QueryTerm message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} DoNotAssociateAction + * @returns {google.cloud.retail.v2alpha.Condition.QueryTerm} QueryTerm */ - DoNotAssociateAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) + QueryTerm.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Condition.QueryTerm) return object; - var message = new $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction(); - if (object.queryTerms) { - if (!Array.isArray(object.queryTerms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.queryTerms: array expected"); - message.queryTerms = []; - for (var i = 0; i < object.queryTerms.length; ++i) - message.queryTerms[i] = String(object.queryTerms[i]); - } - if (object.doNotAssociateTerms) { - if (!Array.isArray(object.doNotAssociateTerms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.doNotAssociateTerms: array expected"); - message.doNotAssociateTerms = []; - for (var i = 0; i < object.doNotAssociateTerms.length; ++i) - message.doNotAssociateTerms[i] = String(object.doNotAssociateTerms[i]); - } - if (object.terms) { - if (!Array.isArray(object.terms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.terms: array expected"); - message.terms = []; - for (var i = 0; i < object.terms.length; ++i) - message.terms[i] = String(object.terms[i]); - } + var message = new $root.google.cloud.retail.v2alpha.Condition.QueryTerm(); + if (object.value != null) + message.value = String(object.value); + if (object.fullMatch != null) + message.fullMatch = Boolean(object.fullMatch); return message; }; /** - * Creates a plain object from a DoNotAssociateAction message. Also converts values to other types if specified. + * Creates a plain object from a QueryTerm message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm * @static - * @param {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} message DoNotAssociateAction + * @param {google.cloud.retail.v2alpha.Condition.QueryTerm} message QueryTerm * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DoNotAssociateAction.toObject = function toObject(message, options) { + QueryTerm.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.terms = []; - object.queryTerms = []; - object.doNotAssociateTerms = []; - } - if (message.terms && message.terms.length) { - object.terms = []; - for (var j = 0; j < message.terms.length; ++j) - object.terms[j] = message.terms[j]; - } - if (message.queryTerms && message.queryTerms.length) { - object.queryTerms = []; - for (var j = 0; j < message.queryTerms.length; ++j) - object.queryTerms[j] = message.queryTerms[j]; - } - if (message.doNotAssociateTerms && message.doNotAssociateTerms.length) { - object.doNotAssociateTerms = []; - for (var j = 0; j < message.doNotAssociateTerms.length; ++j) - object.doNotAssociateTerms[j] = message.doNotAssociateTerms[j]; + if (options.defaults) { + object.value = ""; + object.fullMatch = false; } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.fullMatch != null && message.hasOwnProperty("fullMatch")) + object.fullMatch = message.fullMatch; return object; }; /** - * Converts this DoNotAssociateAction to JSON. + * Converts this QueryTerm to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm * @instance * @returns {Object.} JSON object */ - DoNotAssociateAction.prototype.toJSON = function toJSON() { + QueryTerm.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DoNotAssociateAction; + return QueryTerm; })(); - Rule.ReplacementAction = (function() { + Condition.TimeRange = (function() { /** - * Properties of a ReplacementAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @interface IReplacementAction - * @property {Array.|null} [queryTerms] ReplacementAction queryTerms - * @property {string|null} [replacementTerm] ReplacementAction replacementTerm - * @property {string|null} [term] ReplacementAction term + * Properties of a TimeRange. + * @memberof google.cloud.retail.v2alpha.Condition + * @interface ITimeRange + * @property {google.protobuf.ITimestamp|null} [startTime] TimeRange startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeRange endTime */ /** - * Constructs a new ReplacementAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @classdesc Represents a ReplacementAction. - * @implements IReplacementAction + * Constructs a new TimeRange. + * @memberof google.cloud.retail.v2alpha.Condition + * @classdesc Represents a TimeRange. + * @implements ITimeRange * @constructor - * @param {google.cloud.retail.v2alpha.Rule.IReplacementAction=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.Condition.ITimeRange=} [properties] Properties to set */ - function ReplacementAction(properties) { - this.queryTerms = []; + function TimeRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -26617,325 +26572,88 @@ } /** - * ReplacementAction queryTerms. - * @member {Array.} queryTerms - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @instance - */ - ReplacementAction.prototype.queryTerms = $util.emptyArray; - - /** - * ReplacementAction replacementTerm. - * @member {string} replacementTerm - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * TimeRange startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange * @instance */ - ReplacementAction.prototype.replacementTerm = ""; + TimeRange.prototype.startTime = null; /** - * ReplacementAction term. - * @member {string} term - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * TimeRange endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange * @instance */ - ReplacementAction.prototype.term = ""; + TimeRange.prototype.endTime = null; /** - * Creates a new ReplacementAction instance using the specified properties. + * Creates a new TimeRange instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange * @static - * @param {google.cloud.retail.v2alpha.Rule.IReplacementAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule.ReplacementAction} ReplacementAction instance + * @param {google.cloud.retail.v2alpha.Condition.ITimeRange=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Condition.TimeRange} TimeRange instance */ - ReplacementAction.create = function create(properties) { - return new ReplacementAction(properties); + TimeRange.create = function create(properties) { + return new TimeRange(properties); }; /** - * Encodes the specified ReplacementAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ReplacementAction.verify|verify} messages. + * Encodes the specified TimeRange message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.TimeRange.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange * @static - * @param {google.cloud.retail.v2alpha.Rule.IReplacementAction} message ReplacementAction message or plain object to encode + * @param {google.cloud.retail.v2alpha.Condition.ITimeRange} message TimeRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReplacementAction.encode = function encode(message, writer) { + TimeRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.term != null && Object.hasOwnProperty.call(message, "term")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.term); - if (message.queryTerms != null && message.queryTerms.length) - for (var i = 0; i < message.queryTerms.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.queryTerms[i]); - if (message.replacementTerm != null && Object.hasOwnProperty.call(message, "replacementTerm")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.replacementTerm); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ReplacementAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ReplacementAction.verify|verify} messages. + * Encodes the specified TimeRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.TimeRange.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange * @static - * @param {google.cloud.retail.v2alpha.Rule.IReplacementAction} message ReplacementAction message or plain object to encode + * @param {google.cloud.retail.v2alpha.Condition.ITimeRange} message TimeRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReplacementAction.encodeDelimited = function encodeDelimited(message, writer) { + TimeRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReplacementAction message from the specified reader or buffer. + * Decodes a TimeRange message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange * @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.Rule.ReplacementAction} ReplacementAction + * @returns {google.cloud.retail.v2alpha.Condition.TimeRange} TimeRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReplacementAction.decode = function decode(reader, length) { + TimeRange.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.Rule.ReplacementAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Condition.TimeRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - if (!(message.queryTerms && message.queryTerms.length)) - message.queryTerms = []; - message.queryTerms.push(reader.string()); - break; - case 3: - message.replacementTerm = reader.string(); - break; case 1: - message.term = reader.string(); - break; - default: - reader.skipType(tag & 7); + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; - } - } - return message; - }; - - /** - * Decodes a ReplacementAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule.ReplacementAction} ReplacementAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplacementAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReplacementAction message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReplacementAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { - if (!Array.isArray(message.queryTerms)) - return "queryTerms: array expected"; - for (var i = 0; i < message.queryTerms.length; ++i) - if (!$util.isString(message.queryTerms[i])) - return "queryTerms: string[] expected"; - } - if (message.replacementTerm != null && message.hasOwnProperty("replacementTerm")) - if (!$util.isString(message.replacementTerm)) - return "replacementTerm: string expected"; - if (message.term != null && message.hasOwnProperty("term")) - if (!$util.isString(message.term)) - return "term: string expected"; - return null; - }; - - /** - * Creates a ReplacementAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule.ReplacementAction} ReplacementAction - */ - ReplacementAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule.ReplacementAction) - return object; - var message = new $root.google.cloud.retail.v2alpha.Rule.ReplacementAction(); - if (object.queryTerms) { - if (!Array.isArray(object.queryTerms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.ReplacementAction.queryTerms: array expected"); - message.queryTerms = []; - for (var i = 0; i < object.queryTerms.length; ++i) - message.queryTerms[i] = String(object.queryTerms[i]); - } - if (object.replacementTerm != null) - message.replacementTerm = String(object.replacementTerm); - if (object.term != null) - message.term = String(object.term); - return message; - }; - - /** - * Creates a plain object from a ReplacementAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.ReplacementAction} message ReplacementAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReplacementAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.queryTerms = []; - if (options.defaults) { - object.term = ""; - object.replacementTerm = ""; - } - if (message.term != null && message.hasOwnProperty("term")) - object.term = message.term; - if (message.queryTerms && message.queryTerms.length) { - object.queryTerms = []; - for (var j = 0; j < message.queryTerms.length; ++j) - object.queryTerms[j] = message.queryTerms[j]; - } - if (message.replacementTerm != null && message.hasOwnProperty("replacementTerm")) - object.replacementTerm = message.replacementTerm; - return object; - }; - - /** - * Converts this ReplacementAction to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @instance - * @returns {Object.} JSON object - */ - ReplacementAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ReplacementAction; - })(); - - Rule.IgnoreAction = (function() { - - /** - * Properties of an IgnoreAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @interface IIgnoreAction - * @property {Array.|null} [ignoreTerms] IgnoreAction ignoreTerms - */ - - /** - * Constructs a new IgnoreAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @classdesc Represents an IgnoreAction. - * @implements IIgnoreAction - * @constructor - * @param {google.cloud.retail.v2alpha.Rule.IIgnoreAction=} [properties] Properties to set - */ - function IgnoreAction(properties) { - this.ignoreTerms = []; - 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]]; - } - - /** - * IgnoreAction ignoreTerms. - * @member {Array.} ignoreTerms - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction - * @instance - */ - IgnoreAction.prototype.ignoreTerms = $util.emptyArray; - - /** - * Creates a new IgnoreAction instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IIgnoreAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule.IgnoreAction} IgnoreAction instance - */ - IgnoreAction.create = function create(properties) { - return new IgnoreAction(properties); - }; - - /** - * Encodes the specified IgnoreAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.IgnoreAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IIgnoreAction} message IgnoreAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IgnoreAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ignoreTerms != null && message.ignoreTerms.length) - for (var i = 0; i < message.ignoreTerms.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ignoreTerms[i]); - return writer; - }; - - /** - * Encodes the specified IgnoreAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.IgnoreAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IIgnoreAction} message IgnoreAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IgnoreAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IgnoreAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction - * @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.Rule.IgnoreAction} IgnoreAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IgnoreAction.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.Rule.IgnoreAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.ignoreTerms && message.ignoreTerms.length)) - message.ignoreTerms = []; - message.ignoreTerms.push(reader.string()); + case 2: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -26946,125 +26664,137 @@ }; /** - * Decodes an IgnoreAction message from the specified reader or buffer, length delimited. + * Decodes a TimeRange message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule.IgnoreAction} IgnoreAction + * @returns {google.cloud.retail.v2alpha.Condition.TimeRange} TimeRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IgnoreAction.decodeDelimited = function decodeDelimited(reader) { + TimeRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an IgnoreAction message. + * Verifies a TimeRange message. * @function verify - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - IgnoreAction.verify = function verify(message) { + TimeRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.ignoreTerms != null && message.hasOwnProperty("ignoreTerms")) { - if (!Array.isArray(message.ignoreTerms)) - return "ignoreTerms: array expected"; - for (var i = 0; i < message.ignoreTerms.length; ++i) - if (!$util.isString(message.ignoreTerms[i])) - return "ignoreTerms: string[] expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; } return null; }; /** - * Creates an IgnoreAction message from a plain object. Also converts values to their respective internal types. + * Creates a TimeRange message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule.IgnoreAction} IgnoreAction + * @returns {google.cloud.retail.v2alpha.Condition.TimeRange} TimeRange */ - IgnoreAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule.IgnoreAction) + TimeRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Condition.TimeRange) return object; - var message = new $root.google.cloud.retail.v2alpha.Rule.IgnoreAction(); - if (object.ignoreTerms) { - if (!Array.isArray(object.ignoreTerms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.IgnoreAction.ignoreTerms: array expected"); - message.ignoreTerms = []; - for (var i = 0; i < object.ignoreTerms.length; ++i) - message.ignoreTerms[i] = String(object.ignoreTerms[i]); + var message = new $root.google.cloud.retail.v2alpha.Condition.TimeRange(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Condition.TimeRange.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Condition.TimeRange.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); } return message; }; /** - * Creates a plain object from an IgnoreAction message. Also converts values to other types if specified. + * Creates a plain object from a TimeRange message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange * @static - * @param {google.cloud.retail.v2alpha.Rule.IgnoreAction} message IgnoreAction + * @param {google.cloud.retail.v2alpha.Condition.TimeRange} message TimeRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IgnoreAction.toObject = function toObject(message, options) { + TimeRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.ignoreTerms = []; - if (message.ignoreTerms && message.ignoreTerms.length) { - object.ignoreTerms = []; - for (var j = 0; j < message.ignoreTerms.length; ++j) - object.ignoreTerms[j] = message.ignoreTerms[j]; + if (options.defaults) { + object.startTime = null; + object.endTime = null; } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); return object; }; /** - * Converts this IgnoreAction to JSON. + * Converts this TimeRange to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange * @instance * @returns {Object.} JSON object */ - IgnoreAction.prototype.toJSON = function toJSON() { + TimeRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return IgnoreAction; + return TimeRange; })(); - return Rule; + return Condition; })(); - v2alpha.Audience = (function() { + v2alpha.Rule = (function() { /** - * Properties of an Audience. + * Properties of a Rule. * @memberof google.cloud.retail.v2alpha - * @interface IAudience - * @property {Array.|null} [genders] Audience genders - * @property {Array.|null} [ageGroups] Audience ageGroups + * @interface IRule + * @property {google.cloud.retail.v2alpha.Rule.IBoostAction|null} [boostAction] Rule boostAction + * @property {google.cloud.retail.v2alpha.Rule.IRedirectAction|null} [redirectAction] Rule redirectAction + * @property {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction|null} [onewaySynonymsAction] Rule onewaySynonymsAction + * @property {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction|null} [doNotAssociateAction] Rule doNotAssociateAction + * @property {google.cloud.retail.v2alpha.Rule.IReplacementAction|null} [replacementAction] Rule replacementAction + * @property {google.cloud.retail.v2alpha.Rule.IIgnoreAction|null} [ignoreAction] Rule ignoreAction + * @property {google.cloud.retail.v2alpha.Rule.IFilterAction|null} [filterAction] Rule filterAction + * @property {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction|null} [twowaySynonymsAction] Rule twowaySynonymsAction + * @property {google.cloud.retail.v2alpha.ICondition|null} [condition] Rule condition */ /** - * Constructs a new Audience. + * Constructs a new Rule. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an Audience. - * @implements IAudience + * @classdesc Represents a Rule. + * @implements IRule * @constructor - * @param {google.cloud.retail.v2alpha.IAudience=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IRule=} [properties] Properties to set */ - function Audience(properties) { - this.genders = []; - this.ageGroups = []; + function Rule(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -27072,94 +26802,193 @@ } /** - * Audience genders. - * @member {Array.} genders - * @memberof google.cloud.retail.v2alpha.Audience + * Rule boostAction. + * @member {google.cloud.retail.v2alpha.Rule.IBoostAction|null|undefined} boostAction + * @memberof google.cloud.retail.v2alpha.Rule * @instance */ - Audience.prototype.genders = $util.emptyArray; + Rule.prototype.boostAction = null; /** - * Audience ageGroups. - * @member {Array.} ageGroups - * @memberof google.cloud.retail.v2alpha.Audience + * Rule redirectAction. + * @member {google.cloud.retail.v2alpha.Rule.IRedirectAction|null|undefined} redirectAction + * @memberof google.cloud.retail.v2alpha.Rule * @instance */ - Audience.prototype.ageGroups = $util.emptyArray; + Rule.prototype.redirectAction = null; /** - * Creates a new Audience instance using the specified properties. + * Rule onewaySynonymsAction. + * @member {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction|null|undefined} onewaySynonymsAction + * @memberof google.cloud.retail.v2alpha.Rule + * @instance + */ + Rule.prototype.onewaySynonymsAction = null; + + /** + * Rule doNotAssociateAction. + * @member {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction|null|undefined} doNotAssociateAction + * @memberof google.cloud.retail.v2alpha.Rule + * @instance + */ + Rule.prototype.doNotAssociateAction = null; + + /** + * Rule replacementAction. + * @member {google.cloud.retail.v2alpha.Rule.IReplacementAction|null|undefined} replacementAction + * @memberof google.cloud.retail.v2alpha.Rule + * @instance + */ + Rule.prototype.replacementAction = null; + + /** + * Rule ignoreAction. + * @member {google.cloud.retail.v2alpha.Rule.IIgnoreAction|null|undefined} ignoreAction + * @memberof google.cloud.retail.v2alpha.Rule + * @instance + */ + Rule.prototype.ignoreAction = null; + + /** + * Rule filterAction. + * @member {google.cloud.retail.v2alpha.Rule.IFilterAction|null|undefined} filterAction + * @memberof google.cloud.retail.v2alpha.Rule + * @instance + */ + Rule.prototype.filterAction = null; + + /** + * Rule twowaySynonymsAction. + * @member {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction|null|undefined} twowaySynonymsAction + * @memberof google.cloud.retail.v2alpha.Rule + * @instance + */ + Rule.prototype.twowaySynonymsAction = null; + + /** + * Rule condition. + * @member {google.cloud.retail.v2alpha.ICondition|null|undefined} condition + * @memberof google.cloud.retail.v2alpha.Rule + * @instance + */ + Rule.prototype.condition = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Rule action. + * @member {"boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"|undefined} action + * @memberof google.cloud.retail.v2alpha.Rule + * @instance + */ + Object.defineProperty(Rule.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["boostAction", "redirectAction", "onewaySynonymsAction", "doNotAssociateAction", "replacementAction", "ignoreAction", "filterAction", "twowaySynonymsAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Rule instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.Audience + * @memberof google.cloud.retail.v2alpha.Rule * @static - * @param {google.cloud.retail.v2alpha.IAudience=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Audience} Audience instance + * @param {google.cloud.retail.v2alpha.IRule=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule} Rule instance */ - Audience.create = function create(properties) { - return new Audience(properties); + Rule.create = function create(properties) { + return new Rule(properties); }; /** - * Encodes the specified Audience message. Does not implicitly {@link google.cloud.retail.v2alpha.Audience.verify|verify} messages. + * Encodes the specified Rule message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.Audience + * @memberof google.cloud.retail.v2alpha.Rule * @static - * @param {google.cloud.retail.v2alpha.IAudience} message Audience message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRule} message Rule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Audience.encode = function encode(message, writer) { + Rule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.genders != null && message.genders.length) - for (var i = 0; i < message.genders.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.genders[i]); - if (message.ageGroups != null && message.ageGroups.length) - for (var i = 0; i < message.ageGroups.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ageGroups[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.cloud.retail.v2alpha.Condition.encode(message.condition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boostAction != null && Object.hasOwnProperty.call(message, "boostAction")) + $root.google.cloud.retail.v2alpha.Rule.BoostAction.encode(message.boostAction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.redirectAction != null && Object.hasOwnProperty.call(message, "redirectAction")) + $root.google.cloud.retail.v2alpha.Rule.RedirectAction.encode(message.redirectAction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.onewaySynonymsAction != null && Object.hasOwnProperty.call(message, "onewaySynonymsAction")) + $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.encode(message.onewaySynonymsAction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.doNotAssociateAction != null && Object.hasOwnProperty.call(message, "doNotAssociateAction")) + $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.encode(message.doNotAssociateAction, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.replacementAction != null && Object.hasOwnProperty.call(message, "replacementAction")) + $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.encode(message.replacementAction, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.ignoreAction != null && Object.hasOwnProperty.call(message, "ignoreAction")) + $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.encode(message.ignoreAction, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.filterAction != null && Object.hasOwnProperty.call(message, "filterAction")) + $root.google.cloud.retail.v2alpha.Rule.FilterAction.encode(message.filterAction, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.twowaySynonymsAction != null && Object.hasOwnProperty.call(message, "twowaySynonymsAction")) + $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.encode(message.twowaySynonymsAction, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; /** - * Encodes the specified Audience message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Audience.verify|verify} messages. + * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Audience + * @memberof google.cloud.retail.v2alpha.Rule * @static - * @param {google.cloud.retail.v2alpha.IAudience} message Audience message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRule} message Rule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Audience.encodeDelimited = function encodeDelimited(message, writer) { + Rule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Audience message from the specified reader or buffer. + * Decodes a Rule message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Audience + * @memberof google.cloud.retail.v2alpha.Rule * @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.Audience} Audience + * @returns {google.cloud.retail.v2alpha.Rule} Rule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Audience.decode = function decode(reader, length) { + Rule.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.Audience(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.genders && message.genders.length)) - message.genders = []; - message.genders.push(reader.string()); - break; case 2: - if (!(message.ageGroups && message.ageGroups.length)) - message.ageGroups = []; - message.ageGroups.push(reader.string()); + message.boostAction = $root.google.cloud.retail.v2alpha.Rule.BoostAction.decode(reader, reader.uint32()); + break; + case 3: + message.redirectAction = $root.google.cloud.retail.v2alpha.Rule.RedirectAction.decode(reader, reader.uint32()); + break; + case 6: + message.onewaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.decode(reader, reader.uint32()); + break; + case 7: + message.doNotAssociateAction = $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.decode(reader, reader.uint32()); + break; + case 8: + message.replacementAction = $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.decode(reader, reader.uint32()); + break; + case 9: + message.ignoreAction = $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.decode(reader, reader.uint32()); + break; + case 10: + message.filterAction = $root.google.cloud.retail.v2alpha.Rule.FilterAction.decode(reader, reader.uint32()); + break; + case 11: + message.twowaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.decode(reader, reader.uint32()); + break; + case 1: + message.condition = $root.google.cloud.retail.v2alpha.Condition.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -27170,1888 +26999,1451 @@ }; /** - * Decodes an Audience message from the specified reader or buffer, length delimited. + * Decodes a Rule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Audience + * @memberof google.cloud.retail.v2alpha.Rule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Audience} Audience + * @returns {google.cloud.retail.v2alpha.Rule} Rule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Audience.decodeDelimited = function decodeDelimited(reader) { + Rule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Audience message. + * Verifies a Rule message. * @function verify - * @memberof google.cloud.retail.v2alpha.Audience + * @memberof google.cloud.retail.v2alpha.Rule * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Audience.verify = function verify(message) { + Rule.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.genders != null && message.hasOwnProperty("genders")) { - if (!Array.isArray(message.genders)) - return "genders: array expected"; - for (var i = 0; i < message.genders.length; ++i) - if (!$util.isString(message.genders[i])) - return "genders: string[] expected"; + var properties = {}; + if (message.boostAction != null && message.hasOwnProperty("boostAction")) { + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.BoostAction.verify(message.boostAction); + if (error) + return "boostAction." + error; + } } - if (message.ageGroups != null && message.hasOwnProperty("ageGroups")) { - if (!Array.isArray(message.ageGroups)) - return "ageGroups: array expected"; - for (var i = 0; i < message.ageGroups.length; ++i) - if (!$util.isString(message.ageGroups[i])) - return "ageGroups: string[] expected"; + if (message.redirectAction != null && message.hasOwnProperty("redirectAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.RedirectAction.verify(message.redirectAction); + if (error) + return "redirectAction." + error; + } + } + if (message.onewaySynonymsAction != null && message.hasOwnProperty("onewaySynonymsAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify(message.onewaySynonymsAction); + if (error) + return "onewaySynonymsAction." + error; + } + } + if (message.doNotAssociateAction != null && message.hasOwnProperty("doNotAssociateAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify(message.doNotAssociateAction); + if (error) + return "doNotAssociateAction." + error; + } + } + if (message.replacementAction != null && message.hasOwnProperty("replacementAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.verify(message.replacementAction); + if (error) + return "replacementAction." + error; + } + } + if (message.ignoreAction != null && message.hasOwnProperty("ignoreAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.verify(message.ignoreAction); + if (error) + return "ignoreAction." + error; + } + } + if (message.filterAction != null && message.hasOwnProperty("filterAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.FilterAction.verify(message.filterAction); + if (error) + return "filterAction." + error; + } + } + if (message.twowaySynonymsAction != null && message.hasOwnProperty("twowaySynonymsAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify(message.twowaySynonymsAction); + if (error) + return "twowaySynonymsAction." + error; + } + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.cloud.retail.v2alpha.Condition.verify(message.condition); + if (error) + return "condition." + error; } return null; }; /** - * Creates an Audience message from a plain object. Also converts values to their respective internal types. + * Creates a Rule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Audience + * @memberof google.cloud.retail.v2alpha.Rule * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Audience} Audience + * @returns {google.cloud.retail.v2alpha.Rule} Rule */ - Audience.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Audience) + Rule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule) return object; - var message = new $root.google.cloud.retail.v2alpha.Audience(); - if (object.genders) { - if (!Array.isArray(object.genders)) - throw TypeError(".google.cloud.retail.v2alpha.Audience.genders: array expected"); - message.genders = []; - for (var i = 0; i < object.genders.length; ++i) - message.genders[i] = String(object.genders[i]); + var message = new $root.google.cloud.retail.v2alpha.Rule(); + if (object.boostAction != null) { + if (typeof object.boostAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.boostAction: object expected"); + message.boostAction = $root.google.cloud.retail.v2alpha.Rule.BoostAction.fromObject(object.boostAction); } - if (object.ageGroups) { - if (!Array.isArray(object.ageGroups)) - throw TypeError(".google.cloud.retail.v2alpha.Audience.ageGroups: array expected"); - message.ageGroups = []; - for (var i = 0; i < object.ageGroups.length; ++i) - message.ageGroups[i] = String(object.ageGroups[i]); + if (object.redirectAction != null) { + if (typeof object.redirectAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.redirectAction: object expected"); + message.redirectAction = $root.google.cloud.retail.v2alpha.Rule.RedirectAction.fromObject(object.redirectAction); + } + if (object.onewaySynonymsAction != null) { + if (typeof object.onewaySynonymsAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.onewaySynonymsAction: object expected"); + message.onewaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.fromObject(object.onewaySynonymsAction); + } + if (object.doNotAssociateAction != null) { + if (typeof object.doNotAssociateAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.doNotAssociateAction: object expected"); + message.doNotAssociateAction = $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.fromObject(object.doNotAssociateAction); + } + if (object.replacementAction != null) { + if (typeof object.replacementAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.replacementAction: object expected"); + message.replacementAction = $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.fromObject(object.replacementAction); + } + if (object.ignoreAction != null) { + if (typeof object.ignoreAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.ignoreAction: object expected"); + message.ignoreAction = $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.fromObject(object.ignoreAction); + } + if (object.filterAction != null) { + if (typeof object.filterAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.filterAction: object expected"); + message.filterAction = $root.google.cloud.retail.v2alpha.Rule.FilterAction.fromObject(object.filterAction); + } + if (object.twowaySynonymsAction != null) { + if (typeof object.twowaySynonymsAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.twowaySynonymsAction: object expected"); + message.twowaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.fromObject(object.twowaySynonymsAction); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.condition: object expected"); + message.condition = $root.google.cloud.retail.v2alpha.Condition.fromObject(object.condition); } return message; }; /** - * Creates a plain object from an Audience message. Also converts values to other types if specified. + * Creates a plain object from a Rule message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Audience + * @memberof google.cloud.retail.v2alpha.Rule * @static - * @param {google.cloud.retail.v2alpha.Audience} message Audience + * @param {google.cloud.retail.v2alpha.Rule} message Rule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Audience.toObject = function toObject(message, options) { + Rule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.genders = []; - object.ageGroups = []; + if (options.defaults) + object.condition = null; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.cloud.retail.v2alpha.Condition.toObject(message.condition, options); + if (message.boostAction != null && message.hasOwnProperty("boostAction")) { + object.boostAction = $root.google.cloud.retail.v2alpha.Rule.BoostAction.toObject(message.boostAction, options); + if (options.oneofs) + object.action = "boostAction"; } - if (message.genders && message.genders.length) { - object.genders = []; - for (var j = 0; j < message.genders.length; ++j) - object.genders[j] = message.genders[j]; + if (message.redirectAction != null && message.hasOwnProperty("redirectAction")) { + object.redirectAction = $root.google.cloud.retail.v2alpha.Rule.RedirectAction.toObject(message.redirectAction, options); + if (options.oneofs) + object.action = "redirectAction"; } - if (message.ageGroups && message.ageGroups.length) { - object.ageGroups = []; - for (var j = 0; j < message.ageGroups.length; ++j) - object.ageGroups[j] = message.ageGroups[j]; + if (message.onewaySynonymsAction != null && message.hasOwnProperty("onewaySynonymsAction")) { + object.onewaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.toObject(message.onewaySynonymsAction, options); + if (options.oneofs) + object.action = "onewaySynonymsAction"; + } + if (message.doNotAssociateAction != null && message.hasOwnProperty("doNotAssociateAction")) { + object.doNotAssociateAction = $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.toObject(message.doNotAssociateAction, options); + if (options.oneofs) + object.action = "doNotAssociateAction"; + } + if (message.replacementAction != null && message.hasOwnProperty("replacementAction")) { + object.replacementAction = $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.toObject(message.replacementAction, options); + if (options.oneofs) + object.action = "replacementAction"; + } + if (message.ignoreAction != null && message.hasOwnProperty("ignoreAction")) { + object.ignoreAction = $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.toObject(message.ignoreAction, options); + if (options.oneofs) + object.action = "ignoreAction"; + } + if (message.filterAction != null && message.hasOwnProperty("filterAction")) { + object.filterAction = $root.google.cloud.retail.v2alpha.Rule.FilterAction.toObject(message.filterAction, options); + if (options.oneofs) + object.action = "filterAction"; + } + if (message.twowaySynonymsAction != null && message.hasOwnProperty("twowaySynonymsAction")) { + object.twowaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.toObject(message.twowaySynonymsAction, options); + if (options.oneofs) + object.action = "twowaySynonymsAction"; } return object; }; /** - * Converts this Audience to JSON. + * Converts this Rule to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.Audience + * @memberof google.cloud.retail.v2alpha.Rule * @instance * @returns {Object.} JSON object */ - Audience.prototype.toJSON = function toJSON() { + Rule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Audience; - })(); - - v2alpha.ColorInfo = (function() { + Rule.BoostAction = (function() { - /** - * Properties of a ColorInfo. - * @memberof google.cloud.retail.v2alpha - * @interface IColorInfo - * @property {Array.|null} [colorFamilies] ColorInfo colorFamilies - * @property {Array.|null} [colors] ColorInfo colors - */ + /** + * Properties of a BoostAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @interface IBoostAction + * @property {number|null} [boost] BoostAction boost + * @property {string|null} [productsFilter] BoostAction productsFilter + */ - /** - * Constructs a new ColorInfo. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ColorInfo. - * @implements IColorInfo - * @constructor - * @param {google.cloud.retail.v2alpha.IColorInfo=} [properties] Properties to set - */ - function ColorInfo(properties) { - this.colorFamilies = []; - this.colors = []; - 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]]; - } + /** + * Constructs a new BoostAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @classdesc Represents a BoostAction. + * @implements IBoostAction + * @constructor + * @param {google.cloud.retail.v2alpha.Rule.IBoostAction=} [properties] Properties to set + */ + function BoostAction(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]]; + } - /** - * ColorInfo colorFamilies. - * @member {Array.} colorFamilies - * @memberof google.cloud.retail.v2alpha.ColorInfo - * @instance - */ - ColorInfo.prototype.colorFamilies = $util.emptyArray; + /** + * BoostAction boost. + * @member {number} boost + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @instance + */ + BoostAction.prototype.boost = 0; - /** - * ColorInfo colors. - * @member {Array.} colors - * @memberof google.cloud.retail.v2alpha.ColorInfo - * @instance - */ - ColorInfo.prototype.colors = $util.emptyArray; + /** + * BoostAction productsFilter. + * @member {string} productsFilter + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @instance + */ + BoostAction.prototype.productsFilter = ""; - /** - * Creates a new ColorInfo instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.ColorInfo - * @static - * @param {google.cloud.retail.v2alpha.IColorInfo=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ColorInfo} ColorInfo instance - */ - ColorInfo.create = function create(properties) { - return new ColorInfo(properties); - }; + /** + * Creates a new BoostAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IBoostAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.BoostAction} BoostAction instance + */ + BoostAction.create = function create(properties) { + return new BoostAction(properties); + }; - /** - * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.ColorInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.ColorInfo - * @static - * @param {google.cloud.retail.v2alpha.IColorInfo} message ColorInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ColorInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.colorFamilies != null && message.colorFamilies.length) - for (var i = 0; i < message.colorFamilies.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.colorFamilies[i]); - if (message.colors != null && message.colors.length) - for (var i = 0; i < message.colors.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.colors[i]); - return writer; - }; + /** + * Encodes the specified BoostAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.BoostAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IBoostAction} message BoostAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.boost); + if (message.productsFilter != null && Object.hasOwnProperty.call(message, "productsFilter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.productsFilter); + return writer; + }; - /** - * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ColorInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ColorInfo - * @static - * @param {google.cloud.retail.v2alpha.IColorInfo} message ColorInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ColorInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified BoostAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.BoostAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IBoostAction} message BoostAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ColorInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.ColorInfo - * @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.ColorInfo} ColorInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ColorInfo.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.ColorInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.colorFamilies && message.colorFamilies.length)) - message.colorFamilies = []; - message.colorFamilies.push(reader.string()); - break; - case 2: - if (!(message.colors && message.colors.length)) - message.colors = []; - message.colors.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a BoostAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @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.Rule.BoostAction} BoostAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostAction.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.Rule.BoostAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boost = reader.float(); + break; + case 2: + message.productsFilter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a ColorInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ColorInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ColorInfo} ColorInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ColorInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a BoostAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Rule.BoostAction} BoostAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a ColorInfo message. - * @function verify - * @memberof google.cloud.retail.v2alpha.ColorInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ColorInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.colorFamilies != null && message.hasOwnProperty("colorFamilies")) { - if (!Array.isArray(message.colorFamilies)) - return "colorFamilies: array expected"; - for (var i = 0; i < message.colorFamilies.length; ++i) - if (!$util.isString(message.colorFamilies[i])) - return "colorFamilies: string[] expected"; - } - if (message.colors != null && message.hasOwnProperty("colors")) { - if (!Array.isArray(message.colors)) - return "colors: array expected"; - for (var i = 0; i < message.colors.length; ++i) - if (!$util.isString(message.colors[i])) - return "colors: string[] expected"; - } - return null; - }; + /** + * Verifies a BoostAction message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + if (message.productsFilter != null && message.hasOwnProperty("productsFilter")) + if (!$util.isString(message.productsFilter)) + return "productsFilter: string expected"; + return null; + }; - /** - * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.ColorInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ColorInfo} ColorInfo - */ - ColorInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ColorInfo) + /** + * Creates a BoostAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Rule.BoostAction} BoostAction + */ + BoostAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.BoostAction) + return object; + var message = new $root.google.cloud.retail.v2alpha.Rule.BoostAction(); + if (object.boost != null) + message.boost = Number(object.boost); + if (object.productsFilter != null) + message.productsFilter = String(object.productsFilter); + return message; + }; + + /** + * Creates a plain object from a BoostAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.BoostAction} message BoostAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.boost = 0; + object.productsFilter = ""; + } + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + if (message.productsFilter != null && message.hasOwnProperty("productsFilter")) + object.productsFilter = message.productsFilter; return object; - var message = new $root.google.cloud.retail.v2alpha.ColorInfo(); - if (object.colorFamilies) { - if (!Array.isArray(object.colorFamilies)) - throw TypeError(".google.cloud.retail.v2alpha.ColorInfo.colorFamilies: array expected"); - message.colorFamilies = []; - for (var i = 0; i < object.colorFamilies.length; ++i) - message.colorFamilies[i] = String(object.colorFamilies[i]); - } - if (object.colors) { - if (!Array.isArray(object.colors)) - throw TypeError(".google.cloud.retail.v2alpha.ColorInfo.colors: array expected"); - message.colors = []; - for (var i = 0; i < object.colors.length; ++i) - message.colors[i] = String(object.colors[i]); - } - return message; - }; + }; - /** - * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.ColorInfo - * @static - * @param {google.cloud.retail.v2alpha.ColorInfo} message ColorInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ColorInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.colorFamilies = []; - object.colors = []; - } - if (message.colorFamilies && message.colorFamilies.length) { - object.colorFamilies = []; - for (var j = 0; j < message.colorFamilies.length; ++j) - object.colorFamilies[j] = message.colorFamilies[j]; - } - if (message.colors && message.colors.length) { - object.colors = []; - for (var j = 0; j < message.colors.length; ++j) - object.colors[j] = message.colors[j]; + /** + * Converts this BoostAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @instance + * @returns {Object.} JSON object + */ + BoostAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BoostAction; + })(); + + Rule.FilterAction = (function() { + + /** + * Properties of a FilterAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @interface IFilterAction + * @property {string|null} [filter] FilterAction filter + */ + + /** + * Constructs a new FilterAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @classdesc Represents a FilterAction. + * @implements IFilterAction + * @constructor + * @param {google.cloud.retail.v2alpha.Rule.IFilterAction=} [properties] Properties to set + */ + function FilterAction(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]]; } - return object; - }; - /** - * Converts this ColorInfo to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.ColorInfo - * @instance - * @returns {Object.} JSON object - */ - ColorInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * FilterAction filter. + * @member {string} filter + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @instance + */ + FilterAction.prototype.filter = ""; - return ColorInfo; - })(); + /** + * Creates a new FilterAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IFilterAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.FilterAction} FilterAction instance + */ + FilterAction.create = function create(properties) { + return new FilterAction(properties); + }; - v2alpha.CustomAttribute = (function() { + /** + * Encodes the specified FilterAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.FilterAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IFilterAction} message FilterAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + return writer; + }; - /** - * Properties of a CustomAttribute. - * @memberof google.cloud.retail.v2alpha - * @interface ICustomAttribute - * @property {Array.|null} [text] CustomAttribute text - * @property {Array.|null} [numbers] CustomAttribute numbers - * @property {boolean|null} [searchable] CustomAttribute searchable - * @property {boolean|null} [indexable] CustomAttribute indexable - */ + /** + * Encodes the specified FilterAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.FilterAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IFilterAction} message FilterAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new CustomAttribute. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CustomAttribute. - * @implements ICustomAttribute - * @constructor - * @param {google.cloud.retail.v2alpha.ICustomAttribute=} [properties] Properties to set - */ - function CustomAttribute(properties) { - this.text = []; - this.numbers = []; - 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]]; - } + /** + * Decodes a FilterAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @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.Rule.FilterAction} FilterAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterAction.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.Rule.FilterAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * CustomAttribute text. - * @member {Array.} text - * @memberof google.cloud.retail.v2alpha.CustomAttribute - * @instance - */ - CustomAttribute.prototype.text = $util.emptyArray; + /** + * Decodes a FilterAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Rule.FilterAction} FilterAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * CustomAttribute numbers. - * @member {Array.} numbers - * @memberof google.cloud.retail.v2alpha.CustomAttribute - * @instance - */ - CustomAttribute.prototype.numbers = $util.emptyArray; + /** + * Verifies a FilterAction message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FilterAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; - /** - * CustomAttribute searchable. - * @member {boolean|null|undefined} searchable - * @memberof google.cloud.retail.v2alpha.CustomAttribute - * @instance - */ - CustomAttribute.prototype.searchable = null; + /** + * Creates a FilterAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Rule.FilterAction} FilterAction + */ + FilterAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.FilterAction) + return object; + var message = new $root.google.cloud.retail.v2alpha.Rule.FilterAction(); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; - /** - * CustomAttribute indexable. - * @member {boolean|null|undefined} indexable - * @memberof google.cloud.retail.v2alpha.CustomAttribute - * @instance - */ - CustomAttribute.prototype.indexable = null; + /** + * Creates a plain object from a FilterAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.FilterAction} message FilterAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FilterAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.filter = ""; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Converts this FilterAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @instance + * @returns {Object.} JSON object + */ + FilterAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * CustomAttribute _searchable. - * @member {"searchable"|undefined} _searchable - * @memberof google.cloud.retail.v2alpha.CustomAttribute - * @instance - */ - Object.defineProperty(CustomAttribute.prototype, "_searchable", { - get: $util.oneOfGetter($oneOfFields = ["searchable"]), - set: $util.oneOfSetter($oneOfFields) - }); + return FilterAction; + })(); - /** - * CustomAttribute _indexable. - * @member {"indexable"|undefined} _indexable - * @memberof google.cloud.retail.v2alpha.CustomAttribute - * @instance - */ - Object.defineProperty(CustomAttribute.prototype, "_indexable", { - get: $util.oneOfGetter($oneOfFields = ["indexable"]), - set: $util.oneOfSetter($oneOfFields) - }); + Rule.RedirectAction = (function() { - /** - * Creates a new CustomAttribute instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.CustomAttribute - * @static - * @param {google.cloud.retail.v2alpha.ICustomAttribute=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CustomAttribute} CustomAttribute instance - */ - CustomAttribute.create = function create(properties) { - return new CustomAttribute(properties); - }; + /** + * Properties of a RedirectAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @interface IRedirectAction + * @property {string|null} [redirectUri] RedirectAction redirectUri + */ - /** - * Encodes the specified CustomAttribute message. Does not implicitly {@link google.cloud.retail.v2alpha.CustomAttribute.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.CustomAttribute - * @static - * @param {google.cloud.retail.v2alpha.ICustomAttribute} message CustomAttribute message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomAttribute.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && message.text.length) - for (var i = 0; i < message.text.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text[i]); - if (message.numbers != null && message.numbers.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.numbers.length; ++i) - writer.double(message.numbers[i]); - writer.ldelim(); + /** + * Constructs a new RedirectAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @classdesc Represents a RedirectAction. + * @implements IRedirectAction + * @constructor + * @param {google.cloud.retail.v2alpha.Rule.IRedirectAction=} [properties] Properties to set + */ + function RedirectAction(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]]; } - if (message.searchable != null && Object.hasOwnProperty.call(message, "searchable")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.searchable); - if (message.indexable != null && Object.hasOwnProperty.call(message, "indexable")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.indexable); - return writer; - }; - - /** - * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CustomAttribute.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CustomAttribute - * @static - * @param {google.cloud.retail.v2alpha.ICustomAttribute} message CustomAttribute message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomAttribute.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a CustomAttribute message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.CustomAttribute - * @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.CustomAttribute} CustomAttribute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomAttribute.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.CustomAttribute(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.text && message.text.length)) - message.text = []; - message.text.push(reader.string()); - break; - case 2: - if (!(message.numbers && message.numbers.length)) - message.numbers = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.numbers.push(reader.double()); - } else - message.numbers.push(reader.double()); - break; - case 3: - message.searchable = reader.bool(); - break; - case 4: - message.indexable = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CustomAttribute - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CustomAttribute} CustomAttribute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomAttribute.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomAttribute message. - * @function verify - * @memberof google.cloud.retail.v2alpha.CustomAttribute - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomAttribute.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.text != null && message.hasOwnProperty("text")) { - if (!Array.isArray(message.text)) - return "text: array expected"; - for (var i = 0; i < message.text.length; ++i) - if (!$util.isString(message.text[i])) - return "text: string[] expected"; - } - if (message.numbers != null && message.hasOwnProperty("numbers")) { - if (!Array.isArray(message.numbers)) - return "numbers: array expected"; - for (var i = 0; i < message.numbers.length; ++i) - if (typeof message.numbers[i] !== "number") - return "numbers: number[] expected"; - } - if (message.searchable != null && message.hasOwnProperty("searchable")) { - properties._searchable = 1; - if (typeof message.searchable !== "boolean") - return "searchable: boolean expected"; - } - if (message.indexable != null && message.hasOwnProperty("indexable")) { - properties._indexable = 1; - if (typeof message.indexable !== "boolean") - return "indexable: boolean expected"; - } - return null; - }; + /** + * RedirectAction redirectUri. + * @member {string} redirectUri + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @instance + */ + RedirectAction.prototype.redirectUri = ""; - /** - * Creates a CustomAttribute message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.CustomAttribute - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CustomAttribute} CustomAttribute - */ - CustomAttribute.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CustomAttribute) - return object; - var message = new $root.google.cloud.retail.v2alpha.CustomAttribute(); - if (object.text) { - if (!Array.isArray(object.text)) - throw TypeError(".google.cloud.retail.v2alpha.CustomAttribute.text: array expected"); - message.text = []; - for (var i = 0; i < object.text.length; ++i) - message.text[i] = String(object.text[i]); - } - if (object.numbers) { - if (!Array.isArray(object.numbers)) - throw TypeError(".google.cloud.retail.v2alpha.CustomAttribute.numbers: array expected"); - message.numbers = []; - for (var i = 0; i < object.numbers.length; ++i) - message.numbers[i] = Number(object.numbers[i]); - } - if (object.searchable != null) - message.searchable = Boolean(object.searchable); - if (object.indexable != null) - message.indexable = Boolean(object.indexable); - return message; - }; + /** + * Creates a new RedirectAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IRedirectAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.RedirectAction} RedirectAction instance + */ + RedirectAction.create = function create(properties) { + return new RedirectAction(properties); + }; - /** - * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.CustomAttribute - * @static - * @param {google.cloud.retail.v2alpha.CustomAttribute} message CustomAttribute - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomAttribute.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.text = []; - object.numbers = []; - } - if (message.text && message.text.length) { - object.text = []; - for (var j = 0; j < message.text.length; ++j) - object.text[j] = message.text[j]; - } - if (message.numbers && message.numbers.length) { - object.numbers = []; - for (var j = 0; j < message.numbers.length; ++j) - object.numbers[j] = options.json && !isFinite(message.numbers[j]) ? String(message.numbers[j]) : message.numbers[j]; - } - if (message.searchable != null && message.hasOwnProperty("searchable")) { - object.searchable = message.searchable; - if (options.oneofs) - object._searchable = "searchable"; - } - if (message.indexable != null && message.hasOwnProperty("indexable")) { - object.indexable = message.indexable; - if (options.oneofs) - object._indexable = "indexable"; - } - return object; - }; + /** + * Encodes the specified RedirectAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RedirectAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IRedirectAction} message RedirectAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedirectAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.redirectUri != null && Object.hasOwnProperty.call(message, "redirectUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.redirectUri); + return writer; + }; - /** - * Converts this CustomAttribute to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.CustomAttribute - * @instance - * @returns {Object.} JSON object - */ - CustomAttribute.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified RedirectAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RedirectAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IRedirectAction} message RedirectAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedirectAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - return CustomAttribute; - })(); + /** + * Decodes a RedirectAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @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.Rule.RedirectAction} RedirectAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedirectAction.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.Rule.RedirectAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redirectUri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - v2alpha.FulfillmentInfo = (function() { + /** + * Decodes a RedirectAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Rule.RedirectAction} RedirectAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedirectAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Properties of a FulfillmentInfo. - * @memberof google.cloud.retail.v2alpha - * @interface IFulfillmentInfo - * @property {string|null} [type] FulfillmentInfo type - * @property {Array.|null} [placeIds] FulfillmentInfo placeIds - */ + /** + * Verifies a RedirectAction message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedirectAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) + if (!$util.isString(message.redirectUri)) + return "redirectUri: string expected"; + return null; + }; - /** - * Constructs a new FulfillmentInfo. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a FulfillmentInfo. - * @implements IFulfillmentInfo - * @constructor - * @param {google.cloud.retail.v2alpha.IFulfillmentInfo=} [properties] Properties to set - */ - function FulfillmentInfo(properties) { - this.placeIds = []; - 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]]; - } + /** + * Creates a RedirectAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Rule.RedirectAction} RedirectAction + */ + RedirectAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.RedirectAction) + return object; + var message = new $root.google.cloud.retail.v2alpha.Rule.RedirectAction(); + if (object.redirectUri != null) + message.redirectUri = String(object.redirectUri); + return message; + }; - /** - * FulfillmentInfo type. - * @member {string} type - * @memberof google.cloud.retail.v2alpha.FulfillmentInfo - * @instance - */ - FulfillmentInfo.prototype.type = ""; + /** + * Creates a plain object from a RedirectAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.RedirectAction} message RedirectAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedirectAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.redirectUri = ""; + if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) + object.redirectUri = message.redirectUri; + return object; + }; - /** - * FulfillmentInfo placeIds. - * @member {Array.} placeIds - * @memberof google.cloud.retail.v2alpha.FulfillmentInfo - * @instance - */ - FulfillmentInfo.prototype.placeIds = $util.emptyArray; + /** + * Converts this RedirectAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @instance + * @returns {Object.} JSON object + */ + RedirectAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new FulfillmentInfo instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.FulfillmentInfo - * @static - * @param {google.cloud.retail.v2alpha.IFulfillmentInfo=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.FulfillmentInfo} FulfillmentInfo instance - */ - FulfillmentInfo.create = function create(properties) { - return new FulfillmentInfo(properties); - }; + return RedirectAction; + })(); - /** - * Encodes the specified FulfillmentInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.FulfillmentInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.FulfillmentInfo - * @static - * @param {google.cloud.retail.v2alpha.IFulfillmentInfo} message FulfillmentInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FulfillmentInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.placeIds != null && message.placeIds.length) - for (var i = 0; i < message.placeIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.placeIds[i]); - return writer; - }; + Rule.TwowaySynonymsAction = (function() { - /** - * Encodes the specified FulfillmentInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.FulfillmentInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.FulfillmentInfo - * @static - * @param {google.cloud.retail.v2alpha.IFulfillmentInfo} message FulfillmentInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FulfillmentInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a TwowaySynonymsAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @interface ITwowaySynonymsAction + * @property {Array.|null} [synonyms] TwowaySynonymsAction synonyms + */ - /** - * Decodes a FulfillmentInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.FulfillmentInfo - * @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.FulfillmentInfo} FulfillmentInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FulfillmentInfo.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.FulfillmentInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - if (!(message.placeIds && message.placeIds.length)) - message.placeIds = []; - message.placeIds.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Constructs a new TwowaySynonymsAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @classdesc Represents a TwowaySynonymsAction. + * @implements ITwowaySynonymsAction + * @constructor + * @param {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction=} [properties] Properties to set + */ + function TwowaySynonymsAction(properties) { + this.synonyms = []; + 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]]; } - return message; - }; - /** - * Decodes a FulfillmentInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.FulfillmentInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.FulfillmentInfo} FulfillmentInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FulfillmentInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * TwowaySynonymsAction synonyms. + * @member {Array.} synonyms + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @instance + */ + TwowaySynonymsAction.prototype.synonyms = $util.emptyArray; - /** - * Verifies a FulfillmentInfo message. - * @function verify - * @memberof google.cloud.retail.v2alpha.FulfillmentInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FulfillmentInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.placeIds != null && message.hasOwnProperty("placeIds")) { - if (!Array.isArray(message.placeIds)) - return "placeIds: array expected"; - for (var i = 0; i < message.placeIds.length; ++i) - if (!$util.isString(message.placeIds[i])) - return "placeIds: string[] expected"; - } - return null; - }; - - /** - * Creates a FulfillmentInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.FulfillmentInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.FulfillmentInfo} FulfillmentInfo - */ - FulfillmentInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.FulfillmentInfo) - return object; - var message = new $root.google.cloud.retail.v2alpha.FulfillmentInfo(); - if (object.type != null) - message.type = String(object.type); - if (object.placeIds) { - if (!Array.isArray(object.placeIds)) - throw TypeError(".google.cloud.retail.v2alpha.FulfillmentInfo.placeIds: array expected"); - message.placeIds = []; - for (var i = 0; i < object.placeIds.length; ++i) - message.placeIds[i] = String(object.placeIds[i]); - } - return message; - }; - - /** - * Creates a plain object from a FulfillmentInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.FulfillmentInfo - * @static - * @param {google.cloud.retail.v2alpha.FulfillmentInfo} message FulfillmentInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FulfillmentInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.placeIds = []; - if (options.defaults) - object.type = ""; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.placeIds && message.placeIds.length) { - object.placeIds = []; - for (var j = 0; j < message.placeIds.length; ++j) - object.placeIds[j] = message.placeIds[j]; - } - return object; - }; - - /** - * Converts this FulfillmentInfo to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.FulfillmentInfo - * @instance - * @returns {Object.} JSON object - */ - FulfillmentInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FulfillmentInfo; - })(); - - v2alpha.Image = (function() { - - /** - * Properties of an Image. - * @memberof google.cloud.retail.v2alpha - * @interface IImage - * @property {string|null} [uri] Image uri - * @property {number|null} [height] Image height - * @property {number|null} [width] Image width - */ - - /** - * Constructs a new Image. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an Image. - * @implements IImage - * @constructor - * @param {google.cloud.retail.v2alpha.IImage=} [properties] Properties to set - */ - function Image(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]]; - } + /** + * Creates a new TwowaySynonymsAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} TwowaySynonymsAction instance + */ + TwowaySynonymsAction.create = function create(properties) { + return new TwowaySynonymsAction(properties); + }; - /** - * Image uri. - * @member {string} uri - * @memberof google.cloud.retail.v2alpha.Image - * @instance - */ - Image.prototype.uri = ""; + /** + * Encodes the specified TwowaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction} message TwowaySynonymsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TwowaySynonymsAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.synonyms != null && message.synonyms.length) + for (var i = 0; i < message.synonyms.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.synonyms[i]); + return writer; + }; - /** - * Image height. - * @member {number} height - * @memberof google.cloud.retail.v2alpha.Image - * @instance - */ - Image.prototype.height = 0; + /** + * Encodes the specified TwowaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction} message TwowaySynonymsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TwowaySynonymsAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Image width. - * @member {number} width - * @memberof google.cloud.retail.v2alpha.Image - * @instance - */ - Image.prototype.width = 0; + /** + * Decodes a TwowaySynonymsAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @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.Rule.TwowaySynonymsAction} TwowaySynonymsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TwowaySynonymsAction.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.Rule.TwowaySynonymsAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.synonyms && message.synonyms.length)) + message.synonyms = []; + message.synonyms.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new Image instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Image - * @static - * @param {google.cloud.retail.v2alpha.IImage=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Image} Image instance - */ - Image.create = function create(properties) { - return new Image(properties); - }; + /** + * Decodes a TwowaySynonymsAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} TwowaySynonymsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TwowaySynonymsAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified Image message. Does not implicitly {@link google.cloud.retail.v2alpha.Image.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Image - * @static - * @param {google.cloud.retail.v2alpha.IImage} message Image message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Image.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.height); - if (message.width != null && Object.hasOwnProperty.call(message, "width")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.width); - return writer; - }; + /** + * Verifies a TwowaySynonymsAction message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TwowaySynonymsAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.synonyms != null && message.hasOwnProperty("synonyms")) { + if (!Array.isArray(message.synonyms)) + return "synonyms: array expected"; + for (var i = 0; i < message.synonyms.length; ++i) + if (!$util.isString(message.synonyms[i])) + return "synonyms: string[] expected"; + } + return null; + }; - /** - * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Image.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Image - * @static - * @param {google.cloud.retail.v2alpha.IImage} message Image message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Image.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a TwowaySynonymsAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} TwowaySynonymsAction + */ + TwowaySynonymsAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) + return object; + var message = new $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction(); + if (object.synonyms) { + if (!Array.isArray(object.synonyms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.synonyms: array expected"); + message.synonyms = []; + for (var i = 0; i < object.synonyms.length; ++i) + message.synonyms[i] = String(object.synonyms[i]); + } + return message; + }; - /** - * Decodes an Image message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Image - * @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.Image} Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Image.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.Image(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.uri = reader.string(); - break; - case 2: - message.height = reader.int32(); - break; - case 3: - message.width = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Creates a plain object from a TwowaySynonymsAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} message TwowaySynonymsAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TwowaySynonymsAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.synonyms = []; + if (message.synonyms && message.synonyms.length) { + object.synonyms = []; + for (var j = 0; j < message.synonyms.length; ++j) + object.synonyms[j] = message.synonyms[j]; } - } - return message; - }; + return object; + }; - /** - * Decodes an Image message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Image - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Image} Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Image.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this TwowaySynonymsAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @instance + * @returns {Object.} JSON object + */ + TwowaySynonymsAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies an Image message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Image - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Image.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height)) - return "height: integer expected"; - if (message.width != null && message.hasOwnProperty("width")) - if (!$util.isInteger(message.width)) - return "width: integer expected"; - return null; - }; + return TwowaySynonymsAction; + })(); - /** - * Creates an Image message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Image - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Image} Image - */ - Image.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Image) - return object; - var message = new $root.google.cloud.retail.v2alpha.Image(); - if (object.uri != null) - message.uri = String(object.uri); - if (object.height != null) - message.height = object.height | 0; - if (object.width != null) - message.width = object.width | 0; - return message; - }; + Rule.OnewaySynonymsAction = (function() { - /** - * Creates a plain object from an Image message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Image - * @static - * @param {google.cloud.retail.v2alpha.Image} message Image - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Image.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.uri = ""; - object.height = 0; - object.width = 0; + /** + * Properties of an OnewaySynonymsAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @interface IOnewaySynonymsAction + * @property {Array.|null} [queryTerms] OnewaySynonymsAction queryTerms + * @property {Array.|null} [synonyms] OnewaySynonymsAction synonyms + * @property {Array.|null} [onewayTerms] OnewaySynonymsAction onewayTerms + */ + + /** + * Constructs a new OnewaySynonymsAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @classdesc Represents an OnewaySynonymsAction. + * @implements IOnewaySynonymsAction + * @constructor + * @param {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction=} [properties] Properties to set + */ + function OnewaySynonymsAction(properties) { + this.queryTerms = []; + this.synonyms = []; + this.onewayTerms = []; + 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]]; } - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - if (message.height != null && message.hasOwnProperty("height")) - object.height = message.height; - if (message.width != null && message.hasOwnProperty("width")) - object.width = message.width; - return object; - }; - /** - * Converts this Image to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Image - * @instance - * @returns {Object.} JSON object - */ - Image.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * OnewaySynonymsAction queryTerms. + * @member {Array.} queryTerms + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @instance + */ + OnewaySynonymsAction.prototype.queryTerms = $util.emptyArray; - return Image; - })(); + /** + * OnewaySynonymsAction synonyms. + * @member {Array.} synonyms + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @instance + */ + OnewaySynonymsAction.prototype.synonyms = $util.emptyArray; - v2alpha.Interval = (function() { + /** + * OnewaySynonymsAction onewayTerms. + * @member {Array.} onewayTerms + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @instance + */ + OnewaySynonymsAction.prototype.onewayTerms = $util.emptyArray; - /** - * Properties of an Interval. - * @memberof google.cloud.retail.v2alpha - * @interface IInterval - * @property {number|null} [minimum] Interval minimum - * @property {number|null} [exclusiveMinimum] Interval exclusiveMinimum - * @property {number|null} [maximum] Interval maximum - * @property {number|null} [exclusiveMaximum] Interval exclusiveMaximum - */ + /** + * Creates a new OnewaySynonymsAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} OnewaySynonymsAction instance + */ + OnewaySynonymsAction.create = function create(properties) { + return new OnewaySynonymsAction(properties); + }; - /** - * Constructs a new Interval. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an Interval. - * @implements IInterval - * @constructor - * @param {google.cloud.retail.v2alpha.IInterval=} [properties] Properties to set - */ - function Interval(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]]; - } + /** + * Encodes the specified OnewaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction} message OnewaySynonymsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnewaySynonymsAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.onewayTerms != null && message.onewayTerms.length) + for (var i = 0; i < message.onewayTerms.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.onewayTerms[i]); + if (message.queryTerms != null && message.queryTerms.length) + for (var i = 0; i < message.queryTerms.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.queryTerms[i]); + if (message.synonyms != null && message.synonyms.length) + for (var i = 0; i < message.synonyms.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.synonyms[i]); + return writer; + }; - /** - * Interval minimum. - * @member {number|null|undefined} minimum - * @memberof google.cloud.retail.v2alpha.Interval - * @instance - */ - Interval.prototype.minimum = null; + /** + * Encodes the specified OnewaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction} message OnewaySynonymsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnewaySynonymsAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Interval exclusiveMinimum. - * @member {number|null|undefined} exclusiveMinimum - * @memberof google.cloud.retail.v2alpha.Interval - * @instance - */ - Interval.prototype.exclusiveMinimum = null; + /** + * Decodes an OnewaySynonymsAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @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.Rule.OnewaySynonymsAction} OnewaySynonymsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnewaySynonymsAction.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.Rule.OnewaySynonymsAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + if (!(message.queryTerms && message.queryTerms.length)) + message.queryTerms = []; + message.queryTerms.push(reader.string()); + break; + case 4: + if (!(message.synonyms && message.synonyms.length)) + message.synonyms = []; + message.synonyms.push(reader.string()); + break; + case 2: + if (!(message.onewayTerms && message.onewayTerms.length)) + message.onewayTerms = []; + message.onewayTerms.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Interval maximum. - * @member {number|null|undefined} maximum - * @memberof google.cloud.retail.v2alpha.Interval - * @instance - */ - Interval.prototype.maximum = null; + /** + * Decodes an OnewaySynonymsAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} OnewaySynonymsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnewaySynonymsAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Interval exclusiveMaximum. - * @member {number|null|undefined} exclusiveMaximum - * @memberof google.cloud.retail.v2alpha.Interval - * @instance - */ - Interval.prototype.exclusiveMaximum = null; + /** + * Verifies an OnewaySynonymsAction message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OnewaySynonymsAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { + if (!Array.isArray(message.queryTerms)) + return "queryTerms: array expected"; + for (var i = 0; i < message.queryTerms.length; ++i) + if (!$util.isString(message.queryTerms[i])) + return "queryTerms: string[] expected"; + } + if (message.synonyms != null && message.hasOwnProperty("synonyms")) { + if (!Array.isArray(message.synonyms)) + return "synonyms: array expected"; + for (var i = 0; i < message.synonyms.length; ++i) + if (!$util.isString(message.synonyms[i])) + return "synonyms: string[] expected"; + } + if (message.onewayTerms != null && message.hasOwnProperty("onewayTerms")) { + if (!Array.isArray(message.onewayTerms)) + return "onewayTerms: array expected"; + for (var i = 0; i < message.onewayTerms.length; ++i) + if (!$util.isString(message.onewayTerms[i])) + return "onewayTerms: string[] expected"; + } + return null; + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Creates an OnewaySynonymsAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} OnewaySynonymsAction + */ + OnewaySynonymsAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) + return object; + var message = new $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction(); + if (object.queryTerms) { + if (!Array.isArray(object.queryTerms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.queryTerms: array expected"); + message.queryTerms = []; + for (var i = 0; i < object.queryTerms.length; ++i) + message.queryTerms[i] = String(object.queryTerms[i]); + } + if (object.synonyms) { + if (!Array.isArray(object.synonyms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.synonyms: array expected"); + message.synonyms = []; + for (var i = 0; i < object.synonyms.length; ++i) + message.synonyms[i] = String(object.synonyms[i]); + } + if (object.onewayTerms) { + if (!Array.isArray(object.onewayTerms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.onewayTerms: array expected"); + message.onewayTerms = []; + for (var i = 0; i < object.onewayTerms.length; ++i) + message.onewayTerms[i] = String(object.onewayTerms[i]); + } + return message; + }; - /** - * Interval min. - * @member {"minimum"|"exclusiveMinimum"|undefined} min - * @memberof google.cloud.retail.v2alpha.Interval - * @instance - */ - Object.defineProperty(Interval.prototype, "min", { - get: $util.oneOfGetter($oneOfFields = ["minimum", "exclusiveMinimum"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Creates a plain object from an OnewaySynonymsAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} message OnewaySynonymsAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OnewaySynonymsAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.onewayTerms = []; + object.queryTerms = []; + object.synonyms = []; + } + if (message.onewayTerms && message.onewayTerms.length) { + object.onewayTerms = []; + for (var j = 0; j < message.onewayTerms.length; ++j) + object.onewayTerms[j] = message.onewayTerms[j]; + } + if (message.queryTerms && message.queryTerms.length) { + object.queryTerms = []; + for (var j = 0; j < message.queryTerms.length; ++j) + object.queryTerms[j] = message.queryTerms[j]; + } + if (message.synonyms && message.synonyms.length) { + object.synonyms = []; + for (var j = 0; j < message.synonyms.length; ++j) + object.synonyms[j] = message.synonyms[j]; + } + return object; + }; - /** - * Interval max. - * @member {"maximum"|"exclusiveMaximum"|undefined} max - * @memberof google.cloud.retail.v2alpha.Interval - * @instance - */ - Object.defineProperty(Interval.prototype, "max", { - get: $util.oneOfGetter($oneOfFields = ["maximum", "exclusiveMaximum"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Converts this OnewaySynonymsAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @instance + * @returns {Object.} JSON object + */ + OnewaySynonymsAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new Interval instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Interval - * @static - * @param {google.cloud.retail.v2alpha.IInterval=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Interval} Interval instance - */ - Interval.create = function create(properties) { - return new Interval(properties); - }; + return OnewaySynonymsAction; + })(); - /** - * Encodes the specified Interval message. Does not implicitly {@link google.cloud.retail.v2alpha.Interval.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Interval - * @static - * @param {google.cloud.retail.v2alpha.IInterval} message Interval message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Interval.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minimum != null && Object.hasOwnProperty.call(message, "minimum")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.minimum); - if (message.exclusiveMinimum != null && Object.hasOwnProperty.call(message, "exclusiveMinimum")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.exclusiveMinimum); - if (message.maximum != null && Object.hasOwnProperty.call(message, "maximum")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.maximum); - if (message.exclusiveMaximum != null && Object.hasOwnProperty.call(message, "exclusiveMaximum")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.exclusiveMaximum); - return writer; - }; + Rule.DoNotAssociateAction = (function() { - /** - * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Interval.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Interval - * @static - * @param {google.cloud.retail.v2alpha.IInterval} message Interval message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Interval.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a DoNotAssociateAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @interface IDoNotAssociateAction + * @property {Array.|null} [queryTerms] DoNotAssociateAction queryTerms + * @property {Array.|null} [doNotAssociateTerms] DoNotAssociateAction doNotAssociateTerms + * @property {Array.|null} [terms] DoNotAssociateAction terms + */ - /** - * Decodes an Interval message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Interval - * @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.Interval} Interval - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Interval.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.Interval(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.minimum = reader.double(); - break; - case 2: - message.exclusiveMinimum = reader.double(); - break; - case 3: - message.maximum = reader.double(); - break; - case 4: - message.exclusiveMaximum = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Constructs a new DoNotAssociateAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @classdesc Represents a DoNotAssociateAction. + * @implements IDoNotAssociateAction + * @constructor + * @param {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction=} [properties] Properties to set + */ + function DoNotAssociateAction(properties) { + this.queryTerms = []; + this.doNotAssociateTerms = []; + this.terms = []; + 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]]; } - return message; - }; - - /** - * Decodes an Interval message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Interval - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Interval} Interval - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Interval.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an Interval message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Interval - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Interval.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.minimum != null && message.hasOwnProperty("minimum")) { - properties.min = 1; - if (typeof message.minimum !== "number") - return "minimum: number expected"; - } - if (message.exclusiveMinimum != null && message.hasOwnProperty("exclusiveMinimum")) { - if (properties.min === 1) - return "min: multiple values"; - properties.min = 1; - if (typeof message.exclusiveMinimum !== "number") - return "exclusiveMinimum: number expected"; - } - if (message.maximum != null && message.hasOwnProperty("maximum")) { - properties.max = 1; - if (typeof message.maximum !== "number") - return "maximum: number expected"; - } - if (message.exclusiveMaximum != null && message.hasOwnProperty("exclusiveMaximum")) { - if (properties.max === 1) - return "max: multiple values"; - properties.max = 1; - if (typeof message.exclusiveMaximum !== "number") - return "exclusiveMaximum: number expected"; - } - return null; - }; + /** + * DoNotAssociateAction queryTerms. + * @member {Array.} queryTerms + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction + * @instance + */ + DoNotAssociateAction.prototype.queryTerms = $util.emptyArray; - /** - * Creates an Interval message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Interval - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Interval} Interval - */ - Interval.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Interval) - return object; - var message = new $root.google.cloud.retail.v2alpha.Interval(); - if (object.minimum != null) - message.minimum = Number(object.minimum); - if (object.exclusiveMinimum != null) - message.exclusiveMinimum = Number(object.exclusiveMinimum); - if (object.maximum != null) - message.maximum = Number(object.maximum); - if (object.exclusiveMaximum != null) - message.exclusiveMaximum = Number(object.exclusiveMaximum); - return message; - }; + /** + * DoNotAssociateAction doNotAssociateTerms. + * @member {Array.} doNotAssociateTerms + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction + * @instance + */ + DoNotAssociateAction.prototype.doNotAssociateTerms = $util.emptyArray; - /** - * Creates a plain object from an Interval message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Interval - * @static - * @param {google.cloud.retail.v2alpha.Interval} message Interval - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Interval.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.minimum != null && message.hasOwnProperty("minimum")) { - object.minimum = options.json && !isFinite(message.minimum) ? String(message.minimum) : message.minimum; - if (options.oneofs) - object.min = "minimum"; - } - if (message.exclusiveMinimum != null && message.hasOwnProperty("exclusiveMinimum")) { - object.exclusiveMinimum = options.json && !isFinite(message.exclusiveMinimum) ? String(message.exclusiveMinimum) : message.exclusiveMinimum; - if (options.oneofs) - object.min = "exclusiveMinimum"; - } - if (message.maximum != null && message.hasOwnProperty("maximum")) { - object.maximum = options.json && !isFinite(message.maximum) ? String(message.maximum) : message.maximum; - if (options.oneofs) - object.max = "maximum"; - } - if (message.exclusiveMaximum != null && message.hasOwnProperty("exclusiveMaximum")) { - object.exclusiveMaximum = options.json && !isFinite(message.exclusiveMaximum) ? String(message.exclusiveMaximum) : message.exclusiveMaximum; - if (options.oneofs) - object.max = "exclusiveMaximum"; - } - return object; - }; - - /** - * Converts this Interval to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Interval - * @instance - * @returns {Object.} JSON object - */ - Interval.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Interval; - })(); - - v2alpha.PriceInfo = (function() { - - /** - * Properties of a PriceInfo. - * @memberof google.cloud.retail.v2alpha - * @interface IPriceInfo - * @property {string|null} [currencyCode] PriceInfo currencyCode - * @property {number|null} [price] PriceInfo price - * @property {number|null} [originalPrice] PriceInfo originalPrice - * @property {number|null} [cost] PriceInfo cost - * @property {google.protobuf.ITimestamp|null} [priceEffectiveTime] PriceInfo priceEffectiveTime - * @property {google.protobuf.ITimestamp|null} [priceExpireTime] PriceInfo priceExpireTime - * @property {google.cloud.retail.v2alpha.PriceInfo.IPriceRange|null} [priceRange] PriceInfo priceRange - */ - - /** - * Constructs a new PriceInfo. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PriceInfo. - * @implements IPriceInfo - * @constructor - * @param {google.cloud.retail.v2alpha.IPriceInfo=} [properties] Properties to set - */ - function PriceInfo(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]]; - } - - /** - * PriceInfo currencyCode. - * @member {string} currencyCode - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @instance - */ - PriceInfo.prototype.currencyCode = ""; - - /** - * PriceInfo price. - * @member {number} price - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @instance - */ - PriceInfo.prototype.price = 0; - - /** - * PriceInfo originalPrice. - * @member {number} originalPrice - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @instance - */ - PriceInfo.prototype.originalPrice = 0; - - /** - * PriceInfo cost. - * @member {number} cost - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @instance - */ - PriceInfo.prototype.cost = 0; - - /** - * PriceInfo priceEffectiveTime. - * @member {google.protobuf.ITimestamp|null|undefined} priceEffectiveTime - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @instance - */ - PriceInfo.prototype.priceEffectiveTime = null; - - /** - * PriceInfo priceExpireTime. - * @member {google.protobuf.ITimestamp|null|undefined} priceExpireTime - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @instance - */ - PriceInfo.prototype.priceExpireTime = null; - - /** - * PriceInfo priceRange. - * @member {google.cloud.retail.v2alpha.PriceInfo.IPriceRange|null|undefined} priceRange - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @instance - */ - PriceInfo.prototype.priceRange = null; - - /** - * Creates a new PriceInfo instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @static - * @param {google.cloud.retail.v2alpha.IPriceInfo=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PriceInfo} PriceInfo instance - */ - PriceInfo.create = function create(properties) { - return new PriceInfo(properties); - }; - - /** - * Encodes the specified PriceInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @static - * @param {google.cloud.retail.v2alpha.IPriceInfo} message PriceInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PriceInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCode); - if (message.price != null && Object.hasOwnProperty.call(message, "price")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.price); - if (message.originalPrice != null && Object.hasOwnProperty.call(message, "originalPrice")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.originalPrice); - if (message.cost != null && Object.hasOwnProperty.call(message, "cost")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.cost); - if (message.priceEffectiveTime != null && Object.hasOwnProperty.call(message, "priceEffectiveTime")) - $root.google.protobuf.Timestamp.encode(message.priceEffectiveTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.priceExpireTime != null && Object.hasOwnProperty.call(message, "priceExpireTime")) - $root.google.protobuf.Timestamp.encode(message.priceExpireTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.priceRange != null && Object.hasOwnProperty.call(message, "priceRange")) - $root.google.cloud.retail.v2alpha.PriceInfo.PriceRange.encode(message.priceRange, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PriceInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @static - * @param {google.cloud.retail.v2alpha.IPriceInfo} message PriceInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PriceInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PriceInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @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.PriceInfo} PriceInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PriceInfo.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.PriceInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.currencyCode = reader.string(); - break; - case 2: - message.price = reader.float(); - break; - case 3: - message.originalPrice = reader.float(); - break; - case 4: - message.cost = reader.float(); - break; - case 5: - message.priceEffectiveTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.priceExpireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - message.priceRange = $root.google.cloud.retail.v2alpha.PriceInfo.PriceRange.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PriceInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PriceInfo} PriceInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PriceInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PriceInfo message. - * @function verify - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PriceInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - if (!$util.isString(message.currencyCode)) - return "currencyCode: string expected"; - if (message.price != null && message.hasOwnProperty("price")) - if (typeof message.price !== "number") - return "price: number expected"; - if (message.originalPrice != null && message.hasOwnProperty("originalPrice")) - if (typeof message.originalPrice !== "number") - return "originalPrice: number expected"; - if (message.cost != null && message.hasOwnProperty("cost")) - if (typeof message.cost !== "number") - return "cost: number expected"; - if (message.priceEffectiveTime != null && message.hasOwnProperty("priceEffectiveTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.priceEffectiveTime); - if (error) - return "priceEffectiveTime." + error; - } - if (message.priceExpireTime != null && message.hasOwnProperty("priceExpireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.priceExpireTime); - if (error) - return "priceExpireTime." + error; - } - if (message.priceRange != null && message.hasOwnProperty("priceRange")) { - var error = $root.google.cloud.retail.v2alpha.PriceInfo.PriceRange.verify(message.priceRange); - if (error) - return "priceRange." + error; - } - return null; - }; - - /** - * Creates a PriceInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PriceInfo} PriceInfo - */ - PriceInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PriceInfo) - return object; - var message = new $root.google.cloud.retail.v2alpha.PriceInfo(); - if (object.currencyCode != null) - message.currencyCode = String(object.currencyCode); - if (object.price != null) - message.price = Number(object.price); - if (object.originalPrice != null) - message.originalPrice = Number(object.originalPrice); - if (object.cost != null) - message.cost = Number(object.cost); - if (object.priceEffectiveTime != null) { - if (typeof object.priceEffectiveTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PriceInfo.priceEffectiveTime: object expected"); - message.priceEffectiveTime = $root.google.protobuf.Timestamp.fromObject(object.priceEffectiveTime); - } - if (object.priceExpireTime != null) { - if (typeof object.priceExpireTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PriceInfo.priceExpireTime: object expected"); - message.priceExpireTime = $root.google.protobuf.Timestamp.fromObject(object.priceExpireTime); - } - if (object.priceRange != null) { - if (typeof object.priceRange !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PriceInfo.priceRange: object expected"); - message.priceRange = $root.google.cloud.retail.v2alpha.PriceInfo.PriceRange.fromObject(object.priceRange); - } - return message; - }; - - /** - * Creates a plain object from a PriceInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @static - * @param {google.cloud.retail.v2alpha.PriceInfo} message PriceInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PriceInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.currencyCode = ""; - object.price = 0; - object.originalPrice = 0; - object.cost = 0; - object.priceEffectiveTime = null; - object.priceExpireTime = null; - object.priceRange = null; - } - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - object.currencyCode = message.currencyCode; - if (message.price != null && message.hasOwnProperty("price")) - object.price = options.json && !isFinite(message.price) ? String(message.price) : message.price; - if (message.originalPrice != null && message.hasOwnProperty("originalPrice")) - object.originalPrice = options.json && !isFinite(message.originalPrice) ? String(message.originalPrice) : message.originalPrice; - if (message.cost != null && message.hasOwnProperty("cost")) - object.cost = options.json && !isFinite(message.cost) ? String(message.cost) : message.cost; - if (message.priceEffectiveTime != null && message.hasOwnProperty("priceEffectiveTime")) - object.priceEffectiveTime = $root.google.protobuf.Timestamp.toObject(message.priceEffectiveTime, options); - if (message.priceExpireTime != null && message.hasOwnProperty("priceExpireTime")) - object.priceExpireTime = $root.google.protobuf.Timestamp.toObject(message.priceExpireTime, options); - if (message.priceRange != null && message.hasOwnProperty("priceRange")) - object.priceRange = $root.google.cloud.retail.v2alpha.PriceInfo.PriceRange.toObject(message.priceRange, options); - return object; - }; - - /** - * Converts this PriceInfo to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @instance - * @returns {Object.} JSON object - */ - PriceInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - PriceInfo.PriceRange = (function() { - - /** - * Properties of a PriceRange. - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @interface IPriceRange - * @property {google.cloud.retail.v2alpha.IInterval|null} [price] PriceRange price - * @property {google.cloud.retail.v2alpha.IInterval|null} [originalPrice] PriceRange originalPrice - */ - - /** - * Constructs a new PriceRange. - * @memberof google.cloud.retail.v2alpha.PriceInfo - * @classdesc Represents a PriceRange. - * @implements IPriceRange - * @constructor - * @param {google.cloud.retail.v2alpha.PriceInfo.IPriceRange=} [properties] Properties to set - */ - function PriceRange(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]]; - } - - /** - * PriceRange price. - * @member {google.cloud.retail.v2alpha.IInterval|null|undefined} price - * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange - * @instance - */ - PriceRange.prototype.price = null; - - /** - * PriceRange originalPrice. - * @member {google.cloud.retail.v2alpha.IInterval|null|undefined} originalPrice - * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange - * @instance - */ - PriceRange.prototype.originalPrice = null; + /** + * DoNotAssociateAction terms. + * @member {Array.} terms + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction + * @instance + */ + DoNotAssociateAction.prototype.terms = $util.emptyArray; /** - * Creates a new PriceRange instance using the specified properties. + * Creates a new DoNotAssociateAction instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @static - * @param {google.cloud.retail.v2alpha.PriceInfo.IPriceRange=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PriceInfo.PriceRange} PriceRange instance + * @param {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} DoNotAssociateAction instance */ - PriceRange.create = function create(properties) { - return new PriceRange(properties); + DoNotAssociateAction.create = function create(properties) { + return new DoNotAssociateAction(properties); }; /** - * Encodes the specified PriceRange message. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.PriceRange.verify|verify} messages. + * Encodes the specified DoNotAssociateAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @static - * @param {google.cloud.retail.v2alpha.PriceInfo.IPriceRange} message PriceRange message or plain object to encode + * @param {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction} message DoNotAssociateAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PriceRange.encode = function encode(message, writer) { + DoNotAssociateAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.price != null && Object.hasOwnProperty.call(message, "price")) - $root.google.cloud.retail.v2alpha.Interval.encode(message.price, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.originalPrice != null && Object.hasOwnProperty.call(message, "originalPrice")) - $root.google.cloud.retail.v2alpha.Interval.encode(message.originalPrice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.terms != null && message.terms.length) + for (var i = 0; i < message.terms.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.terms[i]); + if (message.queryTerms != null && message.queryTerms.length) + for (var i = 0; i < message.queryTerms.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.queryTerms[i]); + if (message.doNotAssociateTerms != null && message.doNotAssociateTerms.length) + for (var i = 0; i < message.doNotAssociateTerms.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.doNotAssociateTerms[i]); return writer; }; /** - * Encodes the specified PriceRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.PriceRange.verify|verify} messages. + * Encodes the specified DoNotAssociateAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @static - * @param {google.cloud.retail.v2alpha.PriceInfo.IPriceRange} message PriceRange message or plain object to encode + * @param {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction} message DoNotAssociateAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PriceRange.encodeDelimited = function encodeDelimited(message, writer) { + DoNotAssociateAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PriceRange message from the specified reader or buffer. + * Decodes a DoNotAssociateAction message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @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.PriceInfo.PriceRange} PriceRange + * @returns {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} DoNotAssociateAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PriceRange.decode = function decode(reader, length) { + DoNotAssociateAction.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.PriceInfo.PriceRange(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.price = $root.google.cloud.retail.v2alpha.Interval.decode(reader, reader.uint32()); - break; case 2: - message.originalPrice = $root.google.cloud.retail.v2alpha.Interval.decode(reader, reader.uint32()); + if (!(message.queryTerms && message.queryTerms.length)) + message.queryTerms = []; + message.queryTerms.push(reader.string()); + break; + case 3: + if (!(message.doNotAssociateTerms && message.doNotAssociateTerms.length)) + message.doNotAssociateTerms = []; + message.doNotAssociateTerms.push(reader.string()); + break; + case 1: + if (!(message.terms && message.terms.length)) + message.terms = []; + message.terms.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -29062,389 +28454,618 @@ }; /** - * Decodes a PriceRange message from the specified reader or buffer, length delimited. + * Decodes a DoNotAssociateAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PriceInfo.PriceRange} PriceRange + * @returns {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} DoNotAssociateAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PriceRange.decodeDelimited = function decodeDelimited(reader) { + DoNotAssociateAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PriceRange message. + * Verifies a DoNotAssociateAction message. * @function verify - * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PriceRange.verify = function verify(message) { + DoNotAssociateAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.price != null && message.hasOwnProperty("price")) { - var error = $root.google.cloud.retail.v2alpha.Interval.verify(message.price); - if (error) - return "price." + error; + if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { + if (!Array.isArray(message.queryTerms)) + return "queryTerms: array expected"; + for (var i = 0; i < message.queryTerms.length; ++i) + if (!$util.isString(message.queryTerms[i])) + return "queryTerms: string[] expected"; } - if (message.originalPrice != null && message.hasOwnProperty("originalPrice")) { - var error = $root.google.cloud.retail.v2alpha.Interval.verify(message.originalPrice); - if (error) - return "originalPrice." + error; + if (message.doNotAssociateTerms != null && message.hasOwnProperty("doNotAssociateTerms")) { + if (!Array.isArray(message.doNotAssociateTerms)) + return "doNotAssociateTerms: array expected"; + for (var i = 0; i < message.doNotAssociateTerms.length; ++i) + if (!$util.isString(message.doNotAssociateTerms[i])) + return "doNotAssociateTerms: string[] expected"; + } + if (message.terms != null && message.hasOwnProperty("terms")) { + if (!Array.isArray(message.terms)) + return "terms: array expected"; + for (var i = 0; i < message.terms.length; ++i) + if (!$util.isString(message.terms[i])) + return "terms: string[] expected"; } return null; }; /** - * Creates a PriceRange message from a plain object. Also converts values to their respective internal types. + * Creates a DoNotAssociateAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PriceInfo.PriceRange} PriceRange + * @returns {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} DoNotAssociateAction */ - PriceRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PriceInfo.PriceRange) + DoNotAssociateAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) return object; - var message = new $root.google.cloud.retail.v2alpha.PriceInfo.PriceRange(); - if (object.price != null) { - if (typeof object.price !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PriceInfo.PriceRange.price: object expected"); - message.price = $root.google.cloud.retail.v2alpha.Interval.fromObject(object.price); + var message = new $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction(); + if (object.queryTerms) { + if (!Array.isArray(object.queryTerms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.queryTerms: array expected"); + message.queryTerms = []; + for (var i = 0; i < object.queryTerms.length; ++i) + message.queryTerms[i] = String(object.queryTerms[i]); } - if (object.originalPrice != null) { - if (typeof object.originalPrice !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PriceInfo.PriceRange.originalPrice: object expected"); - message.originalPrice = $root.google.cloud.retail.v2alpha.Interval.fromObject(object.originalPrice); + if (object.doNotAssociateTerms) { + if (!Array.isArray(object.doNotAssociateTerms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.doNotAssociateTerms: array expected"); + message.doNotAssociateTerms = []; + for (var i = 0; i < object.doNotAssociateTerms.length; ++i) + message.doNotAssociateTerms[i] = String(object.doNotAssociateTerms[i]); + } + if (object.terms) { + if (!Array.isArray(object.terms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.terms: array expected"); + message.terms = []; + for (var i = 0; i < object.terms.length; ++i) + message.terms[i] = String(object.terms[i]); } return message; }; /** - * Creates a plain object from a PriceRange message. Also converts values to other types if specified. + * Creates a plain object from a DoNotAssociateAction message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @static - * @param {google.cloud.retail.v2alpha.PriceInfo.PriceRange} message PriceRange + * @param {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} message DoNotAssociateAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PriceRange.toObject = function toObject(message, options) { + DoNotAssociateAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.price = null; - object.originalPrice = null; + if (options.arrays || options.defaults) { + object.terms = []; + object.queryTerms = []; + object.doNotAssociateTerms = []; + } + if (message.terms && message.terms.length) { + object.terms = []; + for (var j = 0; j < message.terms.length; ++j) + object.terms[j] = message.terms[j]; + } + if (message.queryTerms && message.queryTerms.length) { + object.queryTerms = []; + for (var j = 0; j < message.queryTerms.length; ++j) + object.queryTerms[j] = message.queryTerms[j]; + } + if (message.doNotAssociateTerms && message.doNotAssociateTerms.length) { + object.doNotAssociateTerms = []; + for (var j = 0; j < message.doNotAssociateTerms.length; ++j) + object.doNotAssociateTerms[j] = message.doNotAssociateTerms[j]; } - if (message.price != null && message.hasOwnProperty("price")) - object.price = $root.google.cloud.retail.v2alpha.Interval.toObject(message.price, options); - if (message.originalPrice != null && message.hasOwnProperty("originalPrice")) - object.originalPrice = $root.google.cloud.retail.v2alpha.Interval.toObject(message.originalPrice, options); return object; }; /** - * Converts this PriceRange to JSON. + * Converts this DoNotAssociateAction to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @instance * @returns {Object.} JSON object */ - PriceRange.prototype.toJSON = function toJSON() { + DoNotAssociateAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PriceRange; + return DoNotAssociateAction; })(); - return PriceInfo; - })(); - - v2alpha.Rating = (function() { + Rule.ReplacementAction = (function() { - /** - * Properties of a Rating. - * @memberof google.cloud.retail.v2alpha - * @interface IRating - * @property {number|null} [ratingCount] Rating ratingCount - * @property {number|null} [averageRating] Rating averageRating - * @property {Array.|null} [ratingHistogram] Rating ratingHistogram - */ + /** + * Properties of a ReplacementAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @interface IReplacementAction + * @property {Array.|null} [queryTerms] ReplacementAction queryTerms + * @property {string|null} [replacementTerm] ReplacementAction replacementTerm + * @property {string|null} [term] ReplacementAction term + */ - /** - * Constructs a new Rating. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a Rating. - * @implements IRating - * @constructor - * @param {google.cloud.retail.v2alpha.IRating=} [properties] Properties to set - */ - function Rating(properties) { - this.ratingHistogram = []; - 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]]; - } + /** + * Constructs a new ReplacementAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @classdesc Represents a ReplacementAction. + * @implements IReplacementAction + * @constructor + * @param {google.cloud.retail.v2alpha.Rule.IReplacementAction=} [properties] Properties to set + */ + function ReplacementAction(properties) { + this.queryTerms = []; + 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]]; + } - /** - * Rating ratingCount. - * @member {number} ratingCount - * @memberof google.cloud.retail.v2alpha.Rating - * @instance - */ - Rating.prototype.ratingCount = 0; + /** + * ReplacementAction queryTerms. + * @member {Array.} queryTerms + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * @instance + */ + ReplacementAction.prototype.queryTerms = $util.emptyArray; - /** - * Rating averageRating. - * @member {number} averageRating - * @memberof google.cloud.retail.v2alpha.Rating - * @instance - */ - Rating.prototype.averageRating = 0; + /** + * ReplacementAction replacementTerm. + * @member {string} replacementTerm + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * @instance + */ + ReplacementAction.prototype.replacementTerm = ""; - /** - * Rating ratingHistogram. - * @member {Array.} ratingHistogram - * @memberof google.cloud.retail.v2alpha.Rating - * @instance - */ - Rating.prototype.ratingHistogram = $util.emptyArray; + /** + * ReplacementAction term. + * @member {string} term + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * @instance + */ + ReplacementAction.prototype.term = ""; - /** - * Creates a new Rating instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Rating - * @static - * @param {google.cloud.retail.v2alpha.IRating=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rating} Rating instance - */ - Rating.create = function create(properties) { - return new Rating(properties); - }; + /** + * Creates a new ReplacementAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IReplacementAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.ReplacementAction} ReplacementAction instance + */ + ReplacementAction.create = function create(properties) { + return new ReplacementAction(properties); + }; - /** - * Encodes the specified Rating message. Does not implicitly {@link google.cloud.retail.v2alpha.Rating.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Rating - * @static - * @param {google.cloud.retail.v2alpha.IRating} message Rating message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Rating.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ratingCount != null && Object.hasOwnProperty.call(message, "ratingCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ratingCount); - if (message.averageRating != null && Object.hasOwnProperty.call(message, "averageRating")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.averageRating); - if (message.ratingHistogram != null && message.ratingHistogram.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.ratingHistogram.length; ++i) - writer.int32(message.ratingHistogram[i]); - writer.ldelim(); - } - return writer; - }; + /** + * Encodes the specified ReplacementAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ReplacementAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IReplacementAction} message ReplacementAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplacementAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.term != null && Object.hasOwnProperty.call(message, "term")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.term); + if (message.queryTerms != null && message.queryTerms.length) + for (var i = 0; i < message.queryTerms.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.queryTerms[i]); + if (message.replacementTerm != null && Object.hasOwnProperty.call(message, "replacementTerm")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.replacementTerm); + return writer; + }; - /** - * Encodes the specified Rating message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rating.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rating - * @static - * @param {google.cloud.retail.v2alpha.IRating} message Rating message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Rating.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ReplacementAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ReplacementAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IReplacementAction} message ReplacementAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplacementAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a Rating message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Rating - * @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.Rating} Rating - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Rating.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.Rating(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ratingCount = reader.int32(); - break; - case 2: - message.averageRating = reader.float(); - break; - case 3: - if (!(message.ratingHistogram && message.ratingHistogram.length)) - message.ratingHistogram = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.ratingHistogram.push(reader.int32()); - } else - message.ratingHistogram.push(reader.int32()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a ReplacementAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * @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.Rule.ReplacementAction} ReplacementAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplacementAction.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.Rule.ReplacementAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.queryTerms && message.queryTerms.length)) + message.queryTerms = []; + message.queryTerms.push(reader.string()); + break; + case 3: + message.replacementTerm = reader.string(); + break; + case 1: + message.term = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a Rating message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rating - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rating} Rating - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Rating.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a ReplacementAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Rule.ReplacementAction} ReplacementAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplacementAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a Rating message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Rating - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Rating.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ratingCount != null && message.hasOwnProperty("ratingCount")) - if (!$util.isInteger(message.ratingCount)) - return "ratingCount: integer expected"; - if (message.averageRating != null && message.hasOwnProperty("averageRating")) - if (typeof message.averageRating !== "number") - return "averageRating: number expected"; - if (message.ratingHistogram != null && message.hasOwnProperty("ratingHistogram")) { - if (!Array.isArray(message.ratingHistogram)) - return "ratingHistogram: array expected"; - for (var i = 0; i < message.ratingHistogram.length; ++i) - if (!$util.isInteger(message.ratingHistogram[i])) - return "ratingHistogram: integer[] expected"; - } - return null; - }; + /** + * Verifies a ReplacementAction message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplacementAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { + if (!Array.isArray(message.queryTerms)) + return "queryTerms: array expected"; + for (var i = 0; i < message.queryTerms.length; ++i) + if (!$util.isString(message.queryTerms[i])) + return "queryTerms: string[] expected"; + } + if (message.replacementTerm != null && message.hasOwnProperty("replacementTerm")) + if (!$util.isString(message.replacementTerm)) + return "replacementTerm: string expected"; + if (message.term != null && message.hasOwnProperty("term")) + if (!$util.isString(message.term)) + return "term: string expected"; + return null; + }; - /** - * Creates a Rating message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rating - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rating} Rating - */ - Rating.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rating) - return object; - var message = new $root.google.cloud.retail.v2alpha.Rating(); - if (object.ratingCount != null) - message.ratingCount = object.ratingCount | 0; - if (object.averageRating != null) - message.averageRating = Number(object.averageRating); - if (object.ratingHistogram) { - if (!Array.isArray(object.ratingHistogram)) - throw TypeError(".google.cloud.retail.v2alpha.Rating.ratingHistogram: array expected"); - message.ratingHistogram = []; - for (var i = 0; i < object.ratingHistogram.length; ++i) - message.ratingHistogram[i] = object.ratingHistogram[i] | 0; - } - return message; - }; + /** + * Creates a ReplacementAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Rule.ReplacementAction} ReplacementAction + */ + ReplacementAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.ReplacementAction) + return object; + var message = new $root.google.cloud.retail.v2alpha.Rule.ReplacementAction(); + if (object.queryTerms) { + if (!Array.isArray(object.queryTerms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.ReplacementAction.queryTerms: array expected"); + message.queryTerms = []; + for (var i = 0; i < object.queryTerms.length; ++i) + message.queryTerms[i] = String(object.queryTerms[i]); + } + if (object.replacementTerm != null) + message.replacementTerm = String(object.replacementTerm); + if (object.term != null) + message.term = String(object.term); + return message; + }; - /** - * Creates a plain object from a Rating message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Rating - * @static - * @param {google.cloud.retail.v2alpha.Rating} message Rating - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Rating.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ratingHistogram = []; - if (options.defaults) { - object.ratingCount = 0; - object.averageRating = 0; - } - if (message.ratingCount != null && message.hasOwnProperty("ratingCount")) - object.ratingCount = message.ratingCount; - if (message.averageRating != null && message.hasOwnProperty("averageRating")) - object.averageRating = options.json && !isFinite(message.averageRating) ? String(message.averageRating) : message.averageRating; - if (message.ratingHistogram && message.ratingHistogram.length) { - object.ratingHistogram = []; - for (var j = 0; j < message.ratingHistogram.length; ++j) - object.ratingHistogram[j] = message.ratingHistogram[j]; - } - return object; - }; + /** + * Creates a plain object from a ReplacementAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.ReplacementAction} message ReplacementAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplacementAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.queryTerms = []; + if (options.defaults) { + object.term = ""; + object.replacementTerm = ""; + } + if (message.term != null && message.hasOwnProperty("term")) + object.term = message.term; + if (message.queryTerms && message.queryTerms.length) { + object.queryTerms = []; + for (var j = 0; j < message.queryTerms.length; ++j) + object.queryTerms[j] = message.queryTerms[j]; + } + if (message.replacementTerm != null && message.hasOwnProperty("replacementTerm")) + object.replacementTerm = message.replacementTerm; + return object; + }; - /** - * Converts this Rating to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rating - * @instance - * @returns {Object.} JSON object - */ - Rating.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this ReplacementAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * @instance + * @returns {Object.} JSON object + */ + ReplacementAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Rating; + return ReplacementAction; + })(); + + Rule.IgnoreAction = (function() { + + /** + * Properties of an IgnoreAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @interface IIgnoreAction + * @property {Array.|null} [ignoreTerms] IgnoreAction ignoreTerms + */ + + /** + * Constructs a new IgnoreAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @classdesc Represents an IgnoreAction. + * @implements IIgnoreAction + * @constructor + * @param {google.cloud.retail.v2alpha.Rule.IIgnoreAction=} [properties] Properties to set + */ + function IgnoreAction(properties) { + this.ignoreTerms = []; + 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]]; + } + + /** + * IgnoreAction ignoreTerms. + * @member {Array.} ignoreTerms + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction + * @instance + */ + IgnoreAction.prototype.ignoreTerms = $util.emptyArray; + + /** + * Creates a new IgnoreAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IIgnoreAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.IgnoreAction} IgnoreAction instance + */ + IgnoreAction.create = function create(properties) { + return new IgnoreAction(properties); + }; + + /** + * Encodes the specified IgnoreAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.IgnoreAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IIgnoreAction} message IgnoreAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IgnoreAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ignoreTerms != null && message.ignoreTerms.length) + for (var i = 0; i < message.ignoreTerms.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ignoreTerms[i]); + return writer; + }; + + /** + * Encodes the specified IgnoreAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.IgnoreAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IIgnoreAction} message IgnoreAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IgnoreAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IgnoreAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction + * @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.Rule.IgnoreAction} IgnoreAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IgnoreAction.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.Rule.IgnoreAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ignoreTerms && message.ignoreTerms.length)) + message.ignoreTerms = []; + message.ignoreTerms.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IgnoreAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Rule.IgnoreAction} IgnoreAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IgnoreAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IgnoreAction message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IgnoreAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ignoreTerms != null && message.hasOwnProperty("ignoreTerms")) { + if (!Array.isArray(message.ignoreTerms)) + return "ignoreTerms: array expected"; + for (var i = 0; i < message.ignoreTerms.length; ++i) + if (!$util.isString(message.ignoreTerms[i])) + return "ignoreTerms: string[] expected"; + } + return null; + }; + + /** + * Creates an IgnoreAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Rule.IgnoreAction} IgnoreAction + */ + IgnoreAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.IgnoreAction) + return object; + var message = new $root.google.cloud.retail.v2alpha.Rule.IgnoreAction(); + if (object.ignoreTerms) { + if (!Array.isArray(object.ignoreTerms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.IgnoreAction.ignoreTerms: array expected"); + message.ignoreTerms = []; + for (var i = 0; i < object.ignoreTerms.length; ++i) + message.ignoreTerms[i] = String(object.ignoreTerms[i]); + } + return message; + }; + + /** + * Creates a plain object from an IgnoreAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IgnoreAction} message IgnoreAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IgnoreAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ignoreTerms = []; + if (message.ignoreTerms && message.ignoreTerms.length) { + object.ignoreTerms = []; + for (var j = 0; j < message.ignoreTerms.length; ++j) + object.ignoreTerms[j] = message.ignoreTerms[j]; + } + return object; + }; + + /** + * Converts this IgnoreAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction + * @instance + * @returns {Object.} JSON object + */ + IgnoreAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IgnoreAction; + })(); + + return Rule; })(); - v2alpha.UserInfo = (function() { + v2alpha.Audience = (function() { /** - * Properties of a UserInfo. + * Properties of an Audience. * @memberof google.cloud.retail.v2alpha - * @interface IUserInfo - * @property {string|null} [userId] UserInfo userId - * @property {string|null} [ipAddress] UserInfo ipAddress - * @property {string|null} [userAgent] UserInfo userAgent - * @property {boolean|null} [directUserRequest] UserInfo directUserRequest + * @interface IAudience + * @property {Array.|null} [genders] Audience genders + * @property {Array.|null} [ageGroups] Audience ageGroups */ /** - * Constructs a new UserInfo. + * Constructs a new Audience. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a UserInfo. - * @implements IUserInfo + * @classdesc Represents an Audience. + * @implements IAudience * @constructor - * @param {google.cloud.retail.v2alpha.IUserInfo=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IAudience=} [properties] Properties to set */ - function UserInfo(properties) { + function Audience(properties) { + this.genders = []; + this.ageGroups = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29452,114 +29073,94 @@ } /** - * UserInfo userId. - * @member {string} userId - * @memberof google.cloud.retail.v2alpha.UserInfo - * @instance - */ - UserInfo.prototype.userId = ""; - - /** - * UserInfo ipAddress. - * @member {string} ipAddress - * @memberof google.cloud.retail.v2alpha.UserInfo - * @instance - */ - UserInfo.prototype.ipAddress = ""; - - /** - * UserInfo userAgent. - * @member {string} userAgent - * @memberof google.cloud.retail.v2alpha.UserInfo + * Audience genders. + * @member {Array.} genders + * @memberof google.cloud.retail.v2alpha.Audience * @instance */ - UserInfo.prototype.userAgent = ""; + Audience.prototype.genders = $util.emptyArray; /** - * UserInfo directUserRequest. - * @member {boolean} directUserRequest - * @memberof google.cloud.retail.v2alpha.UserInfo + * Audience ageGroups. + * @member {Array.} ageGroups + * @memberof google.cloud.retail.v2alpha.Audience * @instance */ - UserInfo.prototype.directUserRequest = false; + Audience.prototype.ageGroups = $util.emptyArray; /** - * Creates a new UserInfo instance using the specified properties. + * Creates a new Audience instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.UserInfo + * @memberof google.cloud.retail.v2alpha.Audience * @static - * @param {google.cloud.retail.v2alpha.IUserInfo=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.UserInfo} UserInfo instance + * @param {google.cloud.retail.v2alpha.IAudience=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Audience} Audience instance */ - UserInfo.create = function create(properties) { - return new UserInfo(properties); + Audience.create = function create(properties) { + return new Audience(properties); }; /** - * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.UserInfo.verify|verify} messages. + * Encodes the specified Audience message. Does not implicitly {@link google.cloud.retail.v2alpha.Audience.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.UserInfo + * @memberof google.cloud.retail.v2alpha.Audience * @static - * @param {google.cloud.retail.v2alpha.IUserInfo} message UserInfo message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAudience} message Audience message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserInfo.encode = function encode(message, writer) { + Audience.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.userId); - if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAddress); - if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.userAgent); - if (message.directUserRequest != null && Object.hasOwnProperty.call(message, "directUserRequest")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.directUserRequest); + if (message.genders != null && message.genders.length) + for (var i = 0; i < message.genders.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.genders[i]); + if (message.ageGroups != null && message.ageGroups.length) + for (var i = 0; i < message.ageGroups.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ageGroups[i]); return writer; }; /** - * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserInfo.verify|verify} messages. + * Encodes the specified Audience message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Audience.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.UserInfo + * @memberof google.cloud.retail.v2alpha.Audience * @static - * @param {google.cloud.retail.v2alpha.IUserInfo} message UserInfo message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAudience} message Audience message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserInfo.encodeDelimited = function encodeDelimited(message, writer) { + Audience.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserInfo message from the specified reader or buffer. + * Decodes an Audience message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.UserInfo + * @memberof google.cloud.retail.v2alpha.Audience * @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.UserInfo} UserInfo + * @returns {google.cloud.retail.v2alpha.Audience} Audience * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserInfo.decode = function decode(reader, length) { + Audience.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.UserInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Audience(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.userId = reader.string(); + if (!(message.genders && message.genders.length)) + message.genders = []; + message.genders.push(reader.string()); break; case 2: - message.ipAddress = reader.string(); - break; - case 3: - message.userAgent = reader.string(); - break; - case 4: - message.directUserRequest = reader.bool(); + if (!(message.ageGroups && message.ageGroups.length)) + message.ageGroups = []; + message.ageGroups.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -29570,132 +29171,143 @@ }; /** - * Decodes a UserInfo message from the specified reader or buffer, length delimited. + * Decodes an Audience message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.UserInfo + * @memberof google.cloud.retail.v2alpha.Audience * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.UserInfo} UserInfo + * @returns {google.cloud.retail.v2alpha.Audience} Audience * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserInfo.decodeDelimited = function decodeDelimited(reader) { + Audience.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserInfo message. + * Verifies an Audience message. * @function verify - * @memberof google.cloud.retail.v2alpha.UserInfo + * @memberof google.cloud.retail.v2alpha.Audience * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserInfo.verify = function verify(message) { + Audience.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.userId != null && message.hasOwnProperty("userId")) - if (!$util.isString(message.userId)) - return "userId: string expected"; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - if (message.userAgent != null && message.hasOwnProperty("userAgent")) - if (!$util.isString(message.userAgent)) - return "userAgent: string expected"; - if (message.directUserRequest != null && message.hasOwnProperty("directUserRequest")) - if (typeof message.directUserRequest !== "boolean") - return "directUserRequest: boolean expected"; + if (message.genders != null && message.hasOwnProperty("genders")) { + if (!Array.isArray(message.genders)) + return "genders: array expected"; + for (var i = 0; i < message.genders.length; ++i) + if (!$util.isString(message.genders[i])) + return "genders: string[] expected"; + } + if (message.ageGroups != null && message.hasOwnProperty("ageGroups")) { + if (!Array.isArray(message.ageGroups)) + return "ageGroups: array expected"; + for (var i = 0; i < message.ageGroups.length; ++i) + if (!$util.isString(message.ageGroups[i])) + return "ageGroups: string[] expected"; + } return null; }; /** - * Creates a UserInfo message from a plain object. Also converts values to their respective internal types. + * Creates an Audience message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.UserInfo + * @memberof google.cloud.retail.v2alpha.Audience * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.UserInfo} UserInfo + * @returns {google.cloud.retail.v2alpha.Audience} Audience */ - UserInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.UserInfo) + Audience.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Audience) return object; - var message = new $root.google.cloud.retail.v2alpha.UserInfo(); - if (object.userId != null) - message.userId = String(object.userId); - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - if (object.userAgent != null) - message.userAgent = String(object.userAgent); - if (object.directUserRequest != null) - message.directUserRequest = Boolean(object.directUserRequest); + var message = new $root.google.cloud.retail.v2alpha.Audience(); + if (object.genders) { + if (!Array.isArray(object.genders)) + throw TypeError(".google.cloud.retail.v2alpha.Audience.genders: array expected"); + message.genders = []; + for (var i = 0; i < object.genders.length; ++i) + message.genders[i] = String(object.genders[i]); + } + if (object.ageGroups) { + if (!Array.isArray(object.ageGroups)) + throw TypeError(".google.cloud.retail.v2alpha.Audience.ageGroups: array expected"); + message.ageGroups = []; + for (var i = 0; i < object.ageGroups.length; ++i) + message.ageGroups[i] = String(object.ageGroups[i]); + } return message; }; /** - * Creates a plain object from a UserInfo message. Also converts values to other types if specified. + * Creates a plain object from an Audience message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.UserInfo + * @memberof google.cloud.retail.v2alpha.Audience * @static - * @param {google.cloud.retail.v2alpha.UserInfo} message UserInfo + * @param {google.cloud.retail.v2alpha.Audience} message Audience * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserInfo.toObject = function toObject(message, options) { + Audience.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.userId = ""; - object.ipAddress = ""; - object.userAgent = ""; - object.directUserRequest = false; + if (options.arrays || options.defaults) { + object.genders = []; + object.ageGroups = []; + } + if (message.genders && message.genders.length) { + object.genders = []; + for (var j = 0; j < message.genders.length; ++j) + object.genders[j] = message.genders[j]; + } + if (message.ageGroups && message.ageGroups.length) { + object.ageGroups = []; + for (var j = 0; j < message.ageGroups.length; ++j) + object.ageGroups[j] = message.ageGroups[j]; } - if (message.userId != null && message.hasOwnProperty("userId")) - object.userId = message.userId; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - object.ipAddress = message.ipAddress; - if (message.userAgent != null && message.hasOwnProperty("userAgent")) - object.userAgent = message.userAgent; - if (message.directUserRequest != null && message.hasOwnProperty("directUserRequest")) - object.directUserRequest = message.directUserRequest; return object; }; /** - * Converts this UserInfo to JSON. + * Converts this Audience to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.UserInfo + * @memberof google.cloud.retail.v2alpha.Audience * @instance * @returns {Object.} JSON object */ - UserInfo.prototype.toJSON = function toJSON() { + Audience.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UserInfo; + return Audience; })(); - v2alpha.Promotion = (function() { + v2alpha.ColorInfo = (function() { /** - * Properties of a Promotion. + * Properties of a ColorInfo. * @memberof google.cloud.retail.v2alpha - * @interface IPromotion - * @property {string|null} [promotionId] Promotion promotionId + * @interface IColorInfo + * @property {Array.|null} [colorFamilies] ColorInfo colorFamilies + * @property {Array.|null} [colors] ColorInfo colors */ /** - * Constructs a new Promotion. + * Constructs a new ColorInfo. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a Promotion. - * @implements IPromotion + * @classdesc Represents a ColorInfo. + * @implements IColorInfo * @constructor - * @param {google.cloud.retail.v2alpha.IPromotion=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IColorInfo=} [properties] Properties to set */ - function Promotion(properties) { + function ColorInfo(properties) { + this.colorFamilies = []; + this.colors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29703,75 +29315,94 @@ } /** - * Promotion promotionId. - * @member {string} promotionId - * @memberof google.cloud.retail.v2alpha.Promotion + * ColorInfo colorFamilies. + * @member {Array.} colorFamilies + * @memberof google.cloud.retail.v2alpha.ColorInfo * @instance */ - Promotion.prototype.promotionId = ""; + ColorInfo.prototype.colorFamilies = $util.emptyArray; /** - * Creates a new Promotion instance using the specified properties. + * ColorInfo colors. + * @member {Array.} colors + * @memberof google.cloud.retail.v2alpha.ColorInfo + * @instance + */ + ColorInfo.prototype.colors = $util.emptyArray; + + /** + * Creates a new ColorInfo instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ColorInfo * @static - * @param {google.cloud.retail.v2alpha.IPromotion=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Promotion} Promotion instance + * @param {google.cloud.retail.v2alpha.IColorInfo=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ColorInfo} ColorInfo instance */ - Promotion.create = function create(properties) { - return new Promotion(properties); + ColorInfo.create = function create(properties) { + return new ColorInfo(properties); }; /** - * Encodes the specified Promotion message. Does not implicitly {@link google.cloud.retail.v2alpha.Promotion.verify|verify} messages. + * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.ColorInfo.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ColorInfo * @static - * @param {google.cloud.retail.v2alpha.IPromotion} message Promotion message or plain object to encode + * @param {google.cloud.retail.v2alpha.IColorInfo} message ColorInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Promotion.encode = function encode(message, writer) { + ColorInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.promotionId != null && Object.hasOwnProperty.call(message, "promotionId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.promotionId); + if (message.colorFamilies != null && message.colorFamilies.length) + for (var i = 0; i < message.colorFamilies.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.colorFamilies[i]); + if (message.colors != null && message.colors.length) + for (var i = 0; i < message.colors.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.colors[i]); return writer; }; /** - * Encodes the specified Promotion message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Promotion.verify|verify} messages. + * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ColorInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ColorInfo * @static - * @param {google.cloud.retail.v2alpha.IPromotion} message Promotion message or plain object to encode + * @param {google.cloud.retail.v2alpha.IColorInfo} message ColorInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Promotion.encodeDelimited = function encodeDelimited(message, writer) { + ColorInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Promotion message from the specified reader or buffer. + * Decodes a ColorInfo message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ColorInfo * @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.Promotion} Promotion + * @returns {google.cloud.retail.v2alpha.ColorInfo} ColorInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Promotion.decode = function decode(reader, length) { + ColorInfo.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.Promotion(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ColorInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.promotionId = reader.string(); + if (!(message.colorFamilies && message.colorFamilies.length)) + message.colorFamilies = []; + message.colorFamilies.push(reader.string()); + break; + case 2: + if (!(message.colors && message.colors.length)) + message.colors = []; + message.colors.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -29782,110 +29413,145 @@ }; /** - * Decodes a Promotion message from the specified reader or buffer, length delimited. + * Decodes a ColorInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ColorInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Promotion} Promotion + * @returns {google.cloud.retail.v2alpha.ColorInfo} ColorInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Promotion.decodeDelimited = function decodeDelimited(reader) { + ColorInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Promotion message. + * Verifies a ColorInfo message. * @function verify - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ColorInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Promotion.verify = function verify(message) { + ColorInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.promotionId != null && message.hasOwnProperty("promotionId")) - if (!$util.isString(message.promotionId)) - return "promotionId: string expected"; + if (message.colorFamilies != null && message.hasOwnProperty("colorFamilies")) { + if (!Array.isArray(message.colorFamilies)) + return "colorFamilies: array expected"; + for (var i = 0; i < message.colorFamilies.length; ++i) + if (!$util.isString(message.colorFamilies[i])) + return "colorFamilies: string[] expected"; + } + if (message.colors != null && message.hasOwnProperty("colors")) { + if (!Array.isArray(message.colors)) + return "colors: array expected"; + for (var i = 0; i < message.colors.length; ++i) + if (!$util.isString(message.colors[i])) + return "colors: string[] expected"; + } return null; }; /** - * Creates a Promotion message from a plain object. Also converts values to their respective internal types. + * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ColorInfo * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Promotion} Promotion + * @returns {google.cloud.retail.v2alpha.ColorInfo} ColorInfo */ - Promotion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Promotion) + ColorInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ColorInfo) return object; - var message = new $root.google.cloud.retail.v2alpha.Promotion(); - if (object.promotionId != null) - message.promotionId = String(object.promotionId); + var message = new $root.google.cloud.retail.v2alpha.ColorInfo(); + if (object.colorFamilies) { + if (!Array.isArray(object.colorFamilies)) + throw TypeError(".google.cloud.retail.v2alpha.ColorInfo.colorFamilies: array expected"); + message.colorFamilies = []; + for (var i = 0; i < object.colorFamilies.length; ++i) + message.colorFamilies[i] = String(object.colorFamilies[i]); + } + if (object.colors) { + if (!Array.isArray(object.colors)) + throw TypeError(".google.cloud.retail.v2alpha.ColorInfo.colors: array expected"); + message.colors = []; + for (var i = 0; i < object.colors.length; ++i) + message.colors[i] = String(object.colors[i]); + } return message; }; /** - * Creates a plain object from a Promotion message. Also converts values to other types if specified. + * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ColorInfo * @static - * @param {google.cloud.retail.v2alpha.Promotion} message Promotion + * @param {google.cloud.retail.v2alpha.ColorInfo} message ColorInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Promotion.toObject = function toObject(message, options) { + ColorInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.promotionId = ""; - if (message.promotionId != null && message.hasOwnProperty("promotionId")) - object.promotionId = message.promotionId; + if (options.arrays || options.defaults) { + object.colorFamilies = []; + object.colors = []; + } + if (message.colorFamilies && message.colorFamilies.length) { + object.colorFamilies = []; + for (var j = 0; j < message.colorFamilies.length; ++j) + object.colorFamilies[j] = message.colorFamilies[j]; + } + if (message.colors && message.colors.length) { + object.colors = []; + for (var j = 0; j < message.colors.length; ++j) + object.colors[j] = message.colors[j]; + } return object; }; /** - * Converts this Promotion to JSON. + * Converts this ColorInfo to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ColorInfo * @instance * @returns {Object.} JSON object */ - Promotion.prototype.toJSON = function toJSON() { + ColorInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Promotion; + return ColorInfo; })(); - v2alpha.LocalInventory = (function() { + v2alpha.CustomAttribute = (function() { /** - * Properties of a LocalInventory. + * Properties of a CustomAttribute. * @memberof google.cloud.retail.v2alpha - * @interface ILocalInventory - * @property {string|null} [placeId] LocalInventory placeId - * @property {google.cloud.retail.v2alpha.IPriceInfo|null} [priceInfo] LocalInventory priceInfo - * @property {Object.|null} [attributes] LocalInventory attributes + * @interface ICustomAttribute + * @property {Array.|null} [text] CustomAttribute text + * @property {Array.|null} [numbers] CustomAttribute numbers + * @property {boolean|null} [searchable] CustomAttribute searchable + * @property {boolean|null} [indexable] CustomAttribute indexable */ /** - * Constructs a new LocalInventory. + * Constructs a new CustomAttribute. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a LocalInventory. - * @implements ILocalInventory + * @classdesc Represents a CustomAttribute. + * @implements ICustomAttribute * @constructor - * @param {google.cloud.retail.v2alpha.ILocalInventory=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ICustomAttribute=} [properties] Properties to set */ - function LocalInventory(properties) { - this.attributes = {}; + function CustomAttribute(properties) { + this.text = []; + this.numbers = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29893,123 +29559,153 @@ } /** - * LocalInventory placeId. - * @member {string} placeId - * @memberof google.cloud.retail.v2alpha.LocalInventory + * CustomAttribute text. + * @member {Array.} text + * @memberof google.cloud.retail.v2alpha.CustomAttribute * @instance */ - LocalInventory.prototype.placeId = ""; + CustomAttribute.prototype.text = $util.emptyArray; /** - * LocalInventory priceInfo. - * @member {google.cloud.retail.v2alpha.IPriceInfo|null|undefined} priceInfo - * @memberof google.cloud.retail.v2alpha.LocalInventory + * CustomAttribute numbers. + * @member {Array.} numbers + * @memberof google.cloud.retail.v2alpha.CustomAttribute * @instance */ - LocalInventory.prototype.priceInfo = null; + CustomAttribute.prototype.numbers = $util.emptyArray; /** - * LocalInventory attributes. - * @member {Object.} attributes - * @memberof google.cloud.retail.v2alpha.LocalInventory + * CustomAttribute searchable. + * @member {boolean|null|undefined} searchable + * @memberof google.cloud.retail.v2alpha.CustomAttribute * @instance */ - LocalInventory.prototype.attributes = $util.emptyObject; + CustomAttribute.prototype.searchable = null; /** - * Creates a new LocalInventory instance using the specified properties. + * CustomAttribute indexable. + * @member {boolean|null|undefined} indexable + * @memberof google.cloud.retail.v2alpha.CustomAttribute + * @instance + */ + CustomAttribute.prototype.indexable = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CustomAttribute _searchable. + * @member {"searchable"|undefined} _searchable + * @memberof google.cloud.retail.v2alpha.CustomAttribute + * @instance + */ + Object.defineProperty(CustomAttribute.prototype, "_searchable", { + get: $util.oneOfGetter($oneOfFields = ["searchable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CustomAttribute _indexable. + * @member {"indexable"|undefined} _indexable + * @memberof google.cloud.retail.v2alpha.CustomAttribute + * @instance + */ + Object.defineProperty(CustomAttribute.prototype, "_indexable", { + get: $util.oneOfGetter($oneOfFields = ["indexable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomAttribute instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.LocalInventory + * @memberof google.cloud.retail.v2alpha.CustomAttribute * @static - * @param {google.cloud.retail.v2alpha.ILocalInventory=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.LocalInventory} LocalInventory instance + * @param {google.cloud.retail.v2alpha.ICustomAttribute=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CustomAttribute} CustomAttribute instance */ - LocalInventory.create = function create(properties) { - return new LocalInventory(properties); + CustomAttribute.create = function create(properties) { + return new CustomAttribute(properties); }; /** - * Encodes the specified LocalInventory message. Does not implicitly {@link google.cloud.retail.v2alpha.LocalInventory.verify|verify} messages. + * Encodes the specified CustomAttribute message. Does not implicitly {@link google.cloud.retail.v2alpha.CustomAttribute.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.LocalInventory + * @memberof google.cloud.retail.v2alpha.CustomAttribute * @static - * @param {google.cloud.retail.v2alpha.ILocalInventory} message LocalInventory message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICustomAttribute} message CustomAttribute message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LocalInventory.encode = function encode(message, writer) { + CustomAttribute.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.placeId != null && Object.hasOwnProperty.call(message, "placeId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.placeId); - if (message.priceInfo != null && Object.hasOwnProperty.call(message, "priceInfo")) - $root.google.cloud.retail.v2alpha.PriceInfo.encode(message.priceInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.retail.v2alpha.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } + if (message.text != null && message.text.length) + for (var i = 0; i < message.text.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text[i]); + if (message.numbers != null && message.numbers.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.numbers.length; ++i) + writer.double(message.numbers[i]); + writer.ldelim(); + } + if (message.searchable != null && Object.hasOwnProperty.call(message, "searchable")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.searchable); + if (message.indexable != null && Object.hasOwnProperty.call(message, "indexable")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.indexable); return writer; }; /** - * Encodes the specified LocalInventory message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.LocalInventory.verify|verify} messages. + * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CustomAttribute.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.LocalInventory + * @memberof google.cloud.retail.v2alpha.CustomAttribute * @static - * @param {google.cloud.retail.v2alpha.ILocalInventory} message LocalInventory message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICustomAttribute} message CustomAttribute message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LocalInventory.encodeDelimited = function encodeDelimited(message, writer) { + CustomAttribute.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LocalInventory message from the specified reader or buffer. + * Decodes a CustomAttribute message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.LocalInventory + * @memberof google.cloud.retail.v2alpha.CustomAttribute * @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.LocalInventory} LocalInventory + * @returns {google.cloud.retail.v2alpha.CustomAttribute} CustomAttribute * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LocalInventory.decode = function decode(reader, length) { + CustomAttribute.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.LocalInventory(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CustomAttribute(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.placeId = reader.string(); + if (!(message.text && message.text.length)) + message.text = []; + message.text.push(reader.string()); break; case 2: - message.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.decode(reader, reader.uint32()); + if (!(message.numbers && message.numbers.length)) + message.numbers = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.numbers.push(reader.double()); + } else + message.numbers.push(reader.double()); break; case 3: - if (message.attributes === $util.emptyObject) - message.attributes = {}; - 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.CustomAttribute.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributes[key] = value; + message.searchable = reader.bool(); + break; + case 4: + message.indexable = reader.bool(); break; default: reader.skipType(tag & 7); @@ -30020,151 +29716,167 @@ }; /** - * Decodes a LocalInventory message from the specified reader or buffer, length delimited. + * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.LocalInventory + * @memberof google.cloud.retail.v2alpha.CustomAttribute * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.LocalInventory} LocalInventory + * @returns {google.cloud.retail.v2alpha.CustomAttribute} CustomAttribute * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LocalInventory.decodeDelimited = function decodeDelimited(reader) { + CustomAttribute.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LocalInventory message. + * Verifies a CustomAttribute message. * @function verify - * @memberof google.cloud.retail.v2alpha.LocalInventory + * @memberof google.cloud.retail.v2alpha.CustomAttribute * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LocalInventory.verify = function verify(message) { + CustomAttribute.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.placeId != null && message.hasOwnProperty("placeId")) - if (!$util.isString(message.placeId)) - return "placeId: string expected"; - if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) { - var error = $root.google.cloud.retail.v2alpha.PriceInfo.verify(message.priceInfo); - if (error) - return "priceInfo." + error; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + if (!Array.isArray(message.text)) + return "text: array expected"; + for (var i = 0; i < message.text.length; ++i) + if (!$util.isString(message.text[i])) + return "text: string[] expected"; } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.CustomAttribute.verify(message.attributes[key[i]]); - if (error) - return "attributes." + error; - } + if (message.numbers != null && message.hasOwnProperty("numbers")) { + if (!Array.isArray(message.numbers)) + return "numbers: array expected"; + for (var i = 0; i < message.numbers.length; ++i) + if (typeof message.numbers[i] !== "number") + return "numbers: number[] expected"; + } + if (message.searchable != null && message.hasOwnProperty("searchable")) { + properties._searchable = 1; + if (typeof message.searchable !== "boolean") + return "searchable: boolean expected"; + } + if (message.indexable != null && message.hasOwnProperty("indexable")) { + properties._indexable = 1; + if (typeof message.indexable !== "boolean") + return "indexable: boolean expected"; } return null; }; /** - * Creates a LocalInventory message from a plain object. Also converts values to their respective internal types. + * Creates a CustomAttribute message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.LocalInventory + * @memberof google.cloud.retail.v2alpha.CustomAttribute * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.LocalInventory} LocalInventory + * @returns {google.cloud.retail.v2alpha.CustomAttribute} CustomAttribute */ - LocalInventory.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.LocalInventory) + CustomAttribute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CustomAttribute) return object; - var message = new $root.google.cloud.retail.v2alpha.LocalInventory(); - if (object.placeId != null) - message.placeId = String(object.placeId); - if (object.priceInfo != null) { - if (typeof object.priceInfo !== "object") - throw TypeError(".google.cloud.retail.v2alpha.LocalInventory.priceInfo: object expected"); - message.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.fromObject(object.priceInfo); + var message = new $root.google.cloud.retail.v2alpha.CustomAttribute(); + if (object.text) { + if (!Array.isArray(object.text)) + throw TypeError(".google.cloud.retail.v2alpha.CustomAttribute.text: array expected"); + message.text = []; + for (var i = 0; i < object.text.length; ++i) + message.text[i] = String(object.text[i]); } - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.retail.v2alpha.LocalInventory.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { - if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.LocalInventory.attributes: object expected"); - message.attributes[keys[i]] = $root.google.cloud.retail.v2alpha.CustomAttribute.fromObject(object.attributes[keys[i]]); - } + if (object.numbers) { + if (!Array.isArray(object.numbers)) + throw TypeError(".google.cloud.retail.v2alpha.CustomAttribute.numbers: array expected"); + message.numbers = []; + for (var i = 0; i < object.numbers.length; ++i) + message.numbers[i] = Number(object.numbers[i]); } + if (object.searchable != null) + message.searchable = Boolean(object.searchable); + if (object.indexable != null) + message.indexable = Boolean(object.indexable); return message; }; /** - * Creates a plain object from a LocalInventory message. Also converts values to other types if specified. + * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.LocalInventory + * @memberof google.cloud.retail.v2alpha.CustomAttribute * @static - * @param {google.cloud.retail.v2alpha.LocalInventory} message LocalInventory + * @param {google.cloud.retail.v2alpha.CustomAttribute} message CustomAttribute * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LocalInventory.toObject = function toObject(message, options) { + CustomAttribute.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.attributes = {}; - if (options.defaults) { - object.placeId = ""; - object.priceInfo = null; + if (options.arrays || options.defaults) { + object.text = []; + object.numbers = []; } - if (message.placeId != null && message.hasOwnProperty("placeId")) - object.placeId = message.placeId; - if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) - object.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.toObject(message.priceInfo, options); - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = $root.google.cloud.retail.v2alpha.CustomAttribute.toObject(message.attributes[keys2[j]], options); + if (message.text && message.text.length) { + object.text = []; + for (var j = 0; j < message.text.length; ++j) + object.text[j] = message.text[j]; + } + if (message.numbers && message.numbers.length) { + object.numbers = []; + for (var j = 0; j < message.numbers.length; ++j) + object.numbers[j] = options.json && !isFinite(message.numbers[j]) ? String(message.numbers[j]) : message.numbers[j]; + } + if (message.searchable != null && message.hasOwnProperty("searchable")) { + object.searchable = message.searchable; + if (options.oneofs) + object._searchable = "searchable"; + } + if (message.indexable != null && message.hasOwnProperty("indexable")) { + object.indexable = message.indexable; + if (options.oneofs) + object._indexable = "indexable"; } return object; }; /** - * Converts this LocalInventory to JSON. + * Converts this CustomAttribute to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.LocalInventory + * @memberof google.cloud.retail.v2alpha.CustomAttribute * @instance * @returns {Object.} JSON object */ - LocalInventory.prototype.toJSON = function toJSON() { + CustomAttribute.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return LocalInventory; + return CustomAttribute; })(); - v2alpha.GcsSource = (function() { + v2alpha.FulfillmentInfo = (function() { /** - * Properties of a GcsSource. + * Properties of a FulfillmentInfo. * @memberof google.cloud.retail.v2alpha - * @interface IGcsSource - * @property {Array.|null} [inputUris] GcsSource inputUris - * @property {string|null} [dataSchema] GcsSource dataSchema + * @interface IFulfillmentInfo + * @property {string|null} [type] FulfillmentInfo type + * @property {Array.|null} [placeIds] FulfillmentInfo placeIds */ /** - * Constructs a new GcsSource. + * Constructs a new FulfillmentInfo. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a GcsSource. - * @implements IGcsSource + * @classdesc Represents a FulfillmentInfo. + * @implements IFulfillmentInfo * @constructor - * @param {google.cloud.retail.v2alpha.IGcsSource=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IFulfillmentInfo=} [properties] Properties to set */ - function GcsSource(properties) { - this.inputUris = []; + function FulfillmentInfo(properties) { + this.placeIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30172,91 +29884,91 @@ } /** - * GcsSource inputUris. - * @member {Array.} inputUris - * @memberof google.cloud.retail.v2alpha.GcsSource + * FulfillmentInfo type. + * @member {string} type + * @memberof google.cloud.retail.v2alpha.FulfillmentInfo * @instance */ - GcsSource.prototype.inputUris = $util.emptyArray; + FulfillmentInfo.prototype.type = ""; /** - * GcsSource dataSchema. - * @member {string} dataSchema - * @memberof google.cloud.retail.v2alpha.GcsSource + * FulfillmentInfo placeIds. + * @member {Array.} placeIds + * @memberof google.cloud.retail.v2alpha.FulfillmentInfo * @instance */ - GcsSource.prototype.dataSchema = ""; + FulfillmentInfo.prototype.placeIds = $util.emptyArray; /** - * Creates a new GcsSource instance using the specified properties. + * Creates a new FulfillmentInfo instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.FulfillmentInfo * @static - * @param {google.cloud.retail.v2alpha.IGcsSource=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.GcsSource} GcsSource instance + * @param {google.cloud.retail.v2alpha.IFulfillmentInfo=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.FulfillmentInfo} FulfillmentInfo instance */ - GcsSource.create = function create(properties) { - return new GcsSource(properties); + FulfillmentInfo.create = function create(properties) { + return new FulfillmentInfo(properties); }; /** - * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.retail.v2alpha.GcsSource.verify|verify} messages. + * Encodes the specified FulfillmentInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.FulfillmentInfo.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.FulfillmentInfo * @static - * @param {google.cloud.retail.v2alpha.IGcsSource} message GcsSource message or plain object to encode + * @param {google.cloud.retail.v2alpha.IFulfillmentInfo} message FulfillmentInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsSource.encode = function encode(message, writer) { + FulfillmentInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.inputUris != null && message.inputUris.length) - for (var i = 0; i < message.inputUris.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUris[i]); - if (message.dataSchema != null && Object.hasOwnProperty.call(message, "dataSchema")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataSchema); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.placeIds != null && message.placeIds.length) + for (var i = 0; i < message.placeIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.placeIds[i]); return writer; }; /** - * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GcsSource.verify|verify} messages. + * Encodes the specified FulfillmentInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.FulfillmentInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.FulfillmentInfo * @static - * @param {google.cloud.retail.v2alpha.IGcsSource} message GcsSource message or plain object to encode + * @param {google.cloud.retail.v2alpha.IFulfillmentInfo} message FulfillmentInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsSource.encodeDelimited = function encodeDelimited(message, writer) { + FulfillmentInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GcsSource message from the specified reader or buffer. + * Decodes a FulfillmentInfo message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.FulfillmentInfo * @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.GcsSource} GcsSource + * @returns {google.cloud.retail.v2alpha.FulfillmentInfo} FulfillmentInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsSource.decode = function decode(reader, length) { + FulfillmentInfo.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.GcsSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.FulfillmentInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.inputUris && message.inputUris.length)) - message.inputUris = []; - message.inputUris.push(reader.string()); + message.type = reader.string(); break; case 2: - message.dataSchema = reader.string(); + if (!(message.placeIds && message.placeIds.length)) + message.placeIds = []; + message.placeIds.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -30267,133 +29979,130 @@ }; /** - * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * Decodes a FulfillmentInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.FulfillmentInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.GcsSource} GcsSource + * @returns {google.cloud.retail.v2alpha.FulfillmentInfo} FulfillmentInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsSource.decodeDelimited = function decodeDelimited(reader) { + FulfillmentInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GcsSource message. + * Verifies a FulfillmentInfo message. * @function verify - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.FulfillmentInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GcsSource.verify = function verify(message) { + FulfillmentInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.inputUris != null && message.hasOwnProperty("inputUris")) { - if (!Array.isArray(message.inputUris)) - return "inputUris: array expected"; - for (var i = 0; i < message.inputUris.length; ++i) - if (!$util.isString(message.inputUris[i])) - return "inputUris: string[] expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.placeIds != null && message.hasOwnProperty("placeIds")) { + if (!Array.isArray(message.placeIds)) + return "placeIds: array expected"; + for (var i = 0; i < message.placeIds.length; ++i) + if (!$util.isString(message.placeIds[i])) + return "placeIds: string[] expected"; } - if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) - if (!$util.isString(message.dataSchema)) - return "dataSchema: string expected"; return null; }; /** - * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * Creates a FulfillmentInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.FulfillmentInfo * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.GcsSource} GcsSource + * @returns {google.cloud.retail.v2alpha.FulfillmentInfo} FulfillmentInfo */ - GcsSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.GcsSource) + FulfillmentInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.FulfillmentInfo) return object; - var message = new $root.google.cloud.retail.v2alpha.GcsSource(); - if (object.inputUris) { - if (!Array.isArray(object.inputUris)) - throw TypeError(".google.cloud.retail.v2alpha.GcsSource.inputUris: array expected"); - message.inputUris = []; - for (var i = 0; i < object.inputUris.length; ++i) - message.inputUris[i] = String(object.inputUris[i]); + var message = new $root.google.cloud.retail.v2alpha.FulfillmentInfo(); + if (object.type != null) + message.type = String(object.type); + if (object.placeIds) { + if (!Array.isArray(object.placeIds)) + throw TypeError(".google.cloud.retail.v2alpha.FulfillmentInfo.placeIds: array expected"); + message.placeIds = []; + for (var i = 0; i < object.placeIds.length; ++i) + message.placeIds[i] = String(object.placeIds[i]); } - if (object.dataSchema != null) - message.dataSchema = String(object.dataSchema); return message; }; /** - * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * Creates a plain object from a FulfillmentInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.FulfillmentInfo * @static - * @param {google.cloud.retail.v2alpha.GcsSource} message GcsSource + * @param {google.cloud.retail.v2alpha.FulfillmentInfo} message FulfillmentInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GcsSource.toObject = function toObject(message, options) { + FulfillmentInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.inputUris = []; + object.placeIds = []; if (options.defaults) - object.dataSchema = ""; - if (message.inputUris && message.inputUris.length) { - object.inputUris = []; - for (var j = 0; j < message.inputUris.length; ++j) - object.inputUris[j] = message.inputUris[j]; + object.type = ""; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.placeIds && message.placeIds.length) { + object.placeIds = []; + for (var j = 0; j < message.placeIds.length; ++j) + object.placeIds[j] = message.placeIds[j]; } - if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) - object.dataSchema = message.dataSchema; return object; }; /** - * Converts this GcsSource to JSON. + * Converts this FulfillmentInfo to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.FulfillmentInfo * @instance * @returns {Object.} JSON object */ - GcsSource.prototype.toJSON = function toJSON() { + FulfillmentInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GcsSource; + return FulfillmentInfo; })(); - v2alpha.BigQuerySource = (function() { + v2alpha.Image = (function() { /** - * Properties of a BigQuerySource. + * Properties of an Image. * @memberof google.cloud.retail.v2alpha - * @interface IBigQuerySource - * @property {google.type.IDate|null} [partitionDate] BigQuerySource partitionDate - * @property {string|null} [projectId] BigQuerySource projectId - * @property {string|null} [datasetId] BigQuerySource datasetId - * @property {string|null} [tableId] BigQuerySource tableId - * @property {string|null} [gcsStagingDir] BigQuerySource gcsStagingDir - * @property {string|null} [dataSchema] BigQuerySource dataSchema + * @interface IImage + * @property {string|null} [uri] Image uri + * @property {number|null} [height] Image height + * @property {number|null} [width] Image width */ /** - * Constructs a new BigQuerySource. + * Constructs a new Image. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a BigQuerySource. - * @implements IBigQuerySource + * @classdesc Represents an Image. + * @implements IImage * @constructor - * @param {google.cloud.retail.v2alpha.IBigQuerySource=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IImage=} [properties] Properties to set */ - function BigQuerySource(properties) { + function Image(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30401,154 +30110,101 @@ } /** - * BigQuerySource partitionDate. - * @member {google.type.IDate|null|undefined} partitionDate - * @memberof google.cloud.retail.v2alpha.BigQuerySource - * @instance - */ - BigQuerySource.prototype.partitionDate = null; - - /** - * BigQuerySource projectId. - * @member {string} projectId - * @memberof google.cloud.retail.v2alpha.BigQuerySource - * @instance - */ - BigQuerySource.prototype.projectId = ""; - - /** - * BigQuerySource datasetId. - * @member {string} datasetId - * @memberof google.cloud.retail.v2alpha.BigQuerySource - * @instance - */ - BigQuerySource.prototype.datasetId = ""; - - /** - * BigQuerySource tableId. - * @member {string} tableId - * @memberof google.cloud.retail.v2alpha.BigQuerySource - * @instance - */ - BigQuerySource.prototype.tableId = ""; - - /** - * BigQuerySource gcsStagingDir. - * @member {string} gcsStagingDir - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * Image uri. + * @member {string} uri + * @memberof google.cloud.retail.v2alpha.Image * @instance */ - BigQuerySource.prototype.gcsStagingDir = ""; + Image.prototype.uri = ""; /** - * BigQuerySource dataSchema. - * @member {string} dataSchema - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * Image height. + * @member {number} height + * @memberof google.cloud.retail.v2alpha.Image * @instance */ - BigQuerySource.prototype.dataSchema = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + Image.prototype.height = 0; /** - * BigQuerySource partition. - * @member {"partitionDate"|undefined} partition - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * Image width. + * @member {number} width + * @memberof google.cloud.retail.v2alpha.Image * @instance */ - Object.defineProperty(BigQuerySource.prototype, "partition", { - get: $util.oneOfGetter($oneOfFields = ["partitionDate"]), - set: $util.oneOfSetter($oneOfFields) - }); + Image.prototype.width = 0; /** - * Creates a new BigQuerySource instance using the specified properties. + * Creates a new Image instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.Image * @static - * @param {google.cloud.retail.v2alpha.IBigQuerySource=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.BigQuerySource} BigQuerySource instance + * @param {google.cloud.retail.v2alpha.IImage=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Image} Image instance */ - BigQuerySource.create = function create(properties) { - return new BigQuerySource(properties); + Image.create = function create(properties) { + return new Image(properties); }; /** - * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.retail.v2alpha.BigQuerySource.verify|verify} messages. + * Encodes the specified Image message. Does not implicitly {@link google.cloud.retail.v2alpha.Image.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.Image * @static - * @param {google.cloud.retail.v2alpha.IBigQuerySource} message BigQuerySource message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImage} message Image message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BigQuerySource.encode = function encode(message, writer) { + Image.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.datasetId); - if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableId); - if (message.gcsStagingDir != null && Object.hasOwnProperty.call(message, "gcsStagingDir")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsStagingDir); - if (message.dataSchema != null && Object.hasOwnProperty.call(message, "dataSchema")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.dataSchema); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.projectId); - if (message.partitionDate != null && Object.hasOwnProperty.call(message, "partitionDate")) - $root.google.type.Date.encode(message.partitionDate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.height); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.width); return writer; }; /** - * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BigQuerySource.verify|verify} messages. + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Image.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.Image * @static - * @param {google.cloud.retail.v2alpha.IBigQuerySource} message BigQuerySource message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImage} message Image message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BigQuerySource.encodeDelimited = function encodeDelimited(message, writer) { + Image.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BigQuerySource message from the specified reader or buffer. + * Decodes an Image message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.Image * @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.BigQuerySource} BigQuerySource + * @returns {google.cloud.retail.v2alpha.Image} Image * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BigQuerySource.decode = function decode(reader, length) { + Image.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.BigQuerySource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Image(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 6: - message.partitionDate = $root.google.type.Date.decode(reader, reader.uint32()); - break; - case 5: - message.projectId = reader.string(); - break; case 1: - message.datasetId = reader.string(); + message.uri = reader.string(); break; case 2: - message.tableId = reader.string(); + message.height = reader.int32(); break; case 3: - message.gcsStagingDir = reader.string(); - break; - case 4: - message.dataSchema = reader.string(); + message.width = reader.int32(); break; default: reader.skipType(tag & 7); @@ -30559,160 +30215,127 @@ }; /** - * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. + * Decodes an Image message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.Image * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.BigQuerySource} BigQuerySource + * @returns {google.cloud.retail.v2alpha.Image} Image * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BigQuerySource.decodeDelimited = function decodeDelimited(reader) { + Image.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BigQuerySource message. + * Verifies an Image message. * @function verify - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.Image * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BigQuerySource.verify = function verify(message) { + Image.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.partitionDate != null && message.hasOwnProperty("partitionDate")) { - properties.partition = 1; - { - var error = $root.google.type.Date.verify(message.partitionDate); - if (error) - return "partitionDate." + error; - } - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.datasetId != null && message.hasOwnProperty("datasetId")) - if (!$util.isString(message.datasetId)) - return "datasetId: string expected"; - if (message.tableId != null && message.hasOwnProperty("tableId")) - if (!$util.isString(message.tableId)) - return "tableId: string expected"; - if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) - if (!$util.isString(message.gcsStagingDir)) - return "gcsStagingDir: string expected"; - if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) - if (!$util.isString(message.dataSchema)) - return "dataSchema: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; return null; }; /** - * Creates a BigQuerySource message from a plain object. Also converts values to their respective internal types. + * Creates an Image message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.Image * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.BigQuerySource} BigQuerySource + * @returns {google.cloud.retail.v2alpha.Image} Image */ - BigQuerySource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.BigQuerySource) + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Image) return object; - var message = new $root.google.cloud.retail.v2alpha.BigQuerySource(); - if (object.partitionDate != null) { - if (typeof object.partitionDate !== "object") - throw TypeError(".google.cloud.retail.v2alpha.BigQuerySource.partitionDate: object expected"); - message.partitionDate = $root.google.type.Date.fromObject(object.partitionDate); - } - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.datasetId != null) - message.datasetId = String(object.datasetId); - if (object.tableId != null) - message.tableId = String(object.tableId); - if (object.gcsStagingDir != null) - message.gcsStagingDir = String(object.gcsStagingDir); - if (object.dataSchema != null) - message.dataSchema = String(object.dataSchema); + var message = new $root.google.cloud.retail.v2alpha.Image(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.height != null) + message.height = object.height | 0; + if (object.width != null) + message.width = object.width | 0; return message; }; /** - * Creates a plain object from a BigQuerySource message. Also converts values to other types if specified. + * Creates a plain object from an Image message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.Image * @static - * @param {google.cloud.retail.v2alpha.BigQuerySource} message BigQuerySource + * @param {google.cloud.retail.v2alpha.Image} message Image * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BigQuerySource.toObject = function toObject(message, options) { + Image.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.datasetId = ""; - object.tableId = ""; - object.gcsStagingDir = ""; - object.dataSchema = ""; - object.projectId = ""; - } - if (message.datasetId != null && message.hasOwnProperty("datasetId")) - object.datasetId = message.datasetId; - if (message.tableId != null && message.hasOwnProperty("tableId")) - object.tableId = message.tableId; - if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) - object.gcsStagingDir = message.gcsStagingDir; - if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) - object.dataSchema = message.dataSchema; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.partitionDate != null && message.hasOwnProperty("partitionDate")) { - object.partitionDate = $root.google.type.Date.toObject(message.partitionDate, options); - if (options.oneofs) - object.partition = "partitionDate"; + object.uri = ""; + object.height = 0; + object.width = 0; } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; return object; }; /** - * Converts this BigQuerySource to JSON. + * Converts this Image to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.Image * @instance * @returns {Object.} JSON object */ - BigQuerySource.prototype.toJSON = function toJSON() { + Image.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BigQuerySource; + return Image; })(); - v2alpha.ProductInlineSource = (function() { + v2alpha.Interval = (function() { /** - * Properties of a ProductInlineSource. + * Properties of an Interval. * @memberof google.cloud.retail.v2alpha - * @interface IProductInlineSource - * @property {Array.|null} [products] ProductInlineSource products + * @interface IInterval + * @property {number|null} [minimum] Interval minimum + * @property {number|null} [exclusiveMinimum] Interval exclusiveMinimum + * @property {number|null} [maximum] Interval maximum + * @property {number|null} [exclusiveMaximum] Interval exclusiveMaximum */ /** - * Constructs a new ProductInlineSource. + * Constructs a new Interval. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ProductInlineSource. - * @implements IProductInlineSource + * @classdesc Represents an Interval. + * @implements IInterval * @constructor - * @param {google.cloud.retail.v2alpha.IProductInlineSource=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IInterval=} [properties] Properties to set */ - function ProductInlineSource(properties) { - this.products = []; + function Interval(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30720,286 +30343,139 @@ } /** - * ProductInlineSource products. - * @member {Array.} products - * @memberof google.cloud.retail.v2alpha.ProductInlineSource + * Interval minimum. + * @member {number|null|undefined} minimum + * @memberof google.cloud.retail.v2alpha.Interval * @instance */ - ProductInlineSource.prototype.products = $util.emptyArray; + Interval.prototype.minimum = null; /** - * Creates a new ProductInlineSource instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.ProductInlineSource - * @static - * @param {google.cloud.retail.v2alpha.IProductInlineSource=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ProductInlineSource} ProductInlineSource instance + * Interval exclusiveMinimum. + * @member {number|null|undefined} exclusiveMinimum + * @memberof google.cloud.retail.v2alpha.Interval + * @instance */ - ProductInlineSource.create = function create(properties) { - return new ProductInlineSource(properties); - }; + Interval.prototype.exclusiveMinimum = null; /** - * Encodes the specified ProductInlineSource message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInlineSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.ProductInlineSource - * @static - * @param {google.cloud.retail.v2alpha.IProductInlineSource} message ProductInlineSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Interval maximum. + * @member {number|null|undefined} maximum + * @memberof google.cloud.retail.v2alpha.Interval + * @instance */ - ProductInlineSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.products != null && message.products.length) - for (var i = 0; i < message.products.length; ++i) - $root.google.cloud.retail.v2alpha.Product.encode(message.products[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + Interval.prototype.maximum = null; /** - * Encodes the specified ProductInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInlineSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ProductInlineSource - * @static - * @param {google.cloud.retail.v2alpha.IProductInlineSource} message ProductInlineSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Interval exclusiveMaximum. + * @member {number|null|undefined} exclusiveMaximum + * @memberof google.cloud.retail.v2alpha.Interval + * @instance */ - ProductInlineSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Interval.prototype.exclusiveMaximum = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Decodes a ProductInlineSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.ProductInlineSource - * @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.ProductInlineSource} ProductInlineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProductInlineSource.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.ProductInlineSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.products && message.products.length)) - message.products = []; - message.products.push($root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProductInlineSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ProductInlineSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ProductInlineSource} ProductInlineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProductInlineSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProductInlineSource message. - * @function verify - * @memberof google.cloud.retail.v2alpha.ProductInlineSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProductInlineSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.products != null && message.hasOwnProperty("products")) { - if (!Array.isArray(message.products)) - return "products: array expected"; - for (var i = 0; i < message.products.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Product.verify(message.products[i]); - if (error) - return "products." + error; - } - } - return null; - }; - - /** - * Creates a ProductInlineSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.ProductInlineSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ProductInlineSource} ProductInlineSource - */ - ProductInlineSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ProductInlineSource) - return object; - var message = new $root.google.cloud.retail.v2alpha.ProductInlineSource(); - if (object.products) { - if (!Array.isArray(object.products)) - throw TypeError(".google.cloud.retail.v2alpha.ProductInlineSource.products: array expected"); - message.products = []; - for (var i = 0; i < object.products.length; ++i) { - if (typeof object.products[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ProductInlineSource.products: object expected"); - message.products[i] = $root.google.cloud.retail.v2alpha.Product.fromObject(object.products[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ProductInlineSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.ProductInlineSource - * @static - * @param {google.cloud.retail.v2alpha.ProductInlineSource} message ProductInlineSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProductInlineSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.products = []; - if (message.products && message.products.length) { - object.products = []; - for (var j = 0; j < message.products.length; ++j) - object.products[j] = $root.google.cloud.retail.v2alpha.Product.toObject(message.products[j], options); - } - return object; - }; - - /** - * Converts this ProductInlineSource to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.ProductInlineSource + * Interval min. + * @member {"minimum"|"exclusiveMinimum"|undefined} min + * @memberof google.cloud.retail.v2alpha.Interval * @instance - * @returns {Object.} JSON object - */ - ProductInlineSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ProductInlineSource; - })(); - - v2alpha.UserEventInlineSource = (function() { - - /** - * Properties of a UserEventInlineSource. - * @memberof google.cloud.retail.v2alpha - * @interface IUserEventInlineSource - * @property {Array.|null} [userEvents] UserEventInlineSource userEvents - */ - - /** - * Constructs a new UserEventInlineSource. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a UserEventInlineSource. - * @implements IUserEventInlineSource - * @constructor - * @param {google.cloud.retail.v2alpha.IUserEventInlineSource=} [properties] Properties to set */ - function UserEventInlineSource(properties) { - this.userEvents = []; - 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]]; - } + Object.defineProperty(Interval.prototype, "min", { + get: $util.oneOfGetter($oneOfFields = ["minimum", "exclusiveMinimum"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * UserEventInlineSource userEvents. - * @member {Array.} userEvents - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * Interval max. + * @member {"maximum"|"exclusiveMaximum"|undefined} max + * @memberof google.cloud.retail.v2alpha.Interval * @instance */ - UserEventInlineSource.prototype.userEvents = $util.emptyArray; + Object.defineProperty(Interval.prototype, "max", { + get: $util.oneOfGetter($oneOfFields = ["maximum", "exclusiveMaximum"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new UserEventInlineSource instance using the specified properties. + * Creates a new Interval instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.Interval * @static - * @param {google.cloud.retail.v2alpha.IUserEventInlineSource=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.UserEventInlineSource} UserEventInlineSource instance + * @param {google.cloud.retail.v2alpha.IInterval=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Interval} Interval instance */ - UserEventInlineSource.create = function create(properties) { - return new UserEventInlineSource(properties); + Interval.create = function create(properties) { + return new Interval(properties); }; /** - * Encodes the specified UserEventInlineSource message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInlineSource.verify|verify} messages. + * Encodes the specified Interval message. Does not implicitly {@link google.cloud.retail.v2alpha.Interval.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.Interval * @static - * @param {google.cloud.retail.v2alpha.IUserEventInlineSource} message UserEventInlineSource message or plain object to encode + * @param {google.cloud.retail.v2alpha.IInterval} message Interval message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEventInlineSource.encode = function encode(message, writer) { + Interval.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.userEvents != null && message.userEvents.length) - for (var i = 0; i < message.userEvents.length; ++i) - $root.google.cloud.retail.v2alpha.UserEvent.encode(message.userEvents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimum != null && Object.hasOwnProperty.call(message, "minimum")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.minimum); + if (message.exclusiveMinimum != null && Object.hasOwnProperty.call(message, "exclusiveMinimum")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.exclusiveMinimum); + if (message.maximum != null && Object.hasOwnProperty.call(message, "maximum")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.maximum); + if (message.exclusiveMaximum != null && Object.hasOwnProperty.call(message, "exclusiveMaximum")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.exclusiveMaximum); return writer; }; /** - * Encodes the specified UserEventInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInlineSource.verify|verify} messages. + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Interval.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.Interval * @static - * @param {google.cloud.retail.v2alpha.IUserEventInlineSource} message UserEventInlineSource message or plain object to encode + * @param {google.cloud.retail.v2alpha.IInterval} message Interval message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEventInlineSource.encodeDelimited = function encodeDelimited(message, writer) { + Interval.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserEventInlineSource message from the specified reader or buffer. + * Decodes an Interval message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.Interval * @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.UserEventInlineSource} UserEventInlineSource + * @returns {google.cloud.retail.v2alpha.Interval} Interval * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEventInlineSource.decode = function decode(reader, length) { + Interval.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.UserEventInlineSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Interval(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.userEvents && message.userEvents.length)) - message.userEvents = []; - message.userEvents.push($root.google.cloud.retail.v2alpha.UserEvent.decode(reader, reader.uint32())); + message.minimum = reader.double(); + break; + case 2: + message.exclusiveMinimum = reader.double(); + break; + case 3: + message.maximum = reader.double(); + break; + case 4: + message.exclusiveMaximum = reader.double(); break; default: reader.skipType(tag & 7); @@ -31010,124 +30486,157 @@ }; /** - * Decodes a UserEventInlineSource message from the specified reader or buffer, length delimited. + * Decodes an Interval message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.Interval * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.UserEventInlineSource} UserEventInlineSource + * @returns {google.cloud.retail.v2alpha.Interval} Interval * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEventInlineSource.decodeDelimited = function decodeDelimited(reader) { + Interval.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserEventInlineSource message. + * Verifies an Interval message. * @function verify - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.Interval * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserEventInlineSource.verify = function verify(message) { + Interval.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.userEvents != null && message.hasOwnProperty("userEvents")) { - if (!Array.isArray(message.userEvents)) - return "userEvents: array expected"; - for (var i = 0; i < message.userEvents.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.UserEvent.verify(message.userEvents[i]); - if (error) - return "userEvents." + error; - } + var properties = {}; + if (message.minimum != null && message.hasOwnProperty("minimum")) { + properties.min = 1; + if (typeof message.minimum !== "number") + return "minimum: number expected"; + } + if (message.exclusiveMinimum != null && message.hasOwnProperty("exclusiveMinimum")) { + if (properties.min === 1) + return "min: multiple values"; + properties.min = 1; + if (typeof message.exclusiveMinimum !== "number") + return "exclusiveMinimum: number expected"; + } + if (message.maximum != null && message.hasOwnProperty("maximum")) { + properties.max = 1; + if (typeof message.maximum !== "number") + return "maximum: number expected"; + } + if (message.exclusiveMaximum != null && message.hasOwnProperty("exclusiveMaximum")) { + if (properties.max === 1) + return "max: multiple values"; + properties.max = 1; + if (typeof message.exclusiveMaximum !== "number") + return "exclusiveMaximum: number expected"; } return null; }; /** - * Creates a UserEventInlineSource message from a plain object. Also converts values to their respective internal types. + * Creates an Interval message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.Interval * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.UserEventInlineSource} UserEventInlineSource + * @returns {google.cloud.retail.v2alpha.Interval} Interval */ - UserEventInlineSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.UserEventInlineSource) + Interval.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Interval) return object; - var message = new $root.google.cloud.retail.v2alpha.UserEventInlineSource(); - if (object.userEvents) { - if (!Array.isArray(object.userEvents)) - throw TypeError(".google.cloud.retail.v2alpha.UserEventInlineSource.userEvents: array expected"); - message.userEvents = []; - for (var i = 0; i < object.userEvents.length; ++i) { - if (typeof object.userEvents[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEventInlineSource.userEvents: object expected"); - message.userEvents[i] = $root.google.cloud.retail.v2alpha.UserEvent.fromObject(object.userEvents[i]); - } - } + var message = new $root.google.cloud.retail.v2alpha.Interval(); + if (object.minimum != null) + message.minimum = Number(object.minimum); + if (object.exclusiveMinimum != null) + message.exclusiveMinimum = Number(object.exclusiveMinimum); + if (object.maximum != null) + message.maximum = Number(object.maximum); + if (object.exclusiveMaximum != null) + message.exclusiveMaximum = Number(object.exclusiveMaximum); return message; }; /** - * Creates a plain object from a UserEventInlineSource message. Also converts values to other types if specified. + * Creates a plain object from an Interval message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.Interval * @static - * @param {google.cloud.retail.v2alpha.UserEventInlineSource} message UserEventInlineSource + * @param {google.cloud.retail.v2alpha.Interval} message Interval * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserEventInlineSource.toObject = function toObject(message, options) { + Interval.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.userEvents = []; - if (message.userEvents && message.userEvents.length) { - object.userEvents = []; - for (var j = 0; j < message.userEvents.length; ++j) - object.userEvents[j] = $root.google.cloud.retail.v2alpha.UserEvent.toObject(message.userEvents[j], options); + if (message.minimum != null && message.hasOwnProperty("minimum")) { + object.minimum = options.json && !isFinite(message.minimum) ? String(message.minimum) : message.minimum; + if (options.oneofs) + object.min = "minimum"; + } + if (message.exclusiveMinimum != null && message.hasOwnProperty("exclusiveMinimum")) { + object.exclusiveMinimum = options.json && !isFinite(message.exclusiveMinimum) ? String(message.exclusiveMinimum) : message.exclusiveMinimum; + if (options.oneofs) + object.min = "exclusiveMinimum"; + } + if (message.maximum != null && message.hasOwnProperty("maximum")) { + object.maximum = options.json && !isFinite(message.maximum) ? String(message.maximum) : message.maximum; + if (options.oneofs) + object.max = "maximum"; + } + if (message.exclusiveMaximum != null && message.hasOwnProperty("exclusiveMaximum")) { + object.exclusiveMaximum = options.json && !isFinite(message.exclusiveMaximum) ? String(message.exclusiveMaximum) : message.exclusiveMaximum; + if (options.oneofs) + object.max = "exclusiveMaximum"; } return object; }; /** - * Converts this UserEventInlineSource to JSON. + * Converts this Interval to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.Interval * @instance * @returns {Object.} JSON object */ - UserEventInlineSource.prototype.toJSON = function toJSON() { + Interval.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UserEventInlineSource; + return Interval; })(); - v2alpha.ImportErrorsConfig = (function() { + v2alpha.PriceInfo = (function() { /** - * Properties of an ImportErrorsConfig. + * Properties of a PriceInfo. * @memberof google.cloud.retail.v2alpha - * @interface IImportErrorsConfig - * @property {string|null} [gcsPrefix] ImportErrorsConfig gcsPrefix + * @interface IPriceInfo + * @property {string|null} [currencyCode] PriceInfo currencyCode + * @property {number|null} [price] PriceInfo price + * @property {number|null} [originalPrice] PriceInfo originalPrice + * @property {number|null} [cost] PriceInfo cost + * @property {google.protobuf.ITimestamp|null} [priceEffectiveTime] PriceInfo priceEffectiveTime + * @property {google.protobuf.ITimestamp|null} [priceExpireTime] PriceInfo priceExpireTime + * @property {google.cloud.retail.v2alpha.PriceInfo.IPriceRange|null} [priceRange] PriceInfo priceRange */ /** - * Constructs a new ImportErrorsConfig. + * Constructs a new PriceInfo. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ImportErrorsConfig. - * @implements IImportErrorsConfig + * @classdesc Represents a PriceInfo. + * @implements IPriceInfo * @constructor - * @param {google.cloud.retail.v2alpha.IImportErrorsConfig=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IPriceInfo=} [properties] Properties to set */ - function ImportErrorsConfig(properties) { + function PriceInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31135,89 +30644,153 @@ } /** - * ImportErrorsConfig gcsPrefix. - * @member {string|null|undefined} gcsPrefix - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * PriceInfo currencyCode. + * @member {string} currencyCode + * @memberof google.cloud.retail.v2alpha.PriceInfo * @instance */ - ImportErrorsConfig.prototype.gcsPrefix = null; + PriceInfo.prototype.currencyCode = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * PriceInfo price. + * @member {number} price + * @memberof google.cloud.retail.v2alpha.PriceInfo + * @instance + */ + PriceInfo.prototype.price = 0; /** - * ImportErrorsConfig destination. - * @member {"gcsPrefix"|undefined} destination - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * PriceInfo originalPrice. + * @member {number} originalPrice + * @memberof google.cloud.retail.v2alpha.PriceInfo * @instance */ - Object.defineProperty(ImportErrorsConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsPrefix"]), - set: $util.oneOfSetter($oneOfFields) - }); + PriceInfo.prototype.originalPrice = 0; /** - * Creates a new ImportErrorsConfig instance using the specified properties. + * PriceInfo cost. + * @member {number} cost + * @memberof google.cloud.retail.v2alpha.PriceInfo + * @instance + */ + PriceInfo.prototype.cost = 0; + + /** + * PriceInfo priceEffectiveTime. + * @member {google.protobuf.ITimestamp|null|undefined} priceEffectiveTime + * @memberof google.cloud.retail.v2alpha.PriceInfo + * @instance + */ + PriceInfo.prototype.priceEffectiveTime = null; + + /** + * PriceInfo priceExpireTime. + * @member {google.protobuf.ITimestamp|null|undefined} priceExpireTime + * @memberof google.cloud.retail.v2alpha.PriceInfo + * @instance + */ + PriceInfo.prototype.priceExpireTime = null; + + /** + * PriceInfo priceRange. + * @member {google.cloud.retail.v2alpha.PriceInfo.IPriceRange|null|undefined} priceRange + * @memberof google.cloud.retail.v2alpha.PriceInfo + * @instance + */ + PriceInfo.prototype.priceRange = null; + + /** + * Creates a new PriceInfo instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.PriceInfo * @static - * @param {google.cloud.retail.v2alpha.IImportErrorsConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ImportErrorsConfig} ImportErrorsConfig instance + * @param {google.cloud.retail.v2alpha.IPriceInfo=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PriceInfo} PriceInfo instance */ - ImportErrorsConfig.create = function create(properties) { - return new ImportErrorsConfig(properties); + PriceInfo.create = function create(properties) { + return new PriceInfo(properties); }; /** - * Encodes the specified ImportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportErrorsConfig.verify|verify} messages. + * Encodes the specified PriceInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.PriceInfo * @static - * @param {google.cloud.retail.v2alpha.IImportErrorsConfig} message ImportErrorsConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPriceInfo} message PriceInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportErrorsConfig.encode = function encode(message, writer) { + PriceInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsPrefix); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCode); + if (message.price != null && Object.hasOwnProperty.call(message, "price")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.price); + if (message.originalPrice != null && Object.hasOwnProperty.call(message, "originalPrice")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.originalPrice); + if (message.cost != null && Object.hasOwnProperty.call(message, "cost")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.cost); + if (message.priceEffectiveTime != null && Object.hasOwnProperty.call(message, "priceEffectiveTime")) + $root.google.protobuf.Timestamp.encode(message.priceEffectiveTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.priceExpireTime != null && Object.hasOwnProperty.call(message, "priceExpireTime")) + $root.google.protobuf.Timestamp.encode(message.priceExpireTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.priceRange != null && Object.hasOwnProperty.call(message, "priceRange")) + $root.google.cloud.retail.v2alpha.PriceInfo.PriceRange.encode(message.priceRange, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; /** - * Encodes the specified ImportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportErrorsConfig.verify|verify} messages. + * Encodes the specified PriceInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.PriceInfo * @static - * @param {google.cloud.retail.v2alpha.IImportErrorsConfig} message ImportErrorsConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPriceInfo} message PriceInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportErrorsConfig.encodeDelimited = function encodeDelimited(message, writer) { + PriceInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportErrorsConfig message from the specified reader or buffer. + * Decodes a PriceInfo message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.PriceInfo * @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.ImportErrorsConfig} ImportErrorsConfig + * @returns {google.cloud.retail.v2alpha.PriceInfo} PriceInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportErrorsConfig.decode = function decode(reader, length) { + PriceInfo.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.ImportErrorsConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PriceInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gcsPrefix = reader.string(); + message.currencyCode = reader.string(); + break; + case 2: + message.price = reader.float(); + break; + case 3: + message.originalPrice = reader.float(); + break; + case 4: + message.cost = reader.float(); + break; + case 5: + message.priceEffectiveTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.priceExpireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.priceRange = $root.google.cloud.retail.v2alpha.PriceInfo.PriceRange.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -31228,117 +30801,394 @@ }; /** - * Decodes an ImportErrorsConfig message from the specified reader or buffer, length delimited. + * Decodes a PriceInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.PriceInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ImportErrorsConfig} ImportErrorsConfig + * @returns {google.cloud.retail.v2alpha.PriceInfo} PriceInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportErrorsConfig.decodeDelimited = function decodeDelimited(reader) { + PriceInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportErrorsConfig message. + * Verifies a PriceInfo message. * @function verify - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.PriceInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportErrorsConfig.verify = function verify(message) { + PriceInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { - properties.destination = 1; - if (!$util.isString(message.gcsPrefix)) - return "gcsPrefix: string expected"; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + if (message.price != null && message.hasOwnProperty("price")) + if (typeof message.price !== "number") + return "price: number expected"; + if (message.originalPrice != null && message.hasOwnProperty("originalPrice")) + if (typeof message.originalPrice !== "number") + return "originalPrice: number expected"; + if (message.cost != null && message.hasOwnProperty("cost")) + if (typeof message.cost !== "number") + return "cost: number expected"; + if (message.priceEffectiveTime != null && message.hasOwnProperty("priceEffectiveTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.priceEffectiveTime); + if (error) + return "priceEffectiveTime." + error; + } + if (message.priceExpireTime != null && message.hasOwnProperty("priceExpireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.priceExpireTime); + if (error) + return "priceExpireTime." + error; + } + if (message.priceRange != null && message.hasOwnProperty("priceRange")) { + var error = $root.google.cloud.retail.v2alpha.PriceInfo.PriceRange.verify(message.priceRange); + if (error) + return "priceRange." + error; } return null; }; /** - * Creates an ImportErrorsConfig message from a plain object. Also converts values to their respective internal types. + * Creates a PriceInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.PriceInfo * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ImportErrorsConfig} ImportErrorsConfig + * @returns {google.cloud.retail.v2alpha.PriceInfo} PriceInfo */ - ImportErrorsConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ImportErrorsConfig) + PriceInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PriceInfo) return object; - var message = new $root.google.cloud.retail.v2alpha.ImportErrorsConfig(); - if (object.gcsPrefix != null) - message.gcsPrefix = String(object.gcsPrefix); + var message = new $root.google.cloud.retail.v2alpha.PriceInfo(); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.price != null) + message.price = Number(object.price); + if (object.originalPrice != null) + message.originalPrice = Number(object.originalPrice); + if (object.cost != null) + message.cost = Number(object.cost); + if (object.priceEffectiveTime != null) { + if (typeof object.priceEffectiveTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PriceInfo.priceEffectiveTime: object expected"); + message.priceEffectiveTime = $root.google.protobuf.Timestamp.fromObject(object.priceEffectiveTime); + } + if (object.priceExpireTime != null) { + if (typeof object.priceExpireTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PriceInfo.priceExpireTime: object expected"); + message.priceExpireTime = $root.google.protobuf.Timestamp.fromObject(object.priceExpireTime); + } + if (object.priceRange != null) { + if (typeof object.priceRange !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PriceInfo.priceRange: object expected"); + message.priceRange = $root.google.cloud.retail.v2alpha.PriceInfo.PriceRange.fromObject(object.priceRange); + } return message; }; /** - * Creates a plain object from an ImportErrorsConfig message. Also converts values to other types if specified. + * Creates a plain object from a PriceInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.PriceInfo * @static - * @param {google.cloud.retail.v2alpha.ImportErrorsConfig} message ImportErrorsConfig + * @param {google.cloud.retail.v2alpha.PriceInfo} message PriceInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportErrorsConfig.toObject = function toObject(message, options) { + PriceInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { - object.gcsPrefix = message.gcsPrefix; - if (options.oneofs) - object.destination = "gcsPrefix"; + if (options.defaults) { + object.currencyCode = ""; + object.price = 0; + object.originalPrice = 0; + object.cost = 0; + object.priceEffectiveTime = null; + object.priceExpireTime = null; + object.priceRange = null; } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + if (message.price != null && message.hasOwnProperty("price")) + object.price = options.json && !isFinite(message.price) ? String(message.price) : message.price; + if (message.originalPrice != null && message.hasOwnProperty("originalPrice")) + object.originalPrice = options.json && !isFinite(message.originalPrice) ? String(message.originalPrice) : message.originalPrice; + if (message.cost != null && message.hasOwnProperty("cost")) + object.cost = options.json && !isFinite(message.cost) ? String(message.cost) : message.cost; + if (message.priceEffectiveTime != null && message.hasOwnProperty("priceEffectiveTime")) + object.priceEffectiveTime = $root.google.protobuf.Timestamp.toObject(message.priceEffectiveTime, options); + if (message.priceExpireTime != null && message.hasOwnProperty("priceExpireTime")) + object.priceExpireTime = $root.google.protobuf.Timestamp.toObject(message.priceExpireTime, options); + if (message.priceRange != null && message.hasOwnProperty("priceRange")) + object.priceRange = $root.google.cloud.retail.v2alpha.PriceInfo.PriceRange.toObject(message.priceRange, options); return object; }; /** - * Converts this ImportErrorsConfig to JSON. + * Converts this PriceInfo to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.PriceInfo * @instance * @returns {Object.} JSON object */ - ImportErrorsConfig.prototype.toJSON = function toJSON() { + PriceInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ImportErrorsConfig; + PriceInfo.PriceRange = (function() { + + /** + * Properties of a PriceRange. + * @memberof google.cloud.retail.v2alpha.PriceInfo + * @interface IPriceRange + * @property {google.cloud.retail.v2alpha.IInterval|null} [price] PriceRange price + * @property {google.cloud.retail.v2alpha.IInterval|null} [originalPrice] PriceRange originalPrice + */ + + /** + * Constructs a new PriceRange. + * @memberof google.cloud.retail.v2alpha.PriceInfo + * @classdesc Represents a PriceRange. + * @implements IPriceRange + * @constructor + * @param {google.cloud.retail.v2alpha.PriceInfo.IPriceRange=} [properties] Properties to set + */ + function PriceRange(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]]; + } + + /** + * PriceRange price. + * @member {google.cloud.retail.v2alpha.IInterval|null|undefined} price + * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @instance + */ + PriceRange.prototype.price = null; + + /** + * PriceRange originalPrice. + * @member {google.cloud.retail.v2alpha.IInterval|null|undefined} originalPrice + * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @instance + */ + PriceRange.prototype.originalPrice = null; + + /** + * Creates a new PriceRange instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @static + * @param {google.cloud.retail.v2alpha.PriceInfo.IPriceRange=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PriceInfo.PriceRange} PriceRange instance + */ + PriceRange.create = function create(properties) { + return new PriceRange(properties); + }; + + /** + * Encodes the specified PriceRange message. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.PriceRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @static + * @param {google.cloud.retail.v2alpha.PriceInfo.IPriceRange} message PriceRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.price != null && Object.hasOwnProperty.call(message, "price")) + $root.google.cloud.retail.v2alpha.Interval.encode(message.price, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.originalPrice != null && Object.hasOwnProperty.call(message, "originalPrice")) + $root.google.cloud.retail.v2alpha.Interval.encode(message.originalPrice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PriceRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.PriceRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @static + * @param {google.cloud.retail.v2alpha.PriceInfo.IPriceRange} message PriceRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PriceRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @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.PriceInfo.PriceRange} PriceRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceRange.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.PriceInfo.PriceRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = $root.google.cloud.retail.v2alpha.Interval.decode(reader, reader.uint32()); + break; + case 2: + message.originalPrice = $root.google.cloud.retail.v2alpha.Interval.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PriceRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.PriceInfo.PriceRange} PriceRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PriceRange message. + * @function verify + * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PriceRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.price != null && message.hasOwnProperty("price")) { + var error = $root.google.cloud.retail.v2alpha.Interval.verify(message.price); + if (error) + return "price." + error; + } + if (message.originalPrice != null && message.hasOwnProperty("originalPrice")) { + var error = $root.google.cloud.retail.v2alpha.Interval.verify(message.originalPrice); + if (error) + return "originalPrice." + error; + } + return null; + }; + + /** + * Creates a PriceRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.PriceInfo.PriceRange} PriceRange + */ + PriceRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PriceInfo.PriceRange) + return object; + var message = new $root.google.cloud.retail.v2alpha.PriceInfo.PriceRange(); + if (object.price != null) { + if (typeof object.price !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PriceInfo.PriceRange.price: object expected"); + message.price = $root.google.cloud.retail.v2alpha.Interval.fromObject(object.price); + } + if (object.originalPrice != null) { + if (typeof object.originalPrice !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PriceInfo.PriceRange.originalPrice: object expected"); + message.originalPrice = $root.google.cloud.retail.v2alpha.Interval.fromObject(object.originalPrice); + } + return message; + }; + + /** + * Creates a plain object from a PriceRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @static + * @param {google.cloud.retail.v2alpha.PriceInfo.PriceRange} message PriceRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PriceRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.price = null; + object.originalPrice = null; + } + if (message.price != null && message.hasOwnProperty("price")) + object.price = $root.google.cloud.retail.v2alpha.Interval.toObject(message.price, options); + if (message.originalPrice != null && message.hasOwnProperty("originalPrice")) + object.originalPrice = $root.google.cloud.retail.v2alpha.Interval.toObject(message.originalPrice, options); + return object; + }; + + /** + * Converts this PriceRange to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.PriceInfo.PriceRange + * @instance + * @returns {Object.} JSON object + */ + PriceRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PriceRange; + })(); + + return PriceInfo; })(); - v2alpha.ImportProductsRequest = (function() { + v2alpha.Rating = (function() { /** - * Properties of an ImportProductsRequest. + * Properties of a Rating. * @memberof google.cloud.retail.v2alpha - * @interface IImportProductsRequest - * @property {string|null} [parent] ImportProductsRequest parent - * @property {string|null} [requestId] ImportProductsRequest requestId - * @property {google.cloud.retail.v2alpha.IProductInputConfig|null} [inputConfig] ImportProductsRequest inputConfig - * @property {google.cloud.retail.v2alpha.IImportErrorsConfig|null} [errorsConfig] ImportProductsRequest errorsConfig - * @property {google.protobuf.IFieldMask|null} [updateMask] ImportProductsRequest updateMask - * @property {google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode|null} [reconciliationMode] ImportProductsRequest reconciliationMode - * @property {string|null} [notificationPubsubTopic] ImportProductsRequest notificationPubsubTopic + * @interface IRating + * @property {number|null} [ratingCount] Rating ratingCount + * @property {number|null} [averageRating] Rating averageRating + * @property {Array.|null} [ratingHistogram] Rating ratingHistogram */ /** - * Constructs a new ImportProductsRequest. + * Constructs a new Rating. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ImportProductsRequest. - * @implements IImportProductsRequest + * @classdesc Represents a Rating. + * @implements IRating * @constructor - * @param {google.cloud.retail.v2alpha.IImportProductsRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IRating=} [properties] Properties to set */ - function ImportProductsRequest(properties) { + function Rating(properties) { + this.ratingHistogram = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31346,153 +31196,112 @@ } /** - * ImportProductsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest - * @instance - */ - ImportProductsRequest.prototype.parent = ""; - - /** - * ImportProductsRequest requestId. - * @member {string} requestId - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest - * @instance - */ - ImportProductsRequest.prototype.requestId = ""; - - /** - * ImportProductsRequest inputConfig. - * @member {google.cloud.retail.v2alpha.IProductInputConfig|null|undefined} inputConfig - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest - * @instance - */ - ImportProductsRequest.prototype.inputConfig = null; - - /** - * ImportProductsRequest errorsConfig. - * @member {google.cloud.retail.v2alpha.IImportErrorsConfig|null|undefined} errorsConfig - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest - * @instance - */ - ImportProductsRequest.prototype.errorsConfig = null; - - /** - * ImportProductsRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * Rating ratingCount. + * @member {number} ratingCount + * @memberof google.cloud.retail.v2alpha.Rating * @instance */ - ImportProductsRequest.prototype.updateMask = null; + Rating.prototype.ratingCount = 0; /** - * ImportProductsRequest reconciliationMode. - * @member {google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode} reconciliationMode - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * Rating averageRating. + * @member {number} averageRating + * @memberof google.cloud.retail.v2alpha.Rating * @instance */ - ImportProductsRequest.prototype.reconciliationMode = 0; + Rating.prototype.averageRating = 0; /** - * ImportProductsRequest notificationPubsubTopic. - * @member {string} notificationPubsubTopic - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * Rating ratingHistogram. + * @member {Array.} ratingHistogram + * @memberof google.cloud.retail.v2alpha.Rating * @instance */ - ImportProductsRequest.prototype.notificationPubsubTopic = ""; + Rating.prototype.ratingHistogram = $util.emptyArray; /** - * Creates a new ImportProductsRequest instance using the specified properties. + * Creates a new Rating instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.Rating * @static - * @param {google.cloud.retail.v2alpha.IImportProductsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ImportProductsRequest} ImportProductsRequest instance + * @param {google.cloud.retail.v2alpha.IRating=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rating} Rating instance */ - ImportProductsRequest.create = function create(properties) { - return new ImportProductsRequest(properties); + Rating.create = function create(properties) { + return new Rating(properties); }; /** - * Encodes the specified ImportProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsRequest.verify|verify} messages. + * Encodes the specified Rating message. Does not implicitly {@link google.cloud.retail.v2alpha.Rating.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.Rating * @static - * @param {google.cloud.retail.v2alpha.IImportProductsRequest} message ImportProductsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRating} message Rating message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportProductsRequest.encode = function encode(message, writer) { + Rating.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) - $root.google.cloud.retail.v2alpha.ProductInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) - $root.google.cloud.retail.v2alpha.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reconciliationMode != null && Object.hasOwnProperty.call(message, "reconciliationMode")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.reconciliationMode); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.requestId); - if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.notificationPubsubTopic); + if (message.ratingCount != null && Object.hasOwnProperty.call(message, "ratingCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ratingCount); + if (message.averageRating != null && Object.hasOwnProperty.call(message, "averageRating")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.averageRating); + if (message.ratingHistogram != null && message.ratingHistogram.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.ratingHistogram.length; ++i) + writer.int32(message.ratingHistogram[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified ImportProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsRequest.verify|verify} messages. + * Encodes the specified Rating message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rating.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.Rating * @static - * @param {google.cloud.retail.v2alpha.IImportProductsRequest} message ImportProductsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRating} message Rating message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { + Rating.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportProductsRequest message from the specified reader or buffer. + * Decodes a Rating message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.Rating * @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.ImportProductsRequest} ImportProductsRequest + * @returns {google.cloud.retail.v2alpha.Rating} Rating * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportProductsRequest.decode = function decode(reader, length) { + Rating.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.ImportProductsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rating(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 6: - message.requestId = reader.string(); + message.ratingCount = reader.int32(); break; case 2: - message.inputConfig = $root.google.cloud.retail.v2alpha.ProductInputConfig.decode(reader, reader.uint32()); + message.averageRating = reader.float(); break; case 3: - message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.decode(reader, reader.uint32()); - break; - case 4: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 5: - message.reconciliationMode = reader.int32(); - break; - case 7: - message.notificationPubsubTopic = reader.string(); + if (!(message.ratingHistogram && message.ratingHistogram.length)) + message.ratingHistogram = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.ratingHistogram.push(reader.int32()); + } else + message.ratingHistogram.push(reader.int32()); break; default: reader.skipType(tag & 7); @@ -31503,207 +31312,140 @@ }; /** - * Decodes an ImportProductsRequest message from the specified reader or buffer, length delimited. + * Decodes a Rating message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.Rating * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ImportProductsRequest} ImportProductsRequest + * @returns {google.cloud.retail.v2alpha.Rating} Rating * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportProductsRequest.decodeDelimited = function decodeDelimited(reader) { + Rating.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportProductsRequest message. + * Verifies a Rating message. * @function verify - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.Rating * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportProductsRequest.verify = function verify(message) { + Rating.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { - var error = $root.google.cloud.retail.v2alpha.ProductInputConfig.verify(message.inputConfig); - if (error) - return "inputConfig." + error; - } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { - var error = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.verify(message.errorsConfig); - if (error) - return "errorsConfig." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.ratingCount != null && message.hasOwnProperty("ratingCount")) + if (!$util.isInteger(message.ratingCount)) + return "ratingCount: integer expected"; + if (message.averageRating != null && message.hasOwnProperty("averageRating")) + if (typeof message.averageRating !== "number") + return "averageRating: number expected"; + if (message.ratingHistogram != null && message.hasOwnProperty("ratingHistogram")) { + if (!Array.isArray(message.ratingHistogram)) + return "ratingHistogram: array expected"; + for (var i = 0; i < message.ratingHistogram.length; ++i) + if (!$util.isInteger(message.ratingHistogram[i])) + return "ratingHistogram: integer[] expected"; } - if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) - switch (message.reconciliationMode) { - default: - return "reconciliationMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - if (!$util.isString(message.notificationPubsubTopic)) - return "notificationPubsubTopic: string expected"; return null; }; /** - * Creates an ImportProductsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Rating message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.Rating * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ImportProductsRequest} ImportProductsRequest + * @returns {google.cloud.retail.v2alpha.Rating} Rating */ - ImportProductsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ImportProductsRequest) + Rating.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rating) return object; - var message = new $root.google.cloud.retail.v2alpha.ImportProductsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.inputConfig != null) { - if (typeof object.inputConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportProductsRequest.inputConfig: object expected"); - message.inputConfig = $root.google.cloud.retail.v2alpha.ProductInputConfig.fromObject(object.inputConfig); - } - if (object.errorsConfig != null) { - if (typeof object.errorsConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportProductsRequest.errorsConfig: object expected"); - message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.fromObject(object.errorsConfig); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportProductsRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - switch (object.reconciliationMode) { - case "RECONCILIATION_MODE_UNSPECIFIED": - case 0: - message.reconciliationMode = 0; - break; - case "INCREMENTAL": - case 1: - message.reconciliationMode = 1; - break; - case "FULL": - case 2: - message.reconciliationMode = 2; - break; + var message = new $root.google.cloud.retail.v2alpha.Rating(); + if (object.ratingCount != null) + message.ratingCount = object.ratingCount | 0; + if (object.averageRating != null) + message.averageRating = Number(object.averageRating); + if (object.ratingHistogram) { + if (!Array.isArray(object.ratingHistogram)) + throw TypeError(".google.cloud.retail.v2alpha.Rating.ratingHistogram: array expected"); + message.ratingHistogram = []; + for (var i = 0; i < object.ratingHistogram.length; ++i) + message.ratingHistogram[i] = object.ratingHistogram[i] | 0; } - if (object.notificationPubsubTopic != null) - message.notificationPubsubTopic = String(object.notificationPubsubTopic); return message; }; /** - * Creates a plain object from an ImportProductsRequest message. Also converts values to other types if specified. + * Creates a plain object from a Rating message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.Rating * @static - * @param {google.cloud.retail.v2alpha.ImportProductsRequest} message ImportProductsRequest + * @param {google.cloud.retail.v2alpha.Rating} message Rating * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportProductsRequest.toObject = function toObject(message, options) { + Rating.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.ratingHistogram = []; if (options.defaults) { - object.parent = ""; - object.inputConfig = null; - object.errorsConfig = null; - object.updateMask = null; - object.reconciliationMode = options.enums === String ? "RECONCILIATION_MODE_UNSPECIFIED" : 0; - object.requestId = ""; - object.notificationPubsubTopic = ""; + object.ratingCount = 0; + object.averageRating = 0; + } + if (message.ratingCount != null && message.hasOwnProperty("ratingCount")) + object.ratingCount = message.ratingCount; + if (message.averageRating != null && message.hasOwnProperty("averageRating")) + object.averageRating = options.json && !isFinite(message.averageRating) ? String(message.averageRating) : message.averageRating; + if (message.ratingHistogram && message.ratingHistogram.length) { + object.ratingHistogram = []; + for (var j = 0; j < message.ratingHistogram.length; ++j) + object.ratingHistogram[j] = message.ratingHistogram[j]; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) - object.inputConfig = $root.google.cloud.retail.v2alpha.ProductInputConfig.toObject(message.inputConfig, options); - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) - object.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.toObject(message.errorsConfig, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) - object.reconciliationMode = options.enums === String ? $root.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode[message.reconciliationMode] : message.reconciliationMode; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - object.notificationPubsubTopic = message.notificationPubsubTopic; return object; }; /** - * Converts this ImportProductsRequest to JSON. + * Converts this Rating to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.Rating * @instance * @returns {Object.} JSON object */ - ImportProductsRequest.prototype.toJSON = function toJSON() { + Rating.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * ReconciliationMode enum. - * @name google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode - * @enum {number} - * @property {number} RECONCILIATION_MODE_UNSPECIFIED=0 RECONCILIATION_MODE_UNSPECIFIED value - * @property {number} INCREMENTAL=1 INCREMENTAL value - * @property {number} FULL=2 FULL value - */ - ImportProductsRequest.ReconciliationMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RECONCILIATION_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INCREMENTAL"] = 1; - values[valuesById[2] = "FULL"] = 2; - return values; - })(); - - return ImportProductsRequest; + return Rating; })(); - v2alpha.ImportUserEventsRequest = (function() { + v2alpha.UserInfo = (function() { /** - * Properties of an ImportUserEventsRequest. + * Properties of a UserInfo. * @memberof google.cloud.retail.v2alpha - * @interface IImportUserEventsRequest - * @property {string|null} [parent] ImportUserEventsRequest parent - * @property {google.cloud.retail.v2alpha.IUserEventInputConfig|null} [inputConfig] ImportUserEventsRequest inputConfig - * @property {google.cloud.retail.v2alpha.IImportErrorsConfig|null} [errorsConfig] ImportUserEventsRequest errorsConfig + * @interface IUserInfo + * @property {string|null} [userId] UserInfo userId + * @property {string|null} [ipAddress] UserInfo ipAddress + * @property {string|null} [userAgent] UserInfo userAgent + * @property {boolean|null} [directUserRequest] UserInfo directUserRequest */ /** - * Constructs a new ImportUserEventsRequest. + * Constructs a new UserInfo. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ImportUserEventsRequest. - * @implements IImportUserEventsRequest + * @classdesc Represents a UserInfo. + * @implements IUserInfo * @constructor - * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IUserInfo=} [properties] Properties to set */ - function ImportUserEventsRequest(properties) { + function UserInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31711,101 +31453,114 @@ } /** - * ImportUserEventsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest + * UserInfo userId. + * @member {string} userId + * @memberof google.cloud.retail.v2alpha.UserInfo * @instance */ - ImportUserEventsRequest.prototype.parent = ""; + UserInfo.prototype.userId = ""; /** - * ImportUserEventsRequest inputConfig. - * @member {google.cloud.retail.v2alpha.IUserEventInputConfig|null|undefined} inputConfig - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest + * UserInfo ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.retail.v2alpha.UserInfo * @instance */ - ImportUserEventsRequest.prototype.inputConfig = null; + UserInfo.prototype.ipAddress = ""; /** - * ImportUserEventsRequest errorsConfig. - * @member {google.cloud.retail.v2alpha.IImportErrorsConfig|null|undefined} errorsConfig - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest + * UserInfo userAgent. + * @member {string} userAgent + * @memberof google.cloud.retail.v2alpha.UserInfo * @instance */ - ImportUserEventsRequest.prototype.errorsConfig = null; + UserInfo.prototype.userAgent = ""; /** - * Creates a new ImportUserEventsRequest instance using the specified properties. + * UserInfo directUserRequest. + * @member {boolean} directUserRequest + * @memberof google.cloud.retail.v2alpha.UserInfo + * @instance + */ + UserInfo.prototype.directUserRequest = false; + + /** + * Creates a new UserInfo instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest + * @memberof google.cloud.retail.v2alpha.UserInfo * @static - * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ImportUserEventsRequest} ImportUserEventsRequest instance + * @param {google.cloud.retail.v2alpha.IUserInfo=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UserInfo} UserInfo instance */ - ImportUserEventsRequest.create = function create(properties) { - return new ImportUserEventsRequest(properties); + UserInfo.create = function create(properties) { + return new UserInfo(properties); }; /** - * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsRequest.verify|verify} messages. + * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.UserInfo.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest + * @memberof google.cloud.retail.v2alpha.UserInfo * @static - * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUserInfo} message UserInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportUserEventsRequest.encode = function encode(message, writer) { + UserInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) - $root.google.cloud.retail.v2alpha.UserEventInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) - $root.google.cloud.retail.v2alpha.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userId); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAddress); + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.userAgent); + if (message.directUserRequest != null && Object.hasOwnProperty.call(message, "directUserRequest")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.directUserRequest); return writer; }; /** - * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsRequest.verify|verify} messages. + * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest + * @memberof google.cloud.retail.v2alpha.UserInfo * @static - * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUserInfo} message UserInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + UserInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportUserEventsRequest message from the specified reader or buffer. + * Decodes a UserInfo message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest + * @memberof google.cloud.retail.v2alpha.UserInfo * @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.ImportUserEventsRequest} ImportUserEventsRequest + * @returns {google.cloud.retail.v2alpha.UserInfo} UserInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportUserEventsRequest.decode = function decode(reader, length) { + UserInfo.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.ImportUserEventsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UserInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.userId = reader.string(); break; case 2: - message.inputConfig = $root.google.cloud.retail.v2alpha.UserEventInputConfig.decode(reader, reader.uint32()); + message.ipAddress = reader.string(); break; case 3: - message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.decode(reader, reader.uint32()); + message.userAgent = reader.string(); + break; + case 4: + message.directUserRequest = reader.bool(); break; default: reader.skipType(tag & 7); @@ -31816,136 +31571,132 @@ }; /** - * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a UserInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest + * @memberof google.cloud.retail.v2alpha.UserInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ImportUserEventsRequest} ImportUserEventsRequest + * @returns {google.cloud.retail.v2alpha.UserInfo} UserInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { + UserInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportUserEventsRequest message. + * Verifies a UserInfo message. * @function verify - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest + * @memberof google.cloud.retail.v2alpha.UserInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportUserEventsRequest.verify = function verify(message) { + UserInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { - var error = $root.google.cloud.retail.v2alpha.UserEventInputConfig.verify(message.inputConfig); - if (error) - return "inputConfig." + error; - } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { - var error = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.verify(message.errorsConfig); - if (error) - return "errorsConfig." + error; - } + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isString(message.userId)) + return "userId: string expected"; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + if (!$util.isString(message.userAgent)) + return "userAgent: string expected"; + if (message.directUserRequest != null && message.hasOwnProperty("directUserRequest")) + if (typeof message.directUserRequest !== "boolean") + return "directUserRequest: boolean expected"; return null; }; /** - * Creates an ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a UserInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest + * @memberof google.cloud.retail.v2alpha.UserInfo * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ImportUserEventsRequest} ImportUserEventsRequest + * @returns {google.cloud.retail.v2alpha.UserInfo} UserInfo */ - ImportUserEventsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ImportUserEventsRequest) + UserInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UserInfo) return object; - var message = new $root.google.cloud.retail.v2alpha.ImportUserEventsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.inputConfig != null) { - if (typeof object.inputConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsRequest.inputConfig: object expected"); - message.inputConfig = $root.google.cloud.retail.v2alpha.UserEventInputConfig.fromObject(object.inputConfig); - } - if (object.errorsConfig != null) { - if (typeof object.errorsConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsRequest.errorsConfig: object expected"); - message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.fromObject(object.errorsConfig); - } + var message = new $root.google.cloud.retail.v2alpha.UserInfo(); + if (object.userId != null) + message.userId = String(object.userId); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.userAgent != null) + message.userAgent = String(object.userAgent); + if (object.directUserRequest != null) + message.directUserRequest = Boolean(object.directUserRequest); return message; }; /** - * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. + * Creates a plain object from a UserInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest + * @memberof google.cloud.retail.v2alpha.UserInfo * @static - * @param {google.cloud.retail.v2alpha.ImportUserEventsRequest} message ImportUserEventsRequest + * @param {google.cloud.retail.v2alpha.UserInfo} message UserInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportUserEventsRequest.toObject = function toObject(message, options) { + UserInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.inputConfig = null; - object.errorsConfig = null; + object.userId = ""; + object.ipAddress = ""; + object.userAgent = ""; + object.directUserRequest = false; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) - object.inputConfig = $root.google.cloud.retail.v2alpha.UserEventInputConfig.toObject(message.inputConfig, options); - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) - object.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.toObject(message.errorsConfig, options); + if (message.userId != null && message.hasOwnProperty("userId")) + object.userId = message.userId; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + object.userAgent = message.userAgent; + if (message.directUserRequest != null && message.hasOwnProperty("directUserRequest")) + object.directUserRequest = message.directUserRequest; return object; }; /** - * Converts this ImportUserEventsRequest to JSON. + * Converts this UserInfo to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest + * @memberof google.cloud.retail.v2alpha.UserInfo * @instance * @returns {Object.} JSON object */ - ImportUserEventsRequest.prototype.toJSON = function toJSON() { + UserInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ImportUserEventsRequest; + return UserInfo; })(); - v2alpha.ImportCompletionDataRequest = (function() { + v2alpha.Promotion = (function() { /** - * Properties of an ImportCompletionDataRequest. + * Properties of a Promotion. * @memberof google.cloud.retail.v2alpha - * @interface IImportCompletionDataRequest - * @property {string|null} [parent] ImportCompletionDataRequest parent - * @property {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null} [inputConfig] ImportCompletionDataRequest inputConfig - * @property {string|null} [notificationPubsubTopic] ImportCompletionDataRequest notificationPubsubTopic + * @interface IPromotion + * @property {string|null} [promotionId] Promotion promotionId */ /** - * Constructs a new ImportCompletionDataRequest. + * Constructs a new Promotion. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ImportCompletionDataRequest. - * @implements IImportCompletionDataRequest + * @classdesc Represents a Promotion. + * @implements IPromotion * @constructor - * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IPromotion=} [properties] Properties to set */ - function ImportCompletionDataRequest(properties) { + function Promotion(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31953,101 +31704,75 @@ } /** - * ImportCompletionDataRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest - * @instance - */ - ImportCompletionDataRequest.prototype.parent = ""; - - /** - * ImportCompletionDataRequest inputConfig. - * @member {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null|undefined} inputConfig - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest - * @instance - */ - ImportCompletionDataRequest.prototype.inputConfig = null; - - /** - * ImportCompletionDataRequest notificationPubsubTopic. - * @member {string} notificationPubsubTopic - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * Promotion promotionId. + * @member {string} promotionId + * @memberof google.cloud.retail.v2alpha.Promotion * @instance */ - ImportCompletionDataRequest.prototype.notificationPubsubTopic = ""; + Promotion.prototype.promotionId = ""; /** - * Creates a new ImportCompletionDataRequest instance using the specified properties. + * Creates a new Promotion instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * @memberof google.cloud.retail.v2alpha.Promotion * @static - * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ImportCompletionDataRequest} ImportCompletionDataRequest instance + * @param {google.cloud.retail.v2alpha.IPromotion=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Promotion} Promotion instance */ - ImportCompletionDataRequest.create = function create(properties) { - return new ImportCompletionDataRequest(properties); + Promotion.create = function create(properties) { + return new Promotion(properties); }; /** - * Encodes the specified ImportCompletionDataRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataRequest.verify|verify} messages. + * Encodes the specified Promotion message. Does not implicitly {@link google.cloud.retail.v2alpha.Promotion.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * @memberof google.cloud.retail.v2alpha.Promotion * @static - * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest} message ImportCompletionDataRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPromotion} message Promotion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportCompletionDataRequest.encode = function encode(message, writer) { + Promotion.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) - $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.notificationPubsubTopic); + if (message.promotionId != null && Object.hasOwnProperty.call(message, "promotionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.promotionId); return writer; }; /** - * Encodes the specified ImportCompletionDataRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataRequest.verify|verify} messages. + * Encodes the specified Promotion message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Promotion.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * @memberof google.cloud.retail.v2alpha.Promotion * @static - * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest} message ImportCompletionDataRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPromotion} message Promotion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportCompletionDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + Promotion.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportCompletionDataRequest message from the specified reader or buffer. + * Decodes a Promotion message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * @memberof google.cloud.retail.v2alpha.Promotion * @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.ImportCompletionDataRequest} ImportCompletionDataRequest + * @returns {google.cloud.retail.v2alpha.Promotion} Promotion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportCompletionDataRequest.decode = function decode(reader, length) { + Promotion.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.ImportCompletionDataRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Promotion(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.inputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.decode(reader, reader.uint32()); - break; - case 3: - message.notificationPubsubTopic = reader.string(); + message.promotionId = reader.string(); break; default: reader.skipType(tag & 7); @@ -32058,131 +31783,110 @@ }; /** - * Decodes an ImportCompletionDataRequest message from the specified reader or buffer, length delimited. + * Decodes a Promotion message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * @memberof google.cloud.retail.v2alpha.Promotion * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ImportCompletionDataRequest} ImportCompletionDataRequest + * @returns {google.cloud.retail.v2alpha.Promotion} Promotion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportCompletionDataRequest.decodeDelimited = function decodeDelimited(reader) { + Promotion.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportCompletionDataRequest message. + * Verifies a Promotion message. * @function verify - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * @memberof google.cloud.retail.v2alpha.Promotion * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportCompletionDataRequest.verify = function verify(message) { + Promotion.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { - var error = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.verify(message.inputConfig); - if (error) - return "inputConfig." + error; - } - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - if (!$util.isString(message.notificationPubsubTopic)) - return "notificationPubsubTopic: string expected"; + if (message.promotionId != null && message.hasOwnProperty("promotionId")) + if (!$util.isString(message.promotionId)) + return "promotionId: string expected"; return null; }; /** - * Creates an ImportCompletionDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Promotion message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * @memberof google.cloud.retail.v2alpha.Promotion * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ImportCompletionDataRequest} ImportCompletionDataRequest + * @returns {google.cloud.retail.v2alpha.Promotion} Promotion */ - ImportCompletionDataRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ImportCompletionDataRequest) + Promotion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Promotion) return object; - var message = new $root.google.cloud.retail.v2alpha.ImportCompletionDataRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.inputConfig != null) { - if (typeof object.inputConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportCompletionDataRequest.inputConfig: object expected"); - message.inputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.fromObject(object.inputConfig); - } - if (object.notificationPubsubTopic != null) - message.notificationPubsubTopic = String(object.notificationPubsubTopic); + var message = new $root.google.cloud.retail.v2alpha.Promotion(); + if (object.promotionId != null) + message.promotionId = String(object.promotionId); return message; }; /** - * Creates a plain object from an ImportCompletionDataRequest message. Also converts values to other types if specified. + * Creates a plain object from a Promotion message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * @memberof google.cloud.retail.v2alpha.Promotion * @static - * @param {google.cloud.retail.v2alpha.ImportCompletionDataRequest} message ImportCompletionDataRequest + * @param {google.cloud.retail.v2alpha.Promotion} message Promotion * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportCompletionDataRequest.toObject = function toObject(message, options) { + Promotion.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.inputConfig = null; - object.notificationPubsubTopic = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) - object.inputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.toObject(message.inputConfig, options); - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - object.notificationPubsubTopic = message.notificationPubsubTopic; + if (options.defaults) + object.promotionId = ""; + if (message.promotionId != null && message.hasOwnProperty("promotionId")) + object.promotionId = message.promotionId; return object; }; /** - * Converts this ImportCompletionDataRequest to JSON. + * Converts this Promotion to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * @memberof google.cloud.retail.v2alpha.Promotion * @instance * @returns {Object.} JSON object */ - ImportCompletionDataRequest.prototype.toJSON = function toJSON() { + Promotion.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ImportCompletionDataRequest; + return Promotion; })(); - v2alpha.ProductInputConfig = (function() { + v2alpha.LocalInventory = (function() { /** - * Properties of a ProductInputConfig. + * Properties of a LocalInventory. * @memberof google.cloud.retail.v2alpha - * @interface IProductInputConfig - * @property {google.cloud.retail.v2alpha.IProductInlineSource|null} [productInlineSource] ProductInputConfig productInlineSource - * @property {google.cloud.retail.v2alpha.IGcsSource|null} [gcsSource] ProductInputConfig gcsSource - * @property {google.cloud.retail.v2alpha.IBigQuerySource|null} [bigQuerySource] ProductInputConfig bigQuerySource + * @interface ILocalInventory + * @property {string|null} [placeId] LocalInventory placeId + * @property {google.cloud.retail.v2alpha.IPriceInfo|null} [priceInfo] LocalInventory priceInfo + * @property {Object.|null} [attributes] LocalInventory attributes */ /** - * Constructs a new ProductInputConfig. + * Constructs a new LocalInventory. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ProductInputConfig. - * @implements IProductInputConfig + * @classdesc Represents a LocalInventory. + * @implements ILocalInventory * @constructor - * @param {google.cloud.retail.v2alpha.IProductInputConfig=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ILocalInventory=} [properties] Properties to set */ - function ProductInputConfig(properties) { + function LocalInventory(properties) { + this.attributes = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32190,115 +31894,123 @@ } /** - * ProductInputConfig productInlineSource. - * @member {google.cloud.retail.v2alpha.IProductInlineSource|null|undefined} productInlineSource - * @memberof google.cloud.retail.v2alpha.ProductInputConfig - * @instance - */ - ProductInputConfig.prototype.productInlineSource = null; - - /** - * ProductInputConfig gcsSource. - * @member {google.cloud.retail.v2alpha.IGcsSource|null|undefined} gcsSource - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * LocalInventory placeId. + * @member {string} placeId + * @memberof google.cloud.retail.v2alpha.LocalInventory * @instance */ - ProductInputConfig.prototype.gcsSource = null; + LocalInventory.prototype.placeId = ""; /** - * ProductInputConfig bigQuerySource. - * @member {google.cloud.retail.v2alpha.IBigQuerySource|null|undefined} bigQuerySource - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * LocalInventory priceInfo. + * @member {google.cloud.retail.v2alpha.IPriceInfo|null|undefined} priceInfo + * @memberof google.cloud.retail.v2alpha.LocalInventory * @instance */ - ProductInputConfig.prototype.bigQuerySource = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + LocalInventory.prototype.priceInfo = null; /** - * ProductInputConfig source. - * @member {"productInlineSource"|"gcsSource"|"bigQuerySource"|undefined} source - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * LocalInventory attributes. + * @member {Object.} attributes + * @memberof google.cloud.retail.v2alpha.LocalInventory * @instance */ - Object.defineProperty(ProductInputConfig.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["productInlineSource", "gcsSource", "bigQuerySource"]), - set: $util.oneOfSetter($oneOfFields) - }); + LocalInventory.prototype.attributes = $util.emptyObject; /** - * Creates a new ProductInputConfig instance using the specified properties. + * Creates a new LocalInventory instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.LocalInventory * @static - * @param {google.cloud.retail.v2alpha.IProductInputConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ProductInputConfig} ProductInputConfig instance + * @param {google.cloud.retail.v2alpha.ILocalInventory=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.LocalInventory} LocalInventory instance */ - ProductInputConfig.create = function create(properties) { - return new ProductInputConfig(properties); + LocalInventory.create = function create(properties) { + return new LocalInventory(properties); }; /** - * Encodes the specified ProductInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInputConfig.verify|verify} messages. + * Encodes the specified LocalInventory message. Does not implicitly {@link google.cloud.retail.v2alpha.LocalInventory.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.LocalInventory * @static - * @param {google.cloud.retail.v2alpha.IProductInputConfig} message ProductInputConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.ILocalInventory} message LocalInventory message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductInputConfig.encode = function encode(message, writer) { + LocalInventory.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.productInlineSource != null && Object.hasOwnProperty.call(message, "productInlineSource")) - $root.google.cloud.retail.v2alpha.ProductInlineSource.encode(message.productInlineSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) - $root.google.cloud.retail.v2alpha.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) - $root.google.cloud.retail.v2alpha.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.placeId != null && Object.hasOwnProperty.call(message, "placeId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.placeId); + if (message.priceInfo != null && Object.hasOwnProperty.call(message, "priceInfo")) + $root.google.cloud.retail.v2alpha.PriceInfo.encode(message.priceInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.retail.v2alpha.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; /** - * Encodes the specified ProductInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInputConfig.verify|verify} messages. + * Encodes the specified LocalInventory message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.LocalInventory.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.LocalInventory * @static - * @param {google.cloud.retail.v2alpha.IProductInputConfig} message ProductInputConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.ILocalInventory} message LocalInventory message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + LocalInventory.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ProductInputConfig message from the specified reader or buffer. + * Decodes a LocalInventory message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.LocalInventory * @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.ProductInputConfig} ProductInputConfig + * @returns {google.cloud.retail.v2alpha.LocalInventory} LocalInventory * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductInputConfig.decode = function decode(reader, length) { + LocalInventory.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.ProductInputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.LocalInventory(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.productInlineSource = $root.google.cloud.retail.v2alpha.ProductInlineSource.decode(reader, reader.uint32()); + message.placeId = reader.string(); break; case 2: - message.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.decode(reader, reader.uint32()); + message.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.decode(reader, reader.uint32()); break; case 3: - message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.decode(reader, reader.uint32()); + if (message.attributes === $util.emptyObject) + message.attributes = {}; + 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.CustomAttribute.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; break; default: reader.skipType(tag & 7); @@ -32309,159 +32021,151 @@ }; /** - * Decodes a ProductInputConfig message from the specified reader or buffer, length delimited. + * Decodes a LocalInventory message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.LocalInventory * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ProductInputConfig} ProductInputConfig + * @returns {google.cloud.retail.v2alpha.LocalInventory} LocalInventory * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductInputConfig.decodeDelimited = function decodeDelimited(reader) { + LocalInventory.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ProductInputConfig message. + * Verifies a LocalInventory message. * @function verify - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.LocalInventory * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ProductInputConfig.verify = function verify(message) { + LocalInventory.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.productInlineSource != null && message.hasOwnProperty("productInlineSource")) { - properties.source = 1; - { - var error = $root.google.cloud.retail.v2alpha.ProductInlineSource.verify(message.productInlineSource); - if (error) - return "productInlineSource." + error; - } - } - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.retail.v2alpha.GcsSource.verify(message.gcsSource); - if (error) - return "gcsSource." + error; - } + if (message.placeId != null && message.hasOwnProperty("placeId")) + if (!$util.isString(message.placeId)) + return "placeId: string expected"; + if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) { + var error = $root.google.cloud.retail.v2alpha.PriceInfo.verify(message.priceInfo); + if (error) + return "priceInfo." + error; } - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.retail.v2alpha.BigQuerySource.verify(message.bigQuerySource); + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.CustomAttribute.verify(message.attributes[key[i]]); if (error) - return "bigQuerySource." + error; + return "attributes." + error; } } return null; }; /** - * Creates a ProductInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a LocalInventory message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.LocalInventory * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ProductInputConfig} ProductInputConfig + * @returns {google.cloud.retail.v2alpha.LocalInventory} LocalInventory */ - ProductInputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ProductInputConfig) + LocalInventory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.LocalInventory) return object; - var message = new $root.google.cloud.retail.v2alpha.ProductInputConfig(); - if (object.productInlineSource != null) { - if (typeof object.productInlineSource !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ProductInputConfig.productInlineSource: object expected"); - message.productInlineSource = $root.google.cloud.retail.v2alpha.ProductInlineSource.fromObject(object.productInlineSource); - } - if (object.gcsSource != null) { - if (typeof object.gcsSource !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ProductInputConfig.gcsSource: object expected"); - message.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.fromObject(object.gcsSource); + var message = new $root.google.cloud.retail.v2alpha.LocalInventory(); + if (object.placeId != null) + message.placeId = String(object.placeId); + if (object.priceInfo != null) { + if (typeof object.priceInfo !== "object") + throw TypeError(".google.cloud.retail.v2alpha.LocalInventory.priceInfo: object expected"); + message.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.fromObject(object.priceInfo); } - if (object.bigQuerySource != null) { - if (typeof object.bigQuerySource !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ProductInputConfig.bigQuerySource: object expected"); - message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.fromObject(object.bigQuerySource); + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.retail.v2alpha.LocalInventory.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.LocalInventory.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.retail.v2alpha.CustomAttribute.fromObject(object.attributes[keys[i]]); + } } return message; }; /** - * Creates a plain object from a ProductInputConfig message. Also converts values to other types if specified. + * Creates a plain object from a LocalInventory message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.LocalInventory * @static - * @param {google.cloud.retail.v2alpha.ProductInputConfig} message ProductInputConfig + * @param {google.cloud.retail.v2alpha.LocalInventory} message LocalInventory * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ProductInputConfig.toObject = function toObject(message, options) { + LocalInventory.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.productInlineSource != null && message.hasOwnProperty("productInlineSource")) { - object.productInlineSource = $root.google.cloud.retail.v2alpha.ProductInlineSource.toObject(message.productInlineSource, options); - if (options.oneofs) - object.source = "productInlineSource"; - } - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - object.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.toObject(message.gcsSource, options); - if (options.oneofs) - object.source = "gcsSource"; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.placeId = ""; + object.priceInfo = null; } - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - object.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.toObject(message.bigQuerySource, options); - if (options.oneofs) - object.source = "bigQuerySource"; + if (message.placeId != null && message.hasOwnProperty("placeId")) + object.placeId = message.placeId; + if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) + object.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.toObject(message.priceInfo, options); + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.retail.v2alpha.CustomAttribute.toObject(message.attributes[keys2[j]], options); } return object; }; /** - * Converts this ProductInputConfig to JSON. + * Converts this LocalInventory to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.LocalInventory * @instance * @returns {Object.} JSON object */ - ProductInputConfig.prototype.toJSON = function toJSON() { + LocalInventory.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ProductInputConfig; + return LocalInventory; })(); - v2alpha.UserEventInputConfig = (function() { + v2alpha.GcsSource = (function() { /** - * Properties of a UserEventInputConfig. + * Properties of a GcsSource. * @memberof google.cloud.retail.v2alpha - * @interface IUserEventInputConfig - * @property {google.cloud.retail.v2alpha.IUserEventInlineSource|null} [userEventInlineSource] UserEventInputConfig userEventInlineSource - * @property {google.cloud.retail.v2alpha.IGcsSource|null} [gcsSource] UserEventInputConfig gcsSource - * @property {google.cloud.retail.v2alpha.IBigQuerySource|null} [bigQuerySource] UserEventInputConfig bigQuerySource + * @interface IGcsSource + * @property {Array.|null} [inputUris] GcsSource inputUris + * @property {string|null} [dataSchema] GcsSource dataSchema */ /** - * Constructs a new UserEventInputConfig. + * Constructs a new GcsSource. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a UserEventInputConfig. - * @implements IUserEventInputConfig + * @classdesc Represents a GcsSource. + * @implements IGcsSource * @constructor - * @param {google.cloud.retail.v2alpha.IUserEventInputConfig=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IGcsSource=} [properties] Properties to set */ - function UserEventInputConfig(properties) { + function GcsSource(properties) { + this.inputUris = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32469,115 +32173,91 @@ } /** - * UserEventInputConfig userEventInlineSource. - * @member {google.cloud.retail.v2alpha.IUserEventInlineSource|null|undefined} userEventInlineSource - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig - * @instance - */ - UserEventInputConfig.prototype.userEventInlineSource = null; - - /** - * UserEventInputConfig gcsSource. - * @member {google.cloud.retail.v2alpha.IGcsSource|null|undefined} gcsSource - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig - * @instance - */ - UserEventInputConfig.prototype.gcsSource = null; - - /** - * UserEventInputConfig bigQuerySource. - * @member {google.cloud.retail.v2alpha.IBigQuerySource|null|undefined} bigQuerySource - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * GcsSource inputUris. + * @member {Array.} inputUris + * @memberof google.cloud.retail.v2alpha.GcsSource * @instance */ - UserEventInputConfig.prototype.bigQuerySource = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + GcsSource.prototype.inputUris = $util.emptyArray; /** - * UserEventInputConfig source. - * @member {"userEventInlineSource"|"gcsSource"|"bigQuerySource"|undefined} source - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * GcsSource dataSchema. + * @member {string} dataSchema + * @memberof google.cloud.retail.v2alpha.GcsSource * @instance */ - Object.defineProperty(UserEventInputConfig.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["userEventInlineSource", "gcsSource", "bigQuerySource"]), - set: $util.oneOfSetter($oneOfFields) - }); + GcsSource.prototype.dataSchema = ""; /** - * Creates a new UserEventInputConfig instance using the specified properties. + * Creates a new GcsSource instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @memberof google.cloud.retail.v2alpha.GcsSource * @static - * @param {google.cloud.retail.v2alpha.IUserEventInputConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.UserEventInputConfig} UserEventInputConfig instance + * @param {google.cloud.retail.v2alpha.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.GcsSource} GcsSource instance */ - UserEventInputConfig.create = function create(properties) { - return new UserEventInputConfig(properties); + GcsSource.create = function create(properties) { + return new GcsSource(properties); }; /** - * Encodes the specified UserEventInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInputConfig.verify|verify} messages. + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.retail.v2alpha.GcsSource.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @memberof google.cloud.retail.v2alpha.GcsSource * @static - * @param {google.cloud.retail.v2alpha.IUserEventInputConfig} message UserEventInputConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGcsSource} message GcsSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEventInputConfig.encode = function encode(message, writer) { + GcsSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.userEventInlineSource != null && Object.hasOwnProperty.call(message, "userEventInlineSource")) - $root.google.cloud.retail.v2alpha.UserEventInlineSource.encode(message.userEventInlineSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) - $root.google.cloud.retail.v2alpha.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) - $root.google.cloud.retail.v2alpha.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.inputUris != null && message.inputUris.length) + for (var i = 0; i < message.inputUris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUris[i]); + if (message.dataSchema != null && Object.hasOwnProperty.call(message, "dataSchema")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataSchema); return writer; }; /** - * Encodes the specified UserEventInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInputConfig.verify|verify} messages. + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GcsSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @memberof google.cloud.retail.v2alpha.GcsSource * @static - * @param {google.cloud.retail.v2alpha.IUserEventInputConfig} message UserEventInputConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGcsSource} message GcsSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEventInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + GcsSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserEventInputConfig message from the specified reader or buffer. + * Decodes a GcsSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @memberof google.cloud.retail.v2alpha.GcsSource * @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.UserEventInputConfig} UserEventInputConfig + * @returns {google.cloud.retail.v2alpha.GcsSource} GcsSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEventInputConfig.decode = function decode(reader, length) { + GcsSource.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.UserEventInputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GcsSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.userEventInlineSource = $root.google.cloud.retail.v2alpha.UserEventInlineSource.decode(reader, reader.uint32()); + if (!(message.inputUris && message.inputUris.length)) + message.inputUris = []; + message.inputUris.push(reader.string()); break; case 2: - message.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.decode(reader, reader.uint32()); - break; - case 3: - message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.decode(reader, reader.uint32()); + message.dataSchema = reader.string(); break; default: reader.skipType(tag & 7); @@ -32588,157 +32268,133 @@ }; /** - * Decodes a UserEventInputConfig message from the specified reader or buffer, length delimited. + * Decodes a GcsSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @memberof google.cloud.retail.v2alpha.GcsSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.UserEventInputConfig} UserEventInputConfig + * @returns {google.cloud.retail.v2alpha.GcsSource} GcsSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEventInputConfig.decodeDelimited = function decodeDelimited(reader) { + GcsSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserEventInputConfig message. + * Verifies a GcsSource message. * @function verify - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @memberof google.cloud.retail.v2alpha.GcsSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserEventInputConfig.verify = function verify(message) { + GcsSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.userEventInlineSource != null && message.hasOwnProperty("userEventInlineSource")) { - properties.source = 1; - { - var error = $root.google.cloud.retail.v2alpha.UserEventInlineSource.verify(message.userEventInlineSource); - if (error) - return "userEventInlineSource." + error; - } - } - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.retail.v2alpha.GcsSource.verify(message.gcsSource); - if (error) - return "gcsSource." + error; - } - } - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.retail.v2alpha.BigQuerySource.verify(message.bigQuerySource); - if (error) - return "bigQuerySource." + error; - } + if (message.inputUris != null && message.hasOwnProperty("inputUris")) { + if (!Array.isArray(message.inputUris)) + return "inputUris: array expected"; + for (var i = 0; i < message.inputUris.length; ++i) + if (!$util.isString(message.inputUris[i])) + return "inputUris: string[] expected"; } + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + if (!$util.isString(message.dataSchema)) + return "dataSchema: string expected"; return null; }; /** - * Creates a UserEventInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @memberof google.cloud.retail.v2alpha.GcsSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.UserEventInputConfig} UserEventInputConfig + * @returns {google.cloud.retail.v2alpha.GcsSource} GcsSource */ - UserEventInputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.UserEventInputConfig) + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.GcsSource) return object; - var message = new $root.google.cloud.retail.v2alpha.UserEventInputConfig(); - if (object.userEventInlineSource != null) { - if (typeof object.userEventInlineSource !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEventInputConfig.userEventInlineSource: object expected"); - message.userEventInlineSource = $root.google.cloud.retail.v2alpha.UserEventInlineSource.fromObject(object.userEventInlineSource); - } - if (object.gcsSource != null) { - if (typeof object.gcsSource !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEventInputConfig.gcsSource: object expected"); - message.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.fromObject(object.gcsSource); - } - if (object.bigQuerySource != null) { - if (typeof object.bigQuerySource !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEventInputConfig.bigQuerySource: object expected"); - message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.fromObject(object.bigQuerySource); + var message = new $root.google.cloud.retail.v2alpha.GcsSource(); + if (object.inputUris) { + if (!Array.isArray(object.inputUris)) + throw TypeError(".google.cloud.retail.v2alpha.GcsSource.inputUris: array expected"); + message.inputUris = []; + for (var i = 0; i < object.inputUris.length; ++i) + message.inputUris[i] = String(object.inputUris[i]); } + if (object.dataSchema != null) + message.dataSchema = String(object.dataSchema); return message; }; /** - * Creates a plain object from a UserEventInputConfig message. Also converts values to other types if specified. + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @memberof google.cloud.retail.v2alpha.GcsSource * @static - * @param {google.cloud.retail.v2alpha.UserEventInputConfig} message UserEventInputConfig + * @param {google.cloud.retail.v2alpha.GcsSource} message GcsSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserEventInputConfig.toObject = function toObject(message, options) { + GcsSource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.userEventInlineSource != null && message.hasOwnProperty("userEventInlineSource")) { - object.userEventInlineSource = $root.google.cloud.retail.v2alpha.UserEventInlineSource.toObject(message.userEventInlineSource, options); - if (options.oneofs) - object.source = "userEventInlineSource"; - } - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - object.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.toObject(message.gcsSource, options); - if (options.oneofs) - object.source = "gcsSource"; - } - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - object.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.toObject(message.bigQuerySource, options); - if (options.oneofs) - object.source = "bigQuerySource"; + if (options.arrays || options.defaults) + object.inputUris = []; + if (options.defaults) + object.dataSchema = ""; + if (message.inputUris && message.inputUris.length) { + object.inputUris = []; + for (var j = 0; j < message.inputUris.length; ++j) + object.inputUris[j] = message.inputUris[j]; } + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + object.dataSchema = message.dataSchema; return object; }; /** - * Converts this UserEventInputConfig to JSON. + * Converts this GcsSource to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @memberof google.cloud.retail.v2alpha.GcsSource * @instance * @returns {Object.} JSON object */ - UserEventInputConfig.prototype.toJSON = function toJSON() { + GcsSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UserEventInputConfig; + return GcsSource; })(); - v2alpha.CompletionDataInputConfig = (function() { + v2alpha.BigQuerySource = (function() { /** - * Properties of a CompletionDataInputConfig. + * Properties of a BigQuerySource. * @memberof google.cloud.retail.v2alpha - * @interface ICompletionDataInputConfig - * @property {google.cloud.retail.v2alpha.IBigQuerySource|null} [bigQuerySource] CompletionDataInputConfig bigQuerySource + * @interface IBigQuerySource + * @property {google.type.IDate|null} [partitionDate] BigQuerySource partitionDate + * @property {string|null} [projectId] BigQuerySource projectId + * @property {string|null} [datasetId] BigQuerySource datasetId + * @property {string|null} [tableId] BigQuerySource tableId + * @property {string|null} [gcsStagingDir] BigQuerySource gcsStagingDir + * @property {string|null} [dataSchema] BigQuerySource dataSchema */ /** - * Constructs a new CompletionDataInputConfig. + * Constructs a new BigQuerySource. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CompletionDataInputConfig. - * @implements ICompletionDataInputConfig + * @classdesc Represents a BigQuerySource. + * @implements IBigQuerySource * @constructor - * @param {google.cloud.retail.v2alpha.ICompletionDataInputConfig=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IBigQuerySource=} [properties] Properties to set */ - function CompletionDataInputConfig(properties) { + function BigQuerySource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32746,89 +32402,154 @@ } /** - * CompletionDataInputConfig bigQuerySource. - * @member {google.cloud.retail.v2alpha.IBigQuerySource|null|undefined} bigQuerySource - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * BigQuerySource partitionDate. + * @member {google.type.IDate|null|undefined} partitionDate + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @instance */ - CompletionDataInputConfig.prototype.bigQuerySource = null; + BigQuerySource.prototype.partitionDate = null; + + /** + * BigQuerySource projectId. + * @member {string} projectId + * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @instance + */ + BigQuerySource.prototype.projectId = ""; + + /** + * BigQuerySource datasetId. + * @member {string} datasetId + * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @instance + */ + BigQuerySource.prototype.datasetId = ""; + + /** + * BigQuerySource tableId. + * @member {string} tableId + * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @instance + */ + BigQuerySource.prototype.tableId = ""; + + /** + * BigQuerySource gcsStagingDir. + * @member {string} gcsStagingDir + * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @instance + */ + BigQuerySource.prototype.gcsStagingDir = ""; + + /** + * BigQuerySource dataSchema. + * @member {string} dataSchema + * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @instance + */ + BigQuerySource.prototype.dataSchema = ""; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * CompletionDataInputConfig source. - * @member {"bigQuerySource"|undefined} source - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * BigQuerySource partition. + * @member {"partitionDate"|undefined} partition + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @instance */ - Object.defineProperty(CompletionDataInputConfig.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["bigQuerySource"]), + Object.defineProperty(BigQuerySource.prototype, "partition", { + get: $util.oneOfGetter($oneOfFields = ["partitionDate"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new CompletionDataInputConfig instance using the specified properties. + * Creates a new BigQuerySource instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @static - * @param {google.cloud.retail.v2alpha.ICompletionDataInputConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CompletionDataInputConfig} CompletionDataInputConfig instance + * @param {google.cloud.retail.v2alpha.IBigQuerySource=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.BigQuerySource} BigQuerySource instance */ - CompletionDataInputConfig.create = function create(properties) { - return new CompletionDataInputConfig(properties); + BigQuerySource.create = function create(properties) { + return new BigQuerySource(properties); }; /** - * Encodes the specified CompletionDataInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDataInputConfig.verify|verify} messages. + * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.retail.v2alpha.BigQuerySource.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @static - * @param {google.cloud.retail.v2alpha.ICompletionDataInputConfig} message CompletionDataInputConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.IBigQuerySource} message BigQuerySource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompletionDataInputConfig.encode = function encode(message, writer) { + BigQuerySource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) - $root.google.cloud.retail.v2alpha.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableId); + if (message.gcsStagingDir != null && Object.hasOwnProperty.call(message, "gcsStagingDir")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsStagingDir); + if (message.dataSchema != null && Object.hasOwnProperty.call(message, "dataSchema")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.dataSchema); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.projectId); + if (message.partitionDate != null && Object.hasOwnProperty.call(message, "partitionDate")) + $root.google.type.Date.encode(message.partitionDate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified CompletionDataInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDataInputConfig.verify|verify} messages. + * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BigQuerySource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @static - * @param {google.cloud.retail.v2alpha.ICompletionDataInputConfig} message CompletionDataInputConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.IBigQuerySource} message BigQuerySource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompletionDataInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + BigQuerySource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CompletionDataInputConfig message from the specified reader or buffer. + * Decodes a BigQuerySource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @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.CompletionDataInputConfig} CompletionDataInputConfig + * @returns {google.cloud.retail.v2alpha.BigQuerySource} BigQuerySource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompletionDataInputConfig.decode = function decode(reader, length) { + BigQuerySource.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.CompletionDataInputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.BigQuerySource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 6: + message.partitionDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + case 5: + message.projectId = reader.string(); + break; case 1: - message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.decode(reader, reader.uint32()); + message.datasetId = reader.string(); + break; + case 2: + message.tableId = reader.string(); + break; + case 3: + message.gcsStagingDir = reader.string(); + break; + case 4: + message.dataSchema = reader.string(); break; default: reader.skipType(tag & 7); @@ -32839,122 +32560,160 @@ }; /** - * Decodes a CompletionDataInputConfig message from the specified reader or buffer, length delimited. + * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CompletionDataInputConfig} CompletionDataInputConfig + * @returns {google.cloud.retail.v2alpha.BigQuerySource} BigQuerySource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompletionDataInputConfig.decodeDelimited = function decodeDelimited(reader) { + BigQuerySource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CompletionDataInputConfig message. + * Verifies a BigQuerySource message. * @function verify - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CompletionDataInputConfig.verify = function verify(message) { + BigQuerySource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - properties.source = 1; + if (message.partitionDate != null && message.hasOwnProperty("partitionDate")) { + properties.partition = 1; { - var error = $root.google.cloud.retail.v2alpha.BigQuerySource.verify(message.bigQuerySource); + var error = $root.google.type.Date.verify(message.partitionDate); if (error) - return "bigQuerySource." + error; + return "partitionDate." + error; } } + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && message.hasOwnProperty("tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) + if (!$util.isString(message.gcsStagingDir)) + return "gcsStagingDir: string expected"; + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + if (!$util.isString(message.dataSchema)) + return "dataSchema: string expected"; return null; }; /** - * Creates a CompletionDataInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a BigQuerySource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CompletionDataInputConfig} CompletionDataInputConfig + * @returns {google.cloud.retail.v2alpha.BigQuerySource} BigQuerySource */ - CompletionDataInputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CompletionDataInputConfig) + BigQuerySource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.BigQuerySource) return object; - var message = new $root.google.cloud.retail.v2alpha.CompletionDataInputConfig(); - if (object.bigQuerySource != null) { - if (typeof object.bigQuerySource !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CompletionDataInputConfig.bigQuerySource: object expected"); - message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.fromObject(object.bigQuerySource); + var message = new $root.google.cloud.retail.v2alpha.BigQuerySource(); + if (object.partitionDate != null) { + if (typeof object.partitionDate !== "object") + throw TypeError(".google.cloud.retail.v2alpha.BigQuerySource.partitionDate: object expected"); + message.partitionDate = $root.google.type.Date.fromObject(object.partitionDate); } + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.gcsStagingDir != null) + message.gcsStagingDir = String(object.gcsStagingDir); + if (object.dataSchema != null) + message.dataSchema = String(object.dataSchema); return message; }; /** - * Creates a plain object from a CompletionDataInputConfig message. Also converts values to other types if specified. + * Creates a plain object from a BigQuerySource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @static - * @param {google.cloud.retail.v2alpha.CompletionDataInputConfig} message CompletionDataInputConfig + * @param {google.cloud.retail.v2alpha.BigQuerySource} message BigQuerySource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CompletionDataInputConfig.toObject = function toObject(message, options) { + BigQuerySource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - object.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.toObject(message.bigQuerySource, options); + if (options.defaults) { + object.datasetId = ""; + object.tableId = ""; + object.gcsStagingDir = ""; + object.dataSchema = ""; + object.projectId = ""; + } + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && message.hasOwnProperty("tableId")) + object.tableId = message.tableId; + if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) + object.gcsStagingDir = message.gcsStagingDir; + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + object.dataSchema = message.dataSchema; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.partitionDate != null && message.hasOwnProperty("partitionDate")) { + object.partitionDate = $root.google.type.Date.toObject(message.partitionDate, options); if (options.oneofs) - object.source = "bigQuerySource"; + object.partition = "partitionDate"; } return object; }; /** - * Converts this CompletionDataInputConfig to JSON. + * Converts this BigQuerySource to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @instance * @returns {Object.} JSON object */ - CompletionDataInputConfig.prototype.toJSON = function toJSON() { + BigQuerySource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CompletionDataInputConfig; + return BigQuerySource; })(); - v2alpha.ImportMetadata = (function() { + v2alpha.ProductInlineSource = (function() { /** - * Properties of an ImportMetadata. + * Properties of a ProductInlineSource. * @memberof google.cloud.retail.v2alpha - * @interface IImportMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] ImportMetadata createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ImportMetadata updateTime - * @property {number|Long|null} [successCount] ImportMetadata successCount - * @property {number|Long|null} [failureCount] ImportMetadata failureCount - * @property {string|null} [requestId] ImportMetadata requestId - * @property {string|null} [notificationPubsubTopic] ImportMetadata notificationPubsubTopic + * @interface IProductInlineSource + * @property {Array.|null} [products] ProductInlineSource products */ /** - * Constructs a new ImportMetadata. + * Constructs a new ProductInlineSource. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ImportMetadata. - * @implements IImportMetadata + * @classdesc Represents a ProductInlineSource. + * @implements IProductInlineSource * @constructor - * @param {google.cloud.retail.v2alpha.IImportMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IProductInlineSource=} [properties] Properties to set */ - function ImportMetadata(properties) { + function ProductInlineSource(properties) { + this.products = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32962,140 +32721,78 @@ } /** - * ImportMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.retail.v2alpha.ImportMetadata - * @instance - */ - ImportMetadata.prototype.createTime = null; - - /** - * ImportMetadata updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.retail.v2alpha.ImportMetadata - * @instance - */ - ImportMetadata.prototype.updateTime = null; - - /** - * ImportMetadata successCount. - * @member {number|Long} successCount - * @memberof google.cloud.retail.v2alpha.ImportMetadata - * @instance - */ - ImportMetadata.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ImportMetadata failureCount. - * @member {number|Long} failureCount - * @memberof google.cloud.retail.v2alpha.ImportMetadata - * @instance - */ - ImportMetadata.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ImportMetadata requestId. - * @member {string} requestId - * @memberof google.cloud.retail.v2alpha.ImportMetadata - * @instance - */ - ImportMetadata.prototype.requestId = ""; - - /** - * ImportMetadata notificationPubsubTopic. - * @member {string} notificationPubsubTopic - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * ProductInlineSource products. + * @member {Array.} products + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @instance */ - ImportMetadata.prototype.notificationPubsubTopic = ""; + ProductInlineSource.prototype.products = $util.emptyArray; /** - * Creates a new ImportMetadata instance using the specified properties. + * Creates a new ProductInlineSource instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @static - * @param {google.cloud.retail.v2alpha.IImportMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ImportMetadata} ImportMetadata instance + * @param {google.cloud.retail.v2alpha.IProductInlineSource=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ProductInlineSource} ProductInlineSource instance */ - ImportMetadata.create = function create(properties) { - return new ImportMetadata(properties); + ProductInlineSource.create = function create(properties) { + return new ProductInlineSource(properties); }; /** - * Encodes the specified ImportMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportMetadata.verify|verify} messages. + * Encodes the specified ProductInlineSource message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInlineSource.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @static - * @param {google.cloud.retail.v2alpha.IImportMetadata} message ImportMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProductInlineSource} message ProductInlineSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportMetadata.encode = function encode(message, writer) { + ProductInlineSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.successCount); - if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failureCount); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - 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.products != null && message.products.length) + for (var i = 0; i < message.products.length; ++i) + $root.google.cloud.retail.v2alpha.Product.encode(message.products[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ImportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportMetadata.verify|verify} messages. + * Encodes the specified ProductInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInlineSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @static - * @param {google.cloud.retail.v2alpha.IImportMetadata} message ImportMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProductInlineSource} message ProductInlineSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportMetadata.encodeDelimited = function encodeDelimited(message, writer) { + ProductInlineSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportMetadata message from the specified reader or buffer. + * Decodes a ProductInlineSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @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.ImportMetadata} ImportMetadata + * @returns {google.cloud.retail.v2alpha.ProductInlineSource} ProductInlineSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportMetadata.decode = function decode(reader, length) { + ProductInlineSource.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.ImportMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ProductInlineSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.successCount = reader.int64(); - break; - case 4: - message.failureCount = reader.int64(); - break; - case 5: - message.requestId = reader.string(); - break; - case 6: - message.notificationPubsubTopic = reader.string(); + if (!(message.products && message.products.length)) + message.products = []; + message.products.push($root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -33106,188 +32803,125 @@ }; /** - * Decodes an ImportMetadata message from the specified reader or buffer, length delimited. + * Decodes a ProductInlineSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ImportMetadata} ImportMetadata + * @returns {google.cloud.retail.v2alpha.ProductInlineSource} ProductInlineSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportMetadata.decodeDelimited = function decodeDelimited(reader) { + ProductInlineSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportMetadata message. + * Verifies a ProductInlineSource message. * @function verify - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportMetadata.verify = function verify(message) { + ProductInlineSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; + if (message.products != null && message.hasOwnProperty("products")) { + if (!Array.isArray(message.products)) + return "products: array expected"; + for (var i = 0; i < message.products.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Product.verify(message.products[i]); + if (error) + return "products." + error; + } } - if (message.successCount != null && message.hasOwnProperty("successCount")) - if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) - return "successCount: integer|Long expected"; - if (message.failureCount != null && message.hasOwnProperty("failureCount")) - if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) - return "failureCount: integer|Long expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - if (!$util.isString(message.notificationPubsubTopic)) - return "notificationPubsubTopic: string expected"; return null; }; /** - * Creates an ImportMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ProductInlineSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ImportMetadata} ImportMetadata + * @returns {google.cloud.retail.v2alpha.ProductInlineSource} ProductInlineSource */ - ImportMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ImportMetadata) + ProductInlineSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ProductInlineSource) return object; - var message = new $root.google.cloud.retail.v2alpha.ImportMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportMetadata.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + var message = new $root.google.cloud.retail.v2alpha.ProductInlineSource(); + if (object.products) { + if (!Array.isArray(object.products)) + throw TypeError(".google.cloud.retail.v2alpha.ProductInlineSource.products: array expected"); + message.products = []; + for (var i = 0; i < object.products.length; ++i) { + if (typeof object.products[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ProductInlineSource.products: object expected"); + message.products[i] = $root.google.cloud.retail.v2alpha.Product.fromObject(object.products[i]); + } } - if (object.successCount != null) - if ($util.Long) - (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; - else if (typeof object.successCount === "string") - message.successCount = parseInt(object.successCount, 10); - else if (typeof object.successCount === "number") - message.successCount = object.successCount; - else if (typeof object.successCount === "object") - message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); - if (object.failureCount != null) - if ($util.Long) - (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; - else if (typeof object.failureCount === "string") - message.failureCount = parseInt(object.failureCount, 10); - else if (typeof object.failureCount === "number") - message.failureCount = object.failureCount; - else if (typeof object.failureCount === "object") - message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.notificationPubsubTopic != null) - message.notificationPubsubTopic = String(object.notificationPubsubTopic); return message; }; /** - * Creates a plain object from an ImportMetadata message. Also converts values to other types if specified. + * Creates a plain object from a ProductInlineSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @static - * @param {google.cloud.retail.v2alpha.ImportMetadata} message ImportMetadata + * @param {google.cloud.retail.v2alpha.ProductInlineSource} message ProductInlineSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportMetadata.toObject = function toObject(message, options) { + ProductInlineSource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.createTime = null; - object.updateTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.successCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.failureCount = options.longs === String ? "0" : 0; - object.requestId = ""; - object.notificationPubsubTopic = ""; + if (options.arrays || options.defaults) + object.products = []; + if (message.products && message.products.length) { + object.products = []; + for (var j = 0; j < message.products.length; ++j) + object.products[j] = $root.google.cloud.retail.v2alpha.Product.toObject(message.products[j], options); } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.successCount != null && message.hasOwnProperty("successCount")) - if (typeof message.successCount === "number") - object.successCount = options.longs === String ? String(message.successCount) : message.successCount; - else - object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; - if (message.failureCount != null && message.hasOwnProperty("failureCount")) - if (typeof message.failureCount === "number") - object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; - else - object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - object.notificationPubsubTopic = message.notificationPubsubTopic; return object; }; /** - * Converts this ImportMetadata to JSON. + * Converts this ProductInlineSource to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @instance * @returns {Object.} JSON object */ - ImportMetadata.prototype.toJSON = function toJSON() { + ProductInlineSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ImportMetadata; + return ProductInlineSource; })(); - v2alpha.ImportProductsResponse = (function() { + v2alpha.UserEventInlineSource = (function() { /** - * Properties of an ImportProductsResponse. + * Properties of a UserEventInlineSource. * @memberof google.cloud.retail.v2alpha - * @interface IImportProductsResponse - * @property {Array.|null} [errorSamples] ImportProductsResponse errorSamples - * @property {google.cloud.retail.v2alpha.IImportErrorsConfig|null} [errorsConfig] ImportProductsResponse errorsConfig + * @interface IUserEventInlineSource + * @property {Array.|null} [userEvents] UserEventInlineSource userEvents */ /** - * Constructs a new ImportProductsResponse. + * Constructs a new UserEventInlineSource. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ImportProductsResponse. - * @implements IImportProductsResponse + * @classdesc Represents a UserEventInlineSource. + * @implements IUserEventInlineSource * @constructor - * @param {google.cloud.retail.v2alpha.IImportProductsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IUserEventInlineSource=} [properties] Properties to set */ - function ImportProductsResponse(properties) { - this.errorSamples = []; + function UserEventInlineSource(properties) { + this.userEvents = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -33295,91 +32929,78 @@ } /** - * ImportProductsResponse errorSamples. - * @member {Array.} errorSamples - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse - * @instance - */ - ImportProductsResponse.prototype.errorSamples = $util.emptyArray; - - /** - * ImportProductsResponse errorsConfig. - * @member {google.cloud.retail.v2alpha.IImportErrorsConfig|null|undefined} errorsConfig - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * UserEventInlineSource userEvents. + * @member {Array.} userEvents + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource * @instance */ - ImportProductsResponse.prototype.errorsConfig = null; + UserEventInlineSource.prototype.userEvents = $util.emptyArray; /** - * Creates a new ImportProductsResponse instance using the specified properties. + * Creates a new UserEventInlineSource instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource * @static - * @param {google.cloud.retail.v2alpha.IImportProductsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ImportProductsResponse} ImportProductsResponse instance + * @param {google.cloud.retail.v2alpha.IUserEventInlineSource=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UserEventInlineSource} UserEventInlineSource instance */ - ImportProductsResponse.create = function create(properties) { - return new ImportProductsResponse(properties); + UserEventInlineSource.create = function create(properties) { + return new UserEventInlineSource(properties); }; /** - * Encodes the specified ImportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsResponse.verify|verify} messages. + * Encodes the specified UserEventInlineSource message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInlineSource.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource * @static - * @param {google.cloud.retail.v2alpha.IImportProductsResponse} message ImportProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUserEventInlineSource} message UserEventInlineSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportProductsResponse.encode = function encode(message, writer) { + UserEventInlineSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorSamples != null && message.errorSamples.length) - for (var i = 0; i < message.errorSamples.length; ++i) - $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) - $root.google.cloud.retail.v2alpha.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.userEvents != null && message.userEvents.length) + for (var i = 0; i < message.userEvents.length; ++i) + $root.google.cloud.retail.v2alpha.UserEvent.encode(message.userEvents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ImportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsResponse.verify|verify} messages. + * Encodes the specified UserEventInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInlineSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource * @static - * @param {google.cloud.retail.v2alpha.IImportProductsResponse} message ImportProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUserEventInlineSource} message UserEventInlineSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { + UserEventInlineSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportProductsResponse message from the specified reader or buffer. + * Decodes a UserEventInlineSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource * @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.ImportProductsResponse} ImportProductsResponse + * @returns {google.cloud.retail.v2alpha.UserEventInlineSource} UserEventInlineSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportProductsResponse.decode = function decode(reader, length) { + UserEventInlineSource.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.ImportProductsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UserEventInlineSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.errorSamples && message.errorSamples.length)) - message.errorSamples = []; - message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); - break; - case 2: - message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.decode(reader, reader.uint32()); + if (!(message.userEvents && message.userEvents.length)) + message.userEvents = []; + message.userEvents.push($root.google.cloud.retail.v2alpha.UserEvent.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -33390,141 +33011,124 @@ }; /** - * Decodes an ImportProductsResponse message from the specified reader or buffer, length delimited. + * Decodes a UserEventInlineSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ImportProductsResponse} ImportProductsResponse + * @returns {google.cloud.retail.v2alpha.UserEventInlineSource} UserEventInlineSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportProductsResponse.decodeDelimited = function decodeDelimited(reader) { + UserEventInlineSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportProductsResponse message. + * Verifies a UserEventInlineSource message. * @function verify - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportProductsResponse.verify = function verify(message) { + UserEventInlineSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { - if (!Array.isArray(message.errorSamples)) - return "errorSamples: array expected"; - for (var i = 0; i < message.errorSamples.length; ++i) { - var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (message.userEvents != null && message.hasOwnProperty("userEvents")) { + if (!Array.isArray(message.userEvents)) + return "userEvents: array expected"; + for (var i = 0; i < message.userEvents.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.UserEvent.verify(message.userEvents[i]); if (error) - return "errorSamples." + error; + return "userEvents." + error; } } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { - var error = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.verify(message.errorsConfig); - if (error) - return "errorsConfig." + error; - } return null; }; /** - * Creates an ImportProductsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a UserEventInlineSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ImportProductsResponse} ImportProductsResponse + * @returns {google.cloud.retail.v2alpha.UserEventInlineSource} UserEventInlineSource */ - ImportProductsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ImportProductsResponse) + UserEventInlineSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UserEventInlineSource) return object; - var message = new $root.google.cloud.retail.v2alpha.ImportProductsResponse(); - if (object.errorSamples) { - if (!Array.isArray(object.errorSamples)) - throw TypeError(".google.cloud.retail.v2alpha.ImportProductsResponse.errorSamples: array expected"); - message.errorSamples = []; - for (var i = 0; i < object.errorSamples.length; ++i) { - if (typeof object.errorSamples[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportProductsResponse.errorSamples: object expected"); - message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + var message = new $root.google.cloud.retail.v2alpha.UserEventInlineSource(); + if (object.userEvents) { + if (!Array.isArray(object.userEvents)) + throw TypeError(".google.cloud.retail.v2alpha.UserEventInlineSource.userEvents: array expected"); + message.userEvents = []; + for (var i = 0; i < object.userEvents.length; ++i) { + if (typeof object.userEvents[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEventInlineSource.userEvents: object expected"); + message.userEvents[i] = $root.google.cloud.retail.v2alpha.UserEvent.fromObject(object.userEvents[i]); } } - if (object.errorsConfig != null) { - if (typeof object.errorsConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportProductsResponse.errorsConfig: object expected"); - message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.fromObject(object.errorsConfig); - } return message; }; /** - * Creates a plain object from an ImportProductsResponse message. Also converts values to other types if specified. + * Creates a plain object from a UserEventInlineSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource * @static - * @param {google.cloud.retail.v2alpha.ImportProductsResponse} message ImportProductsResponse + * @param {google.cloud.retail.v2alpha.UserEventInlineSource} message UserEventInlineSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportProductsResponse.toObject = function toObject(message, options) { + UserEventInlineSource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.errorSamples = []; - if (options.defaults) - object.errorsConfig = null; - if (message.errorSamples && message.errorSamples.length) { - object.errorSamples = []; - for (var j = 0; j < message.errorSamples.length; ++j) - object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + object.userEvents = []; + if (message.userEvents && message.userEvents.length) { + object.userEvents = []; + for (var j = 0; j < message.userEvents.length; ++j) + object.userEvents[j] = $root.google.cloud.retail.v2alpha.UserEvent.toObject(message.userEvents[j], options); } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) - object.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.toObject(message.errorsConfig, options); return object; }; /** - * Converts this ImportProductsResponse to JSON. + * Converts this UserEventInlineSource to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource * @instance * @returns {Object.} JSON object */ - ImportProductsResponse.prototype.toJSON = function toJSON() { + UserEventInlineSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ImportProductsResponse; + return UserEventInlineSource; })(); - v2alpha.ImportUserEventsResponse = (function() { + v2alpha.ImportErrorsConfig = (function() { /** - * Properties of an ImportUserEventsResponse. + * Properties of an ImportErrorsConfig. * @memberof google.cloud.retail.v2alpha - * @interface IImportUserEventsResponse - * @property {Array.|null} [errorSamples] ImportUserEventsResponse errorSamples - * @property {google.cloud.retail.v2alpha.IImportErrorsConfig|null} [errorsConfig] ImportUserEventsResponse errorsConfig - * @property {google.cloud.retail.v2alpha.IUserEventImportSummary|null} [importSummary] ImportUserEventsResponse importSummary + * @interface IImportErrorsConfig + * @property {string|null} [gcsPrefix] ImportErrorsConfig gcsPrefix */ /** - * Constructs a new ImportUserEventsResponse. + * Constructs a new ImportErrorsConfig. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ImportUserEventsResponse. - * @implements IImportUserEventsResponse + * @classdesc Represents an ImportErrorsConfig. + * @implements IImportErrorsConfig * @constructor - * @param {google.cloud.retail.v2alpha.IImportUserEventsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IImportErrorsConfig=} [properties] Properties to set */ - function ImportUserEventsResponse(properties) { - this.errorSamples = []; + function ImportErrorsConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -33532,104 +33136,89 @@ } /** - * ImportUserEventsResponse errorSamples. - * @member {Array.} errorSamples - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * ImportErrorsConfig gcsPrefix. + * @member {string|null|undefined} gcsPrefix + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig * @instance */ - ImportUserEventsResponse.prototype.errorSamples = $util.emptyArray; + ImportErrorsConfig.prototype.gcsPrefix = null; - /** - * ImportUserEventsResponse errorsConfig. - * @member {google.cloud.retail.v2alpha.IImportErrorsConfig|null|undefined} errorsConfig - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse - * @instance - */ - ImportUserEventsResponse.prototype.errorsConfig = null; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * ImportUserEventsResponse importSummary. - * @member {google.cloud.retail.v2alpha.IUserEventImportSummary|null|undefined} importSummary - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * ImportErrorsConfig destination. + * @member {"gcsPrefix"|undefined} destination + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig * @instance */ - ImportUserEventsResponse.prototype.importSummary = null; + Object.defineProperty(ImportErrorsConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsPrefix"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new ImportUserEventsResponse instance using the specified properties. + * Creates a new ImportErrorsConfig instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig * @static - * @param {google.cloud.retail.v2alpha.IImportUserEventsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ImportUserEventsResponse} ImportUserEventsResponse instance + * @param {google.cloud.retail.v2alpha.IImportErrorsConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ImportErrorsConfig} ImportErrorsConfig instance */ - ImportUserEventsResponse.create = function create(properties) { - return new ImportUserEventsResponse(properties); + ImportErrorsConfig.create = function create(properties) { + return new ImportErrorsConfig(properties); }; /** - * Encodes the specified ImportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsResponse.verify|verify} messages. + * Encodes the specified ImportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportErrorsConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig * @static - * @param {google.cloud.retail.v2alpha.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportErrorsConfig} message ImportErrorsConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportUserEventsResponse.encode = function encode(message, writer) { + ImportErrorsConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorSamples != null && message.errorSamples.length) - for (var i = 0; i < message.errorSamples.length; ++i) - $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) - $root.google.cloud.retail.v2alpha.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.importSummary != null && Object.hasOwnProperty.call(message, "importSummary")) - $root.google.cloud.retail.v2alpha.UserEventImportSummary.encode(message.importSummary, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsPrefix); return writer; }; /** - * Encodes the specified ImportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsResponse.verify|verify} messages. + * Encodes the specified ImportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportErrorsConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig * @static - * @param {google.cloud.retail.v2alpha.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportErrorsConfig} message ImportErrorsConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ImportErrorsConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportUserEventsResponse message from the specified reader or buffer. + * Decodes an ImportErrorsConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig * @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.ImportUserEventsResponse} ImportUserEventsResponse + * @returns {google.cloud.retail.v2alpha.ImportErrorsConfig} ImportErrorsConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportUserEventsResponse.decode = function decode(reader, length) { + ImportErrorsConfig.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.ImportUserEventsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportErrorsConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.errorSamples && message.errorSamples.length)) - message.errorSamples = []; - message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); - break; - case 2: - message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.decode(reader, reader.uint32()); - break; - case 3: - message.importSummary = $root.google.cloud.retail.v2alpha.UserEventImportSummary.decode(reader, reader.uint32()); + message.gcsPrefix = reader.string(); break; default: reader.skipType(tag & 7); @@ -33640,153 +33229,117 @@ }; /** - * Decodes an ImportUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes an ImportErrorsConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ImportUserEventsResponse} ImportUserEventsResponse + * @returns {google.cloud.retail.v2alpha.ImportErrorsConfig} ImportErrorsConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { + ImportErrorsConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportUserEventsResponse message. + * Verifies an ImportErrorsConfig message. * @function verify - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportUserEventsResponse.verify = function verify(message) { + ImportErrorsConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { - if (!Array.isArray(message.errorSamples)) - return "errorSamples: array expected"; - for (var i = 0; i < message.errorSamples.length; ++i) { - var error = $root.google.rpc.Status.verify(message.errorSamples[i]); - if (error) - return "errorSamples." + error; - } - } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { - var error = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.verify(message.errorsConfig); - if (error) - return "errorsConfig." + error; - } - if (message.importSummary != null && message.hasOwnProperty("importSummary")) { - var error = $root.google.cloud.retail.v2alpha.UserEventImportSummary.verify(message.importSummary); - if (error) - return "importSummary." + error; + var properties = {}; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + properties.destination = 1; + if (!$util.isString(message.gcsPrefix)) + return "gcsPrefix: string expected"; } return null; }; /** - * Creates an ImportUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ImportErrorsConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ImportUserEventsResponse} ImportUserEventsResponse + * @returns {google.cloud.retail.v2alpha.ImportErrorsConfig} ImportErrorsConfig */ - ImportUserEventsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ImportUserEventsResponse) + ImportErrorsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ImportErrorsConfig) return object; - var message = new $root.google.cloud.retail.v2alpha.ImportUserEventsResponse(); - if (object.errorSamples) { - if (!Array.isArray(object.errorSamples)) - throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsResponse.errorSamples: array expected"); - message.errorSamples = []; - for (var i = 0; i < object.errorSamples.length; ++i) { - if (typeof object.errorSamples[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsResponse.errorSamples: object expected"); - message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); - } - } - if (object.errorsConfig != null) { - if (typeof object.errorsConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsResponse.errorsConfig: object expected"); - message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.fromObject(object.errorsConfig); - } - if (object.importSummary != null) { - if (typeof object.importSummary !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsResponse.importSummary: object expected"); - message.importSummary = $root.google.cloud.retail.v2alpha.UserEventImportSummary.fromObject(object.importSummary); - } + var message = new $root.google.cloud.retail.v2alpha.ImportErrorsConfig(); + if (object.gcsPrefix != null) + message.gcsPrefix = String(object.gcsPrefix); return message; }; /** - * Creates a plain object from an ImportUserEventsResponse message. Also converts values to other types if specified. + * Creates a plain object from an ImportErrorsConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig * @static - * @param {google.cloud.retail.v2alpha.ImportUserEventsResponse} message ImportUserEventsResponse + * @param {google.cloud.retail.v2alpha.ImportErrorsConfig} message ImportErrorsConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportUserEventsResponse.toObject = function toObject(message, options) { + ImportErrorsConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.errorSamples = []; - if (options.defaults) { - object.errorsConfig = null; - object.importSummary = null; - } - if (message.errorSamples && message.errorSamples.length) { - object.errorSamples = []; - for (var j = 0; j < message.errorSamples.length; ++j) - object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + object.gcsPrefix = message.gcsPrefix; + if (options.oneofs) + object.destination = "gcsPrefix"; } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) - object.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.toObject(message.errorsConfig, options); - if (message.importSummary != null && message.hasOwnProperty("importSummary")) - object.importSummary = $root.google.cloud.retail.v2alpha.UserEventImportSummary.toObject(message.importSummary, options); return object; }; /** - * Converts this ImportUserEventsResponse to JSON. + * Converts this ImportErrorsConfig to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig * @instance * @returns {Object.} JSON object */ - ImportUserEventsResponse.prototype.toJSON = function toJSON() { + ImportErrorsConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ImportUserEventsResponse; + return ImportErrorsConfig; })(); - v2alpha.UserEventImportSummary = (function() { + v2alpha.ImportProductsRequest = (function() { /** - * Properties of a UserEventImportSummary. + * Properties of an ImportProductsRequest. * @memberof google.cloud.retail.v2alpha - * @interface IUserEventImportSummary - * @property {number|Long|null} [joinedEventsCount] UserEventImportSummary joinedEventsCount - * @property {number|Long|null} [unjoinedEventsCount] UserEventImportSummary unjoinedEventsCount - */ - - /** - * Constructs a new UserEventImportSummary. + * @interface IImportProductsRequest + * @property {string|null} [parent] ImportProductsRequest parent + * @property {string|null} [requestId] ImportProductsRequest requestId + * @property {google.cloud.retail.v2alpha.IProductInputConfig|null} [inputConfig] ImportProductsRequest inputConfig + * @property {google.cloud.retail.v2alpha.IImportErrorsConfig|null} [errorsConfig] ImportProductsRequest errorsConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] ImportProductsRequest updateMask + * @property {google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode|null} [reconciliationMode] ImportProductsRequest reconciliationMode + * @property {string|null} [notificationPubsubTopic] ImportProductsRequest notificationPubsubTopic + */ + + /** + * Constructs a new ImportProductsRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a UserEventImportSummary. - * @implements IUserEventImportSummary + * @classdesc Represents an ImportProductsRequest. + * @implements IImportProductsRequest * @constructor - * @param {google.cloud.retail.v2alpha.IUserEventImportSummary=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IImportProductsRequest=} [properties] Properties to set */ - function UserEventImportSummary(properties) { + function ImportProductsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -33794,88 +33347,153 @@ } /** - * UserEventImportSummary joinedEventsCount. - * @member {number|Long} joinedEventsCount - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * ImportProductsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @instance */ - UserEventImportSummary.prototype.joinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ImportProductsRequest.prototype.parent = ""; /** - * UserEventImportSummary unjoinedEventsCount. - * @member {number|Long} unjoinedEventsCount - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * ImportProductsRequest requestId. + * @member {string} requestId + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @instance */ - UserEventImportSummary.prototype.unjoinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ImportProductsRequest.prototype.requestId = ""; /** - * Creates a new UserEventImportSummary instance using the specified properties. + * ImportProductsRequest inputConfig. + * @member {google.cloud.retail.v2alpha.IProductInputConfig|null|undefined} inputConfig + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @instance + */ + ImportProductsRequest.prototype.inputConfig = null; + + /** + * ImportProductsRequest errorsConfig. + * @member {google.cloud.retail.v2alpha.IImportErrorsConfig|null|undefined} errorsConfig + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @instance + */ + ImportProductsRequest.prototype.errorsConfig = null; + + /** + * ImportProductsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @instance + */ + ImportProductsRequest.prototype.updateMask = null; + + /** + * ImportProductsRequest reconciliationMode. + * @member {google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode} reconciliationMode + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @instance + */ + ImportProductsRequest.prototype.reconciliationMode = 0; + + /** + * ImportProductsRequest notificationPubsubTopic. + * @member {string} notificationPubsubTopic + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @instance + */ + ImportProductsRequest.prototype.notificationPubsubTopic = ""; + + /** + * Creates a new ImportProductsRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @static - * @param {google.cloud.retail.v2alpha.IUserEventImportSummary=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.UserEventImportSummary} UserEventImportSummary instance + * @param {google.cloud.retail.v2alpha.IImportProductsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ImportProductsRequest} ImportProductsRequest instance */ - UserEventImportSummary.create = function create(properties) { - return new UserEventImportSummary(properties); + ImportProductsRequest.create = function create(properties) { + return new ImportProductsRequest(properties); }; /** - * Encodes the specified UserEventImportSummary message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventImportSummary.verify|verify} messages. + * Encodes the specified ImportProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @static - * @param {google.cloud.retail.v2alpha.IUserEventImportSummary} message UserEventImportSummary message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportProductsRequest} message ImportProductsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEventImportSummary.encode = function encode(message, writer) { + ImportProductsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.joinedEventsCount != null && Object.hasOwnProperty.call(message, "joinedEventsCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.joinedEventsCount); - if (message.unjoinedEventsCount != null && Object.hasOwnProperty.call(message, "unjoinedEventsCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.unjoinedEventsCount); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.retail.v2alpha.ProductInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) + $root.google.cloud.retail.v2alpha.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reconciliationMode != null && Object.hasOwnProperty.call(message, "reconciliationMode")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.reconciliationMode); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.requestId); + if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.notificationPubsubTopic); return writer; }; /** - * Encodes the specified UserEventImportSummary message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventImportSummary.verify|verify} messages. + * Encodes the specified ImportProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @static - * @param {google.cloud.retail.v2alpha.IUserEventImportSummary} message UserEventImportSummary message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportProductsRequest} message ImportProductsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEventImportSummary.encodeDelimited = function encodeDelimited(message, writer) { + ImportProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserEventImportSummary message from the specified reader or buffer. + * Decodes an ImportProductsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @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.UserEventImportSummary} UserEventImportSummary + * @returns {google.cloud.retail.v2alpha.ImportProductsRequest} ImportProductsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEventImportSummary.decode = function decode(reader, length) { + ImportProductsRequest.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.UserEventImportSummary(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportProductsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.joinedEventsCount = reader.int64(); + message.parent = reader.string(); + break; + case 6: + message.requestId = reader.string(); break; case 2: - message.unjoinedEventsCount = reader.int64(); + message.inputConfig = $root.google.cloud.retail.v2alpha.ProductInputConfig.decode(reader, reader.uint32()); + break; + case 3: + message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.decode(reader, reader.uint32()); + break; + case 4: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 5: + message.reconciliationMode = reader.int32(); + break; + case 7: + message.notificationPubsubTopic = reader.string(); break; default: reader.skipType(tag & 7); @@ -33886,145 +33504,207 @@ }; /** - * Decodes a UserEventImportSummary message from the specified reader or buffer, length delimited. + * Decodes an ImportProductsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.UserEventImportSummary} UserEventImportSummary + * @returns {google.cloud.retail.v2alpha.ImportProductsRequest} ImportProductsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEventImportSummary.decodeDelimited = function decodeDelimited(reader) { + ImportProductsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserEventImportSummary message. + * Verifies an ImportProductsRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserEventImportSummary.verify = function verify(message) { + ImportProductsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) - if (!$util.isInteger(message.joinedEventsCount) && !(message.joinedEventsCount && $util.isInteger(message.joinedEventsCount.low) && $util.isInteger(message.joinedEventsCount.high))) - return "joinedEventsCount: integer|Long expected"; - if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) - if (!$util.isInteger(message.unjoinedEventsCount) && !(message.unjoinedEventsCount && $util.isInteger(message.unjoinedEventsCount.low) && $util.isInteger(message.unjoinedEventsCount.high))) - return "unjoinedEventsCount: integer|Long expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.retail.v2alpha.ProductInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { + var error = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.verify(message.errorsConfig); + if (error) + return "errorsConfig." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) + switch (message.reconciliationMode) { + default: + return "reconciliationMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + if (!$util.isString(message.notificationPubsubTopic)) + return "notificationPubsubTopic: string expected"; return null; }; /** - * Creates a UserEventImportSummary message from a plain object. Also converts values to their respective internal types. + * Creates an ImportProductsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.UserEventImportSummary} UserEventImportSummary + * @returns {google.cloud.retail.v2alpha.ImportProductsRequest} ImportProductsRequest */ - UserEventImportSummary.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.UserEventImportSummary) + ImportProductsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ImportProductsRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.UserEventImportSummary(); - if (object.joinedEventsCount != null) - if ($util.Long) - (message.joinedEventsCount = $util.Long.fromValue(object.joinedEventsCount)).unsigned = false; - else if (typeof object.joinedEventsCount === "string") - message.joinedEventsCount = parseInt(object.joinedEventsCount, 10); - else if (typeof object.joinedEventsCount === "number") - message.joinedEventsCount = object.joinedEventsCount; - else if (typeof object.joinedEventsCount === "object") - message.joinedEventsCount = new $util.LongBits(object.joinedEventsCount.low >>> 0, object.joinedEventsCount.high >>> 0).toNumber(); - if (object.unjoinedEventsCount != null) - if ($util.Long) - (message.unjoinedEventsCount = $util.Long.fromValue(object.unjoinedEventsCount)).unsigned = false; - else if (typeof object.unjoinedEventsCount === "string") - message.unjoinedEventsCount = parseInt(object.unjoinedEventsCount, 10); - else if (typeof object.unjoinedEventsCount === "number") - message.unjoinedEventsCount = object.unjoinedEventsCount; - else if (typeof object.unjoinedEventsCount === "object") - message.unjoinedEventsCount = new $util.LongBits(object.unjoinedEventsCount.low >>> 0, object.unjoinedEventsCount.high >>> 0).toNumber(); + var message = new $root.google.cloud.retail.v2alpha.ImportProductsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportProductsRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.retail.v2alpha.ProductInputConfig.fromObject(object.inputConfig); + } + if (object.errorsConfig != null) { + if (typeof object.errorsConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportProductsRequest.errorsConfig: object expected"); + message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.fromObject(object.errorsConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportProductsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + switch (object.reconciliationMode) { + case "RECONCILIATION_MODE_UNSPECIFIED": + case 0: + message.reconciliationMode = 0; + break; + case "INCREMENTAL": + case 1: + message.reconciliationMode = 1; + break; + case "FULL": + case 2: + message.reconciliationMode = 2; + break; + } + if (object.notificationPubsubTopic != null) + message.notificationPubsubTopic = String(object.notificationPubsubTopic); return message; }; /** - * Creates a plain object from a UserEventImportSummary message. Also converts values to other types if specified. + * Creates a plain object from an ImportProductsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @static - * @param {google.cloud.retail.v2alpha.UserEventImportSummary} message UserEventImportSummary + * @param {google.cloud.retail.v2alpha.ImportProductsRequest} message ImportProductsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserEventImportSummary.toObject = function toObject(message, options) { + ImportProductsRequest.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.joinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.joinedEventsCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.unjoinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.unjoinedEventsCount = options.longs === String ? "0" : 0; + object.parent = ""; + object.inputConfig = null; + object.errorsConfig = null; + object.updateMask = null; + object.reconciliationMode = options.enums === String ? "RECONCILIATION_MODE_UNSPECIFIED" : 0; + object.requestId = ""; + object.notificationPubsubTopic = ""; } - if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) - if (typeof message.joinedEventsCount === "number") - object.joinedEventsCount = options.longs === String ? String(message.joinedEventsCount) : message.joinedEventsCount; - else - object.joinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.joinedEventsCount) : options.longs === Number ? new $util.LongBits(message.joinedEventsCount.low >>> 0, message.joinedEventsCount.high >>> 0).toNumber() : message.joinedEventsCount; - if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) - if (typeof message.unjoinedEventsCount === "number") - object.unjoinedEventsCount = options.longs === String ? String(message.unjoinedEventsCount) : message.unjoinedEventsCount; - else - object.unjoinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.unjoinedEventsCount) : options.longs === Number ? new $util.LongBits(message.unjoinedEventsCount.low >>> 0, message.unjoinedEventsCount.high >>> 0).toNumber() : message.unjoinedEventsCount; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.retail.v2alpha.ProductInputConfig.toObject(message.inputConfig, options); + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) + object.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.toObject(message.errorsConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) + object.reconciliationMode = options.enums === String ? $root.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode[message.reconciliationMode] : message.reconciliationMode; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + object.notificationPubsubTopic = message.notificationPubsubTopic; return object; }; /** - * Converts this UserEventImportSummary to JSON. + * Converts this ImportProductsRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @instance * @returns {Object.} JSON object */ - UserEventImportSummary.prototype.toJSON = function toJSON() { + ImportProductsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UserEventImportSummary; + /** + * ReconciliationMode enum. + * @name google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode + * @enum {number} + * @property {number} RECONCILIATION_MODE_UNSPECIFIED=0 RECONCILIATION_MODE_UNSPECIFIED value + * @property {number} INCREMENTAL=1 INCREMENTAL value + * @property {number} FULL=2 FULL value + */ + ImportProductsRequest.ReconciliationMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RECONCILIATION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCREMENTAL"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + return ImportProductsRequest; })(); - v2alpha.ImportCompletionDataResponse = (function() { + v2alpha.ImportUserEventsRequest = (function() { /** - * Properties of an ImportCompletionDataResponse. + * Properties of an ImportUserEventsRequest. * @memberof google.cloud.retail.v2alpha - * @interface IImportCompletionDataResponse - * @property {Array.|null} [errorSamples] ImportCompletionDataResponse errorSamples + * @interface IImportUserEventsRequest + * @property {string|null} [parent] ImportUserEventsRequest parent + * @property {google.cloud.retail.v2alpha.IUserEventInputConfig|null} [inputConfig] ImportUserEventsRequest inputConfig + * @property {google.cloud.retail.v2alpha.IImportErrorsConfig|null} [errorsConfig] ImportUserEventsRequest errorsConfig */ /** - * Constructs a new ImportCompletionDataResponse. + * Constructs a new ImportUserEventsRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ImportCompletionDataResponse. - * @implements IImportCompletionDataResponse + * @classdesc Represents an ImportUserEventsRequest. + * @implements IImportUserEventsRequest * @constructor - * @param {google.cloud.retail.v2alpha.IImportCompletionDataResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest=} [properties] Properties to set */ - function ImportCompletionDataResponse(properties) { - this.errorSamples = []; + function ImportUserEventsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34032,78 +33712,101 @@ } /** - * ImportCompletionDataResponse errorSamples. - * @member {Array.} errorSamples - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * ImportUserEventsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @instance */ - ImportCompletionDataResponse.prototype.errorSamples = $util.emptyArray; + ImportUserEventsRequest.prototype.parent = ""; /** - * Creates a new ImportCompletionDataResponse instance using the specified properties. + * ImportUserEventsRequest inputConfig. + * @member {google.cloud.retail.v2alpha.IUserEventInputConfig|null|undefined} inputConfig + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest + * @instance + */ + ImportUserEventsRequest.prototype.inputConfig = null; + + /** + * ImportUserEventsRequest errorsConfig. + * @member {google.cloud.retail.v2alpha.IImportErrorsConfig|null|undefined} errorsConfig + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest + * @instance + */ + ImportUserEventsRequest.prototype.errorsConfig = null; + + /** + * Creates a new ImportUserEventsRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @static - * @param {google.cloud.retail.v2alpha.IImportCompletionDataResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ImportCompletionDataResponse} ImportCompletionDataResponse instance + * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ImportUserEventsRequest} ImportUserEventsRequest instance */ - ImportCompletionDataResponse.create = function create(properties) { - return new ImportCompletionDataResponse(properties); + ImportUserEventsRequest.create = function create(properties) { + return new ImportUserEventsRequest(properties); }; /** - * Encodes the specified ImportCompletionDataResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataResponse.verify|verify} messages. + * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @static - * @param {google.cloud.retail.v2alpha.IImportCompletionDataResponse} message ImportCompletionDataResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportCompletionDataResponse.encode = function encode(message, writer) { + ImportUserEventsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorSamples != null && message.errorSamples.length) - for (var i = 0; i < message.errorSamples.length; ++i) - $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.retail.v2alpha.UserEventInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) + $root.google.cloud.retail.v2alpha.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ImportCompletionDataResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataResponse.verify|verify} messages. + * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @static - * @param {google.cloud.retail.v2alpha.IImportCompletionDataResponse} message ImportCompletionDataResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportCompletionDataResponse.encodeDelimited = function encodeDelimited(message, writer) { + ImportUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportCompletionDataResponse message from the specified reader or buffer. + * Decodes an ImportUserEventsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @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.ImportCompletionDataResponse} ImportCompletionDataResponse + * @returns {google.cloud.retail.v2alpha.ImportUserEventsRequest} ImportUserEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportCompletionDataResponse.decode = function decode(reader, length) { + ImportUserEventsRequest.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.ImportCompletionDataResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportUserEventsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.errorSamples && message.errorSamples.length)) - message.errorSamples = []; - message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + message.parent = reader.string(); + break; + case 2: + message.inputConfig = $root.google.cloud.retail.v2alpha.UserEventInputConfig.decode(reader, reader.uint32()); + break; + case 3: + message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -34114,169 +33817,136 @@ }; /** - * Decodes an ImportCompletionDataResponse message from the specified reader or buffer, length delimited. + * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ImportCompletionDataResponse} ImportCompletionDataResponse + * @returns {google.cloud.retail.v2alpha.ImportUserEventsRequest} ImportUserEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportCompletionDataResponse.decodeDelimited = function decodeDelimited(reader) { + ImportUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportCompletionDataResponse message. + * Verifies an ImportUserEventsRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportCompletionDataResponse.verify = function verify(message) { + ImportUserEventsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { - if (!Array.isArray(message.errorSamples)) - return "errorSamples: array expected"; - for (var i = 0; i < message.errorSamples.length; ++i) { - var error = $root.google.rpc.Status.verify(message.errorSamples[i]); - if (error) - return "errorSamples." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.retail.v2alpha.UserEventInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { + var error = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.verify(message.errorsConfig); + if (error) + return "errorsConfig." + error; } return null; }; /** - * Creates an ImportCompletionDataResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ImportCompletionDataResponse} ImportCompletionDataResponse + * @returns {google.cloud.retail.v2alpha.ImportUserEventsRequest} ImportUserEventsRequest */ - ImportCompletionDataResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ImportCompletionDataResponse) + ImportUserEventsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ImportUserEventsRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.ImportCompletionDataResponse(); - if (object.errorSamples) { - if (!Array.isArray(object.errorSamples)) - throw TypeError(".google.cloud.retail.v2alpha.ImportCompletionDataResponse.errorSamples: array expected"); - message.errorSamples = []; - for (var i = 0; i < object.errorSamples.length; ++i) { - if (typeof object.errorSamples[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportCompletionDataResponse.errorSamples: object expected"); - message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); - } + var message = new $root.google.cloud.retail.v2alpha.ImportUserEventsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.retail.v2alpha.UserEventInputConfig.fromObject(object.inputConfig); + } + if (object.errorsConfig != null) { + if (typeof object.errorsConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsRequest.errorsConfig: object expected"); + message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.fromObject(object.errorsConfig); } return message; }; /** - * Creates a plain object from an ImportCompletionDataResponse message. Also converts values to other types if specified. + * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @static - * @param {google.cloud.retail.v2alpha.ImportCompletionDataResponse} message ImportCompletionDataResponse + * @param {google.cloud.retail.v2alpha.ImportUserEventsRequest} message ImportUserEventsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportCompletionDataResponse.toObject = function toObject(message, options) { + ImportUserEventsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.errorSamples = []; - if (message.errorSamples && message.errorSamples.length) { - object.errorSamples = []; - for (var j = 0; j < message.errorSamples.length; ++j) - object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + if (options.defaults) { + object.parent = ""; + object.inputConfig = null; + object.errorsConfig = null; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.retail.v2alpha.UserEventInputConfig.toObject(message.inputConfig, options); + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) + object.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.toObject(message.errorsConfig, options); return object; }; /** - * Converts this ImportCompletionDataResponse to JSON. + * Converts this ImportUserEventsRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @instance * @returns {Object.} JSON object */ - ImportCompletionDataResponse.prototype.toJSON = function toJSON() { + ImportUserEventsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ImportCompletionDataResponse; + return ImportUserEventsRequest; })(); - v2alpha.Product = (function() { + v2alpha.ImportCompletionDataRequest = (function() { /** - * Properties of a Product. + * Properties of an ImportCompletionDataRequest. * @memberof google.cloud.retail.v2alpha - * @interface IProduct - * @property {google.protobuf.ITimestamp|null} [expireTime] Product expireTime - * @property {google.protobuf.IDuration|null} [ttl] Product ttl - * @property {string|null} [name] Product name - * @property {string|null} [id] Product id - * @property {google.cloud.retail.v2alpha.Product.Type|null} [type] Product type - * @property {string|null} [primaryProductId] Product primaryProductId - * @property {Array.|null} [collectionMemberIds] Product collectionMemberIds - * @property {string|null} [gtin] Product gtin - * @property {Array.|null} [categories] Product categories - * @property {string|null} [title] Product title - * @property {Array.|null} [brands] Product brands - * @property {string|null} [description] Product description - * @property {string|null} [languageCode] Product languageCode - * @property {Object.|null} [attributes] Product attributes - * @property {Array.|null} [tags] Product tags - * @property {google.cloud.retail.v2alpha.IPriceInfo|null} [priceInfo] Product priceInfo - * @property {google.cloud.retail.v2alpha.IRating|null} [rating] Product rating - * @property {google.protobuf.ITimestamp|null} [availableTime] Product availableTime - * @property {google.cloud.retail.v2alpha.Product.Availability|null} [availability] Product availability - * @property {google.protobuf.IInt32Value|null} [availableQuantity] Product availableQuantity - * @property {Array.|null} [fulfillmentInfo] Product fulfillmentInfo - * @property {string|null} [uri] Product uri - * @property {Array.|null} [images] Product images - * @property {google.cloud.retail.v2alpha.IAudience|null} [audience] Product audience - * @property {google.cloud.retail.v2alpha.IColorInfo|null} [colorInfo] Product colorInfo - * @property {Array.|null} [sizes] Product sizes - * @property {Array.|null} [materials] Product materials - * @property {Array.|null} [patterns] Product patterns - * @property {Array.|null} [conditions] Product conditions - * @property {Array.|null} [promotions] Product promotions - * @property {google.protobuf.ITimestamp|null} [publishTime] Product publishTime - * @property {google.protobuf.IFieldMask|null} [retrievableFields] Product retrievableFields - * @property {Array.|null} [variants] Product variants + * @interface IImportCompletionDataRequest + * @property {string|null} [parent] ImportCompletionDataRequest parent + * @property {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null} [inputConfig] ImportCompletionDataRequest inputConfig + * @property {string|null} [notificationPubsubTopic] ImportCompletionDataRequest notificationPubsubTopic */ /** - * Constructs a new Product. + * Constructs a new ImportCompletionDataRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a Product. - * @implements IProduct + * @classdesc Represents an ImportCompletionDataRequest. + * @implements IImportCompletionDataRequest * @constructor - * @param {google.cloud.retail.v2alpha.IProduct=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest=} [properties] Properties to set */ - function Product(properties) { - this.collectionMemberIds = []; - this.categories = []; - this.brands = []; - this.attributes = {}; - this.tags = []; - this.fulfillmentInfo = []; - this.images = []; - this.sizes = []; - this.materials = []; - this.patterns = []; - this.conditions = []; - this.promotions = []; - this.variants = []; + function ImportCompletionDataRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34284,563 +33954,631 @@ } /** - * Product expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.retail.v2alpha.Product + * ImportCompletionDataRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest * @instance */ - Product.prototype.expireTime = null; + ImportCompletionDataRequest.prototype.parent = ""; /** - * Product ttl. - * @member {google.protobuf.IDuration|null|undefined} ttl - * @memberof google.cloud.retail.v2alpha.Product + * ImportCompletionDataRequest inputConfig. + * @member {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null|undefined} inputConfig + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest * @instance */ - Product.prototype.ttl = null; + ImportCompletionDataRequest.prototype.inputConfig = null; /** - * Product name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.Product + * ImportCompletionDataRequest notificationPubsubTopic. + * @member {string} notificationPubsubTopic + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest * @instance */ - Product.prototype.name = ""; + ImportCompletionDataRequest.prototype.notificationPubsubTopic = ""; /** - * Product id. - * @member {string} id - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Creates a new ImportCompletionDataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * @static + * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ImportCompletionDataRequest} ImportCompletionDataRequest instance */ - Product.prototype.id = ""; + ImportCompletionDataRequest.create = function create(properties) { + return new ImportCompletionDataRequest(properties); + }; /** - * Product type. - * @member {google.cloud.retail.v2alpha.Product.Type} type - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Encodes the specified ImportCompletionDataRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * @static + * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest} message ImportCompletionDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Product.prototype.type = 0; + ImportCompletionDataRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.notificationPubsubTopic); + return writer; + }; /** - * Product primaryProductId. - * @member {string} primaryProductId - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Encodes the specified ImportCompletionDataRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * @static + * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest} message ImportCompletionDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Product.prototype.primaryProductId = ""; + ImportCompletionDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Product collectionMemberIds. - * @member {Array.} collectionMemberIds - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Decodes an ImportCompletionDataRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * @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.ImportCompletionDataRequest} ImportCompletionDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.prototype.collectionMemberIds = $util.emptyArray; + ImportCompletionDataRequest.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.ImportCompletionDataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.inputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.decode(reader, reader.uint32()); + break; + case 3: + message.notificationPubsubTopic = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Product gtin. - * @member {string} gtin - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Decodes an ImportCompletionDataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.ImportCompletionDataRequest} ImportCompletionDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.prototype.gtin = ""; + ImportCompletionDataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Product categories. - * @member {Array.} categories - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Verifies an ImportCompletionDataRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Product.prototype.categories = $util.emptyArray; + ImportCompletionDataRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + if (!$util.isString(message.notificationPubsubTopic)) + return "notificationPubsubTopic: string expected"; + return null; + }; /** - * Product title. - * @member {string} title - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Creates an ImportCompletionDataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.ImportCompletionDataRequest} ImportCompletionDataRequest */ - Product.prototype.title = ""; + ImportCompletionDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ImportCompletionDataRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.ImportCompletionDataRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportCompletionDataRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.fromObject(object.inputConfig); + } + if (object.notificationPubsubTopic != null) + message.notificationPubsubTopic = String(object.notificationPubsubTopic); + return message; + }; /** - * Product brands. - * @member {Array.} brands - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Creates a plain object from an ImportCompletionDataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest + * @static + * @param {google.cloud.retail.v2alpha.ImportCompletionDataRequest} message ImportCompletionDataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Product.prototype.brands = $util.emptyArray; + ImportCompletionDataRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.inputConfig = null; + object.notificationPubsubTopic = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.toObject(message.inputConfig, options); + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + object.notificationPubsubTopic = message.notificationPubsubTopic; + return object; + }; /** - * Product description. - * @member {string} description - * @memberof google.cloud.retail.v2alpha.Product + * Converts this ImportCompletionDataRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest * @instance + * @returns {Object.} JSON object */ - Product.prototype.description = ""; + ImportCompletionDataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Product languageCode. - * @member {string} languageCode - * @memberof google.cloud.retail.v2alpha.Product - * @instance - */ - Product.prototype.languageCode = ""; + return ImportCompletionDataRequest; + })(); - /** - * Product attributes. - * @member {Object.} attributes - * @memberof google.cloud.retail.v2alpha.Product - * @instance - */ - Product.prototype.attributes = $util.emptyObject; + v2alpha.ProductInputConfig = (function() { /** - * Product tags. - * @member {Array.} tags - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Properties of a ProductInputConfig. + * @memberof google.cloud.retail.v2alpha + * @interface IProductInputConfig + * @property {google.cloud.retail.v2alpha.IProductInlineSource|null} [productInlineSource] ProductInputConfig productInlineSource + * @property {google.cloud.retail.v2alpha.IGcsSource|null} [gcsSource] ProductInputConfig gcsSource + * @property {google.cloud.retail.v2alpha.IBigQuerySource|null} [bigQuerySource] ProductInputConfig bigQuerySource */ - Product.prototype.tags = $util.emptyArray; /** - * Product priceInfo. - * @member {google.cloud.retail.v2alpha.IPriceInfo|null|undefined} priceInfo - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Constructs a new ProductInputConfig. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a ProductInputConfig. + * @implements IProductInputConfig + * @constructor + * @param {google.cloud.retail.v2alpha.IProductInputConfig=} [properties] Properties to set */ - Product.prototype.priceInfo = null; + function ProductInputConfig(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]]; + } /** - * Product rating. - * @member {google.cloud.retail.v2alpha.IRating|null|undefined} rating - * @memberof google.cloud.retail.v2alpha.Product + * ProductInputConfig productInlineSource. + * @member {google.cloud.retail.v2alpha.IProductInlineSource|null|undefined} productInlineSource + * @memberof google.cloud.retail.v2alpha.ProductInputConfig * @instance */ - Product.prototype.rating = null; + ProductInputConfig.prototype.productInlineSource = null; /** - * Product availableTime. - * @member {google.protobuf.ITimestamp|null|undefined} availableTime - * @memberof google.cloud.retail.v2alpha.Product + * ProductInputConfig gcsSource. + * @member {google.cloud.retail.v2alpha.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.retail.v2alpha.ProductInputConfig * @instance */ - Product.prototype.availableTime = null; + ProductInputConfig.prototype.gcsSource = null; /** - * Product availability. - * @member {google.cloud.retail.v2alpha.Product.Availability} availability - * @memberof google.cloud.retail.v2alpha.Product + * ProductInputConfig bigQuerySource. + * @member {google.cloud.retail.v2alpha.IBigQuerySource|null|undefined} bigQuerySource + * @memberof google.cloud.retail.v2alpha.ProductInputConfig * @instance */ - Product.prototype.availability = 0; + ProductInputConfig.prototype.bigQuerySource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Product availableQuantity. - * @member {google.protobuf.IInt32Value|null|undefined} availableQuantity - * @memberof google.cloud.retail.v2alpha.Product + * ProductInputConfig source. + * @member {"productInlineSource"|"gcsSource"|"bigQuerySource"|undefined} source + * @memberof google.cloud.retail.v2alpha.ProductInputConfig * @instance */ - Product.prototype.availableQuantity = null; + Object.defineProperty(ProductInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["productInlineSource", "gcsSource", "bigQuerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Product fulfillmentInfo. - * @member {Array.} fulfillmentInfo - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Creates a new ProductInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @static + * @param {google.cloud.retail.v2alpha.IProductInputConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ProductInputConfig} ProductInputConfig instance */ - Product.prototype.fulfillmentInfo = $util.emptyArray; + ProductInputConfig.create = function create(properties) { + return new ProductInputConfig(properties); + }; /** - * Product uri. - * @member {string} uri - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Encodes the specified ProductInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @static + * @param {google.cloud.retail.v2alpha.IProductInputConfig} message ProductInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Product.prototype.uri = ""; + ProductInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.productInlineSource != null && Object.hasOwnProperty.call(message, "productInlineSource")) + $root.google.cloud.retail.v2alpha.ProductInlineSource.encode(message.productInlineSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.retail.v2alpha.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) + $root.google.cloud.retail.v2alpha.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; /** - * Product images. - * @member {Array.} images - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Encodes the specified ProductInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @static + * @param {google.cloud.retail.v2alpha.IProductInputConfig} message ProductInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Product.prototype.images = $util.emptyArray; + ProductInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Product audience. - * @member {google.cloud.retail.v2alpha.IAudience|null|undefined} audience - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Decodes a ProductInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @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.ProductInputConfig} ProductInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.prototype.audience = null; + ProductInputConfig.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.ProductInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.productInlineSource = $root.google.cloud.retail.v2alpha.ProductInlineSource.decode(reader, reader.uint32()); + break; + case 2: + message.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.decode(reader, reader.uint32()); + break; + case 3: + message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Product colorInfo. - * @member {google.cloud.retail.v2alpha.IColorInfo|null|undefined} colorInfo - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Decodes a ProductInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.ProductInputConfig} ProductInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.prototype.colorInfo = null; + ProductInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Product sizes. - * @member {Array.} sizes - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Verifies a ProductInputConfig message. + * @function verify + * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Product.prototype.sizes = $util.emptyArray; + ProductInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.productInlineSource != null && message.hasOwnProperty("productInlineSource")) { + properties.source = 1; + { + var error = $root.google.cloud.retail.v2alpha.ProductInlineSource.verify(message.productInlineSource); + if (error) + return "productInlineSource." + error; + } + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.retail.v2alpha.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.retail.v2alpha.BigQuerySource.verify(message.bigQuerySource); + if (error) + return "bigQuerySource." + error; + } + } + return null; + }; /** - * Product materials. - * @member {Array.} materials - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Creates a ProductInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.ProductInputConfig} ProductInputConfig */ - Product.prototype.materials = $util.emptyArray; + ProductInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ProductInputConfig) + return object; + var message = new $root.google.cloud.retail.v2alpha.ProductInputConfig(); + if (object.productInlineSource != null) { + if (typeof object.productInlineSource !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ProductInputConfig.productInlineSource: object expected"); + message.productInlineSource = $root.google.cloud.retail.v2alpha.ProductInlineSource.fromObject(object.productInlineSource); + } + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ProductInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.fromObject(object.gcsSource); + } + if (object.bigQuerySource != null) { + if (typeof object.bigQuerySource !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ProductInputConfig.bigQuerySource: object expected"); + message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.fromObject(object.bigQuerySource); + } + return message; + }; /** - * Product patterns. - * @member {Array.} patterns - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Creates a plain object from a ProductInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @static + * @param {google.cloud.retail.v2alpha.ProductInputConfig} message ProductInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Product.prototype.patterns = $util.emptyArray; + ProductInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.productInlineSource != null && message.hasOwnProperty("productInlineSource")) { + object.productInlineSource = $root.google.cloud.retail.v2alpha.ProductInlineSource.toObject(message.productInlineSource, options); + if (options.oneofs) + object.source = "productInlineSource"; + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { + object.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.toObject(message.bigQuerySource, options); + if (options.oneofs) + object.source = "bigQuerySource"; + } + return object; + }; /** - * Product conditions. - * @member {Array.} conditions - * @memberof google.cloud.retail.v2alpha.Product + * Converts this ProductInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.ProductInputConfig * @instance + * @returns {Object.} JSON object */ - Product.prototype.conditions = $util.emptyArray; + ProductInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProductInputConfig; + })(); + + v2alpha.UserEventInputConfig = (function() { /** - * Product promotions. - * @member {Array.} promotions - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Properties of a UserEventInputConfig. + * @memberof google.cloud.retail.v2alpha + * @interface IUserEventInputConfig + * @property {google.cloud.retail.v2alpha.IUserEventInlineSource|null} [userEventInlineSource] UserEventInputConfig userEventInlineSource + * @property {google.cloud.retail.v2alpha.IGcsSource|null} [gcsSource] UserEventInputConfig gcsSource + * @property {google.cloud.retail.v2alpha.IBigQuerySource|null} [bigQuerySource] UserEventInputConfig bigQuerySource */ - Product.prototype.promotions = $util.emptyArray; /** - * Product publishTime. - * @member {google.protobuf.ITimestamp|null|undefined} publishTime - * @memberof google.cloud.retail.v2alpha.Product + * Constructs a new UserEventInputConfig. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a UserEventInputConfig. + * @implements IUserEventInputConfig + * @constructor + * @param {google.cloud.retail.v2alpha.IUserEventInputConfig=} [properties] Properties to set + */ + function UserEventInputConfig(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]]; + } + + /** + * UserEventInputConfig userEventInlineSource. + * @member {google.cloud.retail.v2alpha.IUserEventInlineSource|null|undefined} userEventInlineSource + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @instance */ - Product.prototype.publishTime = null; + UserEventInputConfig.prototype.userEventInlineSource = null; /** - * Product retrievableFields. - * @member {google.protobuf.IFieldMask|null|undefined} retrievableFields - * @memberof google.cloud.retail.v2alpha.Product + * UserEventInputConfig gcsSource. + * @member {google.cloud.retail.v2alpha.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @instance */ - Product.prototype.retrievableFields = null; + UserEventInputConfig.prototype.gcsSource = null; /** - * Product variants. - * @member {Array.} variants - * @memberof google.cloud.retail.v2alpha.Product + * UserEventInputConfig bigQuerySource. + * @member {google.cloud.retail.v2alpha.IBigQuerySource|null|undefined} bigQuerySource + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @instance */ - Product.prototype.variants = $util.emptyArray; + UserEventInputConfig.prototype.bigQuerySource = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * Product expiration. - * @member {"expireTime"|"ttl"|undefined} expiration - * @memberof google.cloud.retail.v2alpha.Product + * UserEventInputConfig source. + * @member {"userEventInlineSource"|"gcsSource"|"bigQuerySource"|undefined} source + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @instance */ - Object.defineProperty(Product.prototype, "expiration", { - get: $util.oneOfGetter($oneOfFields = ["expireTime", "ttl"]), + Object.defineProperty(UserEventInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["userEventInlineSource", "gcsSource", "bigQuerySource"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new Product instance using the specified properties. + * Creates a new UserEventInputConfig instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @static - * @param {google.cloud.retail.v2alpha.IProduct=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Product} Product instance + * @param {google.cloud.retail.v2alpha.IUserEventInputConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UserEventInputConfig} UserEventInputConfig instance */ - Product.create = function create(properties) { - return new Product(properties); + UserEventInputConfig.create = function create(properties) { + return new UserEventInputConfig(properties); }; /** - * Encodes the specified Product message. Does not implicitly {@link google.cloud.retail.v2alpha.Product.verify|verify} messages. + * Encodes the specified UserEventInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @static - * @param {google.cloud.retail.v2alpha.IProduct} message Product message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUserEventInputConfig} message UserEventInputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Product.encode = function encode(message, writer) { + UserEventInputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); - if (message.primaryProductId != null && Object.hasOwnProperty.call(message, "primaryProductId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.primaryProductId); - if (message.collectionMemberIds != null && message.collectionMemberIds.length) - for (var i = 0; i < message.collectionMemberIds.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.collectionMemberIds[i]); - if (message.gtin != null && Object.hasOwnProperty.call(message, "gtin")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.gtin); - if (message.categories != null && message.categories.length) - for (var i = 0; i < message.categories.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.categories[i]); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.title); - if (message.brands != null && message.brands.length) - for (var i = 0; i < message.brands.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.brands[i]); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.description); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.languageCode); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.retail.v2alpha.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.tags[i]); - if (message.priceInfo != null && Object.hasOwnProperty.call(message, "priceInfo")) - $root.google.cloud.retail.v2alpha.PriceInfo.encode(message.priceInfo, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.rating != null && Object.hasOwnProperty.call(message, "rating")) - $root.google.cloud.retail.v2alpha.Rating.encode(message.rating, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) - $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.availableTime != null && Object.hasOwnProperty.call(message, "availableTime")) - $root.google.protobuf.Timestamp.encode(message.availableTime, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.availability != null && Object.hasOwnProperty.call(message, "availability")) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.availability); - if (message.availableQuantity != null && Object.hasOwnProperty.call(message, "availableQuantity")) - $root.google.protobuf.Int32Value.encode(message.availableQuantity, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.fulfillmentInfo != null && message.fulfillmentInfo.length) - for (var i = 0; i < message.fulfillmentInfo.length; ++i) - $root.google.cloud.retail.v2alpha.FulfillmentInfo.encode(message.fulfillmentInfo[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 22, wireType 2 =*/178).string(message.uri); - if (message.images != null && message.images.length) - for (var i = 0; i < message.images.length; ++i) - $root.google.cloud.retail.v2alpha.Image.encode(message.images[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.audience != null && Object.hasOwnProperty.call(message, "audience")) - $root.google.cloud.retail.v2alpha.Audience.encode(message.audience, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.colorInfo != null && Object.hasOwnProperty.call(message, "colorInfo")) - $root.google.cloud.retail.v2alpha.ColorInfo.encode(message.colorInfo, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.sizes != null && message.sizes.length) - for (var i = 0; i < message.sizes.length; ++i) - writer.uint32(/* id 26, wireType 2 =*/210).string(message.sizes[i]); - if (message.materials != null && message.materials.length) - for (var i = 0; i < message.materials.length; ++i) - writer.uint32(/* id 27, wireType 2 =*/218).string(message.materials[i]); - if (message.patterns != null && message.patterns.length) - for (var i = 0; i < message.patterns.length; ++i) - writer.uint32(/* id 28, wireType 2 =*/226).string(message.patterns[i]); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - writer.uint32(/* id 29, wireType 2 =*/234).string(message.conditions[i]); - if (message.retrievableFields != null && Object.hasOwnProperty.call(message, "retrievableFields")) - $root.google.protobuf.FieldMask.encode(message.retrievableFields, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); - if (message.variants != null && message.variants.length) - for (var i = 0; i < message.variants.length; ++i) - $root.google.cloud.retail.v2alpha.Product.encode(message.variants[i], writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.publishTime != null && Object.hasOwnProperty.call(message, "publishTime")) - $root.google.protobuf.Timestamp.encode(message.publishTime, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); - 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.userEventInlineSource != null && Object.hasOwnProperty.call(message, "userEventInlineSource")) + $root.google.cloud.retail.v2alpha.UserEventInlineSource.encode(message.userEventInlineSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.retail.v2alpha.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) + $root.google.cloud.retail.v2alpha.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Product.verify|verify} messages. + * Encodes the specified UserEventInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @static - * @param {google.cloud.retail.v2alpha.IProduct} message Product message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUserEventInputConfig} message UserEventInputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Product.encodeDelimited = function encodeDelimited(message, writer) { + UserEventInputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Product message from the specified reader or buffer. + * Decodes a UserEventInputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @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.Product} Product + * @returns {google.cloud.retail.v2alpha.UserEventInputConfig} UserEventInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.decode = function decode(reader, length) { + UserEventInputConfig.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.Product(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UserEventInputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 16: - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 17: - message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; case 1: - message.name = reader.string(); + message.userEventInlineSource = $root.google.cloud.retail.v2alpha.UserEventInlineSource.decode(reader, reader.uint32()); break; case 2: - message.id = reader.string(); + message.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.decode(reader, reader.uint32()); break; case 3: - message.type = reader.int32(); - break; - case 4: - message.primaryProductId = reader.string(); - break; - case 5: - if (!(message.collectionMemberIds && message.collectionMemberIds.length)) - message.collectionMemberIds = []; - message.collectionMemberIds.push(reader.string()); - break; - case 6: - message.gtin = reader.string(); - break; - case 7: - if (!(message.categories && message.categories.length)) - message.categories = []; - message.categories.push(reader.string()); - break; - case 8: - message.title = reader.string(); - break; - case 9: - if (!(message.brands && message.brands.length)) - message.brands = []; - message.brands.push(reader.string()); - break; - case 10: - message.description = reader.string(); - break; - case 11: - message.languageCode = reader.string(); - break; - case 12: - if (message.attributes === $util.emptyObject) - message.attributes = {}; - 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.CustomAttribute.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributes[key] = value; - break; - case 13: - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(reader.string()); - break; - case 14: - message.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.decode(reader, reader.uint32()); - break; - case 15: - message.rating = $root.google.cloud.retail.v2alpha.Rating.decode(reader, reader.uint32()); - break; - case 18: - message.availableTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 19: - message.availability = reader.int32(); - break; - case 20: - message.availableQuantity = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); - break; - case 21: - if (!(message.fulfillmentInfo && message.fulfillmentInfo.length)) - message.fulfillmentInfo = []; - message.fulfillmentInfo.push($root.google.cloud.retail.v2alpha.FulfillmentInfo.decode(reader, reader.uint32())); - break; - case 22: - message.uri = reader.string(); - break; - case 23: - if (!(message.images && message.images.length)) - message.images = []; - message.images.push($root.google.cloud.retail.v2alpha.Image.decode(reader, reader.uint32())); - break; - case 24: - message.audience = $root.google.cloud.retail.v2alpha.Audience.decode(reader, reader.uint32()); - break; - case 25: - message.colorInfo = $root.google.cloud.retail.v2alpha.ColorInfo.decode(reader, reader.uint32()); - break; - case 26: - if (!(message.sizes && message.sizes.length)) - message.sizes = []; - message.sizes.push(reader.string()); - break; - case 27: - if (!(message.materials && message.materials.length)) - message.materials = []; - message.materials.push(reader.string()); - break; - case 28: - if (!(message.patterns && message.patterns.length)) - message.patterns = []; - message.patterns.push(reader.string()); - break; - case 29: - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push(reader.string()); - break; - case 34: - if (!(message.promotions && message.promotions.length)) - message.promotions = []; - message.promotions.push($root.google.cloud.retail.v2alpha.Promotion.decode(reader, reader.uint32())); - break; - case 33: - message.publishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 30: - message.retrievableFields = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 31: - if (!(message.variants && message.variants.length)) - message.variants = []; - message.variants.push($root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32())); + message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -34851,725 +34589,157 @@ }; /** - * Decodes a Product message from the specified reader or buffer, length delimited. + * Decodes a UserEventInputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Product} Product + * @returns {google.cloud.retail.v2alpha.UserEventInputConfig} UserEventInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.decodeDelimited = function decodeDelimited(reader) { + UserEventInputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Product message. + * Verifies a UserEventInputConfig message. * @function verify - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Product.verify = function verify(message) { + UserEventInputConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - properties.expiration = 1; + if (message.userEventInlineSource != null && message.hasOwnProperty("userEventInlineSource")) { + properties.source = 1; { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + var error = $root.google.cloud.retail.v2alpha.UserEventInlineSource.verify(message.userEventInlineSource); if (error) - return "expireTime." + error; + return "userEventInlineSource." + error; } } - if (message.ttl != null && message.hasOwnProperty("ttl")) { - if (properties.expiration === 1) - return "expiration: multiple values"; - properties.expiration = 1; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; { - var error = $root.google.protobuf.Duration.verify(message.ttl); + var error = $root.google.cloud.retail.v2alpha.GcsSource.verify(message.gcsSource); if (error) - return "ttl." + error; + return "gcsSource." + error; } } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.primaryProductId != null && message.hasOwnProperty("primaryProductId")) - if (!$util.isString(message.primaryProductId)) - return "primaryProductId: string expected"; - if (message.collectionMemberIds != null && message.hasOwnProperty("collectionMemberIds")) { - if (!Array.isArray(message.collectionMemberIds)) - return "collectionMemberIds: array expected"; - for (var i = 0; i < message.collectionMemberIds.length; ++i) - if (!$util.isString(message.collectionMemberIds[i])) - return "collectionMemberIds: string[] expected"; - } - if (message.gtin != null && message.hasOwnProperty("gtin")) - if (!$util.isString(message.gtin)) - return "gtin: string expected"; - if (message.categories != null && message.hasOwnProperty("categories")) { - if (!Array.isArray(message.categories)) - return "categories: array expected"; - for (var i = 0; i < message.categories.length; ++i) - if (!$util.isString(message.categories[i])) - return "categories: string[] expected"; - } - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.brands != null && message.hasOwnProperty("brands")) { - if (!Array.isArray(message.brands)) - return "brands: array expected"; - for (var i = 0; i < message.brands.length; ++i) - if (!$util.isString(message.brands[i])) - return "brands: string[] expected"; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.CustomAttribute.verify(message.attributes[key[i]]); - if (error) - return "attributes." + error; - } - } - if (message.tags != null && message.hasOwnProperty("tags")) { - if (!Array.isArray(message.tags)) - return "tags: array expected"; - for (var i = 0; i < message.tags.length; ++i) - if (!$util.isString(message.tags[i])) - return "tags: string[] expected"; - } - if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) { - var error = $root.google.cloud.retail.v2alpha.PriceInfo.verify(message.priceInfo); - if (error) - return "priceInfo." + error; - } - if (message.rating != null && message.hasOwnProperty("rating")) { - var error = $root.google.cloud.retail.v2alpha.Rating.verify(message.rating); - if (error) - return "rating." + error; - } - if (message.availableTime != null && message.hasOwnProperty("availableTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.availableTime); - if (error) - return "availableTime." + error; - } - if (message.availability != null && message.hasOwnProperty("availability")) - switch (message.availability) { - default: - return "availability: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.availableQuantity != null && message.hasOwnProperty("availableQuantity")) { - var error = $root.google.protobuf.Int32Value.verify(message.availableQuantity); - if (error) - return "availableQuantity." + error; - } - if (message.fulfillmentInfo != null && message.hasOwnProperty("fulfillmentInfo")) { - if (!Array.isArray(message.fulfillmentInfo)) - return "fulfillmentInfo: array expected"; - for (var i = 0; i < message.fulfillmentInfo.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.FulfillmentInfo.verify(message.fulfillmentInfo[i]); - if (error) - return "fulfillmentInfo." + error; - } - } - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - if (message.images != null && message.hasOwnProperty("images")) { - if (!Array.isArray(message.images)) - return "images: array expected"; - for (var i = 0; i < message.images.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Image.verify(message.images[i]); - if (error) - return "images." + error; - } - } - if (message.audience != null && message.hasOwnProperty("audience")) { - var error = $root.google.cloud.retail.v2alpha.Audience.verify(message.audience); - if (error) - return "audience." + error; - } - if (message.colorInfo != null && message.hasOwnProperty("colorInfo")) { - var error = $root.google.cloud.retail.v2alpha.ColorInfo.verify(message.colorInfo); - if (error) - return "colorInfo." + error; - } - if (message.sizes != null && message.hasOwnProperty("sizes")) { - if (!Array.isArray(message.sizes)) - return "sizes: array expected"; - for (var i = 0; i < message.sizes.length; ++i) - if (!$util.isString(message.sizes[i])) - return "sizes: string[] expected"; - } - if (message.materials != null && message.hasOwnProperty("materials")) { - if (!Array.isArray(message.materials)) - return "materials: array expected"; - for (var i = 0; i < message.materials.length; ++i) - if (!$util.isString(message.materials[i])) - return "materials: string[] expected"; - } - if (message.patterns != null && message.hasOwnProperty("patterns")) { - if (!Array.isArray(message.patterns)) - return "patterns: array expected"; - for (var i = 0; i < message.patterns.length; ++i) - if (!$util.isString(message.patterns[i])) - return "patterns: string[] expected"; - } - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) - if (!$util.isString(message.conditions[i])) - return "conditions: string[] expected"; - } - if (message.promotions != null && message.hasOwnProperty("promotions")) { - if (!Array.isArray(message.promotions)) - return "promotions: array expected"; - for (var i = 0; i < message.promotions.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Promotion.verify(message.promotions[i]); - if (error) - return "promotions." + error; - } - } - if (message.publishTime != null && message.hasOwnProperty("publishTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.publishTime); - if (error) - return "publishTime." + error; - } - if (message.retrievableFields != null && message.hasOwnProperty("retrievableFields")) { - var error = $root.google.protobuf.FieldMask.verify(message.retrievableFields); - if (error) - return "retrievableFields." + error; - } - if (message.variants != null && message.hasOwnProperty("variants")) { - if (!Array.isArray(message.variants)) - return "variants: array expected"; - for (var i = 0; i < message.variants.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Product.verify(message.variants[i]); - if (error) - return "variants." + error; + if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.retail.v2alpha.BigQuerySource.verify(message.bigQuerySource); + if (error) + return "bigQuerySource." + error; } } return null; }; /** - * Creates a Product message from a plain object. Also converts values to their respective internal types. + * Creates a UserEventInputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Product} Product + * @returns {google.cloud.retail.v2alpha.UserEventInputConfig} UserEventInputConfig */ - Product.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Product) + UserEventInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UserEventInputConfig) return object; - var message = new $root.google.cloud.retail.v2alpha.Product(); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.ttl != null) { - if (typeof object.ttl !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.ttl: object expected"); - message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); - } - if (object.name != null) - message.name = String(object.name); - if (object.id != null) - message.id = String(object.id); - switch (object.type) { - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "PRIMARY": - case 1: - message.type = 1; - break; - case "VARIANT": - case 2: - message.type = 2; - break; - case "COLLECTION": - case 3: - message.type = 3; - break; - } - if (object.primaryProductId != null) - message.primaryProductId = String(object.primaryProductId); - if (object.collectionMemberIds) { - if (!Array.isArray(object.collectionMemberIds)) - throw TypeError(".google.cloud.retail.v2alpha.Product.collectionMemberIds: array expected"); - message.collectionMemberIds = []; - for (var i = 0; i < object.collectionMemberIds.length; ++i) - message.collectionMemberIds[i] = String(object.collectionMemberIds[i]); - } - if (object.gtin != null) - message.gtin = String(object.gtin); - if (object.categories) { - if (!Array.isArray(object.categories)) - throw TypeError(".google.cloud.retail.v2alpha.Product.categories: array expected"); - message.categories = []; - for (var i = 0; i < object.categories.length; ++i) - message.categories[i] = String(object.categories[i]); - } - if (object.title != null) - message.title = String(object.title); - if (object.brands) { - if (!Array.isArray(object.brands)) - throw TypeError(".google.cloud.retail.v2alpha.Product.brands: array expected"); - message.brands = []; - for (var i = 0; i < object.brands.length; ++i) - message.brands[i] = String(object.brands[i]); - } - if (object.description != null) - message.description = String(object.description); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { - if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.attributes: object expected"); - message.attributes[keys[i]] = $root.google.cloud.retail.v2alpha.CustomAttribute.fromObject(object.attributes[keys[i]]); - } - } - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.cloud.retail.v2alpha.Product.tags: array expected"); - message.tags = []; - for (var i = 0; i < object.tags.length; ++i) - message.tags[i] = String(object.tags[i]); - } - if (object.priceInfo != null) { - if (typeof object.priceInfo !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.priceInfo: object expected"); - message.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.fromObject(object.priceInfo); - } - if (object.rating != null) { - if (typeof object.rating !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.rating: object expected"); - message.rating = $root.google.cloud.retail.v2alpha.Rating.fromObject(object.rating); - } - if (object.availableTime != null) { - if (typeof object.availableTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.availableTime: object expected"); - message.availableTime = $root.google.protobuf.Timestamp.fromObject(object.availableTime); - } - switch (object.availability) { - case "AVAILABILITY_UNSPECIFIED": - case 0: - message.availability = 0; - break; - case "IN_STOCK": - case 1: - message.availability = 1; - break; - case "OUT_OF_STOCK": - case 2: - message.availability = 2; - break; - case "PREORDER": - case 3: - message.availability = 3; - break; - case "BACKORDER": - case 4: - message.availability = 4; - break; - } - if (object.availableQuantity != null) { - if (typeof object.availableQuantity !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.availableQuantity: object expected"); - message.availableQuantity = $root.google.protobuf.Int32Value.fromObject(object.availableQuantity); - } - if (object.fulfillmentInfo) { - if (!Array.isArray(object.fulfillmentInfo)) - throw TypeError(".google.cloud.retail.v2alpha.Product.fulfillmentInfo: array expected"); - message.fulfillmentInfo = []; - for (var i = 0; i < object.fulfillmentInfo.length; ++i) { - if (typeof object.fulfillmentInfo[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.fulfillmentInfo: object expected"); - message.fulfillmentInfo[i] = $root.google.cloud.retail.v2alpha.FulfillmentInfo.fromObject(object.fulfillmentInfo[i]); - } - } - if (object.uri != null) - message.uri = String(object.uri); - if (object.images) { - if (!Array.isArray(object.images)) - throw TypeError(".google.cloud.retail.v2alpha.Product.images: array expected"); - message.images = []; - for (var i = 0; i < object.images.length; ++i) { - if (typeof object.images[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.images: object expected"); - message.images[i] = $root.google.cloud.retail.v2alpha.Image.fromObject(object.images[i]); - } - } - if (object.audience != null) { - if (typeof object.audience !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.audience: object expected"); - message.audience = $root.google.cloud.retail.v2alpha.Audience.fromObject(object.audience); - } - if (object.colorInfo != null) { - if (typeof object.colorInfo !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.colorInfo: object expected"); - message.colorInfo = $root.google.cloud.retail.v2alpha.ColorInfo.fromObject(object.colorInfo); - } - if (object.sizes) { - if (!Array.isArray(object.sizes)) - throw TypeError(".google.cloud.retail.v2alpha.Product.sizes: array expected"); - message.sizes = []; - for (var i = 0; i < object.sizes.length; ++i) - message.sizes[i] = String(object.sizes[i]); - } - if (object.materials) { - if (!Array.isArray(object.materials)) - throw TypeError(".google.cloud.retail.v2alpha.Product.materials: array expected"); - message.materials = []; - for (var i = 0; i < object.materials.length; ++i) - message.materials[i] = String(object.materials[i]); - } - if (object.patterns) { - if (!Array.isArray(object.patterns)) - throw TypeError(".google.cloud.retail.v2alpha.Product.patterns: array expected"); - message.patterns = []; - for (var i = 0; i < object.patterns.length; ++i) - message.patterns[i] = String(object.patterns[i]); - } - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.cloud.retail.v2alpha.Product.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) - message.conditions[i] = String(object.conditions[i]); - } - if (object.promotions) { - if (!Array.isArray(object.promotions)) - throw TypeError(".google.cloud.retail.v2alpha.Product.promotions: array expected"); - message.promotions = []; - for (var i = 0; i < object.promotions.length; ++i) { - if (typeof object.promotions[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.promotions: object expected"); - message.promotions[i] = $root.google.cloud.retail.v2alpha.Promotion.fromObject(object.promotions[i]); - } - } - if (object.publishTime != null) { - if (typeof object.publishTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.publishTime: object expected"); - message.publishTime = $root.google.protobuf.Timestamp.fromObject(object.publishTime); + var message = new $root.google.cloud.retail.v2alpha.UserEventInputConfig(); + if (object.userEventInlineSource != null) { + if (typeof object.userEventInlineSource !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEventInputConfig.userEventInlineSource: object expected"); + message.userEventInlineSource = $root.google.cloud.retail.v2alpha.UserEventInlineSource.fromObject(object.userEventInlineSource); } - if (object.retrievableFields != null) { - if (typeof object.retrievableFields !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.retrievableFields: object expected"); - message.retrievableFields = $root.google.protobuf.FieldMask.fromObject(object.retrievableFields); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEventInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.fromObject(object.gcsSource); } - if (object.variants) { - if (!Array.isArray(object.variants)) - throw TypeError(".google.cloud.retail.v2alpha.Product.variants: array expected"); - message.variants = []; - for (var i = 0; i < object.variants.length; ++i) { - if (typeof object.variants[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.variants: object expected"); - message.variants[i] = $root.google.cloud.retail.v2alpha.Product.fromObject(object.variants[i]); - } + if (object.bigQuerySource != null) { + if (typeof object.bigQuerySource !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEventInputConfig.bigQuerySource: object expected"); + message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.fromObject(object.bigQuerySource); } return message; }; /** - * Creates a plain object from a Product message. Also converts values to other types if specified. + * Creates a plain object from a UserEventInputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @static - * @param {google.cloud.retail.v2alpha.Product} message Product + * @param {google.cloud.retail.v2alpha.UserEventInputConfig} message UserEventInputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Product.toObject = function toObject(message, options) { + UserEventInputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.collectionMemberIds = []; - object.categories = []; - object.brands = []; - object.tags = []; - object.fulfillmentInfo = []; - object.images = []; - object.sizes = []; - object.materials = []; - object.patterns = []; - object.conditions = []; - object.variants = []; - object.promotions = []; - } - if (options.objects || options.defaults) - object.attributes = {}; - if (options.defaults) { - object.name = ""; - object.id = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.primaryProductId = ""; - object.gtin = ""; - object.title = ""; - object.description = ""; - object.languageCode = ""; - object.priceInfo = null; - object.rating = null; - object.availableTime = null; - object.availability = options.enums === String ? "AVAILABILITY_UNSPECIFIED" : 0; - object.availableQuantity = null; - object.uri = ""; - object.audience = null; - object.colorInfo = null; - object.retrievableFields = null; - object.publishTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.retail.v2alpha.Product.Type[message.type] : message.type; - if (message.primaryProductId != null && message.hasOwnProperty("primaryProductId")) - object.primaryProductId = message.primaryProductId; - if (message.collectionMemberIds && message.collectionMemberIds.length) { - object.collectionMemberIds = []; - for (var j = 0; j < message.collectionMemberIds.length; ++j) - object.collectionMemberIds[j] = message.collectionMemberIds[j]; - } - if (message.gtin != null && message.hasOwnProperty("gtin")) - object.gtin = message.gtin; - if (message.categories && message.categories.length) { - object.categories = []; - for (var j = 0; j < message.categories.length; ++j) - object.categories[j] = message.categories[j]; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.brands && message.brands.length) { - object.brands = []; - for (var j = 0; j < message.brands.length; ++j) - object.brands[j] = message.brands[j]; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = $root.google.cloud.retail.v2alpha.CustomAttribute.toObject(message.attributes[keys2[j]], options); - } - if (message.tags && message.tags.length) { - object.tags = []; - for (var j = 0; j < message.tags.length; ++j) - object.tags[j] = message.tags[j]; - } - if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) - object.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.toObject(message.priceInfo, options); - if (message.rating != null && message.hasOwnProperty("rating")) - object.rating = $root.google.cloud.retail.v2alpha.Rating.toObject(message.rating, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.userEventInlineSource != null && message.hasOwnProperty("userEventInlineSource")) { + object.userEventInlineSource = $root.google.cloud.retail.v2alpha.UserEventInlineSource.toObject(message.userEventInlineSource, options); if (options.oneofs) - object.expiration = "expireTime"; + object.source = "userEventInlineSource"; } - if (message.ttl != null && message.hasOwnProperty("ttl")) { - object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.toObject(message.gcsSource, options); if (options.oneofs) - object.expiration = "ttl"; + object.source = "gcsSource"; } - if (message.availableTime != null && message.hasOwnProperty("availableTime")) - object.availableTime = $root.google.protobuf.Timestamp.toObject(message.availableTime, options); - if (message.availability != null && message.hasOwnProperty("availability")) - object.availability = options.enums === String ? $root.google.cloud.retail.v2alpha.Product.Availability[message.availability] : message.availability; - if (message.availableQuantity != null && message.hasOwnProperty("availableQuantity")) - object.availableQuantity = $root.google.protobuf.Int32Value.toObject(message.availableQuantity, options); - if (message.fulfillmentInfo && message.fulfillmentInfo.length) { - object.fulfillmentInfo = []; - for (var j = 0; j < message.fulfillmentInfo.length; ++j) - object.fulfillmentInfo[j] = $root.google.cloud.retail.v2alpha.FulfillmentInfo.toObject(message.fulfillmentInfo[j], options); - } - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - if (message.images && message.images.length) { - object.images = []; - for (var j = 0; j < message.images.length; ++j) - object.images[j] = $root.google.cloud.retail.v2alpha.Image.toObject(message.images[j], options); - } - if (message.audience != null && message.hasOwnProperty("audience")) - object.audience = $root.google.cloud.retail.v2alpha.Audience.toObject(message.audience, options); - if (message.colorInfo != null && message.hasOwnProperty("colorInfo")) - object.colorInfo = $root.google.cloud.retail.v2alpha.ColorInfo.toObject(message.colorInfo, options); - if (message.sizes && message.sizes.length) { - object.sizes = []; - for (var j = 0; j < message.sizes.length; ++j) - object.sizes[j] = message.sizes[j]; - } - if (message.materials && message.materials.length) { - object.materials = []; - for (var j = 0; j < message.materials.length; ++j) - object.materials[j] = message.materials[j]; - } - if (message.patterns && message.patterns.length) { - object.patterns = []; - for (var j = 0; j < message.patterns.length; ++j) - object.patterns[j] = message.patterns[j]; - } - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = message.conditions[j]; - } - if (message.retrievableFields != null && message.hasOwnProperty("retrievableFields")) - object.retrievableFields = $root.google.protobuf.FieldMask.toObject(message.retrievableFields, options); - if (message.variants && message.variants.length) { - object.variants = []; - for (var j = 0; j < message.variants.length; ++j) - object.variants[j] = $root.google.cloud.retail.v2alpha.Product.toObject(message.variants[j], options); - } - if (message.publishTime != null && message.hasOwnProperty("publishTime")) - object.publishTime = $root.google.protobuf.Timestamp.toObject(message.publishTime, options); - if (message.promotions && message.promotions.length) { - object.promotions = []; - 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.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { + object.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.toObject(message.bigQuerySource, options); + if (options.oneofs) + object.source = "bigQuerySource"; } return object; }; /** - * Converts this Product to JSON. + * Converts this UserEventInputConfig to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @instance * @returns {Object.} JSON object */ - Product.prototype.toJSON = function toJSON() { + UserEventInputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Type enum. - * @name google.cloud.retail.v2alpha.Product.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} PRIMARY=1 PRIMARY value - * @property {number} VARIANT=2 VARIANT value - * @property {number} COLLECTION=3 COLLECTION value - */ - Product.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIMARY"] = 1; - values[valuesById[2] = "VARIANT"] = 2; - values[valuesById[3] = "COLLECTION"] = 3; - return values; - })(); - - /** - * Availability enum. - * @name google.cloud.retail.v2alpha.Product.Availability - * @enum {number} - * @property {number} AVAILABILITY_UNSPECIFIED=0 AVAILABILITY_UNSPECIFIED value - * @property {number} IN_STOCK=1 IN_STOCK value - * @property {number} OUT_OF_STOCK=2 OUT_OF_STOCK value - * @property {number} PREORDER=3 PREORDER value - * @property {number} BACKORDER=4 BACKORDER value - */ - Product.Availability = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AVAILABILITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "IN_STOCK"] = 1; - values[valuesById[2] = "OUT_OF_STOCK"] = 2; - values[valuesById[3] = "PREORDER"] = 3; - values[valuesById[4] = "BACKORDER"] = 4; - return values; - })(); - - return Product; + return UserEventInputConfig; })(); - v2alpha.UserEvent = (function() { + v2alpha.CompletionDataInputConfig = (function() { /** - * Properties of a UserEvent. + * Properties of a CompletionDataInputConfig. * @memberof google.cloud.retail.v2alpha - * @interface IUserEvent - * @property {string|null} [eventType] UserEvent eventType - * @property {string|null} [visitorId] UserEvent visitorId - * @property {string|null} [sessionId] UserEvent sessionId - * @property {google.protobuf.ITimestamp|null} [eventTime] UserEvent eventTime - * @property {Array.|null} [experimentIds] UserEvent experimentIds - * @property {string|null} [attributionToken] UserEvent attributionToken - * @property {Array.|null} [productDetails] UserEvent productDetails - * @property {google.cloud.retail.v2alpha.ICompletionDetail|null} [completionDetail] UserEvent completionDetail - * @property {Object.|null} [attributes] UserEvent attributes - * @property {string|null} [cartId] UserEvent cartId - * @property {google.cloud.retail.v2alpha.IPurchaseTransaction|null} [purchaseTransaction] UserEvent purchaseTransaction - * @property {string|null} [searchQuery] UserEvent searchQuery - * @property {string|null} [filter] UserEvent filter - * @property {string|null} [orderBy] UserEvent orderBy - * @property {number|null} [offset] UserEvent offset - * @property {Array.|null} [pageCategories] UserEvent pageCategories - * @property {google.cloud.retail.v2alpha.IUserInfo|null} [userInfo] UserEvent userInfo - * @property {string|null} [uri] UserEvent uri - * @property {string|null} [referrerUri] UserEvent referrerUri - * @property {string|null} [pageViewId] UserEvent pageViewId + * @interface ICompletionDataInputConfig + * @property {google.cloud.retail.v2alpha.IBigQuerySource|null} [bigQuerySource] CompletionDataInputConfig bigQuerySource */ /** - * Constructs a new UserEvent. + * Constructs a new CompletionDataInputConfig. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a UserEvent. - * @implements IUserEvent + * @classdesc Represents a CompletionDataInputConfig. + * @implements ICompletionDataInputConfig * @constructor - * @param {google.cloud.retail.v2alpha.IUserEvent=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ICompletionDataInputConfig=} [properties] Properties to set */ - function UserEvent(properties) { - this.experimentIds = []; - this.productDetails = []; - this.attributes = {}; - this.pageCategories = []; + function CompletionDataInputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -35577,353 +34747,356 @@ } /** - * UserEvent eventType. - * @member {string} eventType - * @memberof google.cloud.retail.v2alpha.UserEvent + * CompletionDataInputConfig bigQuerySource. + * @member {google.cloud.retail.v2alpha.IBigQuerySource|null|undefined} bigQuerySource + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig * @instance */ - UserEvent.prototype.eventType = ""; + CompletionDataInputConfig.prototype.bigQuerySource = null; - /** - * UserEvent visitorId. - * @member {string} visitorId - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.visitorId = ""; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * UserEvent sessionId. - * @member {string} sessionId - * @memberof google.cloud.retail.v2alpha.UserEvent + * CompletionDataInputConfig source. + * @member {"bigQuerySource"|undefined} source + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig * @instance */ - UserEvent.prototype.sessionId = ""; + Object.defineProperty(CompletionDataInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["bigQuerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * UserEvent eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance + * Creates a new CompletionDataInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @static + * @param {google.cloud.retail.v2alpha.ICompletionDataInputConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CompletionDataInputConfig} CompletionDataInputConfig instance */ - UserEvent.prototype.eventTime = null; + CompletionDataInputConfig.create = function create(properties) { + return new CompletionDataInputConfig(properties); + }; /** - * UserEvent experimentIds. - * @member {Array.} experimentIds - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance + * Encodes the specified CompletionDataInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDataInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @static + * @param {google.cloud.retail.v2alpha.ICompletionDataInputConfig} message CompletionDataInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - UserEvent.prototype.experimentIds = $util.emptyArray; + CompletionDataInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) + $root.google.cloud.retail.v2alpha.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; /** - * UserEvent attributionToken. - * @member {string} attributionToken - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance + * Encodes the specified CompletionDataInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDataInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @static + * @param {google.cloud.retail.v2alpha.ICompletionDataInputConfig} message CompletionDataInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - UserEvent.prototype.attributionToken = ""; + CompletionDataInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * UserEvent productDetails. - * @member {Array.} productDetails - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance + * Decodes a CompletionDataInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @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.CompletionDataInputConfig} CompletionDataInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEvent.prototype.productDetails = $util.emptyArray; + CompletionDataInputConfig.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.CompletionDataInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * UserEvent completionDetail. - * @member {google.cloud.retail.v2alpha.ICompletionDetail|null|undefined} completionDetail - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance + * Decodes a CompletionDataInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.CompletionDataInputConfig} CompletionDataInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEvent.prototype.completionDetail = null; + CompletionDataInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * UserEvent attributes. - * @member {Object.} attributes - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance + * Verifies a CompletionDataInputConfig message. + * @function verify + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserEvent.prototype.attributes = $util.emptyObject; + CompletionDataInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { + properties.source = 1; + { + var error = $root.google.cloud.retail.v2alpha.BigQuerySource.verify(message.bigQuerySource); + if (error) + return "bigQuerySource." + error; + } + } + return null; + }; /** - * UserEvent cartId. - * @member {string} cartId - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance + * Creates a CompletionDataInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.CompletionDataInputConfig} CompletionDataInputConfig */ - UserEvent.prototype.cartId = ""; + CompletionDataInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CompletionDataInputConfig) + return object; + var message = new $root.google.cloud.retail.v2alpha.CompletionDataInputConfig(); + if (object.bigQuerySource != null) { + if (typeof object.bigQuerySource !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompletionDataInputConfig.bigQuerySource: object expected"); + message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.fromObject(object.bigQuerySource); + } + return message; + }; /** - * UserEvent purchaseTransaction. - * @member {google.cloud.retail.v2alpha.IPurchaseTransaction|null|undefined} purchaseTransaction - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance + * Creates a plain object from a CompletionDataInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @static + * @param {google.cloud.retail.v2alpha.CompletionDataInputConfig} message CompletionDataInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - UserEvent.prototype.purchaseTransaction = null; + CompletionDataInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { + object.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.toObject(message.bigQuerySource, options); + if (options.oneofs) + object.source = "bigQuerySource"; + } + return object; + }; /** - * UserEvent searchQuery. - * @member {string} searchQuery - * @memberof google.cloud.retail.v2alpha.UserEvent + * Converts this CompletionDataInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig * @instance + * @returns {Object.} JSON object */ - UserEvent.prototype.searchQuery = ""; + CompletionDataInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CompletionDataInputConfig; + })(); + + v2alpha.ImportMetadata = (function() { /** - * UserEvent filter. - * @member {string} filter - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance + * Properties of an ImportMetadata. + * @memberof google.cloud.retail.v2alpha + * @interface IImportMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] ImportMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ImportMetadata updateTime + * @property {number|Long|null} [successCount] ImportMetadata successCount + * @property {number|Long|null} [failureCount] ImportMetadata failureCount + * @property {string|null} [requestId] ImportMetadata requestId + * @property {string|null} [notificationPubsubTopic] ImportMetadata notificationPubsubTopic */ - UserEvent.prototype.filter = ""; /** - * UserEvent orderBy. - * @member {string} orderBy - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance + * Constructs a new ImportMetadata. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an ImportMetadata. + * @implements IImportMetadata + * @constructor + * @param {google.cloud.retail.v2alpha.IImportMetadata=} [properties] Properties to set */ - UserEvent.prototype.orderBy = ""; + function ImportMetadata(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]]; + } /** - * UserEvent offset. - * @member {number} offset - * @memberof google.cloud.retail.v2alpha.UserEvent + * ImportMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @instance */ - UserEvent.prototype.offset = 0; + ImportMetadata.prototype.createTime = null; /** - * UserEvent pageCategories. - * @member {Array.} pageCategories - * @memberof google.cloud.retail.v2alpha.UserEvent + * ImportMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @instance */ - UserEvent.prototype.pageCategories = $util.emptyArray; + ImportMetadata.prototype.updateTime = null; /** - * UserEvent userInfo. - * @member {google.cloud.retail.v2alpha.IUserInfo|null|undefined} userInfo - * @memberof google.cloud.retail.v2alpha.UserEvent + * ImportMetadata successCount. + * @member {number|Long} successCount + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @instance */ - UserEvent.prototype.userInfo = null; + ImportMetadata.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * UserEvent uri. - * @member {string} uri - * @memberof google.cloud.retail.v2alpha.UserEvent + * ImportMetadata failureCount. + * @member {number|Long} failureCount + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @instance */ - UserEvent.prototype.uri = ""; + ImportMetadata.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * UserEvent referrerUri. - * @member {string} referrerUri - * @memberof google.cloud.retail.v2alpha.UserEvent + * ImportMetadata requestId. + * @member {string} requestId + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @instance */ - UserEvent.prototype.referrerUri = ""; + ImportMetadata.prototype.requestId = ""; /** - * UserEvent pageViewId. - * @member {string} pageViewId - * @memberof google.cloud.retail.v2alpha.UserEvent + * ImportMetadata notificationPubsubTopic. + * @member {string} notificationPubsubTopic + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @instance */ - UserEvent.prototype.pageViewId = ""; + ImportMetadata.prototype.notificationPubsubTopic = ""; /** - * Creates a new UserEvent instance using the specified properties. + * Creates a new ImportMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @static - * @param {google.cloud.retail.v2alpha.IUserEvent=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.UserEvent} UserEvent instance + * @param {google.cloud.retail.v2alpha.IImportMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ImportMetadata} ImportMetadata instance */ - UserEvent.create = function create(properties) { - return new UserEvent(properties); + ImportMetadata.create = function create(properties) { + return new ImportMetadata(properties); }; /** - * Encodes the specified UserEvent message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEvent.verify|verify} messages. + * Encodes the specified ImportMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @static - * @param {google.cloud.retail.v2alpha.IUserEvent} message UserEvent message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportMetadata} message ImportMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEvent.encode = function encode(message, writer) { + ImportMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventType); - if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.visitorId); - if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.experimentIds != null && message.experimentIds.length) - for (var i = 0; i < message.experimentIds.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.experimentIds[i]); - if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.attributionToken); - if (message.productDetails != null && message.productDetails.length) - for (var i = 0; i < message.productDetails.length; ++i) - $root.google.cloud.retail.v2alpha.ProductDetail.encode(message.productDetails[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.retail.v2alpha.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.cartId != null && Object.hasOwnProperty.call(message, "cartId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.cartId); - if (message.purchaseTransaction != null && Object.hasOwnProperty.call(message, "purchaseTransaction")) - $root.google.cloud.retail.v2alpha.PurchaseTransaction.encode(message.purchaseTransaction, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.searchQuery != null && Object.hasOwnProperty.call(message, "searchQuery")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.searchQuery); - if (message.pageCategories != null && message.pageCategories.length) - for (var i = 0; i < message.pageCategories.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.pageCategories[i]); - if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) - $root.google.cloud.retail.v2alpha.UserInfo.encode(message.userInfo, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.uri); - if (message.referrerUri != null && Object.hasOwnProperty.call(message, "referrerUri")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.referrerUri); - if (message.pageViewId != null && Object.hasOwnProperty.call(message, "pageViewId")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.pageViewId); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.orderBy); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 18, wireType 0 =*/144).int32(message.offset); - if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) - writer.uint32(/* id 21, wireType 2 =*/170).string(message.sessionId); - if (message.completionDetail != null && Object.hasOwnProperty.call(message, "completionDetail")) - $root.google.cloud.retail.v2alpha.CompletionDetail.encode(message.completionDetail, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.successCount); + if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failureCount); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + 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); return writer; }; /** - * Encodes the specified UserEvent message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEvent.verify|verify} messages. + * Encodes the specified ImportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @static - * @param {google.cloud.retail.v2alpha.IUserEvent} message UserEvent message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportMetadata} message ImportMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEvent.encodeDelimited = function encodeDelimited(message, writer) { + ImportMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserEvent message from the specified reader or buffer. + * Decodes an ImportMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @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.UserEvent} UserEvent + * @returns {google.cloud.retail.v2alpha.ImportMetadata} ImportMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEvent.decode = function decode(reader, length) { + ImportMetadata.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.UserEvent(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.eventType = reader.string(); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 2: - message.visitorId = reader.string(); - break; - case 21: - message.sessionId = reader.string(); + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 3: - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.successCount = reader.int64(); break; case 4: - if (!(message.experimentIds && message.experimentIds.length)) - message.experimentIds = []; - message.experimentIds.push(reader.string()); + message.failureCount = reader.int64(); break; case 5: - message.attributionToken = reader.string(); + message.requestId = reader.string(); break; case 6: - if (!(message.productDetails && message.productDetails.length)) - message.productDetails = []; - message.productDetails.push($root.google.cloud.retail.v2alpha.ProductDetail.decode(reader, reader.uint32())); - break; - case 22: - message.completionDetail = $root.google.cloud.retail.v2alpha.CompletionDetail.decode(reader, reader.uint32()); - break; - case 7: - if (message.attributes === $util.emptyObject) - message.attributes = {}; - 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.CustomAttribute.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributes[key] = value; - break; - case 8: - message.cartId = reader.string(); - break; - case 9: - message.purchaseTransaction = $root.google.cloud.retail.v2alpha.PurchaseTransaction.decode(reader, reader.uint32()); - break; - case 10: - message.searchQuery = reader.string(); - break; - case 16: - message.filter = reader.string(); - break; - case 17: - message.orderBy = reader.string(); - break; - case 18: - message.offset = reader.int32(); - break; - case 11: - if (!(message.pageCategories && message.pageCategories.length)) - message.pageCategories = []; - message.pageCategories.push(reader.string()); - break; - case 12: - message.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.decode(reader, reader.uint32()); - break; - case 13: - message.uri = reader.string(); - break; - case 14: - message.referrerUri = reader.string(); - break; - case 15: - message.pageViewId = reader.string(); + message.notificationPubsubTopic = reader.string(); break; default: reader.skipType(tag & 7); @@ -35934,344 +35107,188 @@ }; /** - * Decodes a UserEvent message from the specified reader or buffer, length delimited. + * Decodes an ImportMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.UserEvent} UserEvent + * @returns {google.cloud.retail.v2alpha.ImportMetadata} ImportMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEvent.decodeDelimited = function decodeDelimited(reader) { + ImportMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserEvent message. + * Verifies an ImportMetadata message. * @function verify - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserEvent.verify = function verify(message) { + ImportMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.eventType != null && message.hasOwnProperty("eventType")) - if (!$util.isString(message.eventType)) - return "eventType: string expected"; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - if (!$util.isString(message.visitorId)) - return "visitorId: string expected"; - if (message.sessionId != null && message.hasOwnProperty("sessionId")) - if (!$util.isString(message.sessionId)) - return "sessionId: string expected"; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } - if (message.experimentIds != null && message.hasOwnProperty("experimentIds")) { - if (!Array.isArray(message.experimentIds)) - return "experimentIds: array expected"; - for (var i = 0; i < message.experimentIds.length; ++i) - if (!$util.isString(message.experimentIds[i])) - return "experimentIds: string[] expected"; - } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - if (!$util.isString(message.attributionToken)) - return "attributionToken: string expected"; - if (message.productDetails != null && message.hasOwnProperty("productDetails")) { - if (!Array.isArray(message.productDetails)) - return "productDetails: array expected"; - for (var i = 0; i < message.productDetails.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.ProductDetail.verify(message.productDetails[i]); - if (error) - return "productDetails." + error; - } - } - if (message.completionDetail != null && message.hasOwnProperty("completionDetail")) { - var error = $root.google.cloud.retail.v2alpha.CompletionDetail.verify(message.completionDetail); - if (error) - return "completionDetail." + error; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.CustomAttribute.verify(message.attributes[key[i]]); - if (error) - return "attributes." + error; - } - } - if (message.cartId != null && message.hasOwnProperty("cartId")) - if (!$util.isString(message.cartId)) - return "cartId: string expected"; - if (message.purchaseTransaction != null && message.hasOwnProperty("purchaseTransaction")) { - var error = $root.google.cloud.retail.v2alpha.PurchaseTransaction.verify(message.purchaseTransaction); + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); if (error) - return "purchaseTransaction." + error; - } - if (message.searchQuery != null && message.hasOwnProperty("searchQuery")) - if (!$util.isString(message.searchQuery)) - return "searchQuery: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset)) - return "offset: integer expected"; - if (message.pageCategories != null && message.hasOwnProperty("pageCategories")) { - if (!Array.isArray(message.pageCategories)) - return "pageCategories: array expected"; - for (var i = 0; i < message.pageCategories.length; ++i) - if (!$util.isString(message.pageCategories[i])) - return "pageCategories: string[] expected"; + return "createTime." + error; } - if (message.userInfo != null && message.hasOwnProperty("userInfo")) { - var error = $root.google.cloud.retail.v2alpha.UserInfo.verify(message.userInfo); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); if (error) - return "userInfo." + error; + return "updateTime." + error; } - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - if (message.referrerUri != null && message.hasOwnProperty("referrerUri")) - if (!$util.isString(message.referrerUri)) - return "referrerUri: string expected"; - if (message.pageViewId != null && message.hasOwnProperty("pageViewId")) - if (!$util.isString(message.pageViewId)) - return "pageViewId: string expected"; + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) + return "successCount: integer|Long expected"; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) + return "failureCount: integer|Long expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + if (!$util.isString(message.notificationPubsubTopic)) + return "notificationPubsubTopic: string expected"; return null; }; /** - * Creates a UserEvent message from a plain object. Also converts values to their respective internal types. + * Creates an ImportMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.UserEvent} UserEvent + * @returns {google.cloud.retail.v2alpha.ImportMetadata} ImportMetadata */ - UserEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.UserEvent) + ImportMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ImportMetadata) return object; - var message = new $root.google.cloud.retail.v2alpha.UserEvent(); - if (object.eventType != null) - message.eventType = String(object.eventType); - if (object.visitorId != null) - message.visitorId = String(object.visitorId); - if (object.sessionId != null) - message.sessionId = String(object.sessionId); - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } - if (object.experimentIds) { - if (!Array.isArray(object.experimentIds)) - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.experimentIds: array expected"); - message.experimentIds = []; - for (var i = 0; i < object.experimentIds.length; ++i) - message.experimentIds[i] = String(object.experimentIds[i]); - } - if (object.attributionToken != null) - message.attributionToken = String(object.attributionToken); - if (object.productDetails) { - if (!Array.isArray(object.productDetails)) - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.productDetails: array expected"); - message.productDetails = []; - for (var i = 0; i < object.productDetails.length; ++i) { - if (typeof object.productDetails[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.productDetails: object expected"); - message.productDetails[i] = $root.google.cloud.retail.v2alpha.ProductDetail.fromObject(object.productDetails[i]); - } - } - if (object.completionDetail != null) { - if (typeof object.completionDetail !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.completionDetail: object expected"); - message.completionDetail = $root.google.cloud.retail.v2alpha.CompletionDetail.fromObject(object.completionDetail); - } - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { - if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.attributes: object expected"); - message.attributes[keys[i]] = $root.google.cloud.retail.v2alpha.CustomAttribute.fromObject(object.attributes[keys[i]]); - } - } - if (object.cartId != null) - message.cartId = String(object.cartId); - if (object.purchaseTransaction != null) { - if (typeof object.purchaseTransaction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.purchaseTransaction: object expected"); - message.purchaseTransaction = $root.google.cloud.retail.v2alpha.PurchaseTransaction.fromObject(object.purchaseTransaction); - } - if (object.searchQuery != null) - message.searchQuery = String(object.searchQuery); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.offset != null) - message.offset = object.offset | 0; - if (object.pageCategories) { - if (!Array.isArray(object.pageCategories)) - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.pageCategories: array expected"); - message.pageCategories = []; - for (var i = 0; i < object.pageCategories.length; ++i) - message.pageCategories[i] = String(object.pageCategories[i]); + var message = new $root.google.cloud.retail.v2alpha.ImportMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } - if (object.userInfo != null) { - if (typeof object.userInfo !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.userInfo: object expected"); - message.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.fromObject(object.userInfo); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } - if (object.uri != null) - message.uri = String(object.uri); - if (object.referrerUri != null) - message.referrerUri = String(object.referrerUri); - if (object.pageViewId != null) - message.pageViewId = String(object.pageViewId); + if (object.successCount != null) + if ($util.Long) + (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; + else if (typeof object.successCount === "string") + message.successCount = parseInt(object.successCount, 10); + else if (typeof object.successCount === "number") + message.successCount = object.successCount; + else if (typeof object.successCount === "object") + message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); + if (object.failureCount != null) + if ($util.Long) + (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; + else if (typeof object.failureCount === "string") + message.failureCount = parseInt(object.failureCount, 10); + else if (typeof object.failureCount === "number") + message.failureCount = object.failureCount; + else if (typeof object.failureCount === "object") + message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.notificationPubsubTopic != null) + message.notificationPubsubTopic = String(object.notificationPubsubTopic); return message; }; /** - * Creates a plain object from a UserEvent message. Also converts values to other types if specified. + * Creates a plain object from an ImportMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @static - * @param {google.cloud.retail.v2alpha.UserEvent} message UserEvent + * @param {google.cloud.retail.v2alpha.ImportMetadata} message ImportMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserEvent.toObject = function toObject(message, options) { + ImportMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.experimentIds = []; - object.productDetails = []; - object.pageCategories = []; - } - if (options.objects || options.defaults) - object.attributes = {}; if (options.defaults) { - object.eventType = ""; - object.visitorId = ""; - object.eventTime = null; - object.attributionToken = ""; - object.cartId = ""; - object.purchaseTransaction = null; - object.searchQuery = ""; - object.userInfo = null; - object.uri = ""; - object.referrerUri = ""; - object.pageViewId = ""; - object.filter = ""; - object.orderBy = ""; - object.offset = 0; - object.sessionId = ""; - object.completionDetail = null; - } - if (message.eventType != null && message.hasOwnProperty("eventType")) - object.eventType = message.eventType; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - object.visitorId = message.visitorId; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - if (message.experimentIds && message.experimentIds.length) { - object.experimentIds = []; - for (var j = 0; j < message.experimentIds.length; ++j) - object.experimentIds[j] = message.experimentIds[j]; - } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - object.attributionToken = message.attributionToken; - if (message.productDetails && message.productDetails.length) { - object.productDetails = []; - for (var j = 0; j < message.productDetails.length; ++j) - object.productDetails[j] = $root.google.cloud.retail.v2alpha.ProductDetail.toObject(message.productDetails[j], options); - } - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = $root.google.cloud.retail.v2alpha.CustomAttribute.toObject(message.attributes[keys2[j]], options); - } - if (message.cartId != null && message.hasOwnProperty("cartId")) - object.cartId = message.cartId; - if (message.purchaseTransaction != null && message.hasOwnProperty("purchaseTransaction")) - object.purchaseTransaction = $root.google.cloud.retail.v2alpha.PurchaseTransaction.toObject(message.purchaseTransaction, options); - if (message.searchQuery != null && message.hasOwnProperty("searchQuery")) - object.searchQuery = message.searchQuery; - if (message.pageCategories && message.pageCategories.length) { - object.pageCategories = []; - for (var j = 0; j < message.pageCategories.length; ++j) - object.pageCategories[j] = message.pageCategories[j]; + object.createTime = null; + object.updateTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.successCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failureCount = options.longs === String ? "0" : 0; + object.requestId = ""; + object.notificationPubsubTopic = ""; } - if (message.userInfo != null && message.hasOwnProperty("userInfo")) - object.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.toObject(message.userInfo, options); - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - if (message.referrerUri != null && message.hasOwnProperty("referrerUri")) - object.referrerUri = message.referrerUri; - if (message.pageViewId != null && message.hasOwnProperty("pageViewId")) - object.pageViewId = message.pageViewId; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = message.offset; - if (message.sessionId != null && message.hasOwnProperty("sessionId")) - object.sessionId = message.sessionId; - if (message.completionDetail != null && message.hasOwnProperty("completionDetail")) - object.completionDetail = $root.google.cloud.retail.v2alpha.CompletionDetail.toObject(message.completionDetail, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (typeof message.successCount === "number") + object.successCount = options.longs === String ? String(message.successCount) : message.successCount; + else + object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (typeof message.failureCount === "number") + object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; + else + object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + object.notificationPubsubTopic = message.notificationPubsubTopic; return object; }; /** - * Converts this UserEvent to JSON. + * Converts this ImportMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @instance * @returns {Object.} JSON object */ - UserEvent.prototype.toJSON = function toJSON() { + ImportMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UserEvent; + return ImportMetadata; })(); - v2alpha.ProductDetail = (function() { + v2alpha.ImportProductsResponse = (function() { /** - * Properties of a ProductDetail. + * Properties of an ImportProductsResponse. * @memberof google.cloud.retail.v2alpha - * @interface IProductDetail - * @property {google.cloud.retail.v2alpha.IProduct|null} [product] ProductDetail product - * @property {google.protobuf.IInt32Value|null} [quantity] ProductDetail quantity + * @interface IImportProductsResponse + * @property {Array.|null} [errorSamples] ImportProductsResponse errorSamples + * @property {google.cloud.retail.v2alpha.IImportErrorsConfig|null} [errorsConfig] ImportProductsResponse errorsConfig */ /** - * Constructs a new ProductDetail. + * Constructs a new ImportProductsResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ProductDetail. - * @implements IProductDetail + * @classdesc Represents an ImportProductsResponse. + * @implements IImportProductsResponse * @constructor - * @param {google.cloud.retail.v2alpha.IProductDetail=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IImportProductsResponse=} [properties] Properties to set */ - function ProductDetail(properties) { + function ImportProductsResponse(properties) { + this.errorSamples = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -36279,88 +35296,91 @@ } /** - * ProductDetail product. - * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} product - * @memberof google.cloud.retail.v2alpha.ProductDetail + * ImportProductsResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @instance */ - ProductDetail.prototype.product = null; + ImportProductsResponse.prototype.errorSamples = $util.emptyArray; /** - * ProductDetail quantity. - * @member {google.protobuf.IInt32Value|null|undefined} quantity - * @memberof google.cloud.retail.v2alpha.ProductDetail + * ImportProductsResponse errorsConfig. + * @member {google.cloud.retail.v2alpha.IImportErrorsConfig|null|undefined} errorsConfig + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @instance */ - ProductDetail.prototype.quantity = null; + ImportProductsResponse.prototype.errorsConfig = null; /** - * Creates a new ProductDetail instance using the specified properties. + * Creates a new ImportProductsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @static - * @param {google.cloud.retail.v2alpha.IProductDetail=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ProductDetail} ProductDetail instance + * @param {google.cloud.retail.v2alpha.IImportProductsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ImportProductsResponse} ImportProductsResponse instance */ - ProductDetail.create = function create(properties) { - return new ProductDetail(properties); + ImportProductsResponse.create = function create(properties) { + return new ImportProductsResponse(properties); }; /** - * Encodes the specified ProductDetail message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductDetail.verify|verify} messages. + * Encodes the specified ImportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @static - * @param {google.cloud.retail.v2alpha.IProductDetail} message ProductDetail message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportProductsResponse} message ImportProductsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductDetail.encode = function encode(message, writer) { + ImportProductsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - $root.google.cloud.retail.v2alpha.Product.encode(message.product, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) - $root.google.protobuf.Int32Value.encode(message.quantity, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) + $root.google.cloud.retail.v2alpha.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ProductDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductDetail.verify|verify} messages. + * Encodes the specified ImportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @static - * @param {google.cloud.retail.v2alpha.IProductDetail} message ProductDetail message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportProductsResponse} message ImportProductsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductDetail.encodeDelimited = function encodeDelimited(message, writer) { + ImportProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ProductDetail message from the specified reader or buffer. + * Decodes an ImportProductsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @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.ProductDetail} ProductDetail + * @returns {google.cloud.retail.v2alpha.ImportProductsResponse} ImportProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductDetail.decode = function decode(reader, length) { + ImportProductsResponse.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.ProductDetail(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportProductsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.product = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); break; case 2: - message.quantity = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); + message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -36371,128 +35391,141 @@ }; /** - * Decodes a ProductDetail message from the specified reader or buffer, length delimited. + * Decodes an ImportProductsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ProductDetail} ProductDetail + * @returns {google.cloud.retail.v2alpha.ImportProductsResponse} ImportProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductDetail.decodeDelimited = function decodeDelimited(reader) { + ImportProductsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ProductDetail message. + * Verifies an ImportProductsResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ProductDetail.verify = function verify(message) { + ImportProductsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.product != null && message.hasOwnProperty("product")) { - var error = $root.google.cloud.retail.v2alpha.Product.verify(message.product); - if (error) - return "product." + error; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } } - if (message.quantity != null && message.hasOwnProperty("quantity")) { - var error = $root.google.protobuf.Int32Value.verify(message.quantity); + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { + var error = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.verify(message.errorsConfig); if (error) - return "quantity." + error; + return "errorsConfig." + error; } return null; }; /** - * Creates a ProductDetail message from a plain object. Also converts values to their respective internal types. + * Creates an ImportProductsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ProductDetail} ProductDetail + * @returns {google.cloud.retail.v2alpha.ImportProductsResponse} ImportProductsResponse */ - ProductDetail.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ProductDetail) + ImportProductsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ImportProductsResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.ProductDetail(); - if (object.product != null) { - if (typeof object.product !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ProductDetail.product: object expected"); - message.product = $root.google.cloud.retail.v2alpha.Product.fromObject(object.product); + var message = new $root.google.cloud.retail.v2alpha.ImportProductsResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.retail.v2alpha.ImportProductsResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportProductsResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } } - if (object.quantity != null) { - if (typeof object.quantity !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ProductDetail.quantity: object expected"); - message.quantity = $root.google.protobuf.Int32Value.fromObject(object.quantity); + if (object.errorsConfig != null) { + if (typeof object.errorsConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportProductsResponse.errorsConfig: object expected"); + message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.fromObject(object.errorsConfig); } return message; }; /** - * Creates a plain object from a ProductDetail message. Also converts values to other types if specified. + * Creates a plain object from an ImportProductsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @static - * @param {google.cloud.retail.v2alpha.ProductDetail} message ProductDetail + * @param {google.cloud.retail.v2alpha.ImportProductsResponse} message ImportProductsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ProductDetail.toObject = function toObject(message, options) { + ImportProductsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.product = null; - object.quantity = null; + if (options.arrays || options.defaults) + object.errorSamples = []; + if (options.defaults) + object.errorsConfig = null; + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); } - if (message.product != null && message.hasOwnProperty("product")) - object.product = $root.google.cloud.retail.v2alpha.Product.toObject(message.product, options); - if (message.quantity != null && message.hasOwnProperty("quantity")) - object.quantity = $root.google.protobuf.Int32Value.toObject(message.quantity, options); + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) + object.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.toObject(message.errorsConfig, options); return object; }; /** - * Converts this ProductDetail to JSON. + * Converts this ImportProductsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @instance * @returns {Object.} JSON object */ - ProductDetail.prototype.toJSON = function toJSON() { + ImportProductsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ProductDetail; + return ImportProductsResponse; })(); - v2alpha.CompletionDetail = (function() { + v2alpha.ImportUserEventsResponse = (function() { /** - * Properties of a CompletionDetail. + * Properties of an ImportUserEventsResponse. * @memberof google.cloud.retail.v2alpha - * @interface ICompletionDetail - * @property {string|null} [completionAttributionToken] CompletionDetail completionAttributionToken - * @property {string|null} [selectedSuggestion] CompletionDetail selectedSuggestion - * @property {number|null} [selectedPosition] CompletionDetail selectedPosition + * @interface IImportUserEventsResponse + * @property {Array.|null} [errorSamples] ImportUserEventsResponse errorSamples + * @property {google.cloud.retail.v2alpha.IImportErrorsConfig|null} [errorsConfig] ImportUserEventsResponse errorsConfig + * @property {google.cloud.retail.v2alpha.IUserEventImportSummary|null} [importSummary] ImportUserEventsResponse importSummary */ /** - * Constructs a new CompletionDetail. + * Constructs a new ImportUserEventsResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CompletionDetail. - * @implements ICompletionDetail + * @classdesc Represents an ImportUserEventsResponse. + * @implements IImportUserEventsResponse * @constructor - * @param {google.cloud.retail.v2alpha.ICompletionDetail=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IImportUserEventsResponse=} [properties] Properties to set */ - function CompletionDetail(properties) { + function ImportUserEventsResponse(properties) { + this.errorSamples = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -36500,101 +35533,104 @@ } /** - * CompletionDetail completionAttributionToken. - * @member {string} completionAttributionToken - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * ImportUserEventsResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @instance */ - CompletionDetail.prototype.completionAttributionToken = ""; + ImportUserEventsResponse.prototype.errorSamples = $util.emptyArray; /** - * CompletionDetail selectedSuggestion. - * @member {string} selectedSuggestion - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * ImportUserEventsResponse errorsConfig. + * @member {google.cloud.retail.v2alpha.IImportErrorsConfig|null|undefined} errorsConfig + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @instance */ - CompletionDetail.prototype.selectedSuggestion = ""; + ImportUserEventsResponse.prototype.errorsConfig = null; /** - * CompletionDetail selectedPosition. - * @member {number} selectedPosition - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * ImportUserEventsResponse importSummary. + * @member {google.cloud.retail.v2alpha.IUserEventImportSummary|null|undefined} importSummary + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @instance */ - CompletionDetail.prototype.selectedPosition = 0; + ImportUserEventsResponse.prototype.importSummary = null; /** - * Creates a new CompletionDetail instance using the specified properties. + * Creates a new ImportUserEventsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.ICompletionDetail=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CompletionDetail} CompletionDetail instance + * @param {google.cloud.retail.v2alpha.IImportUserEventsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ImportUserEventsResponse} ImportUserEventsResponse instance */ - CompletionDetail.create = function create(properties) { - return new CompletionDetail(properties); + ImportUserEventsResponse.create = function create(properties) { + return new ImportUserEventsResponse(properties); }; /** - * Encodes the specified CompletionDetail message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDetail.verify|verify} messages. + * Encodes the specified ImportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.ICompletionDetail} message CompletionDetail message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompletionDetail.encode = function encode(message, writer) { + ImportUserEventsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.completionAttributionToken != null && Object.hasOwnProperty.call(message, "completionAttributionToken")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.completionAttributionToken); - if (message.selectedSuggestion != null && Object.hasOwnProperty.call(message, "selectedSuggestion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.selectedSuggestion); - if (message.selectedPosition != null && Object.hasOwnProperty.call(message, "selectedPosition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.selectedPosition); + if (message.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) + $root.google.cloud.retail.v2alpha.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.importSummary != null && Object.hasOwnProperty.call(message, "importSummary")) + $root.google.cloud.retail.v2alpha.UserEventImportSummary.encode(message.importSummary, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified CompletionDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDetail.verify|verify} messages. + * Encodes the specified ImportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.ICompletionDetail} message CompletionDetail message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompletionDetail.encodeDelimited = function encodeDelimited(message, writer) { + ImportUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CompletionDetail message from the specified reader or buffer. + * Decodes an ImportUserEventsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @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.CompletionDetail} CompletionDetail + * @returns {google.cloud.retail.v2alpha.ImportUserEventsResponse} ImportUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompletionDetail.decode = function decode(reader, length) { + ImportUserEventsResponse.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.CompletionDetail(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportUserEventsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.completionAttributionToken = reader.string(); + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); break; case 2: - message.selectedSuggestion = reader.string(); + message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.decode(reader, reader.uint32()); break; case 3: - message.selectedPosition = reader.int32(); + message.importSummary = $root.google.cloud.retail.v2alpha.UserEventImportSummary.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -36605,128 +35641,153 @@ }; /** - * Decodes a CompletionDetail message from the specified reader or buffer, length delimited. + * Decodes an ImportUserEventsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CompletionDetail} CompletionDetail + * @returns {google.cloud.retail.v2alpha.ImportUserEventsResponse} ImportUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompletionDetail.decodeDelimited = function decodeDelimited(reader) { + ImportUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CompletionDetail message. + * Verifies an ImportUserEventsResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CompletionDetail.verify = function verify(message) { + ImportUserEventsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.completionAttributionToken != null && message.hasOwnProperty("completionAttributionToken")) - if (!$util.isString(message.completionAttributionToken)) - return "completionAttributionToken: string expected"; - if (message.selectedSuggestion != null && message.hasOwnProperty("selectedSuggestion")) - if (!$util.isString(message.selectedSuggestion)) - return "selectedSuggestion: string expected"; - if (message.selectedPosition != null && message.hasOwnProperty("selectedPosition")) - if (!$util.isInteger(message.selectedPosition)) - return "selectedPosition: integer expected"; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } + } + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { + var error = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.verify(message.errorsConfig); + if (error) + return "errorsConfig." + error; + } + if (message.importSummary != null && message.hasOwnProperty("importSummary")) { + var error = $root.google.cloud.retail.v2alpha.UserEventImportSummary.verify(message.importSummary); + if (error) + return "importSummary." + error; + } return null; }; /** - * Creates a CompletionDetail message from a plain object. Also converts values to their respective internal types. + * Creates an ImportUserEventsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CompletionDetail} CompletionDetail + * @returns {google.cloud.retail.v2alpha.ImportUserEventsResponse} ImportUserEventsResponse */ - CompletionDetail.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CompletionDetail) + ImportUserEventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ImportUserEventsResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.CompletionDetail(); - if (object.completionAttributionToken != null) - message.completionAttributionToken = String(object.completionAttributionToken); - if (object.selectedSuggestion != null) - message.selectedSuggestion = String(object.selectedSuggestion); - if (object.selectedPosition != null) - message.selectedPosition = object.selectedPosition | 0; + var message = new $root.google.cloud.retail.v2alpha.ImportUserEventsResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } + } + if (object.errorsConfig != null) { + if (typeof object.errorsConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsResponse.errorsConfig: object expected"); + message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.fromObject(object.errorsConfig); + } + if (object.importSummary != null) { + if (typeof object.importSummary !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsResponse.importSummary: object expected"); + message.importSummary = $root.google.cloud.retail.v2alpha.UserEventImportSummary.fromObject(object.importSummary); + } return message; }; /** - * Creates a plain object from a CompletionDetail message. Also converts values to other types if specified. + * Creates a plain object from an ImportUserEventsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.CompletionDetail} message CompletionDetail + * @param {google.cloud.retail.v2alpha.ImportUserEventsResponse} message ImportUserEventsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CompletionDetail.toObject = function toObject(message, options) { + ImportUserEventsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.errorSamples = []; if (options.defaults) { - object.completionAttributionToken = ""; - object.selectedSuggestion = ""; - object.selectedPosition = 0; + object.errorsConfig = null; + object.importSummary = null; } - if (message.completionAttributionToken != null && message.hasOwnProperty("completionAttributionToken")) - object.completionAttributionToken = message.completionAttributionToken; - if (message.selectedSuggestion != null && message.hasOwnProperty("selectedSuggestion")) - object.selectedSuggestion = message.selectedSuggestion; - if (message.selectedPosition != null && message.hasOwnProperty("selectedPosition")) - object.selectedPosition = message.selectedPosition; + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + } + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) + object.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.toObject(message.errorsConfig, options); + if (message.importSummary != null && message.hasOwnProperty("importSummary")) + object.importSummary = $root.google.cloud.retail.v2alpha.UserEventImportSummary.toObject(message.importSummary, options); return object; }; /** - * Converts this CompletionDetail to JSON. + * Converts this ImportUserEventsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @instance * @returns {Object.} JSON object */ - CompletionDetail.prototype.toJSON = function toJSON() { + ImportUserEventsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CompletionDetail; + return ImportUserEventsResponse; })(); - v2alpha.PurchaseTransaction = (function() { + v2alpha.UserEventImportSummary = (function() { /** - * Properties of a PurchaseTransaction. + * Properties of a UserEventImportSummary. * @memberof google.cloud.retail.v2alpha - * @interface IPurchaseTransaction - * @property {string|null} [id] PurchaseTransaction id - * @property {number|null} [revenue] PurchaseTransaction revenue - * @property {number|null} [tax] PurchaseTransaction tax - * @property {number|null} [cost] PurchaseTransaction cost - * @property {string|null} [currencyCode] PurchaseTransaction currencyCode + * @interface IUserEventImportSummary + * @property {number|Long|null} [joinedEventsCount] UserEventImportSummary joinedEventsCount + * @property {number|Long|null} [unjoinedEventsCount] UserEventImportSummary unjoinedEventsCount */ /** - * Constructs a new PurchaseTransaction. + * Constructs a new UserEventImportSummary. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PurchaseTransaction. - * @implements IPurchaseTransaction + * @classdesc Represents a UserEventImportSummary. + * @implements IUserEventImportSummary * @constructor - * @param {google.cloud.retail.v2alpha.IPurchaseTransaction=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IUserEventImportSummary=} [properties] Properties to set */ - function PurchaseTransaction(properties) { + function UserEventImportSummary(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -36734,127 +35795,88 @@ } /** - * PurchaseTransaction id. - * @member {string} id - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction - * @instance - */ - PurchaseTransaction.prototype.id = ""; - - /** - * PurchaseTransaction revenue. - * @member {number} revenue - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction - * @instance - */ - PurchaseTransaction.prototype.revenue = 0; - - /** - * PurchaseTransaction tax. - * @member {number} tax - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction - * @instance - */ - PurchaseTransaction.prototype.tax = 0; - - /** - * PurchaseTransaction cost. - * @member {number} cost - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * UserEventImportSummary joinedEventsCount. + * @member {number|Long} joinedEventsCount + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @instance */ - PurchaseTransaction.prototype.cost = 0; + UserEventImportSummary.prototype.joinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * PurchaseTransaction currencyCode. - * @member {string} currencyCode - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * UserEventImportSummary unjoinedEventsCount. + * @member {number|Long} unjoinedEventsCount + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @instance */ - PurchaseTransaction.prototype.currencyCode = ""; + UserEventImportSummary.prototype.unjoinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new PurchaseTransaction instance using the specified properties. + * Creates a new UserEventImportSummary instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @static - * @param {google.cloud.retail.v2alpha.IPurchaseTransaction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PurchaseTransaction} PurchaseTransaction instance + * @param {google.cloud.retail.v2alpha.IUserEventImportSummary=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UserEventImportSummary} UserEventImportSummary instance */ - PurchaseTransaction.create = function create(properties) { - return new PurchaseTransaction(properties); + UserEventImportSummary.create = function create(properties) { + return new UserEventImportSummary(properties); }; /** - * Encodes the specified PurchaseTransaction message. Does not implicitly {@link google.cloud.retail.v2alpha.PurchaseTransaction.verify|verify} messages. + * Encodes the specified UserEventImportSummary message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventImportSummary.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @static - * @param {google.cloud.retail.v2alpha.IPurchaseTransaction} message PurchaseTransaction message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUserEventImportSummary} message UserEventImportSummary message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurchaseTransaction.encode = function encode(message, writer) { + UserEventImportSummary.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.revenue != null && Object.hasOwnProperty.call(message, "revenue")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.revenue); - if (message.tax != null && Object.hasOwnProperty.call(message, "tax")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.tax); - if (message.cost != null && Object.hasOwnProperty.call(message, "cost")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.cost); - if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.currencyCode); + if (message.joinedEventsCount != null && Object.hasOwnProperty.call(message, "joinedEventsCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.joinedEventsCount); + if (message.unjoinedEventsCount != null && Object.hasOwnProperty.call(message, "unjoinedEventsCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.unjoinedEventsCount); return writer; }; /** - * Encodes the specified PurchaseTransaction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurchaseTransaction.verify|verify} messages. + * Encodes the specified UserEventImportSummary message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventImportSummary.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @static - * @param {google.cloud.retail.v2alpha.IPurchaseTransaction} message PurchaseTransaction message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUserEventImportSummary} message UserEventImportSummary message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurchaseTransaction.encodeDelimited = function encodeDelimited(message, writer) { + UserEventImportSummary.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PurchaseTransaction message from the specified reader or buffer. + * Decodes a UserEventImportSummary message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @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.PurchaseTransaction} PurchaseTransaction + * @returns {google.cloud.retail.v2alpha.UserEventImportSummary} UserEventImportSummary * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurchaseTransaction.decode = function decode(reader, length) { + UserEventImportSummary.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.PurchaseTransaction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UserEventImportSummary(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.string(); + message.joinedEventsCount = reader.int64(); break; case 2: - message.revenue = reader.float(); - break; - case 3: - message.tax = reader.float(); - break; - case 4: - message.cost = reader.float(); - break; - case 5: - message.currencyCode = reader.string(); + message.unjoinedEventsCount = reader.int64(); break; default: reader.skipType(tag & 7); @@ -36865,309 +35887,145 @@ }; /** - * Decodes a PurchaseTransaction message from the specified reader or buffer, length delimited. + * Decodes a UserEventImportSummary message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PurchaseTransaction} PurchaseTransaction + * @returns {google.cloud.retail.v2alpha.UserEventImportSummary} UserEventImportSummary * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurchaseTransaction.decodeDelimited = function decodeDelimited(reader) { + UserEventImportSummary.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PurchaseTransaction message. + * Verifies a UserEventImportSummary message. * @function verify - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PurchaseTransaction.verify = function verify(message) { + UserEventImportSummary.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.revenue != null && message.hasOwnProperty("revenue")) - if (typeof message.revenue !== "number") - return "revenue: number expected"; - if (message.tax != null && message.hasOwnProperty("tax")) - if (typeof message.tax !== "number") - return "tax: number expected"; - if (message.cost != null && message.hasOwnProperty("cost")) - if (typeof message.cost !== "number") - return "cost: number expected"; - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - if (!$util.isString(message.currencyCode)) - return "currencyCode: string expected"; + if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) + if (!$util.isInteger(message.joinedEventsCount) && !(message.joinedEventsCount && $util.isInteger(message.joinedEventsCount.low) && $util.isInteger(message.joinedEventsCount.high))) + return "joinedEventsCount: integer|Long expected"; + if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) + if (!$util.isInteger(message.unjoinedEventsCount) && !(message.unjoinedEventsCount && $util.isInteger(message.unjoinedEventsCount.low) && $util.isInteger(message.unjoinedEventsCount.high))) + return "unjoinedEventsCount: integer|Long expected"; return null; }; /** - * Creates a PurchaseTransaction message from a plain object. Also converts values to their respective internal types. + * Creates a UserEventImportSummary message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PurchaseTransaction} PurchaseTransaction + * @returns {google.cloud.retail.v2alpha.UserEventImportSummary} UserEventImportSummary */ - PurchaseTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PurchaseTransaction) + UserEventImportSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UserEventImportSummary) return object; - var message = new $root.google.cloud.retail.v2alpha.PurchaseTransaction(); - if (object.id != null) - message.id = String(object.id); - if (object.revenue != null) - message.revenue = Number(object.revenue); - if (object.tax != null) - message.tax = Number(object.tax); - if (object.cost != null) - message.cost = Number(object.cost); - if (object.currencyCode != null) - message.currencyCode = String(object.currencyCode); + var message = new $root.google.cloud.retail.v2alpha.UserEventImportSummary(); + if (object.joinedEventsCount != null) + if ($util.Long) + (message.joinedEventsCount = $util.Long.fromValue(object.joinedEventsCount)).unsigned = false; + else if (typeof object.joinedEventsCount === "string") + message.joinedEventsCount = parseInt(object.joinedEventsCount, 10); + else if (typeof object.joinedEventsCount === "number") + message.joinedEventsCount = object.joinedEventsCount; + else if (typeof object.joinedEventsCount === "object") + message.joinedEventsCount = new $util.LongBits(object.joinedEventsCount.low >>> 0, object.joinedEventsCount.high >>> 0).toNumber(); + if (object.unjoinedEventsCount != null) + if ($util.Long) + (message.unjoinedEventsCount = $util.Long.fromValue(object.unjoinedEventsCount)).unsigned = false; + else if (typeof object.unjoinedEventsCount === "string") + message.unjoinedEventsCount = parseInt(object.unjoinedEventsCount, 10); + else if (typeof object.unjoinedEventsCount === "number") + message.unjoinedEventsCount = object.unjoinedEventsCount; + else if (typeof object.unjoinedEventsCount === "object") + message.unjoinedEventsCount = new $util.LongBits(object.unjoinedEventsCount.low >>> 0, object.unjoinedEventsCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a PurchaseTransaction message. Also converts values to other types if specified. + * Creates a plain object from a UserEventImportSummary message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @static - * @param {google.cloud.retail.v2alpha.PurchaseTransaction} message PurchaseTransaction + * @param {google.cloud.retail.v2alpha.UserEventImportSummary} message UserEventImportSummary * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PurchaseTransaction.toObject = function toObject(message, options) { + UserEventImportSummary.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.id = ""; - object.revenue = 0; - object.tax = 0; - object.cost = 0; - object.currencyCode = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.joinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.joinedEventsCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.unjoinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.unjoinedEventsCount = options.longs === String ? "0" : 0; } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.revenue != null && message.hasOwnProperty("revenue")) - object.revenue = options.json && !isFinite(message.revenue) ? String(message.revenue) : message.revenue; - if (message.tax != null && message.hasOwnProperty("tax")) - object.tax = options.json && !isFinite(message.tax) ? String(message.tax) : message.tax; - if (message.cost != null && message.hasOwnProperty("cost")) - object.cost = options.json && !isFinite(message.cost) ? String(message.cost) : message.cost; - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - object.currencyCode = message.currencyCode; + if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) + if (typeof message.joinedEventsCount === "number") + object.joinedEventsCount = options.longs === String ? String(message.joinedEventsCount) : message.joinedEventsCount; + else + object.joinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.joinedEventsCount) : options.longs === Number ? new $util.LongBits(message.joinedEventsCount.low >>> 0, message.joinedEventsCount.high >>> 0).toNumber() : message.joinedEventsCount; + if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) + if (typeof message.unjoinedEventsCount === "number") + object.unjoinedEventsCount = options.longs === String ? String(message.unjoinedEventsCount) : message.unjoinedEventsCount; + else + object.unjoinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.unjoinedEventsCount) : options.longs === Number ? new $util.LongBits(message.unjoinedEventsCount.low >>> 0, message.unjoinedEventsCount.high >>> 0).toNumber() : message.unjoinedEventsCount; return object; }; /** - * Converts this PurchaseTransaction to JSON. + * Converts this UserEventImportSummary to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @instance * @returns {Object.} JSON object */ - PurchaseTransaction.prototype.toJSON = function toJSON() { + UserEventImportSummary.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PurchaseTransaction; - })(); - - v2alpha.CatalogService = (function() { - - /** - * Constructs a new CatalogService service. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CatalogService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function CatalogService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (CatalogService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CatalogService; - - /** - * Creates new CatalogService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.retail.v2alpha.CatalogService - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {CatalogService} RPC service. Useful where requests and/or responses are streamed. - */ - CatalogService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService#listCatalogs}. - * @memberof google.cloud.retail.v2alpha.CatalogService - * @typedef ListCatalogsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.ListCatalogsResponse} [response] ListCatalogsResponse - */ - - /** - * Calls ListCatalogs. - * @function listCatalogs - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IListCatalogsRequest} request ListCatalogsRequest message or plain object - * @param {google.cloud.retail.v2alpha.CatalogService.ListCatalogsCallback} callback Node-style callback called with the error, if any, and ListCatalogsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CatalogService.prototype.listCatalogs = function listCatalogs(request, callback) { - return this.rpcCall(listCatalogs, $root.google.cloud.retail.v2alpha.ListCatalogsRequest, $root.google.cloud.retail.v2alpha.ListCatalogsResponse, request, callback); - }, "name", { value: "ListCatalogs" }); - - /** - * Calls ListCatalogs. - * @function listCatalogs - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IListCatalogsRequest} request ListCatalogsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService#updateCatalog}. - * @memberof google.cloud.retail.v2alpha.CatalogService - * @typedef UpdateCatalogCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.Catalog} [response] Catalog - */ - - /** - * Calls UpdateCatalog. - * @function updateCatalog - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest} request UpdateCatalogRequest message or plain object - * @param {google.cloud.retail.v2alpha.CatalogService.UpdateCatalogCallback} callback Node-style callback called with the error, if any, and Catalog - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CatalogService.prototype.updateCatalog = function updateCatalog(request, callback) { - return this.rpcCall(updateCatalog, $root.google.cloud.retail.v2alpha.UpdateCatalogRequest, $root.google.cloud.retail.v2alpha.Catalog, request, callback); - }, "name", { value: "UpdateCatalog" }); - - /** - * Calls UpdateCatalog. - * @function updateCatalog - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest} request UpdateCatalogRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService#setDefaultBranch}. - * @memberof google.cloud.retail.v2alpha.CatalogService - * @typedef SetDefaultBranchCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls SetDefaultBranch. - * @function setDefaultBranch - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest} request SetDefaultBranchRequest message or plain object - * @param {google.cloud.retail.v2alpha.CatalogService.SetDefaultBranchCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CatalogService.prototype.setDefaultBranch = function setDefaultBranch(request, callback) { - return this.rpcCall(setDefaultBranch, $root.google.cloud.retail.v2alpha.SetDefaultBranchRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "SetDefaultBranch" }); - - /** - * Calls SetDefaultBranch. - * @function setDefaultBranch - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest} request SetDefaultBranchRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService#getDefaultBranch}. - * @memberof google.cloud.retail.v2alpha.CatalogService - * @typedef GetDefaultBranchCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.GetDefaultBranchResponse} [response] GetDefaultBranchResponse - */ - - /** - * Calls GetDefaultBranch. - * @function getDefaultBranch - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest} request GetDefaultBranchRequest message or plain object - * @param {google.cloud.retail.v2alpha.CatalogService.GetDefaultBranchCallback} callback Node-style callback called with the error, if any, and GetDefaultBranchResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CatalogService.prototype.getDefaultBranch = function getDefaultBranch(request, callback) { - return this.rpcCall(getDefaultBranch, $root.google.cloud.retail.v2alpha.GetDefaultBranchRequest, $root.google.cloud.retail.v2alpha.GetDefaultBranchResponse, request, callback); - }, "name", { value: "GetDefaultBranch" }); - - /** - * Calls GetDefaultBranch. - * @function getDefaultBranch - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest} request GetDefaultBranchRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return CatalogService; + return UserEventImportSummary; })(); - v2alpha.ListCatalogsRequest = (function() { + v2alpha.ImportCompletionDataResponse = (function() { /** - * Properties of a ListCatalogsRequest. + * Properties of an ImportCompletionDataResponse. * @memberof google.cloud.retail.v2alpha - * @interface IListCatalogsRequest - * @property {string|null} [parent] ListCatalogsRequest parent - * @property {number|null} [pageSize] ListCatalogsRequest pageSize - * @property {string|null} [pageToken] ListCatalogsRequest pageToken + * @interface IImportCompletionDataResponse + * @property {Array.|null} [errorSamples] ImportCompletionDataResponse errorSamples */ /** - * Constructs a new ListCatalogsRequest. + * Constructs a new ImportCompletionDataResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ListCatalogsRequest. - * @implements IListCatalogsRequest + * @classdesc Represents an ImportCompletionDataResponse. + * @implements IImportCompletionDataResponse * @constructor - * @param {google.cloud.retail.v2alpha.IListCatalogsRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IImportCompletionDataResponse=} [properties] Properties to set */ - function ListCatalogsRequest(properties) { + function ImportCompletionDataResponse(properties) { + this.errorSamples = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -37175,101 +36033,78 @@ } /** - * ListCatalogsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest - * @instance - */ - ListCatalogsRequest.prototype.parent = ""; - - /** - * ListCatalogsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest - * @instance - */ - ListCatalogsRequest.prototype.pageSize = 0; - - /** - * ListCatalogsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * ImportCompletionDataResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @instance */ - ListCatalogsRequest.prototype.pageToken = ""; + ImportCompletionDataResponse.prototype.errorSamples = $util.emptyArray; /** - * Creates a new ListCatalogsRequest instance using the specified properties. + * Creates a new ImportCompletionDataResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @static - * @param {google.cloud.retail.v2alpha.IListCatalogsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ListCatalogsRequest} ListCatalogsRequest instance + * @param {google.cloud.retail.v2alpha.IImportCompletionDataResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ImportCompletionDataResponse} ImportCompletionDataResponse instance */ - ListCatalogsRequest.create = function create(properties) { - return new ListCatalogsRequest(properties); + ImportCompletionDataResponse.create = function create(properties) { + return new ImportCompletionDataResponse(properties); }; /** - * Encodes the specified ListCatalogsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsRequest.verify|verify} messages. + * Encodes the specified ImportCompletionDataResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @static - * @param {google.cloud.retail.v2alpha.IListCatalogsRequest} message ListCatalogsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportCompletionDataResponse} message ImportCompletionDataResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListCatalogsRequest.encode = function encode(message, writer) { + ImportCompletionDataResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListCatalogsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsRequest.verify|verify} messages. + * Encodes the specified ImportCompletionDataResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @static - * @param {google.cloud.retail.v2alpha.IListCatalogsRequest} message ListCatalogsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportCompletionDataResponse} message ImportCompletionDataResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListCatalogsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ImportCompletionDataResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListCatalogsRequest message from the specified reader or buffer. + * Decodes an ImportCompletionDataResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @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.ListCatalogsRequest} ListCatalogsRequest + * @returns {google.cloud.retail.v2alpha.ImportCompletionDataResponse} ImportCompletionDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListCatalogsRequest.decode = function decode(reader, length) { + ImportCompletionDataResponse.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.ListCatalogsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportCompletionDataResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -37280,126 +36115,169 @@ }; /** - * Decodes a ListCatalogsRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportCompletionDataResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ListCatalogsRequest} ListCatalogsRequest + * @returns {google.cloud.retail.v2alpha.ImportCompletionDataResponse} ImportCompletionDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListCatalogsRequest.decodeDelimited = function decodeDelimited(reader) { + ImportCompletionDataResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListCatalogsRequest message. + * Verifies an ImportCompletionDataResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListCatalogsRequest.verify = function verify(message) { + ImportCompletionDataResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } + } return null; }; /** - * Creates a ListCatalogsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImportCompletionDataResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ListCatalogsRequest} ListCatalogsRequest + * @returns {google.cloud.retail.v2alpha.ImportCompletionDataResponse} ImportCompletionDataResponse */ - ListCatalogsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ListCatalogsRequest) + ImportCompletionDataResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ImportCompletionDataResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.ListCatalogsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + var message = new $root.google.cloud.retail.v2alpha.ImportCompletionDataResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.retail.v2alpha.ImportCompletionDataResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportCompletionDataResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } + } return message; }; /** - * Creates a plain object from a ListCatalogsRequest message. Also converts values to other types if specified. + * Creates a plain object from an ImportCompletionDataResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @static - * @param {google.cloud.retail.v2alpha.ListCatalogsRequest} message ListCatalogsRequest + * @param {google.cloud.retail.v2alpha.ImportCompletionDataResponse} message ImportCompletionDataResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListCatalogsRequest.toObject = function toObject(message, options) { + ImportCompletionDataResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; + if (options.arrays || options.defaults) + object.errorSamples = []; + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; return object; }; /** - * Converts this ListCatalogsRequest to JSON. + * Converts this ImportCompletionDataResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @instance * @returns {Object.} JSON object */ - ListCatalogsRequest.prototype.toJSON = function toJSON() { + ImportCompletionDataResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListCatalogsRequest; + return ImportCompletionDataResponse; })(); - v2alpha.ListCatalogsResponse = (function() { + v2alpha.Product = (function() { /** - * Properties of a ListCatalogsResponse. + * Properties of a Product. * @memberof google.cloud.retail.v2alpha - * @interface IListCatalogsResponse - * @property {Array.|null} [catalogs] ListCatalogsResponse catalogs - * @property {string|null} [nextPageToken] ListCatalogsResponse nextPageToken + * @interface IProduct + * @property {google.protobuf.ITimestamp|null} [expireTime] Product expireTime + * @property {google.protobuf.IDuration|null} [ttl] Product ttl + * @property {string|null} [name] Product name + * @property {string|null} [id] Product id + * @property {google.cloud.retail.v2alpha.Product.Type|null} [type] Product type + * @property {string|null} [primaryProductId] Product primaryProductId + * @property {Array.|null} [collectionMemberIds] Product collectionMemberIds + * @property {string|null} [gtin] Product gtin + * @property {Array.|null} [categories] Product categories + * @property {string|null} [title] Product title + * @property {Array.|null} [brands] Product brands + * @property {string|null} [description] Product description + * @property {string|null} [languageCode] Product languageCode + * @property {Object.|null} [attributes] Product attributes + * @property {Array.|null} [tags] Product tags + * @property {google.cloud.retail.v2alpha.IPriceInfo|null} [priceInfo] Product priceInfo + * @property {google.cloud.retail.v2alpha.IRating|null} [rating] Product rating + * @property {google.protobuf.ITimestamp|null} [availableTime] Product availableTime + * @property {google.cloud.retail.v2alpha.Product.Availability|null} [availability] Product availability + * @property {google.protobuf.IInt32Value|null} [availableQuantity] Product availableQuantity + * @property {Array.|null} [fulfillmentInfo] Product fulfillmentInfo + * @property {string|null} [uri] Product uri + * @property {Array.|null} [images] Product images + * @property {google.cloud.retail.v2alpha.IAudience|null} [audience] Product audience + * @property {google.cloud.retail.v2alpha.IColorInfo|null} [colorInfo] Product colorInfo + * @property {Array.|null} [sizes] Product sizes + * @property {Array.|null} [materials] Product materials + * @property {Array.|null} [patterns] Product patterns + * @property {Array.|null} [conditions] Product conditions + * @property {Array.|null} [promotions] Product promotions + * @property {google.protobuf.ITimestamp|null} [publishTime] Product publishTime + * @property {google.protobuf.IFieldMask|null} [retrievableFields] Product retrievableFields + * @property {Array.|null} [variants] Product variants */ /** - * Constructs a new ListCatalogsResponse. + * Constructs a new Product. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ListCatalogsResponse. - * @implements IListCatalogsResponse + * @classdesc Represents a Product. + * @implements IProduct * @constructor - * @param {google.cloud.retail.v2alpha.IListCatalogsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IProduct=} [properties] Properties to set */ - function ListCatalogsResponse(properties) { - this.catalogs = []; + function Product(properties) { + this.collectionMemberIds = []; + this.categories = []; + this.brands = []; + this.attributes = {}; + this.tags = []; + this.fulfillmentInfo = []; + this.images = []; + this.sizes = []; + this.materials = []; + this.patterns = []; + this.conditions = []; + this.promotions = []; + this.variants = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -37407,756 +36285,563 @@ } /** - * ListCatalogsResponse catalogs. - * @member {Array.} catalogs - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse + * Product expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.retail.v2alpha.Product * @instance */ - ListCatalogsResponse.prototype.catalogs = $util.emptyArray; + Product.prototype.expireTime = null; /** - * ListCatalogsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse + * Product ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.cloud.retail.v2alpha.Product * @instance */ - ListCatalogsResponse.prototype.nextPageToken = ""; + Product.prototype.ttl = null; /** - * Creates a new ListCatalogsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse - * @static - * @param {google.cloud.retail.v2alpha.IListCatalogsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ListCatalogsResponse} ListCatalogsResponse instance + * Product name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - ListCatalogsResponse.create = function create(properties) { - return new ListCatalogsResponse(properties); - }; + Product.prototype.name = ""; /** - * Encodes the specified ListCatalogsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse - * @static - * @param {google.cloud.retail.v2alpha.IListCatalogsResponse} message ListCatalogsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Product id. + * @member {string} id + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - ListCatalogsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.catalogs != null && message.catalogs.length) - for (var i = 0; i < message.catalogs.length; ++i) - $root.google.cloud.retail.v2alpha.Catalog.encode(message.catalogs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; + Product.prototype.id = ""; /** - * Encodes the specified ListCatalogsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse - * @static - * @param {google.cloud.retail.v2alpha.IListCatalogsResponse} message ListCatalogsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Product type. + * @member {google.cloud.retail.v2alpha.Product.Type} type + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - ListCatalogsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Product.prototype.type = 0; /** - * Decodes a ListCatalogsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse - * @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.ListCatalogsResponse} ListCatalogsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Product primaryProductId. + * @member {string} primaryProductId + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - ListCatalogsResponse.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.ListCatalogsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.catalogs && message.catalogs.length)) - message.catalogs = []; - message.catalogs.push($root.google.cloud.retail.v2alpha.Catalog.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + Product.prototype.primaryProductId = ""; /** - * Decodes a ListCatalogsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ListCatalogsResponse} ListCatalogsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Product collectionMemberIds. + * @member {Array.} collectionMemberIds + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - ListCatalogsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Product.prototype.collectionMemberIds = $util.emptyArray; /** - * Verifies a ListCatalogsResponse message. - * @function verify - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Product gtin. + * @member {string} gtin + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - ListCatalogsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.catalogs != null && message.hasOwnProperty("catalogs")) { - if (!Array.isArray(message.catalogs)) - return "catalogs: array expected"; - for (var i = 0; i < message.catalogs.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Catalog.verify(message.catalogs[i]); - if (error) - return "catalogs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; + Product.prototype.gtin = ""; /** - * Creates a ListCatalogsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ListCatalogsResponse} ListCatalogsResponse + * Product categories. + * @member {Array.} categories + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - ListCatalogsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ListCatalogsResponse) - return object; - var message = new $root.google.cloud.retail.v2alpha.ListCatalogsResponse(); - if (object.catalogs) { - if (!Array.isArray(object.catalogs)) - throw TypeError(".google.cloud.retail.v2alpha.ListCatalogsResponse.catalogs: array expected"); - message.catalogs = []; - for (var i = 0; i < object.catalogs.length; ++i) { - if (typeof object.catalogs[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ListCatalogsResponse.catalogs: object expected"); - message.catalogs[i] = $root.google.cloud.retail.v2alpha.Catalog.fromObject(object.catalogs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; + Product.prototype.categories = $util.emptyArray; /** - * Creates a plain object from a ListCatalogsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse - * @static - * @param {google.cloud.retail.v2alpha.ListCatalogsResponse} message ListCatalogsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Product title. + * @member {string} title + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - ListCatalogsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.catalogs = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.catalogs && message.catalogs.length) { - object.catalogs = []; - for (var j = 0; j < message.catalogs.length; ++j) - object.catalogs[j] = $root.google.cloud.retail.v2alpha.Catalog.toObject(message.catalogs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; + Product.prototype.title = ""; /** - * Converts this ListCatalogsResponse to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse + * Product brands. + * @member {Array.} brands + * @memberof google.cloud.retail.v2alpha.Product * @instance - * @returns {Object.} JSON object */ - ListCatalogsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ListCatalogsResponse; - })(); - - v2alpha.UpdateCatalogRequest = (function() { + Product.prototype.brands = $util.emptyArray; /** - * Properties of an UpdateCatalogRequest. - * @memberof google.cloud.retail.v2alpha - * @interface IUpdateCatalogRequest - * @property {google.cloud.retail.v2alpha.ICatalog|null} [catalog] UpdateCatalogRequest catalog - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCatalogRequest updateMask + * Product description. + * @member {string} description + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ + Product.prototype.description = ""; /** - * Constructs a new UpdateCatalogRequest. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an UpdateCatalogRequest. - * @implements IUpdateCatalogRequest - * @constructor - * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest=} [properties] Properties to set + * Product languageCode. + * @member {string} languageCode + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - function UpdateCatalogRequest(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]]; - } + Product.prototype.languageCode = ""; /** - * UpdateCatalogRequest catalog. - * @member {google.cloud.retail.v2alpha.ICatalog|null|undefined} catalog - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest + * Product attributes. + * @member {Object.} attributes + * @memberof google.cloud.retail.v2alpha.Product * @instance */ - UpdateCatalogRequest.prototype.catalog = null; + Product.prototype.attributes = $util.emptyObject; /** - * UpdateCatalogRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest + * Product tags. + * @member {Array.} tags + * @memberof google.cloud.retail.v2alpha.Product * @instance */ - UpdateCatalogRequest.prototype.updateMask = null; + Product.prototype.tags = $util.emptyArray; /** - * Creates a new UpdateCatalogRequest instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest - * @static - * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.UpdateCatalogRequest} UpdateCatalogRequest instance + * Product priceInfo. + * @member {google.cloud.retail.v2alpha.IPriceInfo|null|undefined} priceInfo + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - UpdateCatalogRequest.create = function create(properties) { - return new UpdateCatalogRequest(properties); - }; + Product.prototype.priceInfo = null; /** - * Encodes the specified UpdateCatalogRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCatalogRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest - * @static - * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest} message UpdateCatalogRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Product rating. + * @member {google.cloud.retail.v2alpha.IRating|null|undefined} rating + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - UpdateCatalogRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) - $root.google.cloud.retail.v2alpha.Catalog.encode(message.catalog, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + Product.prototype.rating = null; /** - * Encodes the specified UpdateCatalogRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCatalogRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest - * @static - * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest} message UpdateCatalogRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Product availableTime. + * @member {google.protobuf.ITimestamp|null|undefined} availableTime + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - UpdateCatalogRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Product.prototype.availableTime = null; /** - * Decodes an UpdateCatalogRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest - * @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.UpdateCatalogRequest} UpdateCatalogRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Product availability. + * @member {google.cloud.retail.v2alpha.Product.Availability} availability + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - UpdateCatalogRequest.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.UpdateCatalogRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.catalog = $root.google.cloud.retail.v2alpha.Catalog.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + Product.prototype.availability = 0; /** - * Decodes an UpdateCatalogRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.UpdateCatalogRequest} UpdateCatalogRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Product availableQuantity. + * @member {google.protobuf.IInt32Value|null|undefined} availableQuantity + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - UpdateCatalogRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Product.prototype.availableQuantity = null; /** - * Verifies an UpdateCatalogRequest message. - * @function verify - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Product fulfillmentInfo. + * @member {Array.} fulfillmentInfo + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - UpdateCatalogRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.catalog != null && message.hasOwnProperty("catalog")) { - var error = $root.google.cloud.retail.v2alpha.Catalog.verify(message.catalog); - if (error) - return "catalog." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; + Product.prototype.fulfillmentInfo = $util.emptyArray; /** - * Creates an UpdateCatalogRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.UpdateCatalogRequest} UpdateCatalogRequest + * Product uri. + * @member {string} uri + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - UpdateCatalogRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.UpdateCatalogRequest) - return object; - var message = new $root.google.cloud.retail.v2alpha.UpdateCatalogRequest(); - if (object.catalog != null) { - if (typeof object.catalog !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UpdateCatalogRequest.catalog: object expected"); - message.catalog = $root.google.cloud.retail.v2alpha.Catalog.fromObject(object.catalog); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UpdateCatalogRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; + Product.prototype.uri = ""; /** - * Creates a plain object from an UpdateCatalogRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest - * @static - * @param {google.cloud.retail.v2alpha.UpdateCatalogRequest} message UpdateCatalogRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Product images. + * @member {Array.} images + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - UpdateCatalogRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.catalog = null; - object.updateMask = null; - } - if (message.catalog != null && message.hasOwnProperty("catalog")) - object.catalog = $root.google.cloud.retail.v2alpha.Catalog.toObject(message.catalog, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; + Product.prototype.images = $util.emptyArray; /** - * Converts this UpdateCatalogRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest + * Product audience. + * @member {google.cloud.retail.v2alpha.IAudience|null|undefined} audience + * @memberof google.cloud.retail.v2alpha.Product * @instance - * @returns {Object.} JSON object */ - UpdateCatalogRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UpdateCatalogRequest; - })(); - - v2alpha.SetDefaultBranchRequest = (function() { + Product.prototype.audience = null; /** - * Properties of a SetDefaultBranchRequest. - * @memberof google.cloud.retail.v2alpha - * @interface ISetDefaultBranchRequest - * @property {string|null} [catalog] SetDefaultBranchRequest catalog - * @property {string|null} [branchId] SetDefaultBranchRequest branchId - * @property {string|null} [note] SetDefaultBranchRequest note + * Product colorInfo. + * @member {google.cloud.retail.v2alpha.IColorInfo|null|undefined} colorInfo + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ + Product.prototype.colorInfo = null; /** - * Constructs a new SetDefaultBranchRequest. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a SetDefaultBranchRequest. - * @implements ISetDefaultBranchRequest - * @constructor - * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest=} [properties] Properties to set + * Product sizes. + * @member {Array.} sizes + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - function SetDefaultBranchRequest(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]]; - } + Product.prototype.sizes = $util.emptyArray; /** - * SetDefaultBranchRequest catalog. - * @member {string} catalog - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * Product materials. + * @member {Array.} materials + * @memberof google.cloud.retail.v2alpha.Product * @instance */ - SetDefaultBranchRequest.prototype.catalog = ""; + Product.prototype.materials = $util.emptyArray; /** - * SetDefaultBranchRequest branchId. - * @member {string} branchId - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * Product patterns. + * @member {Array.} patterns + * @memberof google.cloud.retail.v2alpha.Product * @instance */ - SetDefaultBranchRequest.prototype.branchId = ""; + Product.prototype.patterns = $util.emptyArray; /** - * SetDefaultBranchRequest note. - * @member {string} note - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest - * @instance - */ - SetDefaultBranchRequest.prototype.note = ""; - - /** - * Creates a new SetDefaultBranchRequest instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest - * @static - * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SetDefaultBranchRequest} SetDefaultBranchRequest instance - */ - SetDefaultBranchRequest.create = function create(properties) { - return new SetDefaultBranchRequest(properties); - }; - - /** - * Encodes the specified SetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SetDefaultBranchRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest - * @static - * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest} message SetDefaultBranchRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetDefaultBranchRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); - if (message.branchId != null && Object.hasOwnProperty.call(message, "branchId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.branchId); - if (message.note != null && Object.hasOwnProperty.call(message, "note")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.note); - return writer; - }; - - /** - * Encodes the specified SetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetDefaultBranchRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest - * @static - * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest} message SetDefaultBranchRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetDefaultBranchRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetDefaultBranchRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest - * @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.SetDefaultBranchRequest} SetDefaultBranchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetDefaultBranchRequest.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.SetDefaultBranchRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.catalog = reader.string(); - break; - case 2: - message.branchId = reader.string(); - break; - case 3: - message.note = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SetDefaultBranchRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SetDefaultBranchRequest} SetDefaultBranchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetDefaultBranchRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SetDefaultBranchRequest message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Product conditions. + * @member {Array.} conditions + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - SetDefaultBranchRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.catalog != null && message.hasOwnProperty("catalog")) - if (!$util.isString(message.catalog)) - return "catalog: string expected"; - if (message.branchId != null && message.hasOwnProperty("branchId")) - if (!$util.isString(message.branchId)) - return "branchId: string expected"; - if (message.note != null && message.hasOwnProperty("note")) - if (!$util.isString(message.note)) - return "note: string expected"; - return null; - }; + Product.prototype.conditions = $util.emptyArray; /** - * Creates a SetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SetDefaultBranchRequest} SetDefaultBranchRequest + * Product promotions. + * @member {Array.} promotions + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - SetDefaultBranchRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SetDefaultBranchRequest) - return object; - var message = new $root.google.cloud.retail.v2alpha.SetDefaultBranchRequest(); - if (object.catalog != null) - message.catalog = String(object.catalog); - if (object.branchId != null) - message.branchId = String(object.branchId); - if (object.note != null) - message.note = String(object.note); - return message; - }; + Product.prototype.promotions = $util.emptyArray; /** - * Creates a plain object from a SetDefaultBranchRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest - * @static - * @param {google.cloud.retail.v2alpha.SetDefaultBranchRequest} message SetDefaultBranchRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Product publishTime. + * @member {google.protobuf.ITimestamp|null|undefined} publishTime + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ - SetDefaultBranchRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.catalog = ""; - object.branchId = ""; - object.note = ""; - } - if (message.catalog != null && message.hasOwnProperty("catalog")) - object.catalog = message.catalog; - if (message.branchId != null && message.hasOwnProperty("branchId")) - object.branchId = message.branchId; - if (message.note != null && message.hasOwnProperty("note")) - object.note = message.note; - return object; - }; + Product.prototype.publishTime = null; /** - * Converts this SetDefaultBranchRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * Product retrievableFields. + * @member {google.protobuf.IFieldMask|null|undefined} retrievableFields + * @memberof google.cloud.retail.v2alpha.Product * @instance - * @returns {Object.} JSON object */ - SetDefaultBranchRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SetDefaultBranchRequest; - })(); - - v2alpha.GetDefaultBranchRequest = (function() { + Product.prototype.retrievableFields = null; /** - * Properties of a GetDefaultBranchRequest. - * @memberof google.cloud.retail.v2alpha - * @interface IGetDefaultBranchRequest - * @property {string|null} [catalog] GetDefaultBranchRequest catalog + * Product variants. + * @member {Array.} variants + * @memberof google.cloud.retail.v2alpha.Product + * @instance */ + Product.prototype.variants = $util.emptyArray; - /** - * Constructs a new GetDefaultBranchRequest. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a GetDefaultBranchRequest. - * @implements IGetDefaultBranchRequest - * @constructor - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest=} [properties] Properties to set - */ - function GetDefaultBranchRequest(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]]; - } + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * GetDefaultBranchRequest catalog. - * @member {string} catalog - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * Product expiration. + * @member {"expireTime"|"ttl"|undefined} expiration + * @memberof google.cloud.retail.v2alpha.Product * @instance */ - GetDefaultBranchRequest.prototype.catalog = ""; + Object.defineProperty(Product.prototype, "expiration", { + get: $util.oneOfGetter($oneOfFields = ["expireTime", "ttl"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new GetDefaultBranchRequest instance using the specified properties. + * Creates a new Product instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.Product * @static - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.GetDefaultBranchRequest} GetDefaultBranchRequest instance + * @param {google.cloud.retail.v2alpha.IProduct=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Product} Product instance */ - GetDefaultBranchRequest.create = function create(properties) { - return new GetDefaultBranchRequest(properties); + Product.create = function create(properties) { + return new Product(properties); }; /** - * Encodes the specified GetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchRequest.verify|verify} messages. + * Encodes the specified Product message. Does not implicitly {@link google.cloud.retail.v2alpha.Product.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.Product * @static - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest} message GetDefaultBranchRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProduct} message Product message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDefaultBranchRequest.encode = function encode(message, writer) { + Product.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.primaryProductId != null && Object.hasOwnProperty.call(message, "primaryProductId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.primaryProductId); + if (message.collectionMemberIds != null && message.collectionMemberIds.length) + for (var i = 0; i < message.collectionMemberIds.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.collectionMemberIds[i]); + if (message.gtin != null && Object.hasOwnProperty.call(message, "gtin")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.gtin); + if (message.categories != null && message.categories.length) + for (var i = 0; i < message.categories.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.categories[i]); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.title); + if (message.brands != null && message.brands.length) + for (var i = 0; i < message.brands.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.brands[i]); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.description); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.languageCode); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.retail.v2alpha.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.tags[i]); + if (message.priceInfo != null && Object.hasOwnProperty.call(message, "priceInfo")) + $root.google.cloud.retail.v2alpha.PriceInfo.encode(message.priceInfo, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.rating != null && Object.hasOwnProperty.call(message, "rating")) + $root.google.cloud.retail.v2alpha.Rating.encode(message.rating, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.availableTime != null && Object.hasOwnProperty.call(message, "availableTime")) + $root.google.protobuf.Timestamp.encode(message.availableTime, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.availability != null && Object.hasOwnProperty.call(message, "availability")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.availability); + if (message.availableQuantity != null && Object.hasOwnProperty.call(message, "availableQuantity")) + $root.google.protobuf.Int32Value.encode(message.availableQuantity, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.fulfillmentInfo != null && message.fulfillmentInfo.length) + for (var i = 0; i < message.fulfillmentInfo.length; ++i) + $root.google.cloud.retail.v2alpha.FulfillmentInfo.encode(message.fulfillmentInfo[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.uri); + if (message.images != null && message.images.length) + for (var i = 0; i < message.images.length; ++i) + $root.google.cloud.retail.v2alpha.Image.encode(message.images[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.audience != null && Object.hasOwnProperty.call(message, "audience")) + $root.google.cloud.retail.v2alpha.Audience.encode(message.audience, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.colorInfo != null && Object.hasOwnProperty.call(message, "colorInfo")) + $root.google.cloud.retail.v2alpha.ColorInfo.encode(message.colorInfo, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.sizes != null && message.sizes.length) + for (var i = 0; i < message.sizes.length; ++i) + writer.uint32(/* id 26, wireType 2 =*/210).string(message.sizes[i]); + if (message.materials != null && message.materials.length) + for (var i = 0; i < message.materials.length; ++i) + writer.uint32(/* id 27, wireType 2 =*/218).string(message.materials[i]); + if (message.patterns != null && message.patterns.length) + for (var i = 0; i < message.patterns.length; ++i) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.patterns[i]); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + writer.uint32(/* id 29, wireType 2 =*/234).string(message.conditions[i]); + if (message.retrievableFields != null && Object.hasOwnProperty.call(message, "retrievableFields")) + $root.google.protobuf.FieldMask.encode(message.retrievableFields, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.variants != null && message.variants.length) + for (var i = 0; i < message.variants.length; ++i) + $root.google.cloud.retail.v2alpha.Product.encode(message.variants[i], writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.publishTime != null && Object.hasOwnProperty.call(message, "publishTime")) + $root.google.protobuf.Timestamp.encode(message.publishTime, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + 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(); return writer; }; /** - * Encodes the specified GetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchRequest.verify|verify} messages. + * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Product.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.Product * @static - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest} message GetDefaultBranchRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProduct} message Product message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDefaultBranchRequest.encodeDelimited = function encodeDelimited(message, writer) { + Product.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDefaultBranchRequest message from the specified reader or buffer. + * Decodes a Product message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.Product * @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.GetDefaultBranchRequest} GetDefaultBranchRequest + * @returns {google.cloud.retail.v2alpha.Product} Product * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDefaultBranchRequest.decode = function decode(reader, length) { + Product.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.GetDefaultBranchRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Product(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 16: + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 17: + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; case 1: - message.catalog = reader.string(); + message.name = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + case 3: + message.type = reader.int32(); + break; + case 4: + message.primaryProductId = reader.string(); + break; + case 5: + if (!(message.collectionMemberIds && message.collectionMemberIds.length)) + message.collectionMemberIds = []; + message.collectionMemberIds.push(reader.string()); + break; + case 6: + message.gtin = reader.string(); + break; + case 7: + if (!(message.categories && message.categories.length)) + message.categories = []; + message.categories.push(reader.string()); + break; + case 8: + message.title = reader.string(); + break; + case 9: + if (!(message.brands && message.brands.length)) + message.brands = []; + message.brands.push(reader.string()); + break; + case 10: + message.description = reader.string(); + break; + case 11: + message.languageCode = reader.string(); + break; + case 12: + if (message.attributes === $util.emptyObject) + message.attributes = {}; + 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.CustomAttribute.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + case 13: + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + case 14: + message.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.decode(reader, reader.uint32()); + break; + case 15: + message.rating = $root.google.cloud.retail.v2alpha.Rating.decode(reader, reader.uint32()); + break; + case 18: + message.availableTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 19: + message.availability = reader.int32(); + break; + case 20: + message.availableQuantity = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); + break; + case 21: + if (!(message.fulfillmentInfo && message.fulfillmentInfo.length)) + message.fulfillmentInfo = []; + message.fulfillmentInfo.push($root.google.cloud.retail.v2alpha.FulfillmentInfo.decode(reader, reader.uint32())); + break; + case 22: + message.uri = reader.string(); + break; + case 23: + if (!(message.images && message.images.length)) + message.images = []; + message.images.push($root.google.cloud.retail.v2alpha.Image.decode(reader, reader.uint32())); + break; + case 24: + message.audience = $root.google.cloud.retail.v2alpha.Audience.decode(reader, reader.uint32()); + break; + case 25: + message.colorInfo = $root.google.cloud.retail.v2alpha.ColorInfo.decode(reader, reader.uint32()); + break; + case 26: + if (!(message.sizes && message.sizes.length)) + message.sizes = []; + message.sizes.push(reader.string()); + break; + case 27: + if (!(message.materials && message.materials.length)) + message.materials = []; + message.materials.push(reader.string()); + break; + case 28: + if (!(message.patterns && message.patterns.length)) + message.patterns = []; + message.patterns.push(reader.string()); + break; + case 29: + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push(reader.string()); + break; + case 34: + if (!(message.promotions && message.promotions.length)) + message.promotions = []; + message.promotions.push($root.google.cloud.retail.v2alpha.Promotion.decode(reader, reader.uint32())); + break; + case 33: + message.publishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 30: + message.retrievableFields = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 31: + if (!(message.variants && message.variants.length)) + message.variants = []; + message.variants.push($root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -38167,452 +36852,725 @@ }; /** - * Decodes a GetDefaultBranchRequest message from the specified reader or buffer, length delimited. + * Decodes a Product message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.Product * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.GetDefaultBranchRequest} GetDefaultBranchRequest + * @returns {google.cloud.retail.v2alpha.Product} Product * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDefaultBranchRequest.decodeDelimited = function decodeDelimited(reader) { + Product.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDefaultBranchRequest message. + * Verifies a Product message. * @function verify - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.Product * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDefaultBranchRequest.verify = function verify(message) { + Product.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.catalog != null && message.hasOwnProperty("catalog")) - if (!$util.isString(message.catalog)) - return "catalog: string expected"; - return null; - }; - - /** - * Creates a GetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.GetDefaultBranchRequest} GetDefaultBranchRequest - */ - GetDefaultBranchRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.GetDefaultBranchRequest) - return object; - var message = new $root.google.cloud.retail.v2alpha.GetDefaultBranchRequest(); - if (object.catalog != null) - message.catalog = String(object.catalog); - return message; - }; - - /** - * Creates a plain object from a GetDefaultBranchRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest - * @static - * @param {google.cloud.retail.v2alpha.GetDefaultBranchRequest} message GetDefaultBranchRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDefaultBranchRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.catalog = ""; - if (message.catalog != null && message.hasOwnProperty("catalog")) - object.catalog = message.catalog; - return object; - }; - - /** - * Converts this GetDefaultBranchRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest - * @instance - * @returns {Object.} JSON object - */ - GetDefaultBranchRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetDefaultBranchRequest; - })(); - - v2alpha.GetDefaultBranchResponse = (function() { - - /** - * Properties of a GetDefaultBranchResponse. - * @memberof google.cloud.retail.v2alpha - * @interface IGetDefaultBranchResponse - * @property {string|null} [branch] GetDefaultBranchResponse branch - * @property {google.protobuf.ITimestamp|null} [setTime] GetDefaultBranchResponse setTime - * @property {string|null} [note] GetDefaultBranchResponse note - */ - - /** - * Constructs a new GetDefaultBranchResponse. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a GetDefaultBranchResponse. - * @implements IGetDefaultBranchResponse - * @constructor - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchResponse=} [properties] Properties to set - */ - function GetDefaultBranchResponse(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]]; - } - - /** - * GetDefaultBranchResponse branch. - * @member {string} branch - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse - * @instance - */ - GetDefaultBranchResponse.prototype.branch = ""; - - /** - * GetDefaultBranchResponse setTime. - * @member {google.protobuf.ITimestamp|null|undefined} setTime - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse - * @instance - */ - GetDefaultBranchResponse.prototype.setTime = null; - - /** - * GetDefaultBranchResponse note. - * @member {string} note - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse - * @instance - */ - GetDefaultBranchResponse.prototype.note = ""; - - /** - * Creates a new GetDefaultBranchResponse instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse - * @static - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.GetDefaultBranchResponse} GetDefaultBranchResponse instance - */ - GetDefaultBranchResponse.create = function create(properties) { - return new GetDefaultBranchResponse(properties); - }; - - /** - * Encodes the specified GetDefaultBranchResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse - * @static - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchResponse} message GetDefaultBranchResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDefaultBranchResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.branch); - if (message.setTime != null && Object.hasOwnProperty.call(message, "setTime")) - $root.google.protobuf.Timestamp.encode(message.setTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.note != null && Object.hasOwnProperty.call(message, "note")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.note); - return writer; - }; - - /** - * Encodes the specified GetDefaultBranchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse - * @static - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchResponse} message GetDefaultBranchResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDefaultBranchResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDefaultBranchResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse - * @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.GetDefaultBranchResponse} GetDefaultBranchResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDefaultBranchResponse.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.GetDefaultBranchResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { + var properties = {}; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + properties.expiration = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + if (properties.expiration === 1) + return "expiration: multiple values"; + properties.expiration = 1; + { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: case 1: - message.branch = reader.string(); - break; case 2: - message.setTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; case 3: - message.note = reader.string(); break; + } + if (message.primaryProductId != null && message.hasOwnProperty("primaryProductId")) + if (!$util.isString(message.primaryProductId)) + return "primaryProductId: string expected"; + if (message.collectionMemberIds != null && message.hasOwnProperty("collectionMemberIds")) { + if (!Array.isArray(message.collectionMemberIds)) + return "collectionMemberIds: array expected"; + for (var i = 0; i < message.collectionMemberIds.length; ++i) + if (!$util.isString(message.collectionMemberIds[i])) + return "collectionMemberIds: string[] expected"; + } + if (message.gtin != null && message.hasOwnProperty("gtin")) + if (!$util.isString(message.gtin)) + return "gtin: string expected"; + if (message.categories != null && message.hasOwnProperty("categories")) { + if (!Array.isArray(message.categories)) + return "categories: array expected"; + for (var i = 0; i < message.categories.length; ++i) + if (!$util.isString(message.categories[i])) + return "categories: string[] expected"; + } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.brands != null && message.hasOwnProperty("brands")) { + if (!Array.isArray(message.brands)) + return "brands: array expected"; + for (var i = 0; i < message.brands.length; ++i) + if (!$util.isString(message.brands[i])) + return "brands: string[] expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.CustomAttribute.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) { + var error = $root.google.cloud.retail.v2alpha.PriceInfo.verify(message.priceInfo); + if (error) + return "priceInfo." + error; + } + if (message.rating != null && message.hasOwnProperty("rating")) { + var error = $root.google.cloud.retail.v2alpha.Rating.verify(message.rating); + if (error) + return "rating." + error; + } + if (message.availableTime != null && message.hasOwnProperty("availableTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.availableTime); + if (error) + return "availableTime." + error; + } + if (message.availability != null && message.hasOwnProperty("availability")) + switch (message.availability) { default: - reader.skipType(tag & 7); + return "availability: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: break; } + if (message.availableQuantity != null && message.hasOwnProperty("availableQuantity")) { + var error = $root.google.protobuf.Int32Value.verify(message.availableQuantity); + if (error) + return "availableQuantity." + error; } - return message; - }; - - /** - * Decodes a GetDefaultBranchResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.GetDefaultBranchResponse} GetDefaultBranchResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDefaultBranchResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDefaultBranchResponse message. - * @function verify - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDefaultBranchResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.branch != null && message.hasOwnProperty("branch")) - if (!$util.isString(message.branch)) - return "branch: string expected"; - if (message.setTime != null && message.hasOwnProperty("setTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.setTime); + if (message.fulfillmentInfo != null && message.hasOwnProperty("fulfillmentInfo")) { + if (!Array.isArray(message.fulfillmentInfo)) + return "fulfillmentInfo: array expected"; + for (var i = 0; i < message.fulfillmentInfo.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.FulfillmentInfo.verify(message.fulfillmentInfo[i]); + if (error) + return "fulfillmentInfo." + error; + } + } + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.images != null && message.hasOwnProperty("images")) { + if (!Array.isArray(message.images)) + return "images: array expected"; + for (var i = 0; i < message.images.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Image.verify(message.images[i]); + if (error) + return "images." + error; + } + } + if (message.audience != null && message.hasOwnProperty("audience")) { + var error = $root.google.cloud.retail.v2alpha.Audience.verify(message.audience); if (error) - return "setTime." + error; + return "audience." + error; + } + if (message.colorInfo != null && message.hasOwnProperty("colorInfo")) { + var error = $root.google.cloud.retail.v2alpha.ColorInfo.verify(message.colorInfo); + if (error) + return "colorInfo." + error; + } + if (message.sizes != null && message.hasOwnProperty("sizes")) { + if (!Array.isArray(message.sizes)) + return "sizes: array expected"; + for (var i = 0; i < message.sizes.length; ++i) + if (!$util.isString(message.sizes[i])) + return "sizes: string[] expected"; + } + if (message.materials != null && message.hasOwnProperty("materials")) { + if (!Array.isArray(message.materials)) + return "materials: array expected"; + for (var i = 0; i < message.materials.length; ++i) + if (!$util.isString(message.materials[i])) + return "materials: string[] expected"; + } + if (message.patterns != null && message.hasOwnProperty("patterns")) { + if (!Array.isArray(message.patterns)) + return "patterns: array expected"; + for (var i = 0; i < message.patterns.length; ++i) + if (!$util.isString(message.patterns[i])) + return "patterns: string[] expected"; + } + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) + if (!$util.isString(message.conditions[i])) + return "conditions: string[] expected"; + } + if (message.promotions != null && message.hasOwnProperty("promotions")) { + if (!Array.isArray(message.promotions)) + return "promotions: array expected"; + for (var i = 0; i < message.promotions.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Promotion.verify(message.promotions[i]); + if (error) + return "promotions." + error; + } + } + if (message.publishTime != null && message.hasOwnProperty("publishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.publishTime); + if (error) + return "publishTime." + error; + } + if (message.retrievableFields != null && message.hasOwnProperty("retrievableFields")) { + var error = $root.google.protobuf.FieldMask.verify(message.retrievableFields); + if (error) + return "retrievableFields." + error; + } + if (message.variants != null && message.hasOwnProperty("variants")) { + if (!Array.isArray(message.variants)) + return "variants: array expected"; + for (var i = 0; i < message.variants.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Product.verify(message.variants[i]); + if (error) + return "variants." + error; + } } - if (message.note != null && message.hasOwnProperty("note")) - if (!$util.isString(message.note)) - return "note: string expected"; return null; }; /** - * Creates a GetDefaultBranchResponse message from a plain object. Also converts values to their respective internal types. + * Creates a Product message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2alpha.Product * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.GetDefaultBranchResponse} GetDefaultBranchResponse + * @returns {google.cloud.retail.v2alpha.Product} Product */ - GetDefaultBranchResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.GetDefaultBranchResponse) + Product.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Product) return object; - var message = new $root.google.cloud.retail.v2alpha.GetDefaultBranchResponse(); - if (object.branch != null) - message.branch = String(object.branch); - if (object.setTime != null) { - if (typeof object.setTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.GetDefaultBranchResponse.setTime: object expected"); - message.setTime = $root.google.protobuf.Timestamp.fromObject(object.setTime); + var message = new $root.google.cloud.retail.v2alpha.Product(); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); } - if (object.note != null) - message.note = String(object.note); - return message; - }; - - /** - * Creates a plain object from a GetDefaultBranchResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse - * @static - * @param {google.cloud.retail.v2alpha.GetDefaultBranchResponse} message GetDefaultBranchResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDefaultBranchResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.branch = ""; - object.setTime = null; - object.note = ""; + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); } - if (message.branch != null && message.hasOwnProperty("branch")) - object.branch = message.branch; - if (message.setTime != null && message.hasOwnProperty("setTime")) - object.setTime = $root.google.protobuf.Timestamp.toObject(message.setTime, options); - if (message.note != null && message.hasOwnProperty("note")) - object.note = message.note; - return object; - }; - - /** - * Converts this GetDefaultBranchResponse to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse - * @instance - * @returns {Object.} JSON object - */ - GetDefaultBranchResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetDefaultBranchResponse; - })(); - - v2alpha.CompletionService = (function() { - - /** - * Constructs a new CompletionService service. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CompletionService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function CompletionService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (CompletionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CompletionService; - - /** - * Creates new CompletionService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.retail.v2alpha.CompletionService - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {CompletionService} RPC service. Useful where requests and/or responses are streamed. - */ - CompletionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CompletionService#completeQuery}. - * @memberof google.cloud.retail.v2alpha.CompletionService - * @typedef CompleteQueryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse} [response] CompleteQueryResponse - */ + if (object.name != null) + message.name = String(object.name); + if (object.id != null) + message.id = String(object.id); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PRIMARY": + case 1: + message.type = 1; + break; + case "VARIANT": + case 2: + message.type = 2; + break; + case "COLLECTION": + case 3: + message.type = 3; + break; + } + if (object.primaryProductId != null) + message.primaryProductId = String(object.primaryProductId); + if (object.collectionMemberIds) { + if (!Array.isArray(object.collectionMemberIds)) + throw TypeError(".google.cloud.retail.v2alpha.Product.collectionMemberIds: array expected"); + message.collectionMemberIds = []; + for (var i = 0; i < object.collectionMemberIds.length; ++i) + message.collectionMemberIds[i] = String(object.collectionMemberIds[i]); + } + if (object.gtin != null) + message.gtin = String(object.gtin); + if (object.categories) { + if (!Array.isArray(object.categories)) + throw TypeError(".google.cloud.retail.v2alpha.Product.categories: array expected"); + message.categories = []; + for (var i = 0; i < object.categories.length; ++i) + message.categories[i] = String(object.categories[i]); + } + if (object.title != null) + message.title = String(object.title); + if (object.brands) { + if (!Array.isArray(object.brands)) + throw TypeError(".google.cloud.retail.v2alpha.Product.brands: array expected"); + message.brands = []; + for (var i = 0; i < object.brands.length; ++i) + message.brands[i] = String(object.brands[i]); + } + if (object.description != null) + message.description = String(object.description); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.retail.v2alpha.CustomAttribute.fromObject(object.attributes[keys[i]]); + } + } + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.retail.v2alpha.Product.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.priceInfo != null) { + if (typeof object.priceInfo !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.priceInfo: object expected"); + message.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.fromObject(object.priceInfo); + } + if (object.rating != null) { + if (typeof object.rating !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.rating: object expected"); + message.rating = $root.google.cloud.retail.v2alpha.Rating.fromObject(object.rating); + } + if (object.availableTime != null) { + if (typeof object.availableTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.availableTime: object expected"); + message.availableTime = $root.google.protobuf.Timestamp.fromObject(object.availableTime); + } + switch (object.availability) { + case "AVAILABILITY_UNSPECIFIED": + case 0: + message.availability = 0; + break; + case "IN_STOCK": + case 1: + message.availability = 1; + break; + case "OUT_OF_STOCK": + case 2: + message.availability = 2; + break; + case "PREORDER": + case 3: + message.availability = 3; + break; + case "BACKORDER": + case 4: + message.availability = 4; + break; + } + if (object.availableQuantity != null) { + if (typeof object.availableQuantity !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.availableQuantity: object expected"); + message.availableQuantity = $root.google.protobuf.Int32Value.fromObject(object.availableQuantity); + } + if (object.fulfillmentInfo) { + if (!Array.isArray(object.fulfillmentInfo)) + throw TypeError(".google.cloud.retail.v2alpha.Product.fulfillmentInfo: array expected"); + message.fulfillmentInfo = []; + for (var i = 0; i < object.fulfillmentInfo.length; ++i) { + if (typeof object.fulfillmentInfo[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.fulfillmentInfo: object expected"); + message.fulfillmentInfo[i] = $root.google.cloud.retail.v2alpha.FulfillmentInfo.fromObject(object.fulfillmentInfo[i]); + } + } + if (object.uri != null) + message.uri = String(object.uri); + if (object.images) { + if (!Array.isArray(object.images)) + throw TypeError(".google.cloud.retail.v2alpha.Product.images: array expected"); + message.images = []; + for (var i = 0; i < object.images.length; ++i) { + if (typeof object.images[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.images: object expected"); + message.images[i] = $root.google.cloud.retail.v2alpha.Image.fromObject(object.images[i]); + } + } + if (object.audience != null) { + if (typeof object.audience !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.audience: object expected"); + message.audience = $root.google.cloud.retail.v2alpha.Audience.fromObject(object.audience); + } + if (object.colorInfo != null) { + if (typeof object.colorInfo !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.colorInfo: object expected"); + message.colorInfo = $root.google.cloud.retail.v2alpha.ColorInfo.fromObject(object.colorInfo); + } + if (object.sizes) { + if (!Array.isArray(object.sizes)) + throw TypeError(".google.cloud.retail.v2alpha.Product.sizes: array expected"); + message.sizes = []; + for (var i = 0; i < object.sizes.length; ++i) + message.sizes[i] = String(object.sizes[i]); + } + if (object.materials) { + if (!Array.isArray(object.materials)) + throw TypeError(".google.cloud.retail.v2alpha.Product.materials: array expected"); + message.materials = []; + for (var i = 0; i < object.materials.length; ++i) + message.materials[i] = String(object.materials[i]); + } + if (object.patterns) { + if (!Array.isArray(object.patterns)) + throw TypeError(".google.cloud.retail.v2alpha.Product.patterns: array expected"); + message.patterns = []; + for (var i = 0; i < object.patterns.length; ++i) + message.patterns[i] = String(object.patterns[i]); + } + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.cloud.retail.v2alpha.Product.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) + message.conditions[i] = String(object.conditions[i]); + } + if (object.promotions) { + if (!Array.isArray(object.promotions)) + throw TypeError(".google.cloud.retail.v2alpha.Product.promotions: array expected"); + message.promotions = []; + for (var i = 0; i < object.promotions.length; ++i) { + if (typeof object.promotions[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.promotions: object expected"); + message.promotions[i] = $root.google.cloud.retail.v2alpha.Promotion.fromObject(object.promotions[i]); + } + } + if (object.publishTime != null) { + if (typeof object.publishTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.publishTime: object expected"); + message.publishTime = $root.google.protobuf.Timestamp.fromObject(object.publishTime); + } + if (object.retrievableFields != null) { + if (typeof object.retrievableFields !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.retrievableFields: object expected"); + message.retrievableFields = $root.google.protobuf.FieldMask.fromObject(object.retrievableFields); + } + if (object.variants) { + if (!Array.isArray(object.variants)) + throw TypeError(".google.cloud.retail.v2alpha.Product.variants: array expected"); + message.variants = []; + for (var i = 0; i < object.variants.length; ++i) { + if (typeof object.variants[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.variants: object expected"); + message.variants[i] = $root.google.cloud.retail.v2alpha.Product.fromObject(object.variants[i]); + } + } + return message; + }; /** - * Calls CompleteQuery. - * @function completeQuery - * @memberof google.cloud.retail.v2alpha.CompletionService - * @instance - * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest} request CompleteQueryRequest message or plain object - * @param {google.cloud.retail.v2alpha.CompletionService.CompleteQueryCallback} callback Node-style callback called with the error, if any, and CompleteQueryResponse - * @returns {undefined} - * @variation 1 + * Creates a plain object from a Product message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Product + * @static + * @param {google.cloud.retail.v2alpha.Product} message Product + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(CompletionService.prototype.completeQuery = function completeQuery(request, callback) { - return this.rpcCall(completeQuery, $root.google.cloud.retail.v2alpha.CompleteQueryRequest, $root.google.cloud.retail.v2alpha.CompleteQueryResponse, request, callback); - }, "name", { value: "CompleteQuery" }); + Product.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.collectionMemberIds = []; + object.categories = []; + object.brands = []; + object.tags = []; + object.fulfillmentInfo = []; + object.images = []; + object.sizes = []; + object.materials = []; + object.patterns = []; + object.conditions = []; + object.variants = []; + object.promotions = []; + } + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.id = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.primaryProductId = ""; + object.gtin = ""; + object.title = ""; + object.description = ""; + object.languageCode = ""; + object.priceInfo = null; + object.rating = null; + object.availableTime = null; + object.availability = options.enums === String ? "AVAILABILITY_UNSPECIFIED" : 0; + object.availableQuantity = null; + object.uri = ""; + object.audience = null; + object.colorInfo = null; + object.retrievableFields = null; + object.publishTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.retail.v2alpha.Product.Type[message.type] : message.type; + if (message.primaryProductId != null && message.hasOwnProperty("primaryProductId")) + object.primaryProductId = message.primaryProductId; + if (message.collectionMemberIds && message.collectionMemberIds.length) { + object.collectionMemberIds = []; + for (var j = 0; j < message.collectionMemberIds.length; ++j) + object.collectionMemberIds[j] = message.collectionMemberIds[j]; + } + if (message.gtin != null && message.hasOwnProperty("gtin")) + object.gtin = message.gtin; + if (message.categories && message.categories.length) { + object.categories = []; + for (var j = 0; j < message.categories.length; ++j) + object.categories[j] = message.categories[j]; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.brands && message.brands.length) { + object.brands = []; + for (var j = 0; j < message.brands.length; ++j) + object.brands[j] = message.brands[j]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.retail.v2alpha.CustomAttribute.toObject(message.attributes[keys2[j]], options); + } + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) + object.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.toObject(message.priceInfo, options); + if (message.rating != null && message.hasOwnProperty("rating")) + object.rating = $root.google.cloud.retail.v2alpha.Rating.toObject(message.rating, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (options.oneofs) + object.expiration = "expireTime"; + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + if (options.oneofs) + object.expiration = "ttl"; + } + if (message.availableTime != null && message.hasOwnProperty("availableTime")) + object.availableTime = $root.google.protobuf.Timestamp.toObject(message.availableTime, options); + if (message.availability != null && message.hasOwnProperty("availability")) + object.availability = options.enums === String ? $root.google.cloud.retail.v2alpha.Product.Availability[message.availability] : message.availability; + if (message.availableQuantity != null && message.hasOwnProperty("availableQuantity")) + object.availableQuantity = $root.google.protobuf.Int32Value.toObject(message.availableQuantity, options); + if (message.fulfillmentInfo && message.fulfillmentInfo.length) { + object.fulfillmentInfo = []; + for (var j = 0; j < message.fulfillmentInfo.length; ++j) + object.fulfillmentInfo[j] = $root.google.cloud.retail.v2alpha.FulfillmentInfo.toObject(message.fulfillmentInfo[j], options); + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.images && message.images.length) { + object.images = []; + for (var j = 0; j < message.images.length; ++j) + object.images[j] = $root.google.cloud.retail.v2alpha.Image.toObject(message.images[j], options); + } + if (message.audience != null && message.hasOwnProperty("audience")) + object.audience = $root.google.cloud.retail.v2alpha.Audience.toObject(message.audience, options); + if (message.colorInfo != null && message.hasOwnProperty("colorInfo")) + object.colorInfo = $root.google.cloud.retail.v2alpha.ColorInfo.toObject(message.colorInfo, options); + if (message.sizes && message.sizes.length) { + object.sizes = []; + for (var j = 0; j < message.sizes.length; ++j) + object.sizes[j] = message.sizes[j]; + } + if (message.materials && message.materials.length) { + object.materials = []; + for (var j = 0; j < message.materials.length; ++j) + object.materials[j] = message.materials[j]; + } + if (message.patterns && message.patterns.length) { + object.patterns = []; + for (var j = 0; j < message.patterns.length; ++j) + object.patterns[j] = message.patterns[j]; + } + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = message.conditions[j]; + } + if (message.retrievableFields != null && message.hasOwnProperty("retrievableFields")) + object.retrievableFields = $root.google.protobuf.FieldMask.toObject(message.retrievableFields, options); + if (message.variants && message.variants.length) { + object.variants = []; + for (var j = 0; j < message.variants.length; ++j) + object.variants[j] = $root.google.cloud.retail.v2alpha.Product.toObject(message.variants[j], options); + } + if (message.publishTime != null && message.hasOwnProperty("publishTime")) + object.publishTime = $root.google.protobuf.Timestamp.toObject(message.publishTime, options); + if (message.promotions && message.promotions.length) { + object.promotions = []; + for (var j = 0; j < message.promotions.length; ++j) + object.promotions[j] = $root.google.cloud.retail.v2alpha.Promotion.toObject(message.promotions[j], options); + } + return object; + }; /** - * Calls CompleteQuery. - * @function completeQuery - * @memberof google.cloud.retail.v2alpha.CompletionService + * Converts this Product to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Product * @instance - * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest} request CompleteQueryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CompletionService#importCompletionData}. - * @memberof google.cloud.retail.v2alpha.CompletionService - * @typedef ImportCompletionDataCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * @returns {Object.} JSON object */ + Product.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls ImportCompletionData. - * @function importCompletionData - * @memberof google.cloud.retail.v2alpha.CompletionService - * @instance - * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest} request ImportCompletionDataRequest message or plain object - * @param {google.cloud.retail.v2alpha.CompletionService.ImportCompletionDataCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Type enum. + * @name google.cloud.retail.v2alpha.Product.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} PRIMARY=1 PRIMARY value + * @property {number} VARIANT=2 VARIANT value + * @property {number} COLLECTION=3 COLLECTION value */ - Object.defineProperty(CompletionService.prototype.importCompletionData = function importCompletionData(request, callback) { - return this.rpcCall(importCompletionData, $root.google.cloud.retail.v2alpha.ImportCompletionDataRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportCompletionData" }); + Product.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY"] = 1; + values[valuesById[2] = "VARIANT"] = 2; + values[valuesById[3] = "COLLECTION"] = 3; + return values; + })(); /** - * Calls ImportCompletionData. - * @function importCompletionData - * @memberof google.cloud.retail.v2alpha.CompletionService - * @instance - * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest} request ImportCompletionDataRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Availability enum. + * @name google.cloud.retail.v2alpha.Product.Availability + * @enum {number} + * @property {number} AVAILABILITY_UNSPECIFIED=0 AVAILABILITY_UNSPECIFIED value + * @property {number} IN_STOCK=1 IN_STOCK value + * @property {number} OUT_OF_STOCK=2 OUT_OF_STOCK value + * @property {number} PREORDER=3 PREORDER value + * @property {number} BACKORDER=4 BACKORDER value */ + Product.Availability = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AVAILABILITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN_STOCK"] = 1; + values[valuesById[2] = "OUT_OF_STOCK"] = 2; + values[valuesById[3] = "PREORDER"] = 3; + values[valuesById[4] = "BACKORDER"] = 4; + return values; + })(); - return CompletionService; + return Product; })(); - v2alpha.CompleteQueryRequest = (function() { + v2alpha.UserEvent = (function() { /** - * Properties of a CompleteQueryRequest. + * Properties of a UserEvent. * @memberof google.cloud.retail.v2alpha - * @interface ICompleteQueryRequest - * @property {string|null} [catalog] CompleteQueryRequest catalog - * @property {string|null} [query] CompleteQueryRequest query - * @property {string|null} [visitorId] CompleteQueryRequest visitorId - * @property {Array.|null} [languageCodes] CompleteQueryRequest languageCodes - * @property {string|null} [deviceType] CompleteQueryRequest deviceType - * @property {string|null} [dataset] CompleteQueryRequest dataset - * @property {number|null} [maxSuggestions] CompleteQueryRequest maxSuggestions + * @interface IUserEvent + * @property {string|null} [eventType] UserEvent eventType + * @property {string|null} [visitorId] UserEvent visitorId + * @property {string|null} [sessionId] UserEvent sessionId + * @property {google.protobuf.ITimestamp|null} [eventTime] UserEvent eventTime + * @property {Array.|null} [experimentIds] UserEvent experimentIds + * @property {string|null} [attributionToken] UserEvent attributionToken + * @property {Array.|null} [productDetails] UserEvent productDetails + * @property {google.cloud.retail.v2alpha.ICompletionDetail|null} [completionDetail] UserEvent completionDetail + * @property {Object.|null} [attributes] UserEvent attributes + * @property {string|null} [cartId] UserEvent cartId + * @property {google.cloud.retail.v2alpha.IPurchaseTransaction|null} [purchaseTransaction] UserEvent purchaseTransaction + * @property {string|null} [searchQuery] UserEvent searchQuery + * @property {string|null} [filter] UserEvent filter + * @property {string|null} [orderBy] UserEvent orderBy + * @property {number|null} [offset] UserEvent offset + * @property {Array.|null} [pageCategories] UserEvent pageCategories + * @property {google.cloud.retail.v2alpha.IUserInfo|null} [userInfo] UserEvent userInfo + * @property {string|null} [uri] UserEvent uri + * @property {string|null} [referrerUri] UserEvent referrerUri + * @property {string|null} [pageViewId] UserEvent pageViewId */ /** - * Constructs a new CompleteQueryRequest. + * Constructs a new UserEvent. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CompleteQueryRequest. - * @implements ICompleteQueryRequest + * @classdesc Represents a UserEvent. + * @implements IUserEvent * @constructor - * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IUserEvent=} [properties] Properties to set */ - function CompleteQueryRequest(properties) { - this.languageCodes = []; + function UserEvent(properties) { + this.experimentIds = []; + this.productDetails = []; + this.attributes = {}; + this.pageCategories = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -38620,156 +37578,353 @@ } /** - * CompleteQueryRequest catalog. - * @member {string} catalog - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * UserEvent eventType. + * @member {string} eventType + * @memberof google.cloud.retail.v2alpha.UserEvent * @instance */ - CompleteQueryRequest.prototype.catalog = ""; + UserEvent.prototype.eventType = ""; /** - * CompleteQueryRequest query. - * @member {string} query - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * UserEvent visitorId. + * @member {string} visitorId + * @memberof google.cloud.retail.v2alpha.UserEvent * @instance */ - CompleteQueryRequest.prototype.query = ""; + UserEvent.prototype.visitorId = ""; /** - * CompleteQueryRequest visitorId. - * @member {string} visitorId - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * UserEvent sessionId. + * @member {string} sessionId + * @memberof google.cloud.retail.v2alpha.UserEvent * @instance */ - CompleteQueryRequest.prototype.visitorId = ""; + UserEvent.prototype.sessionId = ""; /** - * CompleteQueryRequest languageCodes. - * @member {Array.} languageCodes - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * UserEvent eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.retail.v2alpha.UserEvent * @instance */ - CompleteQueryRequest.prototype.languageCodes = $util.emptyArray; + UserEvent.prototype.eventTime = null; /** - * CompleteQueryRequest deviceType. - * @member {string} deviceType - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * UserEvent experimentIds. + * @member {Array.} experimentIds + * @memberof google.cloud.retail.v2alpha.UserEvent * @instance */ - CompleteQueryRequest.prototype.deviceType = ""; + UserEvent.prototype.experimentIds = $util.emptyArray; /** - * CompleteQueryRequest dataset. - * @member {string} dataset - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * UserEvent attributionToken. + * @member {string} attributionToken + * @memberof google.cloud.retail.v2alpha.UserEvent * @instance */ - CompleteQueryRequest.prototype.dataset = ""; + UserEvent.prototype.attributionToken = ""; /** - * CompleteQueryRequest maxSuggestions. - * @member {number} maxSuggestions - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * UserEvent productDetails. + * @member {Array.} productDetails + * @memberof google.cloud.retail.v2alpha.UserEvent * @instance */ - CompleteQueryRequest.prototype.maxSuggestions = 0; + UserEvent.prototype.productDetails = $util.emptyArray; /** - * Creates a new CompleteQueryRequest instance using the specified properties. + * UserEvent completionDetail. + * @member {google.cloud.retail.v2alpha.ICompletionDetail|null|undefined} completionDetail + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.completionDetail = null; + + /** + * UserEvent attributes. + * @member {Object.} attributes + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.attributes = $util.emptyObject; + + /** + * UserEvent cartId. + * @member {string} cartId + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.cartId = ""; + + /** + * UserEvent purchaseTransaction. + * @member {google.cloud.retail.v2alpha.IPurchaseTransaction|null|undefined} purchaseTransaction + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.purchaseTransaction = null; + + /** + * UserEvent searchQuery. + * @member {string} searchQuery + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.searchQuery = ""; + + /** + * UserEvent filter. + * @member {string} filter + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.filter = ""; + + /** + * UserEvent orderBy. + * @member {string} orderBy + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.orderBy = ""; + + /** + * UserEvent offset. + * @member {number} offset + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.offset = 0; + + /** + * UserEvent pageCategories. + * @member {Array.} pageCategories + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.pageCategories = $util.emptyArray; + + /** + * UserEvent userInfo. + * @member {google.cloud.retail.v2alpha.IUserInfo|null|undefined} userInfo + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.userInfo = null; + + /** + * UserEvent uri. + * @member {string} uri + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.uri = ""; + + /** + * UserEvent referrerUri. + * @member {string} referrerUri + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.referrerUri = ""; + + /** + * UserEvent pageViewId. + * @member {string} pageViewId + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.pageViewId = ""; + + /** + * Creates a new UserEvent instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @static - * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CompleteQueryRequest} CompleteQueryRequest instance + * @param {google.cloud.retail.v2alpha.IUserEvent=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UserEvent} UserEvent instance */ - CompleteQueryRequest.create = function create(properties) { - return new CompleteQueryRequest(properties); + UserEvent.create = function create(properties) { + return new UserEvent(properties); }; /** - * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryRequest.verify|verify} messages. + * Encodes the specified UserEvent message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEvent.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @static - * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUserEvent} message UserEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompleteQueryRequest.encode = function encode(message, writer) { + UserEvent.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); - if (message.languageCodes != null && message.languageCodes.length) - for (var i = 0; i < message.languageCodes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCodes[i]); - if (message.deviceType != null && Object.hasOwnProperty.call(message, "deviceType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.deviceType); - if (message.maxSuggestions != null && Object.hasOwnProperty.call(message, "maxSuggestions")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxSuggestions); - if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.dataset); + if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventType); if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.visitorId); + writer.uint32(/* id 2, wireType 2 =*/18).string(message.visitorId); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.experimentIds != null && message.experimentIds.length) + for (var i = 0; i < message.experimentIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.experimentIds[i]); + if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.attributionToken); + if (message.productDetails != null && message.productDetails.length) + for (var i = 0; i < message.productDetails.length; ++i) + $root.google.cloud.retail.v2alpha.ProductDetail.encode(message.productDetails[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.retail.v2alpha.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.cartId != null && Object.hasOwnProperty.call(message, "cartId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.cartId); + if (message.purchaseTransaction != null && Object.hasOwnProperty.call(message, "purchaseTransaction")) + $root.google.cloud.retail.v2alpha.PurchaseTransaction.encode(message.purchaseTransaction, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.searchQuery != null && Object.hasOwnProperty.call(message, "searchQuery")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.searchQuery); + if (message.pageCategories != null && message.pageCategories.length) + for (var i = 0; i < message.pageCategories.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.pageCategories[i]); + if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) + $root.google.cloud.retail.v2alpha.UserInfo.encode(message.userInfo, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.uri); + if (message.referrerUri != null && Object.hasOwnProperty.call(message, "referrerUri")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.referrerUri); + if (message.pageViewId != null && Object.hasOwnProperty.call(message, "pageViewId")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.pageViewId); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.orderBy); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.offset); + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.sessionId); + if (message.completionDetail != null && Object.hasOwnProperty.call(message, "completionDetail")) + $root.google.cloud.retail.v2alpha.CompletionDetail.encode(message.completionDetail, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); return writer; }; /** - * Encodes the specified CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryRequest.verify|verify} messages. + * Encodes the specified UserEvent message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEvent.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @static - * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUserEvent} message UserEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompleteQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + UserEvent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CompleteQueryRequest message from the specified reader or buffer. + * Decodes a UserEvent message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @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.CompleteQueryRequest} CompleteQueryRequest + * @returns {google.cloud.retail.v2alpha.UserEvent} UserEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteQueryRequest.decode = function decode(reader, length) { + UserEvent.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.CompleteQueryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UserEvent(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.catalog = reader.string(); + message.eventType = reader.string(); break; case 2: - message.query = reader.string(); - break; - case 7: message.visitorId = reader.string(); break; + case 21: + message.sessionId = reader.string(); + break; case 3: - if (!(message.languageCodes && message.languageCodes.length)) - message.languageCodes = []; - message.languageCodes.push(reader.string()); + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 4: - message.deviceType = reader.string(); + if (!(message.experimentIds && message.experimentIds.length)) + message.experimentIds = []; + message.experimentIds.push(reader.string()); + break; + case 5: + message.attributionToken = reader.string(); break; case 6: - message.dataset = reader.string(); + if (!(message.productDetails && message.productDetails.length)) + message.productDetails = []; + message.productDetails.push($root.google.cloud.retail.v2alpha.ProductDetail.decode(reader, reader.uint32())); break; - case 5: - message.maxSuggestions = reader.int32(); + case 22: + message.completionDetail = $root.google.cloud.retail.v2alpha.CompletionDetail.decode(reader, reader.uint32()); + break; + case 7: + if (message.attributes === $util.emptyObject) + message.attributes = {}; + 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.CustomAttribute.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + case 8: + message.cartId = reader.string(); + break; + case 9: + message.purchaseTransaction = $root.google.cloud.retail.v2alpha.PurchaseTransaction.decode(reader, reader.uint32()); + break; + case 10: + message.searchQuery = reader.string(); + break; + case 16: + message.filter = reader.string(); + break; + case 17: + message.orderBy = reader.string(); + break; + case 18: + message.offset = reader.int32(); + break; + case 11: + if (!(message.pageCategories && message.pageCategories.length)) + message.pageCategories = []; + message.pageCategories.push(reader.string()); + break; + case 12: + message.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.decode(reader, reader.uint32()); + break; + case 13: + message.uri = reader.string(); + break; + case 14: + message.referrerUri = reader.string(); + break; + case 15: + message.pageViewId = reader.string(); break; default: reader.skipType(tag & 7); @@ -38780,173 +37935,344 @@ }; /** - * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. + * Decodes a UserEvent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CompleteQueryRequest} CompleteQueryRequest + * @returns {google.cloud.retail.v2alpha.UserEvent} UserEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteQueryRequest.decodeDelimited = function decodeDelimited(reader) { + UserEvent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CompleteQueryRequest message. + * Verifies a UserEvent message. * @function verify - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CompleteQueryRequest.verify = function verify(message) { + UserEvent.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.catalog != null && message.hasOwnProperty("catalog")) - if (!$util.isString(message.catalog)) - return "catalog: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: string expected"; + if (message.eventType != null && message.hasOwnProperty("eventType")) + if (!$util.isString(message.eventType)) + return "eventType: string expected"; if (message.visitorId != null && message.hasOwnProperty("visitorId")) if (!$util.isString(message.visitorId)) return "visitorId: string expected"; - if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { - if (!Array.isArray(message.languageCodes)) - return "languageCodes: array expected"; - for (var i = 0; i < message.languageCodes.length; ++i) - if (!$util.isString(message.languageCodes[i])) - return "languageCodes: string[] expected"; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + if (!$util.isString(message.sessionId)) + return "sessionId: string expected"; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; } - if (message.deviceType != null && message.hasOwnProperty("deviceType")) - if (!$util.isString(message.deviceType)) - return "deviceType: string expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) - if (!$util.isInteger(message.maxSuggestions)) - return "maxSuggestions: integer expected"; + if (message.experimentIds != null && message.hasOwnProperty("experimentIds")) { + if (!Array.isArray(message.experimentIds)) + return "experimentIds: array expected"; + for (var i = 0; i < message.experimentIds.length; ++i) + if (!$util.isString(message.experimentIds[i])) + return "experimentIds: string[] expected"; + } + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + if (!$util.isString(message.attributionToken)) + return "attributionToken: string expected"; + if (message.productDetails != null && message.hasOwnProperty("productDetails")) { + if (!Array.isArray(message.productDetails)) + return "productDetails: array expected"; + for (var i = 0; i < message.productDetails.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.ProductDetail.verify(message.productDetails[i]); + if (error) + return "productDetails." + error; + } + } + if (message.completionDetail != null && message.hasOwnProperty("completionDetail")) { + var error = $root.google.cloud.retail.v2alpha.CompletionDetail.verify(message.completionDetail); + if (error) + return "completionDetail." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.CustomAttribute.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + if (message.cartId != null && message.hasOwnProperty("cartId")) + if (!$util.isString(message.cartId)) + return "cartId: string expected"; + if (message.purchaseTransaction != null && message.hasOwnProperty("purchaseTransaction")) { + var error = $root.google.cloud.retail.v2alpha.PurchaseTransaction.verify(message.purchaseTransaction); + if (error) + return "purchaseTransaction." + error; + } + if (message.searchQuery != null && message.hasOwnProperty("searchQuery")) + if (!$util.isString(message.searchQuery)) + return "searchQuery: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.pageCategories != null && message.hasOwnProperty("pageCategories")) { + if (!Array.isArray(message.pageCategories)) + return "pageCategories: array expected"; + for (var i = 0; i < message.pageCategories.length; ++i) + if (!$util.isString(message.pageCategories[i])) + return "pageCategories: string[] expected"; + } + if (message.userInfo != null && message.hasOwnProperty("userInfo")) { + var error = $root.google.cloud.retail.v2alpha.UserInfo.verify(message.userInfo); + if (error) + return "userInfo." + error; + } + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.referrerUri != null && message.hasOwnProperty("referrerUri")) + if (!$util.isString(message.referrerUri)) + return "referrerUri: string expected"; + if (message.pageViewId != null && message.hasOwnProperty("pageViewId")) + if (!$util.isString(message.pageViewId)) + return "pageViewId: string expected"; return null; }; /** - * Creates a CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a UserEvent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CompleteQueryRequest} CompleteQueryRequest + * @returns {google.cloud.retail.v2alpha.UserEvent} UserEvent */ - CompleteQueryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryRequest) + UserEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UserEvent) return object; - var message = new $root.google.cloud.retail.v2alpha.CompleteQueryRequest(); - if (object.catalog != null) - message.catalog = String(object.catalog); - if (object.query != null) - message.query = String(object.query); + var message = new $root.google.cloud.retail.v2alpha.UserEvent(); + if (object.eventType != null) + message.eventType = String(object.eventType); if (object.visitorId != null) message.visitorId = String(object.visitorId); - if (object.languageCodes) { - if (!Array.isArray(object.languageCodes)) - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryRequest.languageCodes: array expected"); - message.languageCodes = []; - for (var i = 0; i < object.languageCodes.length; ++i) - message.languageCodes[i] = String(object.languageCodes[i]); + if (object.sessionId != null) + message.sessionId = String(object.sessionId); + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); } - if (object.deviceType != null) - message.deviceType = String(object.deviceType); - if (object.dataset != null) - message.dataset = String(object.dataset); - if (object.maxSuggestions != null) - message.maxSuggestions = object.maxSuggestions | 0; - return message; - }; - - /** - * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryRequest} message CompleteQueryRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CompleteQueryRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.languageCodes = []; - if (options.defaults) { - object.catalog = ""; - object.query = ""; - object.deviceType = ""; - object.maxSuggestions = 0; - object.dataset = ""; - object.visitorId = ""; + if (object.experimentIds) { + if (!Array.isArray(object.experimentIds)) + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.experimentIds: array expected"); + message.experimentIds = []; + for (var i = 0; i < object.experimentIds.length; ++i) + message.experimentIds[i] = String(object.experimentIds[i]); } - if (message.catalog != null && message.hasOwnProperty("catalog")) - object.catalog = message.catalog; - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.languageCodes && message.languageCodes.length) { - object.languageCodes = []; - for (var j = 0; j < message.languageCodes.length; ++j) - object.languageCodes[j] = message.languageCodes[j]; + if (object.attributionToken != null) + message.attributionToken = String(object.attributionToken); + if (object.productDetails) { + if (!Array.isArray(object.productDetails)) + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.productDetails: array expected"); + message.productDetails = []; + for (var i = 0; i < object.productDetails.length; ++i) { + if (typeof object.productDetails[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.productDetails: object expected"); + message.productDetails[i] = $root.google.cloud.retail.v2alpha.ProductDetail.fromObject(object.productDetails[i]); + } } - if (message.deviceType != null && message.hasOwnProperty("deviceType")) - object.deviceType = message.deviceType; - if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) - object.maxSuggestions = message.maxSuggestions; - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = message.dataset; + if (object.completionDetail != null) { + if (typeof object.completionDetail !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.completionDetail: object expected"); + message.completionDetail = $root.google.cloud.retail.v2alpha.CompletionDetail.fromObject(object.completionDetail); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.retail.v2alpha.CustomAttribute.fromObject(object.attributes[keys[i]]); + } + } + if (object.cartId != null) + message.cartId = String(object.cartId); + if (object.purchaseTransaction != null) { + if (typeof object.purchaseTransaction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.purchaseTransaction: object expected"); + message.purchaseTransaction = $root.google.cloud.retail.v2alpha.PurchaseTransaction.fromObject(object.purchaseTransaction); + } + if (object.searchQuery != null) + message.searchQuery = String(object.searchQuery); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.offset != null) + message.offset = object.offset | 0; + if (object.pageCategories) { + if (!Array.isArray(object.pageCategories)) + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.pageCategories: array expected"); + message.pageCategories = []; + for (var i = 0; i < object.pageCategories.length; ++i) + message.pageCategories[i] = String(object.pageCategories[i]); + } + if (object.userInfo != null) { + if (typeof object.userInfo !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.userInfo: object expected"); + message.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.fromObject(object.userInfo); + } + if (object.uri != null) + message.uri = String(object.uri); + if (object.referrerUri != null) + message.referrerUri = String(object.referrerUri); + if (object.pageViewId != null) + message.pageViewId = String(object.pageViewId); + return message; + }; + + /** + * Creates a plain object from a UserEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.UserEvent + * @static + * @param {google.cloud.retail.v2alpha.UserEvent} message UserEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.experimentIds = []; + object.productDetails = []; + object.pageCategories = []; + } + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.eventType = ""; + object.visitorId = ""; + object.eventTime = null; + object.attributionToken = ""; + object.cartId = ""; + object.purchaseTransaction = null; + object.searchQuery = ""; + object.userInfo = null; + object.uri = ""; + object.referrerUri = ""; + object.pageViewId = ""; + object.filter = ""; + object.orderBy = ""; + object.offset = 0; + object.sessionId = ""; + object.completionDetail = null; + } + if (message.eventType != null && message.hasOwnProperty("eventType")) + object.eventType = message.eventType; if (message.visitorId != null && message.hasOwnProperty("visitorId")) object.visitorId = message.visitorId; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.experimentIds && message.experimentIds.length) { + object.experimentIds = []; + for (var j = 0; j < message.experimentIds.length; ++j) + object.experimentIds[j] = message.experimentIds[j]; + } + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + object.attributionToken = message.attributionToken; + if (message.productDetails && message.productDetails.length) { + object.productDetails = []; + for (var j = 0; j < message.productDetails.length; ++j) + object.productDetails[j] = $root.google.cloud.retail.v2alpha.ProductDetail.toObject(message.productDetails[j], options); + } + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.retail.v2alpha.CustomAttribute.toObject(message.attributes[keys2[j]], options); + } + if (message.cartId != null && message.hasOwnProperty("cartId")) + object.cartId = message.cartId; + if (message.purchaseTransaction != null && message.hasOwnProperty("purchaseTransaction")) + object.purchaseTransaction = $root.google.cloud.retail.v2alpha.PurchaseTransaction.toObject(message.purchaseTransaction, options); + if (message.searchQuery != null && message.hasOwnProperty("searchQuery")) + object.searchQuery = message.searchQuery; + if (message.pageCategories && message.pageCategories.length) { + object.pageCategories = []; + for (var j = 0; j < message.pageCategories.length; ++j) + object.pageCategories[j] = message.pageCategories[j]; + } + if (message.userInfo != null && message.hasOwnProperty("userInfo")) + object.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.toObject(message.userInfo, options); + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.referrerUri != null && message.hasOwnProperty("referrerUri")) + object.referrerUri = message.referrerUri; + if (message.pageViewId != null && message.hasOwnProperty("pageViewId")) + object.pageViewId = message.pageViewId; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + object.sessionId = message.sessionId; + if (message.completionDetail != null && message.hasOwnProperty("completionDetail")) + object.completionDetail = $root.google.cloud.retail.v2alpha.CompletionDetail.toObject(message.completionDetail, options); return object; }; /** - * Converts this CompleteQueryRequest to JSON. + * Converts this UserEvent to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @instance * @returns {Object.} JSON object */ - CompleteQueryRequest.prototype.toJSON = function toJSON() { + UserEvent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CompleteQueryRequest; + return UserEvent; })(); - v2alpha.CompleteQueryResponse = (function() { + v2alpha.ProductDetail = (function() { /** - * Properties of a CompleteQueryResponse. + * Properties of a ProductDetail. * @memberof google.cloud.retail.v2alpha - * @interface ICompleteQueryResponse - * @property {Array.|null} [completionResults] CompleteQueryResponse completionResults - * @property {string|null} [attributionToken] CompleteQueryResponse attributionToken - * @property {Array.|null} [recentSearchResults] CompleteQueryResponse recentSearchResults + * @interface IProductDetail + * @property {google.cloud.retail.v2alpha.IProduct|null} [product] ProductDetail product + * @property {google.protobuf.IInt32Value|null} [quantity] ProductDetail quantity */ /** - * Constructs a new CompleteQueryResponse. + * Constructs a new ProductDetail. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CompleteQueryResponse. - * @implements ICompleteQueryResponse + * @classdesc Represents a ProductDetail. + * @implements IProductDetail * @constructor - * @param {google.cloud.retail.v2alpha.ICompleteQueryResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IProductDetail=} [properties] Properties to set */ - function CompleteQueryResponse(properties) { - this.completionResults = []; - this.recentSearchResults = []; + function ProductDetail(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -38954,107 +38280,88 @@ } /** - * CompleteQueryResponse completionResults. - * @member {Array.} completionResults - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse - * @instance - */ - CompleteQueryResponse.prototype.completionResults = $util.emptyArray; - - /** - * CompleteQueryResponse attributionToken. - * @member {string} attributionToken - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * ProductDetail product. + * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} product + * @memberof google.cloud.retail.v2alpha.ProductDetail * @instance */ - CompleteQueryResponse.prototype.attributionToken = ""; + ProductDetail.prototype.product = null; /** - * CompleteQueryResponse recentSearchResults. - * @member {Array.} recentSearchResults - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * ProductDetail quantity. + * @member {google.protobuf.IInt32Value|null|undefined} quantity + * @memberof google.cloud.retail.v2alpha.ProductDetail * @instance */ - CompleteQueryResponse.prototype.recentSearchResults = $util.emptyArray; + ProductDetail.prototype.quantity = null; /** - * Creates a new CompleteQueryResponse instance using the specified properties. + * Creates a new ProductDetail instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.ProductDetail * @static - * @param {google.cloud.retail.v2alpha.ICompleteQueryResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse} CompleteQueryResponse instance + * @param {google.cloud.retail.v2alpha.IProductDetail=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ProductDetail} ProductDetail instance */ - CompleteQueryResponse.create = function create(properties) { - return new CompleteQueryResponse(properties); + ProductDetail.create = function create(properties) { + return new ProductDetail(properties); }; /** - * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.verify|verify} messages. + * Encodes the specified ProductDetail message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductDetail.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.ProductDetail * @static - * @param {google.cloud.retail.v2alpha.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProductDetail} message ProductDetail message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompleteQueryResponse.encode = function encode(message, writer) { + ProductDetail.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.completionResults != null && message.completionResults.length) - for (var i = 0; i < message.completionResults.length; ++i) - $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.encode(message.completionResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributionToken); - 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.product != null && Object.hasOwnProperty.call(message, "product")) + $root.google.cloud.retail.v2alpha.Product.encode(message.product, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + $root.google.protobuf.Int32Value.encode(message.quantity, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.verify|verify} messages. + * Encodes the specified ProductDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductDetail.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.ProductDetail * @static - * @param {google.cloud.retail.v2alpha.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProductDetail} message ProductDetail message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompleteQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + ProductDetail.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CompleteQueryResponse message from the specified reader or buffer. + * Decodes a ProductDetail message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.ProductDetail * @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} CompleteQueryResponse + * @returns {google.cloud.retail.v2alpha.ProductDetail} ProductDetail * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteQueryResponse.decode = function decode(reader, length) { + ProductDetail.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.ProductDetail(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.completionResults && message.completionResults.length)) - message.completionResults = []; - message.completionResults.push($root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.decode(reader, reader.uint32())); + message.product = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); break; case 2: - message.attributionToken = reader.string(); - break; - case 3: - if (!(message.recentSearchResults && message.recentSearchResults.length)) - message.recentSearchResults = []; - message.recentSearchResults.push($root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.decode(reader, reader.uint32())); + message.quantity = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -39065,688 +38372,230 @@ }; /** - * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. + * Decodes a ProductDetail message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.ProductDetail * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse} CompleteQueryResponse + * @returns {google.cloud.retail.v2alpha.ProductDetail} ProductDetail * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteQueryResponse.decodeDelimited = function decodeDelimited(reader) { + ProductDetail.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CompleteQueryResponse message. + * Verifies a ProductDetail message. * @function verify - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.ProductDetail * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CompleteQueryResponse.verify = function verify(message) { + ProductDetail.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.completionResults != null && message.hasOwnProperty("completionResults")) { - if (!Array.isArray(message.completionResults)) - return "completionResults: array expected"; - for (var i = 0; i < message.completionResults.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify(message.completionResults[i]); - if (error) - return "completionResults." + error; - } + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.retail.v2alpha.Product.verify(message.product); + if (error) + return "product." + error; } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - if (!$util.isString(message.attributionToken)) - return "attributionToken: string expected"; - if (message.recentSearchResults != null && message.hasOwnProperty("recentSearchResults")) { - if (!Array.isArray(message.recentSearchResults)) - return "recentSearchResults: array expected"; - for (var i = 0; i < message.recentSearchResults.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify(message.recentSearchResults[i]); - if (error) - return "recentSearchResults." + error; - } + if (message.quantity != null && message.hasOwnProperty("quantity")) { + var error = $root.google.protobuf.Int32Value.verify(message.quantity); + if (error) + return "quantity." + error; } return null; }; /** - * Creates a CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ProductDetail message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.ProductDetail * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse} CompleteQueryResponse + * @returns {google.cloud.retail.v2alpha.ProductDetail} ProductDetail */ - CompleteQueryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryResponse) + ProductDetail.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ProductDetail) return object; - var message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse(); - if (object.completionResults) { - if (!Array.isArray(object.completionResults)) - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.completionResults: array expected"); - message.completionResults = []; - for (var i = 0; i < object.completionResults.length; ++i) { - if (typeof object.completionResults[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.completionResults: object expected"); - message.completionResults[i] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.fromObject(object.completionResults[i]); - } + var message = new $root.google.cloud.retail.v2alpha.ProductDetail(); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ProductDetail.product: object expected"); + message.product = $root.google.cloud.retail.v2alpha.Product.fromObject(object.product); } - if (object.attributionToken != null) - message.attributionToken = String(object.attributionToken); - if (object.recentSearchResults) { - if (!Array.isArray(object.recentSearchResults)) - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.recentSearchResults: array expected"); - message.recentSearchResults = []; - for (var i = 0; i < object.recentSearchResults.length; ++i) { - if (typeof object.recentSearchResults[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.recentSearchResults: object expected"); - message.recentSearchResults[i] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.fromObject(object.recentSearchResults[i]); - } + if (object.quantity != null) { + if (typeof object.quantity !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ProductDetail.quantity: object expected"); + message.quantity = $root.google.protobuf.Int32Value.fromObject(object.quantity); } return message; }; /** - * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. + * Creates a plain object from a ProductDetail message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.ProductDetail * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse} message CompleteQueryResponse + * @param {google.cloud.retail.v2alpha.ProductDetail} message ProductDetail * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CompleteQueryResponse.toObject = function toObject(message, options) { + ProductDetail.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.completionResults = []; - object.recentSearchResults = []; - } - if (options.defaults) - object.attributionToken = ""; - if (message.completionResults && message.completionResults.length) { - object.completionResults = []; - for (var j = 0; j < message.completionResults.length; ++j) - object.completionResults[j] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.toObject(message.completionResults[j], options); - } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - object.attributionToken = message.attributionToken; - if (message.recentSearchResults && message.recentSearchResults.length) { - object.recentSearchResults = []; - for (var j = 0; j < message.recentSearchResults.length; ++j) - object.recentSearchResults[j] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.toObject(message.recentSearchResults[j], options); + if (options.defaults) { + object.product = null; + object.quantity = null; } + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.retail.v2alpha.Product.toObject(message.product, options); + if (message.quantity != null && message.hasOwnProperty("quantity")) + object.quantity = $root.google.protobuf.Int32Value.toObject(message.quantity, options); return object; }; /** - * Converts this CompleteQueryResponse to JSON. + * Converts this ProductDetail to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.ProductDetail * @instance * @returns {Object.} JSON object */ - CompleteQueryResponse.prototype.toJSON = function toJSON() { + ProductDetail.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - CompleteQueryResponse.CompletionResult = (function() { + return ProductDetail; + })(); - /** - * Properties of a CompletionResult. - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse - * @interface ICompletionResult - * @property {string|null} [suggestion] CompletionResult suggestion - * @property {Object.|null} [attributes] CompletionResult attributes - */ + v2alpha.CompletionDetail = (function() { - /** - * Constructs a new CompletionResult. - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse - * @classdesc Represents a CompletionResult. - * @implements ICompletionResult - * @constructor - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult=} [properties] Properties to set - */ - function CompletionResult(properties) { - this.attributes = {}; - 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]]; - } + /** + * Properties of a CompletionDetail. + * @memberof google.cloud.retail.v2alpha + * @interface ICompletionDetail + * @property {string|null} [completionAttributionToken] CompletionDetail completionAttributionToken + * @property {string|null} [selectedSuggestion] CompletionDetail selectedSuggestion + * @property {number|null} [selectedPosition] CompletionDetail selectedPosition + */ - /** - * CompletionResult suggestion. - * @member {string} suggestion - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @instance - */ - CompletionResult.prototype.suggestion = ""; + /** + * Constructs a new CompletionDetail. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a CompletionDetail. + * @implements ICompletionDetail + * @constructor + * @param {google.cloud.retail.v2alpha.ICompletionDetail=} [properties] Properties to set + */ + function CompletionDetail(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]]; + } - /** - * CompletionResult attributes. - * @member {Object.} attributes - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @instance - */ - CompletionResult.prototype.attributes = $util.emptyObject; + /** + * CompletionDetail completionAttributionToken. + * @member {string} completionAttributionToken + * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @instance + */ + CompletionDetail.prototype.completionAttributionToken = ""; - /** - * Creates a new CompletionResult instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} CompletionResult instance - */ - CompletionResult.create = function create(properties) { - return new CompletionResult(properties); - }; - - /** - * Encodes the specified CompletionResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult} message CompletionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompletionResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.suggestion != null && Object.hasOwnProperty.call(message, "suggestion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.suggestion); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.retail.v2alpha.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CompletionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult} message CompletionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompletionResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CompletionResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @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.CompletionResult} CompletionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompletionResult.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.CompletionResult(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.suggestion = reader.string(); - break; - case 2: - if (message.attributes === $util.emptyObject) - message.attributes = {}; - 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.CustomAttribute.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributes[key] = value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CompletionResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} CompletionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompletionResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CompletionResult message. - * @function verify - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CompletionResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.suggestion != null && message.hasOwnProperty("suggestion")) - if (!$util.isString(message.suggestion)) - return "suggestion: string expected"; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.CustomAttribute.verify(message.attributes[key[i]]); - if (error) - return "attributes." + error; - } - } - return null; - }; - - /** - * Creates a CompletionResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} CompletionResult - */ - CompletionResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult) - return object; - var message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult(); - if (object.suggestion != null) - message.suggestion = String(object.suggestion); - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { - if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.attributes: object expected"); - message.attributes[keys[i]] = $root.google.cloud.retail.v2alpha.CustomAttribute.fromObject(object.attributes[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a CompletionResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} message CompletionResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CompletionResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.attributes = {}; - if (options.defaults) - object.suggestion = ""; - if (message.suggestion != null && message.hasOwnProperty("suggestion")) - object.suggestion = message.suggestion; - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = $root.google.cloud.retail.v2alpha.CustomAttribute.toObject(message.attributes[keys2[j]], options); - } - return object; - }; - - /** - * Converts this CompletionResult to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @instance - * @returns {Object.} JSON object - */ - CompletionResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CompletionResult; - })(); - - CompleteQueryResponse.RecentSearchResult = (function() { - - /** - * Properties of a RecentSearchResult. - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse - * @interface IRecentSearchResult - * @property {string|null} [recentSearch] RecentSearchResult recentSearch - */ - - /** - * Constructs a new RecentSearchResult. - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse - * @classdesc Represents a RecentSearchResult. - * @implements IRecentSearchResult - * @constructor - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult=} [properties] Properties to set - */ - function RecentSearchResult(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]]; - } - - /** - * RecentSearchResult recentSearch. - * @member {string} recentSearch - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @instance - */ - RecentSearchResult.prototype.recentSearch = ""; - - /** - * Creates a new RecentSearchResult instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} RecentSearchResult instance - */ - RecentSearchResult.create = function create(properties) { - return new RecentSearchResult(properties); - }; - - /** - * Encodes the specified RecentSearchResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult} message RecentSearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RecentSearchResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.recentSearch != null && Object.hasOwnProperty.call(message, "recentSearch")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.recentSearch); - return writer; - }; - - /** - * Encodes the specified RecentSearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult} message RecentSearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RecentSearchResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RecentSearchResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @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.RecentSearchResult} RecentSearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RecentSearchResult.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.RecentSearchResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.recentSearch = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RecentSearchResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} RecentSearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RecentSearchResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RecentSearchResult message. - * @function verify - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RecentSearchResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.recentSearch != null && message.hasOwnProperty("recentSearch")) - if (!$util.isString(message.recentSearch)) - return "recentSearch: string expected"; - return null; - }; - - /** - * Creates a RecentSearchResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} RecentSearchResult - */ - RecentSearchResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult) - return object; - var message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult(); - if (object.recentSearch != null) - message.recentSearch = String(object.recentSearch); - return message; - }; - - /** - * Creates a plain object from a RecentSearchResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} message RecentSearchResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RecentSearchResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.recentSearch = ""; - if (message.recentSearch != null && message.hasOwnProperty("recentSearch")) - object.recentSearch = message.recentSearch; - return object; - }; - - /** - * Converts this RecentSearchResult to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @instance - * @returns {Object.} JSON object - */ - RecentSearchResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RecentSearchResult; - })(); - - return CompleteQueryResponse; - })(); - - v2alpha.ExportErrorsConfig = (function() { - - /** - * Properties of an ExportErrorsConfig. - * @memberof google.cloud.retail.v2alpha - * @interface IExportErrorsConfig - * @property {string|null} [gcsPrefix] ExportErrorsConfig gcsPrefix - */ - - /** - * Constructs a new ExportErrorsConfig. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ExportErrorsConfig. - * @implements IExportErrorsConfig - * @constructor - * @param {google.cloud.retail.v2alpha.IExportErrorsConfig=} [properties] Properties to set - */ - function ExportErrorsConfig(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]]; - } - - /** - * ExportErrorsConfig gcsPrefix. - * @member {string|null|undefined} gcsPrefix - * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig - * @instance - */ - ExportErrorsConfig.prototype.gcsPrefix = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * CompletionDetail selectedSuggestion. + * @member {string} selectedSuggestion + * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @instance + */ + CompletionDetail.prototype.selectedSuggestion = ""; /** - * ExportErrorsConfig destination. - * @member {"gcsPrefix"|undefined} destination - * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig + * CompletionDetail selectedPosition. + * @member {number} selectedPosition + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @instance */ - Object.defineProperty(ExportErrorsConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsPrefix"]), - set: $util.oneOfSetter($oneOfFields) - }); + CompletionDetail.prototype.selectedPosition = 0; /** - * Creates a new ExportErrorsConfig instance using the specified properties. + * Creates a new CompletionDetail instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @static - * @param {google.cloud.retail.v2alpha.IExportErrorsConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ExportErrorsConfig} ExportErrorsConfig instance + * @param {google.cloud.retail.v2alpha.ICompletionDetail=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CompletionDetail} CompletionDetail instance */ - ExportErrorsConfig.create = function create(properties) { - return new ExportErrorsConfig(properties); + CompletionDetail.create = function create(properties) { + return new CompletionDetail(properties); }; /** - * Encodes the specified ExportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ExportErrorsConfig.verify|verify} messages. + * Encodes the specified CompletionDetail message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDetail.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @static - * @param {google.cloud.retail.v2alpha.IExportErrorsConfig} message ExportErrorsConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICompletionDetail} message CompletionDetail message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportErrorsConfig.encode = function encode(message, writer) { + CompletionDetail.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsPrefix); + if (message.completionAttributionToken != null && Object.hasOwnProperty.call(message, "completionAttributionToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.completionAttributionToken); + if (message.selectedSuggestion != null && Object.hasOwnProperty.call(message, "selectedSuggestion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.selectedSuggestion); + if (message.selectedPosition != null && Object.hasOwnProperty.call(message, "selectedPosition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.selectedPosition); return writer; }; /** - * Encodes the specified ExportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExportErrorsConfig.verify|verify} messages. + * Encodes the specified CompletionDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDetail.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @static - * @param {google.cloud.retail.v2alpha.IExportErrorsConfig} message ExportErrorsConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICompletionDetail} message CompletionDetail message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportErrorsConfig.encodeDelimited = function encodeDelimited(message, writer) { + CompletionDetail.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportErrorsConfig message from the specified reader or buffer. + * Decodes a CompletionDetail message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @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.ExportErrorsConfig} ExportErrorsConfig + * @returns {google.cloud.retail.v2alpha.CompletionDetail} CompletionDetail * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportErrorsConfig.decode = function decode(reader, length) { + CompletionDetail.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.ExportErrorsConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompletionDetail(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gcsPrefix = reader.string(); + message.completionAttributionToken = reader.string(); + break; + case 2: + message.selectedSuggestion = reader.string(); + break; + case 3: + message.selectedPosition = reader.int32(); break; default: reader.skipType(tag & 7); @@ -39757,112 +38606,128 @@ }; /** - * Decodes an ExportErrorsConfig message from the specified reader or buffer, length delimited. + * Decodes a CompletionDetail message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ExportErrorsConfig} ExportErrorsConfig + * @returns {google.cloud.retail.v2alpha.CompletionDetail} CompletionDetail * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportErrorsConfig.decodeDelimited = function decodeDelimited(reader) { + CompletionDetail.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportErrorsConfig message. + * Verifies a CompletionDetail message. * @function verify - * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportErrorsConfig.verify = function verify(message) { + CompletionDetail.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { - properties.destination = 1; - if (!$util.isString(message.gcsPrefix)) - return "gcsPrefix: string expected"; - } + if (message.completionAttributionToken != null && message.hasOwnProperty("completionAttributionToken")) + if (!$util.isString(message.completionAttributionToken)) + return "completionAttributionToken: string expected"; + if (message.selectedSuggestion != null && message.hasOwnProperty("selectedSuggestion")) + if (!$util.isString(message.selectedSuggestion)) + return "selectedSuggestion: string expected"; + if (message.selectedPosition != null && message.hasOwnProperty("selectedPosition")) + if (!$util.isInteger(message.selectedPosition)) + return "selectedPosition: integer expected"; return null; }; /** - * Creates an ExportErrorsConfig message from a plain object. Also converts values to their respective internal types. + * Creates a CompletionDetail message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ExportErrorsConfig} ExportErrorsConfig + * @returns {google.cloud.retail.v2alpha.CompletionDetail} CompletionDetail */ - ExportErrorsConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ExportErrorsConfig) + CompletionDetail.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CompletionDetail) return object; - var message = new $root.google.cloud.retail.v2alpha.ExportErrorsConfig(); - if (object.gcsPrefix != null) - message.gcsPrefix = String(object.gcsPrefix); - return message; + var message = new $root.google.cloud.retail.v2alpha.CompletionDetail(); + if (object.completionAttributionToken != null) + message.completionAttributionToken = String(object.completionAttributionToken); + if (object.selectedSuggestion != null) + message.selectedSuggestion = String(object.selectedSuggestion); + if (object.selectedPosition != null) + message.selectedPosition = object.selectedPosition | 0; + return message; }; /** - * Creates a plain object from an ExportErrorsConfig message. Also converts values to other types if specified. + * Creates a plain object from a CompletionDetail message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @static - * @param {google.cloud.retail.v2alpha.ExportErrorsConfig} message ExportErrorsConfig + * @param {google.cloud.retail.v2alpha.CompletionDetail} message CompletionDetail * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportErrorsConfig.toObject = function toObject(message, options) { + CompletionDetail.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { - object.gcsPrefix = message.gcsPrefix; - if (options.oneofs) - object.destination = "gcsPrefix"; + if (options.defaults) { + object.completionAttributionToken = ""; + object.selectedSuggestion = ""; + object.selectedPosition = 0; } + if (message.completionAttributionToken != null && message.hasOwnProperty("completionAttributionToken")) + object.completionAttributionToken = message.completionAttributionToken; + if (message.selectedSuggestion != null && message.hasOwnProperty("selectedSuggestion")) + object.selectedSuggestion = message.selectedSuggestion; + if (message.selectedPosition != null && message.hasOwnProperty("selectedPosition")) + object.selectedPosition = message.selectedPosition; return object; }; /** - * Converts this ExportErrorsConfig to JSON. + * Converts this CompletionDetail to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @instance * @returns {Object.} JSON object */ - ExportErrorsConfig.prototype.toJSON = function toJSON() { + CompletionDetail.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportErrorsConfig; + return CompletionDetail; })(); - v2alpha.ExportMetadata = (function() { + v2alpha.PurchaseTransaction = (function() { /** - * Properties of an ExportMetadata. + * Properties of a PurchaseTransaction. * @memberof google.cloud.retail.v2alpha - * @interface IExportMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] ExportMetadata createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ExportMetadata updateTime + * @interface IPurchaseTransaction + * @property {string|null} [id] PurchaseTransaction id + * @property {number|null} [revenue] PurchaseTransaction revenue + * @property {number|null} [tax] PurchaseTransaction tax + * @property {number|null} [cost] PurchaseTransaction cost + * @property {string|null} [currencyCode] PurchaseTransaction currencyCode */ /** - * Constructs a new ExportMetadata. + * Constructs a new PurchaseTransaction. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ExportMetadata. - * @implements IExportMetadata + * @classdesc Represents a PurchaseTransaction. + * @implements IPurchaseTransaction * @constructor - * @param {google.cloud.retail.v2alpha.IExportMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IPurchaseTransaction=} [properties] Properties to set */ - function ExportMetadata(properties) { + function PurchaseTransaction(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -39870,88 +38735,127 @@ } /** - * ExportMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.retail.v2alpha.ExportMetadata + * PurchaseTransaction id. + * @member {string} id + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @instance */ - ExportMetadata.prototype.createTime = null; + PurchaseTransaction.prototype.id = ""; /** - * ExportMetadata updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.retail.v2alpha.ExportMetadata + * PurchaseTransaction revenue. + * @member {number} revenue + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @instance */ - ExportMetadata.prototype.updateTime = null; + PurchaseTransaction.prototype.revenue = 0; /** - * Creates a new ExportMetadata instance using the specified properties. + * PurchaseTransaction tax. + * @member {number} tax + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @instance + */ + PurchaseTransaction.prototype.tax = 0; + + /** + * PurchaseTransaction cost. + * @member {number} cost + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @instance + */ + PurchaseTransaction.prototype.cost = 0; + + /** + * PurchaseTransaction currencyCode. + * @member {string} currencyCode + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @instance + */ + PurchaseTransaction.prototype.currencyCode = ""; + + /** + * Creates a new PurchaseTransaction instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ExportMetadata + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @static - * @param {google.cloud.retail.v2alpha.IExportMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ExportMetadata} ExportMetadata instance + * @param {google.cloud.retail.v2alpha.IPurchaseTransaction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PurchaseTransaction} PurchaseTransaction instance */ - ExportMetadata.create = function create(properties) { - return new ExportMetadata(properties); + PurchaseTransaction.create = function create(properties) { + return new PurchaseTransaction(properties); }; /** - * Encodes the specified ExportMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.ExportMetadata.verify|verify} messages. + * Encodes the specified PurchaseTransaction message. Does not implicitly {@link google.cloud.retail.v2alpha.PurchaseTransaction.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ExportMetadata + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @static - * @param {google.cloud.retail.v2alpha.IExportMetadata} message ExportMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurchaseTransaction} message PurchaseTransaction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportMetadata.encode = function encode(message, writer) { + PurchaseTransaction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.revenue != null && Object.hasOwnProperty.call(message, "revenue")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.revenue); + if (message.tax != null && Object.hasOwnProperty.call(message, "tax")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.tax); + if (message.cost != null && Object.hasOwnProperty.call(message, "cost")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.cost); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.currencyCode); return writer; }; /** - * Encodes the specified ExportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExportMetadata.verify|verify} messages. + * Encodes the specified PurchaseTransaction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurchaseTransaction.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ExportMetadata + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @static - * @param {google.cloud.retail.v2alpha.IExportMetadata} message ExportMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurchaseTransaction} message PurchaseTransaction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportMetadata.encodeDelimited = function encodeDelimited(message, writer) { + PurchaseTransaction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportMetadata message from the specified reader or buffer. + * Decodes a PurchaseTransaction message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ExportMetadata + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @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.ExportMetadata} ExportMetadata + * @returns {google.cloud.retail.v2alpha.PurchaseTransaction} PurchaseTransaction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportMetadata.decode = function decode(reader, length) { + PurchaseTransaction.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.ExportMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PurchaseTransaction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.id = reader.string(); break; case 2: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.revenue = reader.float(); + break; + case 3: + message.tax = reader.float(); + break; + case 4: + message.cost = reader.float(); + break; + case 5: + message.currencyCode = reader.string(); break; default: reader.skipType(tag & 7); @@ -39962,128 +38866,309 @@ }; /** - * Decodes an ExportMetadata message from the specified reader or buffer, length delimited. + * Decodes a PurchaseTransaction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ExportMetadata + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ExportMetadata} ExportMetadata + * @returns {google.cloud.retail.v2alpha.PurchaseTransaction} PurchaseTransaction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportMetadata.decodeDelimited = function decodeDelimited(reader) { + PurchaseTransaction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportMetadata message. + * Verifies a PurchaseTransaction message. * @function verify - * @memberof google.cloud.retail.v2alpha.ExportMetadata + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportMetadata.verify = function verify(message) { + PurchaseTransaction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.revenue != null && message.hasOwnProperty("revenue")) + if (typeof message.revenue !== "number") + return "revenue: number expected"; + if (message.tax != null && message.hasOwnProperty("tax")) + if (typeof message.tax !== "number") + return "tax: number expected"; + if (message.cost != null && message.hasOwnProperty("cost")) + if (typeof message.cost !== "number") + return "cost: number expected"; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; return null; }; /** - * Creates an ExportMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a PurchaseTransaction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ExportMetadata + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ExportMetadata} ExportMetadata + * @returns {google.cloud.retail.v2alpha.PurchaseTransaction} PurchaseTransaction */ - ExportMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ExportMetadata) + PurchaseTransaction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PurchaseTransaction) return object; - var message = new $root.google.cloud.retail.v2alpha.ExportMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ExportMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ExportMetadata.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } + var message = new $root.google.cloud.retail.v2alpha.PurchaseTransaction(); + if (object.id != null) + message.id = String(object.id); + if (object.revenue != null) + message.revenue = Number(object.revenue); + if (object.tax != null) + message.tax = Number(object.tax); + if (object.cost != null) + message.cost = Number(object.cost); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); return message; }; /** - * Creates a plain object from an ExportMetadata message. Also converts values to other types if specified. + * Creates a plain object from a PurchaseTransaction message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ExportMetadata + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @static - * @param {google.cloud.retail.v2alpha.ExportMetadata} message ExportMetadata + * @param {google.cloud.retail.v2alpha.PurchaseTransaction} message PurchaseTransaction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportMetadata.toObject = function toObject(message, options) { + PurchaseTransaction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.createTime = null; - object.updateTime = null; + object.id = ""; + object.revenue = 0; + object.tax = 0; + object.cost = 0; + object.currencyCode = ""; } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.revenue != null && message.hasOwnProperty("revenue")) + object.revenue = options.json && !isFinite(message.revenue) ? String(message.revenue) : message.revenue; + if (message.tax != null && message.hasOwnProperty("tax")) + object.tax = options.json && !isFinite(message.tax) ? String(message.tax) : message.tax; + if (message.cost != null && message.hasOwnProperty("cost")) + object.cost = options.json && !isFinite(message.cost) ? String(message.cost) : message.cost; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; return object; }; /** - * Converts this ExportMetadata to JSON. + * Converts this PurchaseTransaction to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ExportMetadata + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @instance * @returns {Object.} JSON object */ - ExportMetadata.prototype.toJSON = function toJSON() { + PurchaseTransaction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportMetadata; + return PurchaseTransaction; })(); - v2alpha.ExportProductsResponse = (function() { + v2alpha.CatalogService = (function() { /** - * Properties of an ExportProductsResponse. + * Constructs a new CatalogService service. * @memberof google.cloud.retail.v2alpha - * @interface IExportProductsResponse - * @property {Array.|null} [errorSamples] ExportProductsResponse errorSamples - * @property {google.cloud.retail.v2alpha.IExportErrorsConfig|null} [errorsConfig] ExportProductsResponse errorsConfig + * @classdesc Represents a CatalogService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function CatalogService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CatalogService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CatalogService; + + /** + * Creates new CatalogService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2alpha.CatalogService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {CatalogService} RPC service. Useful where requests and/or responses are streamed. + */ + CatalogService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService#listCatalogs}. + * @memberof google.cloud.retail.v2alpha.CatalogService + * @typedef ListCatalogsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.ListCatalogsResponse} [response] ListCatalogsResponse */ /** - * Constructs a new ExportProductsResponse. + * Calls ListCatalogs. + * @function listCatalogs + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IListCatalogsRequest} request ListCatalogsRequest message or plain object + * @param {google.cloud.retail.v2alpha.CatalogService.ListCatalogsCallback} callback Node-style callback called with the error, if any, and ListCatalogsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.listCatalogs = function listCatalogs(request, callback) { + return this.rpcCall(listCatalogs, $root.google.cloud.retail.v2alpha.ListCatalogsRequest, $root.google.cloud.retail.v2alpha.ListCatalogsResponse, request, callback); + }, "name", { value: "ListCatalogs" }); + + /** + * Calls ListCatalogs. + * @function listCatalogs + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IListCatalogsRequest} request ListCatalogsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService#updateCatalog}. + * @memberof google.cloud.retail.v2alpha.CatalogService + * @typedef UpdateCatalogCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Catalog} [response] Catalog + */ + + /** + * Calls UpdateCatalog. + * @function updateCatalog + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest} request UpdateCatalogRequest message or plain object + * @param {google.cloud.retail.v2alpha.CatalogService.UpdateCatalogCallback} callback Node-style callback called with the error, if any, and Catalog + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.updateCatalog = function updateCatalog(request, callback) { + return this.rpcCall(updateCatalog, $root.google.cloud.retail.v2alpha.UpdateCatalogRequest, $root.google.cloud.retail.v2alpha.Catalog, request, callback); + }, "name", { value: "UpdateCatalog" }); + + /** + * Calls UpdateCatalog. + * @function updateCatalog + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest} request UpdateCatalogRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService#setDefaultBranch}. + * @memberof google.cloud.retail.v2alpha.CatalogService + * @typedef SetDefaultBranchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls SetDefaultBranch. + * @function setDefaultBranch + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest} request SetDefaultBranchRequest message or plain object + * @param {google.cloud.retail.v2alpha.CatalogService.SetDefaultBranchCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.setDefaultBranch = function setDefaultBranch(request, callback) { + return this.rpcCall(setDefaultBranch, $root.google.cloud.retail.v2alpha.SetDefaultBranchRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "SetDefaultBranch" }); + + /** + * Calls SetDefaultBranch. + * @function setDefaultBranch + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest} request SetDefaultBranchRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService#getDefaultBranch}. + * @memberof google.cloud.retail.v2alpha.CatalogService + * @typedef GetDefaultBranchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.GetDefaultBranchResponse} [response] GetDefaultBranchResponse + */ + + /** + * Calls GetDefaultBranch. + * @function getDefaultBranch + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest} request GetDefaultBranchRequest message or plain object + * @param {google.cloud.retail.v2alpha.CatalogService.GetDefaultBranchCallback} callback Node-style callback called with the error, if any, and GetDefaultBranchResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.getDefaultBranch = function getDefaultBranch(request, callback) { + return this.rpcCall(getDefaultBranch, $root.google.cloud.retail.v2alpha.GetDefaultBranchRequest, $root.google.cloud.retail.v2alpha.GetDefaultBranchResponse, request, callback); + }, "name", { value: "GetDefaultBranch" }); + + /** + * Calls GetDefaultBranch. + * @function getDefaultBranch + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest} request GetDefaultBranchRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CatalogService; + })(); + + v2alpha.ListCatalogsRequest = (function() { + + /** + * Properties of a ListCatalogsRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ExportProductsResponse. - * @implements IExportProductsResponse + * @interface IListCatalogsRequest + * @property {string|null} [parent] ListCatalogsRequest parent + * @property {number|null} [pageSize] ListCatalogsRequest pageSize + * @property {string|null} [pageToken] ListCatalogsRequest pageToken + */ + + /** + * Constructs a new ListCatalogsRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a ListCatalogsRequest. + * @implements IListCatalogsRequest * @constructor - * @param {google.cloud.retail.v2alpha.IExportProductsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IListCatalogsRequest=} [properties] Properties to set */ - function ExportProductsResponse(properties) { - this.errorSamples = []; + function ListCatalogsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -40091,91 +39176,101 @@ } /** - * ExportProductsResponse errorSamples. - * @member {Array.} errorSamples - * @memberof google.cloud.retail.v2alpha.ExportProductsResponse + * ListCatalogsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @instance */ - ExportProductsResponse.prototype.errorSamples = $util.emptyArray; + ListCatalogsRequest.prototype.parent = ""; /** - * ExportProductsResponse errorsConfig. - * @member {google.cloud.retail.v2alpha.IExportErrorsConfig|null|undefined} errorsConfig - * @memberof google.cloud.retail.v2alpha.ExportProductsResponse + * ListCatalogsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @instance */ - ExportProductsResponse.prototype.errorsConfig = null; + ListCatalogsRequest.prototype.pageSize = 0; /** - * Creates a new ExportProductsResponse instance using the specified properties. + * ListCatalogsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @instance + */ + ListCatalogsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCatalogsRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ExportProductsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @static - * @param {google.cloud.retail.v2alpha.IExportProductsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ExportProductsResponse} ExportProductsResponse instance + * @param {google.cloud.retail.v2alpha.IListCatalogsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListCatalogsRequest} ListCatalogsRequest instance */ - ExportProductsResponse.create = function create(properties) { - return new ExportProductsResponse(properties); + ListCatalogsRequest.create = function create(properties) { + return new ListCatalogsRequest(properties); }; /** - * Encodes the specified ExportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ExportProductsResponse.verify|verify} messages. + * Encodes the specified ListCatalogsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ExportProductsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @static - * @param {google.cloud.retail.v2alpha.IExportProductsResponse} message ExportProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListCatalogsRequest} message ListCatalogsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportProductsResponse.encode = function encode(message, writer) { + ListCatalogsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorSamples != null && message.errorSamples.length) - for (var i = 0; i < message.errorSamples.length; ++i) - $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) - $root.google.cloud.retail.v2alpha.ExportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified ExportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExportProductsResponse.verify|verify} messages. + * Encodes the specified ListCatalogsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ExportProductsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @static - * @param {google.cloud.retail.v2alpha.IExportProductsResponse} message ExportProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListCatalogsRequest} message ListCatalogsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListCatalogsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportProductsResponse message from the specified reader or buffer. + * Decodes a ListCatalogsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ExportProductsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @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.ExportProductsResponse} ExportProductsResponse + * @returns {google.cloud.retail.v2alpha.ListCatalogsRequest} ListCatalogsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportProductsResponse.decode = function decode(reader, length) { + ListCatalogsRequest.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.ExportProductsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListCatalogsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.errorSamples && message.errorSamples.length)) - message.errorSamples = []; - message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + message.parent = reader.string(); break; case 2: - message.errorsConfig = $root.google.cloud.retail.v2alpha.ExportErrorsConfig.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -40186,140 +39281,126 @@ }; /** - * Decodes an ExportProductsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListCatalogsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ExportProductsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ExportProductsResponse} ExportProductsResponse + * @returns {google.cloud.retail.v2alpha.ListCatalogsRequest} ListCatalogsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportProductsResponse.decodeDelimited = function decodeDelimited(reader) { + ListCatalogsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportProductsResponse message. + * Verifies a ListCatalogsRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.ExportProductsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportProductsResponse.verify = function verify(message) { + ListCatalogsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { - if (!Array.isArray(message.errorSamples)) - return "errorSamples: array expected"; - for (var i = 0; i < message.errorSamples.length; ++i) { - var error = $root.google.rpc.Status.verify(message.errorSamples[i]); - if (error) - return "errorSamples." + error; - } - } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { - var error = $root.google.cloud.retail.v2alpha.ExportErrorsConfig.verify(message.errorsConfig); - if (error) - return "errorsConfig." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates an ExportProductsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListCatalogsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ExportProductsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ExportProductsResponse} ExportProductsResponse + * @returns {google.cloud.retail.v2alpha.ListCatalogsRequest} ListCatalogsRequest */ - ExportProductsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ExportProductsResponse) + ListCatalogsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListCatalogsRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.ExportProductsResponse(); - if (object.errorSamples) { - if (!Array.isArray(object.errorSamples)) - throw TypeError(".google.cloud.retail.v2alpha.ExportProductsResponse.errorSamples: array expected"); - message.errorSamples = []; - for (var i = 0; i < object.errorSamples.length; ++i) { - if (typeof object.errorSamples[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ExportProductsResponse.errorSamples: object expected"); - message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); - } - } - if (object.errorsConfig != null) { - if (typeof object.errorsConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ExportProductsResponse.errorsConfig: object expected"); - message.errorsConfig = $root.google.cloud.retail.v2alpha.ExportErrorsConfig.fromObject(object.errorsConfig); - } + var message = new $root.google.cloud.retail.v2alpha.ListCatalogsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from an ExportProductsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListCatalogsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ExportProductsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @static - * @param {google.cloud.retail.v2alpha.ExportProductsResponse} message ExportProductsResponse + * @param {google.cloud.retail.v2alpha.ListCatalogsRequest} message ListCatalogsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportProductsResponse.toObject = function toObject(message, options) { + ListCatalogsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.errorSamples = []; - if (options.defaults) - object.errorsConfig = null; - if (message.errorSamples && message.errorSamples.length) { - object.errorSamples = []; - for (var j = 0; j < message.errorSamples.length; ++j) - object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) - object.errorsConfig = $root.google.cloud.retail.v2alpha.ExportErrorsConfig.toObject(message.errorsConfig, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this ExportProductsResponse to JSON. + * Converts this ListCatalogsRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ExportProductsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @instance * @returns {Object.} JSON object */ - ExportProductsResponse.prototype.toJSON = function toJSON() { + ListCatalogsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportProductsResponse; + return ListCatalogsRequest; })(); - v2alpha.ExportUserEventsResponse = (function() { + v2alpha.ListCatalogsResponse = (function() { /** - * Properties of an ExportUserEventsResponse. + * Properties of a ListCatalogsResponse. * @memberof google.cloud.retail.v2alpha - * @interface IExportUserEventsResponse - * @property {Array.|null} [errorSamples] ExportUserEventsResponse errorSamples - * @property {google.cloud.retail.v2alpha.IExportErrorsConfig|null} [errorsConfig] ExportUserEventsResponse errorsConfig + * @interface IListCatalogsResponse + * @property {Array.|null} [catalogs] ListCatalogsResponse catalogs + * @property {string|null} [nextPageToken] ListCatalogsResponse nextPageToken */ /** - * Constructs a new ExportUserEventsResponse. + * Constructs a new ListCatalogsResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ExportUserEventsResponse. - * @implements IExportUserEventsResponse + * @classdesc Represents a ListCatalogsResponse. + * @implements IListCatalogsResponse * @constructor - * @param {google.cloud.retail.v2alpha.IExportUserEventsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IListCatalogsResponse=} [properties] Properties to set */ - function ExportUserEventsResponse(properties) { - this.errorSamples = []; + function ListCatalogsResponse(properties) { + this.catalogs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -40327,91 +39408,91 @@ } /** - * ExportUserEventsResponse errorSamples. - * @member {Array.} errorSamples - * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse + * ListCatalogsResponse catalogs. + * @member {Array.} catalogs + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @instance */ - ExportUserEventsResponse.prototype.errorSamples = $util.emptyArray; + ListCatalogsResponse.prototype.catalogs = $util.emptyArray; /** - * ExportUserEventsResponse errorsConfig. - * @member {google.cloud.retail.v2alpha.IExportErrorsConfig|null|undefined} errorsConfig - * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse + * ListCatalogsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @instance */ - ExportUserEventsResponse.prototype.errorsConfig = null; + ListCatalogsResponse.prototype.nextPageToken = ""; /** - * Creates a new ExportUserEventsResponse instance using the specified properties. + * Creates a new ListCatalogsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @static - * @param {google.cloud.retail.v2alpha.IExportUserEventsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ExportUserEventsResponse} ExportUserEventsResponse instance + * @param {google.cloud.retail.v2alpha.IListCatalogsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListCatalogsResponse} ListCatalogsResponse instance */ - ExportUserEventsResponse.create = function create(properties) { - return new ExportUserEventsResponse(properties); + ListCatalogsResponse.create = function create(properties) { + return new ListCatalogsResponse(properties); }; /** - * Encodes the specified ExportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ExportUserEventsResponse.verify|verify} messages. + * Encodes the specified ListCatalogsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @static - * @param {google.cloud.retail.v2alpha.IExportUserEventsResponse} message ExportUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListCatalogsResponse} message ListCatalogsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportUserEventsResponse.encode = function encode(message, writer) { + ListCatalogsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorSamples != null && message.errorSamples.length) - for (var i = 0; i < message.errorSamples.length; ++i) - $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) - $root.google.cloud.retail.v2alpha.ExportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.catalogs != null && message.catalogs.length) + for (var i = 0; i < message.catalogs.length; ++i) + $root.google.cloud.retail.v2alpha.Catalog.encode(message.catalogs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified ExportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExportUserEventsResponse.verify|verify} messages. + * Encodes the specified ListCatalogsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @static - * @param {google.cloud.retail.v2alpha.IExportUserEventsResponse} message ExportUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListCatalogsResponse} message ListCatalogsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListCatalogsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportUserEventsResponse message from the specified reader or buffer. + * Decodes a ListCatalogsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @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.ExportUserEventsResponse} ExportUserEventsResponse + * @returns {google.cloud.retail.v2alpha.ListCatalogsResponse} ListCatalogsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportUserEventsResponse.decode = function decode(reader, length) { + ListCatalogsResponse.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.ExportUserEventsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListCatalogsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.errorSamples && message.errorSamples.length)) - message.errorSamples = []; - message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + if (!(message.catalogs && message.catalogs.length)) + message.catalogs = []; + message.catalogs.push($root.google.cloud.retail.v2alpha.Catalog.decode(reader, reader.uint32())); break; case 2: - message.errorsConfig = $root.google.cloud.retail.v2alpha.ExportErrorsConfig.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -40422,215 +39503,134 @@ }; /** - * Decodes an ExportUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListCatalogsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ExportUserEventsResponse} ExportUserEventsResponse + * @returns {google.cloud.retail.v2alpha.ListCatalogsResponse} ListCatalogsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { + ListCatalogsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportUserEventsResponse message. + * Verifies a ListCatalogsResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportUserEventsResponse.verify = function verify(message) { + ListCatalogsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { - if (!Array.isArray(message.errorSamples)) - return "errorSamples: array expected"; - for (var i = 0; i < message.errorSamples.length; ++i) { - var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (message.catalogs != null && message.hasOwnProperty("catalogs")) { + if (!Array.isArray(message.catalogs)) + return "catalogs: array expected"; + for (var i = 0; i < message.catalogs.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Catalog.verify(message.catalogs[i]); if (error) - return "errorSamples." + error; + return "catalogs." + error; } } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { - var error = $root.google.cloud.retail.v2alpha.ExportErrorsConfig.verify(message.errorsConfig); - if (error) - return "errorsConfig." + error; - } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an ExportUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListCatalogsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ExportUserEventsResponse} ExportUserEventsResponse + * @returns {google.cloud.retail.v2alpha.ListCatalogsResponse} ListCatalogsResponse */ - ExportUserEventsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ExportUserEventsResponse) + ListCatalogsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListCatalogsResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.ExportUserEventsResponse(); - if (object.errorSamples) { - if (!Array.isArray(object.errorSamples)) - throw TypeError(".google.cloud.retail.v2alpha.ExportUserEventsResponse.errorSamples: array expected"); - message.errorSamples = []; - for (var i = 0; i < object.errorSamples.length; ++i) { - if (typeof object.errorSamples[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ExportUserEventsResponse.errorSamples: object expected"); - message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + var message = new $root.google.cloud.retail.v2alpha.ListCatalogsResponse(); + if (object.catalogs) { + if (!Array.isArray(object.catalogs)) + throw TypeError(".google.cloud.retail.v2alpha.ListCatalogsResponse.catalogs: array expected"); + message.catalogs = []; + for (var i = 0; i < object.catalogs.length; ++i) { + if (typeof object.catalogs[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ListCatalogsResponse.catalogs: object expected"); + message.catalogs[i] = $root.google.cloud.retail.v2alpha.Catalog.fromObject(object.catalogs[i]); } } - if (object.errorsConfig != null) { - if (typeof object.errorsConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ExportUserEventsResponse.errorsConfig: object expected"); - message.errorsConfig = $root.google.cloud.retail.v2alpha.ExportErrorsConfig.fromObject(object.errorsConfig); - } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an ExportUserEventsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListCatalogsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @static - * @param {google.cloud.retail.v2alpha.ExportUserEventsResponse} message ExportUserEventsResponse + * @param {google.cloud.retail.v2alpha.ListCatalogsResponse} message ListCatalogsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportUserEventsResponse.toObject = function toObject(message, options) { + ListCatalogsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.errorSamples = []; + object.catalogs = []; if (options.defaults) - object.errorsConfig = null; - if (message.errorSamples && message.errorSamples.length) { - object.errorSamples = []; - for (var j = 0; j < message.errorSamples.length; ++j) - object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + object.nextPageToken = ""; + if (message.catalogs && message.catalogs.length) { + object.catalogs = []; + for (var j = 0; j < message.catalogs.length; ++j) + object.catalogs[j] = $root.google.cloud.retail.v2alpha.Catalog.toObject(message.catalogs[j], options); } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) - object.errorsConfig = $root.google.cloud.retail.v2alpha.ExportErrorsConfig.toObject(message.errorsConfig, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ExportUserEventsResponse to JSON. + * Converts this ListCatalogsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @instance * @returns {Object.} JSON object */ - ExportUserEventsResponse.prototype.toJSON = function toJSON() { + ListCatalogsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportUserEventsResponse; - })(); - - v2alpha.PredictionService = (function() { - - /** - * Constructs a new PredictionService service. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PredictionService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function PredictionService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (PredictionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PredictionService; - - /** - * Creates new PredictionService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.retail.v2alpha.PredictionService - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {PredictionService} RPC service. Useful where requests and/or responses are streamed. - */ - PredictionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.PredictionService#predict}. - * @memberof google.cloud.retail.v2alpha.PredictionService - * @typedef PredictCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.PredictResponse} [response] PredictResponse - */ - - /** - * Calls Predict. - * @function predict - * @memberof google.cloud.retail.v2alpha.PredictionService - * @instance - * @param {google.cloud.retail.v2alpha.IPredictRequest} request PredictRequest message or plain object - * @param {google.cloud.retail.v2alpha.PredictionService.PredictCallback} callback Node-style callback called with the error, if any, and PredictResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(PredictionService.prototype.predict = function predict(request, callback) { - return this.rpcCall(predict, $root.google.cloud.retail.v2alpha.PredictRequest, $root.google.cloud.retail.v2alpha.PredictResponse, request, callback); - }, "name", { value: "Predict" }); - - /** - * Calls Predict. - * @function predict - * @memberof google.cloud.retail.v2alpha.PredictionService - * @instance - * @param {google.cloud.retail.v2alpha.IPredictRequest} request PredictRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return PredictionService; + return ListCatalogsResponse; })(); - v2alpha.PredictRequest = (function() { + v2alpha.UpdateCatalogRequest = (function() { /** - * Properties of a PredictRequest. + * Properties of an UpdateCatalogRequest. * @memberof google.cloud.retail.v2alpha - * @interface IPredictRequest - * @property {string|null} [placement] PredictRequest placement - * @property {google.cloud.retail.v2alpha.IUserEvent|null} [userEvent] PredictRequest userEvent - * @property {number|null} [pageSize] PredictRequest pageSize - * @property {string|null} [pageToken] PredictRequest pageToken - * @property {string|null} [filter] PredictRequest filter - * @property {boolean|null} [validateOnly] PredictRequest validateOnly - * @property {Object.|null} [params] PredictRequest params - * @property {Object.|null} [labels] PredictRequest labels + * @interface IUpdateCatalogRequest + * @property {google.cloud.retail.v2alpha.ICatalog|null} [catalog] UpdateCatalogRequest catalog + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCatalogRequest updateMask */ /** - * Constructs a new PredictRequest. + * Constructs a new UpdateCatalogRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PredictRequest. - * @implements IPredictRequest + * @classdesc Represents an UpdateCatalogRequest. + * @implements IUpdateCatalogRequest * @constructor - * @param {google.cloud.retail.v2alpha.IPredictRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest=} [properties] Properties to set */ - function PredictRequest(properties) { - this.params = {}; - this.labels = {}; + function UpdateCatalogRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -40638,208 +39638,88 @@ } /** - * PredictRequest placement. - * @member {string} placement - * @memberof google.cloud.retail.v2alpha.PredictRequest - * @instance - */ - PredictRequest.prototype.placement = ""; - - /** - * PredictRequest userEvent. - * @member {google.cloud.retail.v2alpha.IUserEvent|null|undefined} userEvent - * @memberof google.cloud.retail.v2alpha.PredictRequest - * @instance - */ - PredictRequest.prototype.userEvent = null; - - /** - * PredictRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.retail.v2alpha.PredictRequest - * @instance - */ - PredictRequest.prototype.pageSize = 0; - - /** - * PredictRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.retail.v2alpha.PredictRequest - * @instance - */ - PredictRequest.prototype.pageToken = ""; - - /** - * PredictRequest filter. - * @member {string} filter - * @memberof google.cloud.retail.v2alpha.PredictRequest - * @instance - */ - PredictRequest.prototype.filter = ""; - - /** - * PredictRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.retail.v2alpha.PredictRequest - * @instance - */ - PredictRequest.prototype.validateOnly = false; - - /** - * PredictRequest params. - * @member {Object.} params - * @memberof google.cloud.retail.v2alpha.PredictRequest + * UpdateCatalogRequest catalog. + * @member {google.cloud.retail.v2alpha.ICatalog|null|undefined} catalog + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @instance */ - PredictRequest.prototype.params = $util.emptyObject; + UpdateCatalogRequest.prototype.catalog = null; /** - * PredictRequest labels. - * @member {Object.} labels - * @memberof google.cloud.retail.v2alpha.PredictRequest + * UpdateCatalogRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @instance */ - PredictRequest.prototype.labels = $util.emptyObject; + UpdateCatalogRequest.prototype.updateMask = null; /** - * Creates a new PredictRequest instance using the specified properties. + * Creates a new UpdateCatalogRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @static - * @param {google.cloud.retail.v2alpha.IPredictRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PredictRequest} PredictRequest instance + * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UpdateCatalogRequest} UpdateCatalogRequest instance */ - PredictRequest.create = function create(properties) { - return new PredictRequest(properties); + UpdateCatalogRequest.create = function create(properties) { + return new UpdateCatalogRequest(properties); }; /** - * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictRequest.verify|verify} messages. + * Encodes the specified UpdateCatalogRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCatalogRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @static - * @param {google.cloud.retail.v2alpha.IPredictRequest} message PredictRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest} message UpdateCatalogRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PredictRequest.encode = function encode(message, writer) { + UpdateCatalogRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.placement); - 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.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.params[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) + $root.google.cloud.retail.v2alpha.Catalog.encode(message.catalog, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictRequest.verify|verify} messages. + * Encodes the specified UpdateCatalogRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCatalogRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @static - * @param {google.cloud.retail.v2alpha.IPredictRequest} message PredictRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest} message UpdateCatalogRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PredictRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateCatalogRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PredictRequest message from the specified reader or buffer. + * Decodes an UpdateCatalogRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @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.PredictRequest} PredictRequest + * @returns {google.cloud.retail.v2alpha.UpdateCatalogRequest} UpdateCatalogRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PredictRequest.decode = function decode(reader, length) { + UpdateCatalogRequest.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.PredictRequest(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UpdateCatalogRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.placement = reader.string(); + message.catalog = $root.google.cloud.retail.v2alpha.Catalog.decode(reader, reader.uint32()); break; case 2: - message.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.decode(reader, reader.uint32()); - break; - case 3: - message.pageSize = reader.int32(); - break; - case 4: - message.pageToken = reader.string(); - break; - case 5: - message.filter = reader.string(); - break; - case 6: - message.validateOnly = reader.bool(); - break; - case 7: - if (message.params === $util.emptyObject) - message.params = {}; - 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.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.params[key] = value; - break; - case 8: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -40850,208 +39730,128 @@ }; /** - * Decodes a PredictRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateCatalogRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PredictRequest} PredictRequest + * @returns {google.cloud.retail.v2alpha.UpdateCatalogRequest} UpdateCatalogRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PredictRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateCatalogRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PredictRequest message. + * Verifies an UpdateCatalogRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PredictRequest.verify = function verify(message) { + UpdateCatalogRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.placement != null && message.hasOwnProperty("placement")) - if (!$util.isString(message.placement)) - return "placement: string expected"; - if (message.userEvent != null && message.hasOwnProperty("userEvent")) { - var error = $root.google.cloud.retail.v2alpha.UserEvent.verify(message.userEvent); + if (message.catalog != null && message.hasOwnProperty("catalog")) { + var error = $root.google.cloud.retail.v2alpha.Catalog.verify(message.catalog); if (error) - return "userEvent." + error; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.params != null && message.hasOwnProperty("params")) { - if (!$util.isObject(message.params)) - return "params: object expected"; - var key = Object.keys(message.params); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.params[key[i]]); - if (error) - return "params." + error; - } + return "catalog." + error; } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } return null; }; /** - * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateCatalogRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PredictRequest} PredictRequest + * @returns {google.cloud.retail.v2alpha.UpdateCatalogRequest} UpdateCatalogRequest */ - PredictRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PredictRequest) + UpdateCatalogRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UpdateCatalogRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.PredictRequest(); - if (object.placement != null) - message.placement = String(object.placement); - if (object.userEvent != null) { - if (typeof object.userEvent !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PredictRequest.userEvent: object expected"); - message.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.fromObject(object.userEvent); - } - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.params) { - if (typeof object.params !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PredictRequest.params: object expected"); - message.params = {}; - for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) { - if (typeof object.params[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PredictRequest.params: object expected"); - message.params[keys[i]] = $root.google.protobuf.Value.fromObject(object.params[keys[i]]); - } + var message = new $root.google.cloud.retail.v2alpha.UpdateCatalogRequest(); + if (object.catalog != null) { + if (typeof object.catalog !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateCatalogRequest.catalog: object expected"); + message.catalog = $root.google.cloud.retail.v2alpha.Catalog.fromObject(object.catalog); } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PredictRequest.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateCatalogRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateCatalogRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @static - * @param {google.cloud.retail.v2alpha.PredictRequest} message PredictRequest + * @param {google.cloud.retail.v2alpha.UpdateCatalogRequest} message UpdateCatalogRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PredictRequest.toObject = function toObject(message, options) { + UpdateCatalogRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) { - object.params = {}; - object.labels = {}; - } if (options.defaults) { - object.placement = ""; - object.userEvent = null; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.validateOnly = false; - } - if (message.placement != null && message.hasOwnProperty("placement")) - object.placement = message.placement; - if (message.userEvent != null && message.hasOwnProperty("userEvent")) - object.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.toObject(message.userEvent, options); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - var keys2; - if (message.params && (keys2 = Object.keys(message.params)).length) { - object.params = {}; - for (var j = 0; j < keys2.length; ++j) - object.params[keys2[j]] = $root.google.protobuf.Value.toObject(message.params[keys2[j]], options); - } - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; + object.catalog = null; + object.updateMask = null; } + if (message.catalog != null && message.hasOwnProperty("catalog")) + object.catalog = $root.google.cloud.retail.v2alpha.Catalog.toObject(message.catalog, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this PredictRequest to JSON. + * Converts this UpdateCatalogRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @instance * @returns {Object.} JSON object */ - PredictRequest.prototype.toJSON = function toJSON() { + UpdateCatalogRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PredictRequest; + return UpdateCatalogRequest; })(); - v2alpha.PredictResponse = (function() { + v2alpha.SetDefaultBranchRequest = (function() { /** - * Properties of a PredictResponse. + * Properties of a SetDefaultBranchRequest. * @memberof google.cloud.retail.v2alpha - * @interface IPredictResponse - * @property {Array.|null} [results] PredictResponse results - * @property {string|null} [attributionToken] PredictResponse attributionToken - * @property {Array.|null} [missingIds] PredictResponse missingIds - * @property {boolean|null} [validateOnly] PredictResponse validateOnly + * @interface ISetDefaultBranchRequest + * @property {string|null} [catalog] SetDefaultBranchRequest catalog + * @property {string|null} [branchId] SetDefaultBranchRequest branchId + * @property {string|null} [note] SetDefaultBranchRequest note */ /** - * Constructs a new PredictResponse. + * Constructs a new SetDefaultBranchRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PredictResponse. - * @implements IPredictResponse + * @classdesc Represents a SetDefaultBranchRequest. + * @implements ISetDefaultBranchRequest * @constructor - * @param {google.cloud.retail.v2alpha.IPredictResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest=} [properties] Properties to set */ - function PredictResponse(properties) { - this.results = []; - this.missingIds = []; + function SetDefaultBranchRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -41059,120 +39859,101 @@ } /** - * PredictResponse results. - * @member {Array.} results - * @memberof google.cloud.retail.v2alpha.PredictResponse - * @instance - */ - PredictResponse.prototype.results = $util.emptyArray; - - /** - * PredictResponse attributionToken. - * @member {string} attributionToken - * @memberof google.cloud.retail.v2alpha.PredictResponse + * SetDefaultBranchRequest catalog. + * @member {string} catalog + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @instance */ - PredictResponse.prototype.attributionToken = ""; + SetDefaultBranchRequest.prototype.catalog = ""; /** - * PredictResponse missingIds. - * @member {Array.} missingIds - * @memberof google.cloud.retail.v2alpha.PredictResponse + * SetDefaultBranchRequest branchId. + * @member {string} branchId + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @instance */ - PredictResponse.prototype.missingIds = $util.emptyArray; + SetDefaultBranchRequest.prototype.branchId = ""; /** - * PredictResponse validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.retail.v2alpha.PredictResponse + * SetDefaultBranchRequest note. + * @member {string} note + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @instance */ - PredictResponse.prototype.validateOnly = false; + SetDefaultBranchRequest.prototype.note = ""; /** - * Creates a new PredictResponse instance using the specified properties. + * Creates a new SetDefaultBranchRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @static - * @param {google.cloud.retail.v2alpha.IPredictResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PredictResponse} PredictResponse instance + * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SetDefaultBranchRequest} SetDefaultBranchRequest instance */ - PredictResponse.create = function create(properties) { - return new PredictResponse(properties); + SetDefaultBranchRequest.create = function create(properties) { + return new SetDefaultBranchRequest(properties); }; /** - * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.verify|verify} messages. + * Encodes the specified SetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SetDefaultBranchRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @static - * @param {google.cloud.retail.v2alpha.IPredictResponse} message PredictResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest} message SetDefaultBranchRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PredictResponse.encode = function encode(message, writer) { + SetDefaultBranchRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.results != null && message.results.length) - for (var i = 0; i < message.results.length; ++i) - $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributionToken); - if (message.missingIds != null && message.missingIds.length) - for (var i = 0; i < message.missingIds.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.missingIds[i]); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); + if (message.branchId != null && Object.hasOwnProperty.call(message, "branchId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.branchId); + if (message.note != null && Object.hasOwnProperty.call(message, "note")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.note); return writer; }; /** - * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.verify|verify} messages. + * Encodes the specified SetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetDefaultBranchRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @static - * @param {google.cloud.retail.v2alpha.IPredictResponse} message PredictResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest} message SetDefaultBranchRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PredictResponse.encodeDelimited = function encodeDelimited(message, writer) { + SetDefaultBranchRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PredictResponse message from the specified reader or buffer. + * Decodes a SetDefaultBranchRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @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.PredictResponse} PredictResponse + * @returns {google.cloud.retail.v2alpha.SetDefaultBranchRequest} SetDefaultBranchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PredictResponse.decode = function decode(reader, length) { + SetDefaultBranchRequest.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.PredictResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SetDefaultBranchRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.results && message.results.length)) - message.results = []; - message.results.push($root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.decode(reader, reader.uint32())); + message.catalog = reader.string(); break; case 2: - message.attributionToken = reader.string(); + message.branchId = reader.string(); break; case 3: - if (!(message.missingIds && message.missingIds.length)) - message.missingIds = []; - message.missingIds.push(reader.string()); - break; - case 4: - message.validateOnly = reader.bool(); + message.note = reader.string(); break; default: reader.skipType(tag & 7); @@ -41183,815 +39964,313 @@ }; /** - * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * Decodes a SetDefaultBranchRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PredictResponse} PredictResponse + * @returns {google.cloud.retail.v2alpha.SetDefaultBranchRequest} SetDefaultBranchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PredictResponse.decodeDelimited = function decodeDelimited(reader) { + SetDefaultBranchRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PredictResponse message. + * Verifies a SetDefaultBranchRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PredictResponse.verify = function verify(message) { + SetDefaultBranchRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.results != null && message.hasOwnProperty("results")) { - if (!Array.isArray(message.results)) - return "results: array expected"; - for (var i = 0; i < message.results.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify(message.results[i]); - if (error) - return "results." + error; - } - } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - if (!$util.isString(message.attributionToken)) - return "attributionToken: string expected"; - if (message.missingIds != null && message.hasOwnProperty("missingIds")) { - if (!Array.isArray(message.missingIds)) - return "missingIds: array expected"; - for (var i = 0; i < message.missingIds.length; ++i) - if (!$util.isString(message.missingIds[i])) - return "missingIds: string[] expected"; - } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; + if (message.catalog != null && message.hasOwnProperty("catalog")) + if (!$util.isString(message.catalog)) + return "catalog: string expected"; + if (message.branchId != null && message.hasOwnProperty("branchId")) + if (!$util.isString(message.branchId)) + return "branchId: string expected"; + if (message.note != null && message.hasOwnProperty("note")) + if (!$util.isString(message.note)) + return "note: string expected"; return null; }; /** - * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PredictResponse} PredictResponse + * @returns {google.cloud.retail.v2alpha.SetDefaultBranchRequest} SetDefaultBranchRequest */ - PredictResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PredictResponse) + SetDefaultBranchRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SetDefaultBranchRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.PredictResponse(); - if (object.results) { - if (!Array.isArray(object.results)) - throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.results: array expected"); - message.results = []; - for (var i = 0; i < object.results.length; ++i) { - if (typeof object.results[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.results: object expected"); - message.results[i] = $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.fromObject(object.results[i]); - } - } - if (object.attributionToken != null) - message.attributionToken = String(object.attributionToken); - if (object.missingIds) { - if (!Array.isArray(object.missingIds)) - throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.missingIds: array expected"); - message.missingIds = []; - for (var i = 0; i < object.missingIds.length; ++i) - message.missingIds[i] = String(object.missingIds[i]); - } - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); + var message = new $root.google.cloud.retail.v2alpha.SetDefaultBranchRequest(); + if (object.catalog != null) + message.catalog = String(object.catalog); + if (object.branchId != null) + message.branchId = String(object.branchId); + if (object.note != null) + message.note = String(object.note); return message; }; /** - * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * Creates a plain object from a SetDefaultBranchRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @static - * @param {google.cloud.retail.v2alpha.PredictResponse} message PredictResponse + * @param {google.cloud.retail.v2alpha.SetDefaultBranchRequest} message SetDefaultBranchRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PredictResponse.toObject = function toObject(message, options) { + SetDefaultBranchRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.results = []; - object.missingIds = []; - } if (options.defaults) { - object.attributionToken = ""; - object.validateOnly = false; - } - if (message.results && message.results.length) { - object.results = []; - for (var j = 0; j < message.results.length; ++j) - object.results[j] = $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.toObject(message.results[j], options); - } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - object.attributionToken = message.attributionToken; - if (message.missingIds && message.missingIds.length) { - object.missingIds = []; - for (var j = 0; j < message.missingIds.length; ++j) - object.missingIds[j] = message.missingIds[j]; + object.catalog = ""; + object.branchId = ""; + object.note = ""; } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; + if (message.catalog != null && message.hasOwnProperty("catalog")) + object.catalog = message.catalog; + if (message.branchId != null && message.hasOwnProperty("branchId")) + object.branchId = message.branchId; + if (message.note != null && message.hasOwnProperty("note")) + object.note = message.note; return object; }; /** - * Converts this PredictResponse to JSON. + * Converts this SetDefaultBranchRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @instance * @returns {Object.} JSON object */ - PredictResponse.prototype.toJSON = function toJSON() { + SetDefaultBranchRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - PredictResponse.PredictionResult = (function() { - - /** - * Properties of a PredictionResult. - * @memberof google.cloud.retail.v2alpha.PredictResponse - * @interface IPredictionResult - * @property {string|null} [id] PredictionResult id - * @property {Object.|null} [metadata] PredictionResult metadata - */ - - /** - * Constructs a new PredictionResult. - * @memberof google.cloud.retail.v2alpha.PredictResponse - * @classdesc Represents a PredictionResult. - * @implements IPredictionResult - * @constructor - * @param {google.cloud.retail.v2alpha.PredictResponse.IPredictionResult=} [properties] Properties to set - */ - function PredictionResult(properties) { - this.metadata = {}; - 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]]; - } - - /** - * PredictionResult id. - * @member {string} id - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @instance - */ - PredictionResult.prototype.id = ""; - - /** - * PredictionResult metadata. - * @member {Object.} metadata - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @instance - */ - PredictionResult.prototype.metadata = $util.emptyObject; - - /** - * Creates a new PredictionResult instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @static - * @param {google.cloud.retail.v2alpha.PredictResponse.IPredictionResult=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} PredictionResult instance - */ - PredictionResult.create = function create(properties) { - return new PredictionResult(properties); - }; - - /** - * Encodes the specified PredictionResult message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @static - * @param {google.cloud.retail.v2alpha.PredictResponse.IPredictionResult} message PredictionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PredictionResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.metadata[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified PredictionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @static - * @param {google.cloud.retail.v2alpha.PredictResponse.IPredictionResult} message PredictionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PredictionResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PredictionResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @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.PredictResponse.PredictionResult} PredictionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PredictionResult.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.PredictResponse.PredictionResult(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - if (message.metadata === $util.emptyObject) - message.metadata = {}; - 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.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.metadata[key] = value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PredictionResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} PredictionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PredictionResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PredictionResult message. - * @function verify - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PredictionResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - if (!$util.isObject(message.metadata)) - return "metadata: object expected"; - var key = Object.keys(message.metadata); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.metadata[key[i]]); - if (error) - return "metadata." + error; - } - } - return null; - }; - - /** - * Creates a PredictionResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} PredictionResult - */ - PredictionResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult) - return object; - var message = new $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult(); - if (object.id != null) - message.id = String(object.id); - if (object.metadata) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.PredictionResult.metadata: object expected"); - message.metadata = {}; - for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) { - if (typeof object.metadata[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.PredictionResult.metadata: object expected"); - message.metadata[keys[i]] = $root.google.protobuf.Value.fromObject(object.metadata[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a PredictionResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @static - * @param {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} message PredictionResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PredictionResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.metadata = {}; - if (options.defaults) - object.id = ""; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - var keys2; - if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { - object.metadata = {}; - for (var j = 0; j < keys2.length; ++j) - object.metadata[keys2[j]] = $root.google.protobuf.Value.toObject(message.metadata[keys2[j]], options); - } - return object; - }; - - /** - * Converts this PredictionResult to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @instance - * @returns {Object.} JSON object - */ - PredictionResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PredictionResult; - })(); - - return PredictResponse; + return SetDefaultBranchRequest; })(); - v2alpha.ProductService = (function() { + v2alpha.GetDefaultBranchRequest = (function() { /** - * Constructs a new ProductService service. + * Properties of a GetDefaultBranchRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ProductService - * @extends $protobuf.rpc.Service + * @interface IGetDefaultBranchRequest + * @property {string|null} [catalog] GetDefaultBranchRequest catalog + */ + + /** + * Constructs a new GetDefaultBranchRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a GetDefaultBranchRequest. + * @implements IGetDefaultBranchRequest * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest=} [properties] Properties to set */ - function ProductService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function GetDefaultBranchRequest(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]]; } - (ProductService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ProductService; + /** + * GetDefaultBranchRequest catalog. + * @member {string} catalog + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @instance + */ + GetDefaultBranchRequest.prototype.catalog = ""; /** - * Creates new ProductService service using the specified rpc implementation. + * Creates a new GetDefaultBranchRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ProductService + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {ProductService} RPC service. Useful where requests and/or responses are streamed. + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.GetDefaultBranchRequest} GetDefaultBranchRequest instance */ - ProductService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + GetDefaultBranchRequest.create = function create(properties) { + return new GetDefaultBranchRequest(properties); }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#createProduct}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef CreateProductCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.Product} [response] Product + * Encodes the specified GetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @static + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest} message GetDefaultBranchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + GetDefaultBranchRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); + return writer; + }; /** - * Calls CreateProduct. - * @function createProduct - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.ICreateProductRequest} request CreateProductRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.CreateProductCallback} callback Node-style callback called with the error, if any, and Product - * @returns {undefined} - * @variation 1 + * Encodes the specified GetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @static + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest} message GetDefaultBranchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(ProductService.prototype.createProduct = function createProduct(request, callback) { - return this.rpcCall(createProduct, $root.google.cloud.retail.v2alpha.CreateProductRequest, $root.google.cloud.retail.v2alpha.Product, request, callback); - }, "name", { value: "CreateProduct" }); + GetDefaultBranchRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls CreateProduct. - * @function createProduct - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.ICreateProductRequest} request CreateProductRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a GetDefaultBranchRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @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.GetDefaultBranchRequest} GetDefaultBranchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetDefaultBranchRequest.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.GetDefaultBranchRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.catalog = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#getProduct}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef GetProductCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.Product} [response] Product + * Decodes a GetDefaultBranchRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.GetDefaultBranchRequest} GetDefaultBranchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetDefaultBranchRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GetProduct. - * @function getProduct - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IGetProductRequest} request GetProductRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.GetProductCallback} callback Node-style callback called with the error, if any, and Product - * @returns {undefined} - * @variation 1 + * Verifies a GetDefaultBranchRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(ProductService.prototype.getProduct = function getProduct(request, callback) { - return this.rpcCall(getProduct, $root.google.cloud.retail.v2alpha.GetProductRequest, $root.google.cloud.retail.v2alpha.Product, request, callback); - }, "name", { value: "GetProduct" }); + GetDefaultBranchRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.catalog != null && message.hasOwnProperty("catalog")) + if (!$util.isString(message.catalog)) + return "catalog: string expected"; + return null; + }; /** - * Calls GetProduct. - * @function getProduct - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IGetProductRequest} request GetProductRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a GetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.GetDefaultBranchRequest} GetDefaultBranchRequest */ + GetDefaultBranchRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.GetDefaultBranchRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.GetDefaultBranchRequest(); + if (object.catalog != null) + message.catalog = String(object.catalog); + return message; + }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#listProducts}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef ListProductsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.ListProductsResponse} [response] ListProductsResponse + * Creates a plain object from a GetDefaultBranchRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @static + * @param {google.cloud.retail.v2alpha.GetDefaultBranchRequest} message GetDefaultBranchRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + GetDefaultBranchRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.catalog = ""; + if (message.catalog != null && message.hasOwnProperty("catalog")) + object.catalog = message.catalog; + return object; + }; /** - * Calls ListProducts. - * @function listProducts - * @memberof google.cloud.retail.v2alpha.ProductService + * Converts this GetDefaultBranchRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest * @instance - * @param {google.cloud.retail.v2alpha.IListProductsRequest} request ListProductsRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.ListProductsCallback} callback Node-style callback called with the error, if any, and ListProductsResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(ProductService.prototype.listProducts = function listProducts(request, callback) { - return this.rpcCall(listProducts, $root.google.cloud.retail.v2alpha.ListProductsRequest, $root.google.cloud.retail.v2alpha.ListProductsResponse, request, callback); - }, "name", { value: "ListProducts" }); + GetDefaultBranchRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls ListProducts. - * @function listProducts - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IListProductsRequest} request ListProductsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + return GetDefaultBranchRequest; + })(); + + v2alpha.GetDefaultBranchResponse = (function() { /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#updateProduct}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef UpdateProductCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.Product} [response] Product + * Properties of a GetDefaultBranchResponse. + * @memberof google.cloud.retail.v2alpha + * @interface IGetDefaultBranchResponse + * @property {string|null} [branch] GetDefaultBranchResponse branch + * @property {google.protobuf.ITimestamp|null} [setTime] GetDefaultBranchResponse setTime + * @property {string|null} [note] GetDefaultBranchResponse note */ /** - * Calls UpdateProduct. - * @function updateProduct - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IUpdateProductRequest} request UpdateProductRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.UpdateProductCallback} callback Node-style callback called with the error, if any, and Product - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ProductService.prototype.updateProduct = function updateProduct(request, callback) { - return this.rpcCall(updateProduct, $root.google.cloud.retail.v2alpha.UpdateProductRequest, $root.google.cloud.retail.v2alpha.Product, request, callback); - }, "name", { value: "UpdateProduct" }); - - /** - * Calls UpdateProduct. - * @function updateProduct - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IUpdateProductRequest} request UpdateProductRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#deleteProduct}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef DeleteProductCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteProduct. - * @function deleteProduct - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IDeleteProductRequest} request DeleteProductRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.DeleteProductCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ProductService.prototype.deleteProduct = function deleteProduct(request, callback) { - return this.rpcCall(deleteProduct, $root.google.cloud.retail.v2alpha.DeleteProductRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteProduct" }); - - /** - * Calls DeleteProduct. - * @function deleteProduct - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IDeleteProductRequest} request DeleteProductRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#importProducts}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef ImportProductsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ImportProducts. - * @function importProducts - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IImportProductsRequest} request ImportProductsRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.ImportProductsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ProductService.prototype.importProducts = function importProducts(request, callback) { - return this.rpcCall(importProducts, $root.google.cloud.retail.v2alpha.ImportProductsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportProducts" }); - - /** - * Calls ImportProducts. - * @function importProducts - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IImportProductsRequest} request ImportProductsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#setInventory}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef SetInventoryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls SetInventory. - * @function setInventory - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.ISetInventoryRequest} request SetInventoryRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.SetInventoryCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ProductService.prototype.setInventory = function setInventory(request, callback) { - return this.rpcCall(setInventory, $root.google.cloud.retail.v2alpha.SetInventoryRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "SetInventory" }); - - /** - * Calls SetInventory. - * @function setInventory - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.ISetInventoryRequest} request SetInventoryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#addFulfillmentPlaces}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef AddFulfillmentPlacesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls AddFulfillmentPlaces. - * @function addFulfillmentPlaces - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest} request AddFulfillmentPlacesRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlacesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ProductService.prototype.addFulfillmentPlaces = function addFulfillmentPlaces(request, callback) { - return this.rpcCall(addFulfillmentPlaces, $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "AddFulfillmentPlaces" }); - - /** - * Calls AddFulfillmentPlaces. - * @function addFulfillmentPlaces - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest} request AddFulfillmentPlacesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#removeFulfillmentPlaces}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef RemoveFulfillmentPlacesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RemoveFulfillmentPlaces. - * @function removeFulfillmentPlaces - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest} request RemoveFulfillmentPlacesRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlacesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ProductService.prototype.removeFulfillmentPlaces = function removeFulfillmentPlaces(request, callback) { - return this.rpcCall(removeFulfillmentPlaces, $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RemoveFulfillmentPlaces" }); - - /** - * Calls RemoveFulfillmentPlaces. - * @function removeFulfillmentPlaces - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest} request RemoveFulfillmentPlacesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#addLocalInventories}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef AddLocalInventoriesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls AddLocalInventories. - * @function addLocalInventories - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest} request AddLocalInventoriesRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.AddLocalInventoriesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ProductService.prototype.addLocalInventories = function addLocalInventories(request, callback) { - return this.rpcCall(addLocalInventories, $root.google.cloud.retail.v2alpha.AddLocalInventoriesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "AddLocalInventories" }); - - /** - * Calls AddLocalInventories. - * @function addLocalInventories - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest} request AddLocalInventoriesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#removeLocalInventories}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef RemoveLocalInventoriesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RemoveLocalInventories. - * @function removeLocalInventories - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest} request RemoveLocalInventoriesRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.RemoveLocalInventoriesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ProductService.prototype.removeLocalInventories = function removeLocalInventories(request, callback) { - return this.rpcCall(removeLocalInventories, $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RemoveLocalInventories" }); - - /** - * Calls RemoveLocalInventories. - * @function removeLocalInventories - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest} request RemoveLocalInventoriesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return ProductService; - })(); - - v2alpha.CreateProductRequest = (function() { - - /** - * Properties of a CreateProductRequest. - * @memberof google.cloud.retail.v2alpha - * @interface ICreateProductRequest - * @property {string|null} [parent] CreateProductRequest parent - * @property {google.cloud.retail.v2alpha.IProduct|null} [product] CreateProductRequest product - * @property {string|null} [productId] CreateProductRequest productId - */ - - /** - * Constructs a new CreateProductRequest. + * Constructs a new GetDefaultBranchResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CreateProductRequest. - * @implements ICreateProductRequest + * @classdesc Represents a GetDefaultBranchResponse. + * @implements IGetDefaultBranchResponse * @constructor - * @param {google.cloud.retail.v2alpha.ICreateProductRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchResponse=} [properties] Properties to set */ - function CreateProductRequest(properties) { + function GetDefaultBranchResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -41999,101 +40278,101 @@ } /** - * CreateProductRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * GetDefaultBranchResponse branch. + * @member {string} branch + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse * @instance */ - CreateProductRequest.prototype.parent = ""; + GetDefaultBranchResponse.prototype.branch = ""; /** - * CreateProductRequest product. - * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} product - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * GetDefaultBranchResponse setTime. + * @member {google.protobuf.ITimestamp|null|undefined} setTime + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse * @instance */ - CreateProductRequest.prototype.product = null; + GetDefaultBranchResponse.prototype.setTime = null; /** - * CreateProductRequest productId. - * @member {string} productId - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * GetDefaultBranchResponse note. + * @member {string} note + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse * @instance */ - CreateProductRequest.prototype.productId = ""; + GetDefaultBranchResponse.prototype.note = ""; /** - * Creates a new CreateProductRequest instance using the specified properties. + * Creates a new GetDefaultBranchResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse * @static - * @param {google.cloud.retail.v2alpha.ICreateProductRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CreateProductRequest} CreateProductRequest instance + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.GetDefaultBranchResponse} GetDefaultBranchResponse instance */ - CreateProductRequest.create = function create(properties) { - return new CreateProductRequest(properties); + GetDefaultBranchResponse.create = function create(properties) { + return new GetDefaultBranchResponse(properties); }; /** - * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateProductRequest.verify|verify} messages. + * Encodes the specified GetDefaultBranchResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse * @static - * @param {google.cloud.retail.v2alpha.ICreateProductRequest} message CreateProductRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchResponse} message GetDefaultBranchResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateProductRequest.encode = function encode(message, writer) { + GetDefaultBranchResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - $root.google.cloud.retail.v2alpha.Product.encode(message.product, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.productId != null && Object.hasOwnProperty.call(message, "productId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.productId); + if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.branch); + if (message.setTime != null && Object.hasOwnProperty.call(message, "setTime")) + $root.google.protobuf.Timestamp.encode(message.setTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.note != null && Object.hasOwnProperty.call(message, "note")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.note); return writer; }; /** - * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateProductRequest.verify|verify} messages. + * Encodes the specified GetDefaultBranchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse * @static - * @param {google.cloud.retail.v2alpha.ICreateProductRequest} message CreateProductRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchResponse} message GetDefaultBranchResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetDefaultBranchResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateProductRequest message from the specified reader or buffer. + * Decodes a GetDefaultBranchResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse * @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.CreateProductRequest} CreateProductRequest + * @returns {google.cloud.retail.v2alpha.GetDefaultBranchResponse} GetDefaultBranchResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateProductRequest.decode = function decode(reader, length) { + GetDefaultBranchResponse.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.CreateProductRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetDefaultBranchResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.branch = reader.string(); break; case 2: - message.product = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); + message.setTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 3: - message.productId = reader.string(); + message.note = reader.string(); break; default: reader.skipType(tag & 7); @@ -42104,205 +40383,394 @@ }; /** - * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. + * Decodes a GetDefaultBranchResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CreateProductRequest} CreateProductRequest + * @returns {google.cloud.retail.v2alpha.GetDefaultBranchResponse} GetDefaultBranchResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateProductRequest.decodeDelimited = function decodeDelimited(reader) { + GetDefaultBranchResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateProductRequest message. + * Verifies a GetDefaultBranchResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateProductRequest.verify = function verify(message) { + GetDefaultBranchResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.product != null && message.hasOwnProperty("product")) { - var error = $root.google.cloud.retail.v2alpha.Product.verify(message.product); + if (message.branch != null && message.hasOwnProperty("branch")) + if (!$util.isString(message.branch)) + return "branch: string expected"; + if (message.setTime != null && message.hasOwnProperty("setTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.setTime); if (error) - return "product." + error; + return "setTime." + error; } - if (message.productId != null && message.hasOwnProperty("productId")) - if (!$util.isString(message.productId)) - return "productId: string expected"; + if (message.note != null && message.hasOwnProperty("note")) + if (!$util.isString(message.note)) + return "note: string expected"; return null; }; /** - * Creates a CreateProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetDefaultBranchResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CreateProductRequest} CreateProductRequest + * @returns {google.cloud.retail.v2alpha.GetDefaultBranchResponse} GetDefaultBranchResponse */ - CreateProductRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CreateProductRequest) + GetDefaultBranchResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.GetDefaultBranchResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.CreateProductRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.product != null) { - if (typeof object.product !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CreateProductRequest.product: object expected"); - message.product = $root.google.cloud.retail.v2alpha.Product.fromObject(object.product); + var message = new $root.google.cloud.retail.v2alpha.GetDefaultBranchResponse(); + if (object.branch != null) + message.branch = String(object.branch); + if (object.setTime != null) { + if (typeof object.setTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.GetDefaultBranchResponse.setTime: object expected"); + message.setTime = $root.google.protobuf.Timestamp.fromObject(object.setTime); } - if (object.productId != null) - message.productId = String(object.productId); + if (object.note != null) + message.note = String(object.note); return message; }; /** - * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetDefaultBranchResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse * @static - * @param {google.cloud.retail.v2alpha.CreateProductRequest} message CreateProductRequest + * @param {google.cloud.retail.v2alpha.GetDefaultBranchResponse} message GetDefaultBranchResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateProductRequest.toObject = function toObject(message, options) { + GetDefaultBranchResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.product = null; - object.productId = ""; + object.branch = ""; + object.setTime = null; + object.note = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.product != null && message.hasOwnProperty("product")) - object.product = $root.google.cloud.retail.v2alpha.Product.toObject(message.product, options); - if (message.productId != null && message.hasOwnProperty("productId")) - object.productId = message.productId; + if (message.branch != null && message.hasOwnProperty("branch")) + object.branch = message.branch; + if (message.setTime != null && message.hasOwnProperty("setTime")) + object.setTime = $root.google.protobuf.Timestamp.toObject(message.setTime, options); + if (message.note != null && message.hasOwnProperty("note")) + object.note = message.note; return object; }; /** - * Converts this CreateProductRequest to JSON. + * Converts this GetDefaultBranchResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse * @instance * @returns {Object.} JSON object */ - CreateProductRequest.prototype.toJSON = function toJSON() { + GetDefaultBranchResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateProductRequest; + return GetDefaultBranchResponse; })(); - v2alpha.GetProductRequest = (function() { - - /** - * Properties of a GetProductRequest. - * @memberof google.cloud.retail.v2alpha - * @interface IGetProductRequest - * @property {string|null} [name] GetProductRequest name - */ + v2alpha.CompletionService = (function() { /** - * Constructs a new GetProductRequest. + * Constructs a new CompletionService service. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a GetProductRequest. - * @implements IGetProductRequest + * @classdesc Represents a CompletionService + * @extends $protobuf.rpc.Service * @constructor - * @param {google.cloud.retail.v2alpha.IGetProductRequest=} [properties] Properties to set + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ - function GetProductRequest(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]]; + function CompletionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - /** - * GetProductRequest name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.GetProductRequest - * @instance - */ - GetProductRequest.prototype.name = ""; + (CompletionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CompletionService; /** - * Creates a new GetProductRequest instance using the specified properties. + * Creates new CompletionService service using the specified rpc implementation. * @function create - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.CompletionService * @static - * @param {google.cloud.retail.v2alpha.IGetProductRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.GetProductRequest} GetProductRequest instance + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {CompletionService} RPC service. Useful where requests and/or responses are streamed. */ - GetProductRequest.create = function create(properties) { - return new GetProductRequest(properties); + CompletionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetProductRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.GetProductRequest - * @static - * @param {google.cloud.retail.v2alpha.IGetProductRequest} message GetProductRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.retail.v2alpha.CompletionService#completeQuery}. + * @memberof google.cloud.retail.v2alpha.CompletionService + * @typedef CompleteQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse} [response] CompleteQueryResponse */ - GetProductRequest.encode = function encode(message, writer) { + + /** + * Calls CompleteQuery. + * @function completeQuery + * @memberof google.cloud.retail.v2alpha.CompletionService + * @instance + * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest} request CompleteQueryRequest message or plain object + * @param {google.cloud.retail.v2alpha.CompletionService.CompleteQueryCallback} callback Node-style callback called with the error, if any, and CompleteQueryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CompletionService.prototype.completeQuery = function completeQuery(request, callback) { + return this.rpcCall(completeQuery, $root.google.cloud.retail.v2alpha.CompleteQueryRequest, $root.google.cloud.retail.v2alpha.CompleteQueryResponse, request, callback); + }, "name", { value: "CompleteQuery" }); + + /** + * Calls CompleteQuery. + * @function completeQuery + * @memberof google.cloud.retail.v2alpha.CompletionService + * @instance + * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest} request CompleteQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CompletionService#importCompletionData}. + * @memberof google.cloud.retail.v2alpha.CompletionService + * @typedef ImportCompletionDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportCompletionData. + * @function importCompletionData + * @memberof google.cloud.retail.v2alpha.CompletionService + * @instance + * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest} request ImportCompletionDataRequest message or plain object + * @param {google.cloud.retail.v2alpha.CompletionService.ImportCompletionDataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CompletionService.prototype.importCompletionData = function importCompletionData(request, callback) { + return this.rpcCall(importCompletionData, $root.google.cloud.retail.v2alpha.ImportCompletionDataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportCompletionData" }); + + /** + * Calls ImportCompletionData. + * @function importCompletionData + * @memberof google.cloud.retail.v2alpha.CompletionService + * @instance + * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest} request ImportCompletionDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CompletionService; + })(); + + v2alpha.CompleteQueryRequest = (function() { + + /** + * Properties of a CompleteQueryRequest. + * @memberof google.cloud.retail.v2alpha + * @interface ICompleteQueryRequest + * @property {string|null} [catalog] CompleteQueryRequest catalog + * @property {string|null} [query] CompleteQueryRequest query + * @property {string|null} [visitorId] CompleteQueryRequest visitorId + * @property {Array.|null} [languageCodes] CompleteQueryRequest languageCodes + * @property {string|null} [deviceType] CompleteQueryRequest deviceType + * @property {string|null} [dataset] CompleteQueryRequest dataset + * @property {number|null} [maxSuggestions] CompleteQueryRequest maxSuggestions + */ + + /** + * Constructs a new CompleteQueryRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a CompleteQueryRequest. + * @implements ICompleteQueryRequest + * @constructor + * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest=} [properties] Properties to set + */ + function CompleteQueryRequest(properties) { + this.languageCodes = []; + 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]]; + } + + /** + * CompleteQueryRequest catalog. + * @member {string} catalog + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.catalog = ""; + + /** + * CompleteQueryRequest query. + * @member {string} query + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.query = ""; + + /** + * CompleteQueryRequest visitorId. + * @member {string} visitorId + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.visitorId = ""; + + /** + * CompleteQueryRequest languageCodes. + * @member {Array.} languageCodes + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.languageCodes = $util.emptyArray; + + /** + * CompleteQueryRequest deviceType. + * @member {string} deviceType + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.deviceType = ""; + + /** + * CompleteQueryRequest dataset. + * @member {string} dataset + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.dataset = ""; + + /** + * CompleteQueryRequest maxSuggestions. + * @member {number} maxSuggestions + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.maxSuggestions = 0; + + /** + * Creates a new CompleteQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @static + * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CompleteQueryRequest} CompleteQueryRequest instance + */ + CompleteQueryRequest.create = function create(properties) { + return new CompleteQueryRequest(properties); + }; + + /** + * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @static + * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.languageCodes != null && message.languageCodes.length) + for (var i = 0; i < message.languageCodes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCodes[i]); + if (message.deviceType != null && Object.hasOwnProperty.call(message, "deviceType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.deviceType); + if (message.maxSuggestions != null && Object.hasOwnProperty.call(message, "maxSuggestions")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxSuggestions); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + 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); return writer; }; /** - * Encodes the specified GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetProductRequest.verify|verify} messages. + * Encodes the specified CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest * @static - * @param {google.cloud.retail.v2alpha.IGetProductRequest} message GetProductRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + CompleteQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetProductRequest message from the specified reader or buffer. + * Decodes a CompleteQueryRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest * @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.GetProductRequest} GetProductRequest + * @returns {google.cloud.retail.v2alpha.CompleteQueryRequest} CompleteQueryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetProductRequest.decode = function decode(reader, length) { + CompleteQueryRequest.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.GetProductRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompleteQueryRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.catalog = reader.string(); + break; + case 2: + message.query = reader.string(); + break; + case 7: + message.visitorId = reader.string(); + break; + case 3: + if (!(message.languageCodes && message.languageCodes.length)) + message.languageCodes = []; + message.languageCodes.push(reader.string()); + break; + case 4: + message.deviceType = reader.string(); + break; + case 6: + message.dataset = reader.string(); + break; + case 5: + message.maxSuggestions = reader.int32(); break; default: reader.skipType(tag & 7); @@ -42313,109 +40781,173 @@ }; /** - * Decodes a GetProductRequest message from the specified reader or buffer, length delimited. + * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.GetProductRequest} GetProductRequest + * @returns {google.cloud.retail.v2alpha.CompleteQueryRequest} CompleteQueryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetProductRequest.decodeDelimited = function decodeDelimited(reader) { + CompleteQueryRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetProductRequest message. + * Verifies a CompleteQueryRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetProductRequest.verify = function verify(message) { + CompleteQueryRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.catalog != null && message.hasOwnProperty("catalog")) + if (!$util.isString(message.catalog)) + return "catalog: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + if (!$util.isString(message.visitorId)) + return "visitorId: string expected"; + if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { + if (!Array.isArray(message.languageCodes)) + return "languageCodes: array expected"; + for (var i = 0; i < message.languageCodes.length; ++i) + if (!$util.isString(message.languageCodes[i])) + return "languageCodes: string[] expected"; + } + if (message.deviceType != null && message.hasOwnProperty("deviceType")) + if (!$util.isString(message.deviceType)) + return "deviceType: string expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) + if (!$util.isInteger(message.maxSuggestions)) + return "maxSuggestions: integer expected"; return null; }; /** - * Creates a GetProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.GetProductRequest} GetProductRequest + * @returns {google.cloud.retail.v2alpha.CompleteQueryRequest} CompleteQueryRequest */ - GetProductRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.GetProductRequest) + CompleteQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.GetProductRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.retail.v2alpha.CompleteQueryRequest(); + if (object.catalog != null) + message.catalog = String(object.catalog); + if (object.query != null) + message.query = String(object.query); + if (object.visitorId != null) + message.visitorId = String(object.visitorId); + if (object.languageCodes) { + if (!Array.isArray(object.languageCodes)) + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryRequest.languageCodes: array expected"); + message.languageCodes = []; + for (var i = 0; i < object.languageCodes.length; ++i) + message.languageCodes[i] = String(object.languageCodes[i]); + } + if (object.deviceType != null) + message.deviceType = String(object.deviceType); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.maxSuggestions != null) + message.maxSuggestions = object.maxSuggestions | 0; return message; }; /** - * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. + * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest * @static - * @param {google.cloud.retail.v2alpha.GetProductRequest} message GetProductRequest + * @param {google.cloud.retail.v2alpha.CompleteQueryRequest} message CompleteQueryRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetProductRequest.toObject = function toObject(message, options) { + CompleteQueryRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.arrays || options.defaults) + object.languageCodes = []; + if (options.defaults) { + object.catalog = ""; + object.query = ""; + object.deviceType = ""; + object.maxSuggestions = 0; + object.dataset = ""; + object.visitorId = ""; + } + if (message.catalog != null && message.hasOwnProperty("catalog")) + object.catalog = message.catalog; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.languageCodes && message.languageCodes.length) { + object.languageCodes = []; + for (var j = 0; j < message.languageCodes.length; ++j) + object.languageCodes[j] = message.languageCodes[j]; + } + if (message.deviceType != null && message.hasOwnProperty("deviceType")) + object.deviceType = message.deviceType; + if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) + object.maxSuggestions = message.maxSuggestions; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + object.visitorId = message.visitorId; return object; }; /** - * Converts this GetProductRequest to JSON. + * Converts this CompleteQueryRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest * @instance * @returns {Object.} JSON object */ - GetProductRequest.prototype.toJSON = function toJSON() { + CompleteQueryRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetProductRequest; + return CompleteQueryRequest; })(); - v2alpha.UpdateProductRequest = (function() { + v2alpha.CompleteQueryResponse = (function() { /** - * Properties of an UpdateProductRequest. + * Properties of a CompleteQueryResponse. * @memberof google.cloud.retail.v2alpha - * @interface IUpdateProductRequest - * @property {google.cloud.retail.v2alpha.IProduct|null} [product] UpdateProductRequest product - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProductRequest updateMask - * @property {boolean|null} [allowMissing] UpdateProductRequest allowMissing + * @interface ICompleteQueryResponse + * @property {Array.|null} [completionResults] CompleteQueryResponse completionResults + * @property {string|null} [attributionToken] CompleteQueryResponse attributionToken + * @property {Array.|null} [recentSearchResults] CompleteQueryResponse recentSearchResults */ /** - * Constructs a new UpdateProductRequest. + * Constructs a new CompleteQueryResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an UpdateProductRequest. - * @implements IUpdateProductRequest + * @classdesc Represents a CompleteQueryResponse. + * @implements ICompleteQueryResponse * @constructor - * @param {google.cloud.retail.v2alpha.IUpdateProductRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ICompleteQueryResponse=} [properties] Properties to set */ - function UpdateProductRequest(properties) { + function CompleteQueryResponse(properties) { + this.completionResults = []; + this.recentSearchResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -42423,101 +40955,107 @@ } /** - * UpdateProductRequest product. - * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} product - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * CompleteQueryResponse completionResults. + * @member {Array.} completionResults + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse * @instance */ - UpdateProductRequest.prototype.product = null; + CompleteQueryResponse.prototype.completionResults = $util.emptyArray; /** - * UpdateProductRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * CompleteQueryResponse attributionToken. + * @member {string} attributionToken + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse * @instance */ - UpdateProductRequest.prototype.updateMask = null; + CompleteQueryResponse.prototype.attributionToken = ""; /** - * UpdateProductRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * CompleteQueryResponse recentSearchResults. + * @member {Array.} recentSearchResults + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse * @instance */ - UpdateProductRequest.prototype.allowMissing = false; + CompleteQueryResponse.prototype.recentSearchResults = $util.emptyArray; /** - * Creates a new UpdateProductRequest instance using the specified properties. + * Creates a new CompleteQueryResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse * @static - * @param {google.cloud.retail.v2alpha.IUpdateProductRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.UpdateProductRequest} UpdateProductRequest instance + * @param {google.cloud.retail.v2alpha.ICompleteQueryResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse} CompleteQueryResponse instance */ - UpdateProductRequest.create = function create(properties) { - return new UpdateProductRequest(properties); + CompleteQueryResponse.create = function create(properties) { + return new CompleteQueryResponse(properties); }; /** - * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateProductRequest.verify|verify} messages. + * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse * @static - * @param {google.cloud.retail.v2alpha.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateProductRequest.encode = function encode(message, writer) { + CompleteQueryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - $root.google.cloud.retail.v2alpha.Product.encode(message.product, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + if (message.completionResults != null && message.completionResults.length) + for (var i = 0; i < message.completionResults.length; ++i) + $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.encode(message.completionResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributionToken); + 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(); return writer; }; /** - * Encodes the specified UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateProductRequest.verify|verify} messages. + * Encodes the specified CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse * @static - * @param {google.cloud.retail.v2alpha.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + CompleteQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateProductRequest message from the specified reader or buffer. + * Decodes a CompleteQueryResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse * @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.UpdateProductRequest} UpdateProductRequest + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse} CompleteQueryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateProductRequest.decode = function decode(reader, length) { + 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.UpdateProductRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.product = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); + if (!(message.completionResults && message.completionResults.length)) + message.completionResults = []; + message.completionResults.push($root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.decode(reader, reader.uint32())); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.attributionToken = reader.string(); break; case 3: - message.allowMissing = reader.bool(); + if (!(message.recentSearchResults && message.recentSearchResults.length)) + message.recentSearchResults = []; + message.recentSearchResults.push($root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -42528,467 +41066,688 @@ }; /** - * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. + * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.UpdateProductRequest} UpdateProductRequest + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse} CompleteQueryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateProductRequest.decodeDelimited = function decodeDelimited(reader) { + CompleteQueryResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateProductRequest message. + * Verifies a CompleteQueryResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateProductRequest.verify = function verify(message) { + CompleteQueryResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.product != null && message.hasOwnProperty("product")) { - var error = $root.google.cloud.retail.v2alpha.Product.verify(message.product); - if (error) - return "product." + error; + if (message.completionResults != null && message.hasOwnProperty("completionResults")) { + if (!Array.isArray(message.completionResults)) + return "completionResults: array expected"; + for (var i = 0; i < message.completionResults.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify(message.completionResults[i]); + if (error) + return "completionResults." + error; + } } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + if (!$util.isString(message.attributionToken)) + return "attributionToken: string expected"; + if (message.recentSearchResults != null && message.hasOwnProperty("recentSearchResults")) { + if (!Array.isArray(message.recentSearchResults)) + return "recentSearchResults: array expected"; + for (var i = 0; i < message.recentSearchResults.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify(message.recentSearchResults[i]); + if (error) + return "recentSearchResults." + error; + } } - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; return null; }; /** - * Creates an UpdateProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.UpdateProductRequest} UpdateProductRequest + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse} CompleteQueryResponse */ - UpdateProductRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.UpdateProductRequest) + CompleteQueryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.UpdateProductRequest(); - if (object.product != null) { - if (typeof object.product !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UpdateProductRequest.product: object expected"); - message.product = $root.google.cloud.retail.v2alpha.Product.fromObject(object.product); + var message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse(); + if (object.completionResults) { + if (!Array.isArray(object.completionResults)) + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.completionResults: array expected"); + message.completionResults = []; + for (var i = 0; i < object.completionResults.length; ++i) { + if (typeof object.completionResults[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.completionResults: object expected"); + message.completionResults[i] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.fromObject(object.completionResults[i]); + } } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UpdateProductRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + if (object.attributionToken != null) + message.attributionToken = String(object.attributionToken); + if (object.recentSearchResults) { + if (!Array.isArray(object.recentSearchResults)) + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.recentSearchResults: array expected"); + message.recentSearchResults = []; + for (var i = 0; i < object.recentSearchResults.length; ++i) { + if (typeof object.recentSearchResults[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.recentSearchResults: object expected"); + message.recentSearchResults[i] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.fromObject(object.recentSearchResults[i]); + } } - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. + * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse * @static - * @param {google.cloud.retail.v2alpha.UpdateProductRequest} message UpdateProductRequest + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse} message CompleteQueryResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateProductRequest.toObject = function toObject(message, options) { + CompleteQueryResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.product = null; - object.updateMask = null; - object.allowMissing = false; + if (options.arrays || options.defaults) { + object.completionResults = []; + object.recentSearchResults = []; + } + if (options.defaults) + object.attributionToken = ""; + if (message.completionResults && message.completionResults.length) { + object.completionResults = []; + for (var j = 0; j < message.completionResults.length; ++j) + object.completionResults[j] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.toObject(message.completionResults[j], options); + } + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + object.attributionToken = message.attributionToken; + if (message.recentSearchResults && message.recentSearchResults.length) { + object.recentSearchResults = []; + for (var j = 0; j < message.recentSearchResults.length; ++j) + object.recentSearchResults[j] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.toObject(message.recentSearchResults[j], options); } - if (message.product != null && message.hasOwnProperty("product")) - object.product = $root.google.cloud.retail.v2alpha.Product.toObject(message.product, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; return object; }; /** - * Converts this UpdateProductRequest to JSON. + * Converts this CompleteQueryResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse * @instance * @returns {Object.} JSON object */ - UpdateProductRequest.prototype.toJSON = function toJSON() { + CompleteQueryResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateProductRequest; - })(); + CompleteQueryResponse.CompletionResult = (function() { - v2alpha.DeleteProductRequest = (function() { + /** + * Properties of a CompletionResult. + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @interface ICompletionResult + * @property {string|null} [suggestion] CompletionResult suggestion + * @property {Object.|null} [attributes] CompletionResult attributes + */ - /** - * Properties of a DeleteProductRequest. - * @memberof google.cloud.retail.v2alpha - * @interface IDeleteProductRequest - * @property {string|null} [name] DeleteProductRequest name - */ + /** + * Constructs a new CompletionResult. + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @classdesc Represents a CompletionResult. + * @implements ICompletionResult + * @constructor + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult=} [properties] Properties to set + */ + function CompletionResult(properties) { + this.attributes = {}; + 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]]; + } - /** - * Constructs a new DeleteProductRequest. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a DeleteProductRequest. - * @implements IDeleteProductRequest - * @constructor - * @param {google.cloud.retail.v2alpha.IDeleteProductRequest=} [properties] Properties to set - */ - function DeleteProductRequest(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]]; - } + /** + * CompletionResult suggestion. + * @member {string} suggestion + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @instance + */ + CompletionResult.prototype.suggestion = ""; - /** - * DeleteProductRequest name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest - * @instance - */ - DeleteProductRequest.prototype.name = ""; + /** + * CompletionResult attributes. + * @member {Object.} attributes + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @instance + */ + CompletionResult.prototype.attributes = $util.emptyObject; - /** - * Creates a new DeleteProductRequest instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest - * @static - * @param {google.cloud.retail.v2alpha.IDeleteProductRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.DeleteProductRequest} DeleteProductRequest instance - */ - DeleteProductRequest.create = function create(properties) { - return new DeleteProductRequest(properties); - }; + /** + * Creates a new CompletionResult instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} CompletionResult instance + */ + CompletionResult.create = function create(properties) { + return new CompletionResult(properties); + }; - /** - * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteProductRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest - * @static - * @param {google.cloud.retail.v2alpha.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProductRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; + /** + * Encodes the specified CompletionResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult} message CompletionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompletionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.suggestion != null && Object.hasOwnProperty.call(message, "suggestion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.suggestion); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.retail.v2alpha.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; - /** - * Encodes the specified DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteProductRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest - * @static - * @param {google.cloud.retail.v2alpha.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProductRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified CompletionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult} message CompletionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompletionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a DeleteProductRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest - * @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.DeleteProductRequest} DeleteProductRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProductRequest.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.DeleteProductRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a CompletionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @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.CompletionResult} CompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompletionResult.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.CompletionResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.suggestion = reader.string(); + break; + case 2: + if (message.attributes === $util.emptyObject) + message.attributes = {}; + 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.CustomAttribute.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a DeleteProductRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.DeleteProductRequest} DeleteProductRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProductRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a CompletionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} CompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompletionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a DeleteProductRequest message. - * @function verify - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteProductRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; + /** + * Verifies a CompletionResult message. + * @function verify + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompletionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.suggestion != null && message.hasOwnProperty("suggestion")) + if (!$util.isString(message.suggestion)) + return "suggestion: string expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.CustomAttribute.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + return null; + }; - /** - * Creates a DeleteProductRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.DeleteProductRequest} DeleteProductRequest - */ - DeleteProductRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.DeleteProductRequest) - return object; - var message = new $root.google.cloud.retail.v2alpha.DeleteProductRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + /** + * Creates a CompletionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} CompletionResult + */ + CompletionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult) + return object; + var message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult(); + if (object.suggestion != null) + message.suggestion = String(object.suggestion); + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.retail.v2alpha.CustomAttribute.fromObject(object.attributes[keys[i]]); + } + } + return message; + }; - /** - * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest - * @static - * @param {google.cloud.retail.v2alpha.DeleteProductRequest} message DeleteProductRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteProductRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; + /** + * Creates a plain object from a CompletionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} message CompletionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompletionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) + object.suggestion = ""; + if (message.suggestion != null && message.hasOwnProperty("suggestion")) + object.suggestion = message.suggestion; + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.retail.v2alpha.CustomAttribute.toObject(message.attributes[keys2[j]], options); + } + return object; + }; - /** - * Converts this DeleteProductRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteProductRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this CompletionResult to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @instance + * @returns {Object.} JSON object + */ + CompletionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return DeleteProductRequest; - })(); + return CompletionResult; + })(); - v2alpha.ListProductsRequest = (function() { + CompleteQueryResponse.RecentSearchResult = (function() { - /** - * Properties of a ListProductsRequest. - * @memberof google.cloud.retail.v2alpha - * @interface IListProductsRequest - * @property {string|null} [parent] ListProductsRequest parent - * @property {number|null} [pageSize] ListProductsRequest pageSize - * @property {string|null} [pageToken] ListProductsRequest pageToken - * @property {string|null} [filter] ListProductsRequest filter - * @property {google.protobuf.IFieldMask|null} [readMask] ListProductsRequest readMask - * @property {boolean|null} [requireTotalSize] ListProductsRequest requireTotalSize - */ + /** + * Properties of a RecentSearchResult. + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @interface IRecentSearchResult + * @property {string|null} [recentSearch] RecentSearchResult recentSearch + */ - /** - * Constructs a new ListProductsRequest. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ListProductsRequest. - * @implements IListProductsRequest - * @constructor - * @param {google.cloud.retail.v2alpha.IListProductsRequest=} [properties] Properties to set - */ - function ListProductsRequest(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]]; - } + /** + * Constructs a new RecentSearchResult. + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @classdesc Represents a RecentSearchResult. + * @implements IRecentSearchResult + * @constructor + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult=} [properties] Properties to set + */ + function RecentSearchResult(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]]; + } - /** - * ListProductsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.ListProductsRequest - * @instance - */ - ListProductsRequest.prototype.parent = ""; + /** + * RecentSearchResult recentSearch. + * @member {string} recentSearch + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @instance + */ + RecentSearchResult.prototype.recentSearch = ""; - /** - * ListProductsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.retail.v2alpha.ListProductsRequest - * @instance - */ - ListProductsRequest.prototype.pageSize = 0; + /** + * Creates a new RecentSearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} RecentSearchResult instance + */ + RecentSearchResult.create = function create(properties) { + return new RecentSearchResult(properties); + }; + + /** + * Encodes the specified RecentSearchResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult} message RecentSearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecentSearchResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recentSearch != null && Object.hasOwnProperty.call(message, "recentSearch")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.recentSearch); + return writer; + }; + + /** + * Encodes the specified RecentSearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult} message RecentSearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecentSearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecentSearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @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.RecentSearchResult} RecentSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecentSearchResult.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.RecentSearchResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.recentSearch = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecentSearchResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} RecentSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecentSearchResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecentSearchResult message. + * @function verify + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecentSearchResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recentSearch != null && message.hasOwnProperty("recentSearch")) + if (!$util.isString(message.recentSearch)) + return "recentSearch: string expected"; + return null; + }; + + /** + * Creates a RecentSearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} RecentSearchResult + */ + RecentSearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult) + return object; + var message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult(); + if (object.recentSearch != null) + message.recentSearch = String(object.recentSearch); + return message; + }; + + /** + * Creates a plain object from a RecentSearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} message RecentSearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecentSearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.recentSearch = ""; + if (message.recentSearch != null && message.hasOwnProperty("recentSearch")) + object.recentSearch = message.recentSearch; + return object; + }; + + /** + * Converts this RecentSearchResult to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @instance + * @returns {Object.} JSON object + */ + RecentSearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RecentSearchResult; + })(); + + return CompleteQueryResponse; + })(); + + v2alpha.ExportErrorsConfig = (function() { /** - * ListProductsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.retail.v2alpha.ListProductsRequest - * @instance + * Properties of an ExportErrorsConfig. + * @memberof google.cloud.retail.v2alpha + * @interface IExportErrorsConfig + * @property {string|null} [gcsPrefix] ExportErrorsConfig gcsPrefix */ - ListProductsRequest.prototype.pageToken = ""; /** - * ListProductsRequest filter. - * @member {string} filter - * @memberof google.cloud.retail.v2alpha.ListProductsRequest - * @instance + * Constructs a new ExportErrorsConfig. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an ExportErrorsConfig. + * @implements IExportErrorsConfig + * @constructor + * @param {google.cloud.retail.v2alpha.IExportErrorsConfig=} [properties] Properties to set */ - ListProductsRequest.prototype.filter = ""; + function ExportErrorsConfig(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]]; + } /** - * ListProductsRequest readMask. - * @member {google.protobuf.IFieldMask|null|undefined} readMask - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * ExportErrorsConfig gcsPrefix. + * @member {string|null|undefined} gcsPrefix + * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig * @instance */ - ListProductsRequest.prototype.readMask = null; + ExportErrorsConfig.prototype.gcsPrefix = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * ListProductsRequest requireTotalSize. - * @member {boolean} requireTotalSize - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * ExportErrorsConfig destination. + * @member {"gcsPrefix"|undefined} destination + * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig * @instance */ - ListProductsRequest.prototype.requireTotalSize = false; + Object.defineProperty(ExportErrorsConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsPrefix"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new ListProductsRequest instance using the specified properties. + * Creates a new ExportErrorsConfig instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig * @static - * @param {google.cloud.retail.v2alpha.IListProductsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ListProductsRequest} ListProductsRequest instance + * @param {google.cloud.retail.v2alpha.IExportErrorsConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ExportErrorsConfig} ExportErrorsConfig instance */ - ListProductsRequest.create = function create(properties) { - return new ListProductsRequest(properties); + ExportErrorsConfig.create = function create(properties) { + return new ExportErrorsConfig(properties); }; /** - * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsRequest.verify|verify} messages. + * Encodes the specified ExportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ExportErrorsConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig * @static - * @param {google.cloud.retail.v2alpha.IListProductsRequest} message ListProductsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IExportErrorsConfig} message ExportErrorsConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListProductsRequest.encode = function encode(message, writer) { + ExportErrorsConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) - $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.requireTotalSize != null && Object.hasOwnProperty.call(message, "requireTotalSize")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requireTotalSize); + if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsPrefix); return writer; }; /** - * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsRequest.verify|verify} messages. + * Encodes the specified ExportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExportErrorsConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig * @static - * @param {google.cloud.retail.v2alpha.IListProductsRequest} message ListProductsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IExportErrorsConfig} message ExportErrorsConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ExportErrorsConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListProductsRequest message from the specified reader or buffer. + * Decodes an ExportErrorsConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig * @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.ListProductsRequest} ListProductsRequest + * @returns {google.cloud.retail.v2alpha.ExportErrorsConfig} ExportErrorsConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListProductsRequest.decode = function decode(reader, length) { + ExportErrorsConfig.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.ListProductsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ExportErrorsConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - case 4: - message.filter = reader.string(); - break; - case 5: - message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 6: - message.requireTotalSize = reader.bool(); + message.gcsPrefix = reader.string(); break; default: reader.skipType(tag & 7); @@ -42999,156 +41758,112 @@ }; /** - * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. + * Decodes an ExportErrorsConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ListProductsRequest} ListProductsRequest + * @returns {google.cloud.retail.v2alpha.ExportErrorsConfig} ExportErrorsConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListProductsRequest.decodeDelimited = function decodeDelimited(reader) { + ExportErrorsConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListProductsRequest message. + * Verifies an ExportErrorsConfig message. * @function verify - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListProductsRequest.verify = function verify(message) { + ExportErrorsConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.readMask != null && message.hasOwnProperty("readMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.readMask); - if (error) - return "readMask." + error; + var properties = {}; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + properties.destination = 1; + if (!$util.isString(message.gcsPrefix)) + return "gcsPrefix: string expected"; } - if (message.requireTotalSize != null && message.hasOwnProperty("requireTotalSize")) - if (typeof message.requireTotalSize !== "boolean") - return "requireTotalSize: boolean expected"; return null; }; /** - * Creates a ListProductsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExportErrorsConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ListProductsRequest} ListProductsRequest + * @returns {google.cloud.retail.v2alpha.ExportErrorsConfig} ExportErrorsConfig */ - ListProductsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ListProductsRequest) + ExportErrorsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ExportErrorsConfig) return object; - var message = new $root.google.cloud.retail.v2alpha.ListProductsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.readMask != null) { - if (typeof object.readMask !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ListProductsRequest.readMask: object expected"); - message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); - } - if (object.requireTotalSize != null) - message.requireTotalSize = Boolean(object.requireTotalSize); + var message = new $root.google.cloud.retail.v2alpha.ExportErrorsConfig(); + if (object.gcsPrefix != null) + message.gcsPrefix = String(object.gcsPrefix); return message; }; /** - * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. + * Creates a plain object from an ExportErrorsConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig * @static - * @param {google.cloud.retail.v2alpha.ListProductsRequest} message ListProductsRequest + * @param {google.cloud.retail.v2alpha.ExportErrorsConfig} message ExportErrorsConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListProductsRequest.toObject = function toObject(message, options) { + ExportErrorsConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.readMask = null; - object.requireTotalSize = false; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + object.gcsPrefix = message.gcsPrefix; + if (options.oneofs) + object.destination = "gcsPrefix"; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.readMask != null && message.hasOwnProperty("readMask")) - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); - if (message.requireTotalSize != null && message.hasOwnProperty("requireTotalSize")) - object.requireTotalSize = message.requireTotalSize; return object; }; /** - * Converts this ListProductsRequest to JSON. + * Converts this ExportErrorsConfig to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.ExportErrorsConfig * @instance * @returns {Object.} JSON object */ - ListProductsRequest.prototype.toJSON = function toJSON() { + ExportErrorsConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListProductsRequest; + return ExportErrorsConfig; })(); - v2alpha.ListProductsResponse = (function() { + v2alpha.ExportMetadata = (function() { /** - * Properties of a ListProductsResponse. + * Properties of an ExportMetadata. * @memberof google.cloud.retail.v2alpha - * @interface IListProductsResponse - * @property {Array.|null} [products] ListProductsResponse products - * @property {string|null} [nextPageToken] ListProductsResponse nextPageToken - * @property {number|null} [totalSize] ListProductsResponse totalSize + * @interface IExportMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] ExportMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ExportMetadata updateTime */ /** - * Constructs a new ListProductsResponse. + * Constructs a new ExportMetadata. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ListProductsResponse. - * @implements IListProductsResponse + * @classdesc Represents an ExportMetadata. + * @implements IExportMetadata * @constructor - * @param {google.cloud.retail.v2alpha.IListProductsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IExportMetadata=} [properties] Properties to set */ - function ListProductsResponse(properties) { - this.products = []; + function ExportMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43156,104 +41871,88 @@ } /** - * ListProductsResponse products. - * @member {Array.} products - * @memberof google.cloud.retail.v2alpha.ListProductsResponse - * @instance - */ - ListProductsResponse.prototype.products = $util.emptyArray; - - /** - * ListProductsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * ExportMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.retail.v2alpha.ExportMetadata * @instance */ - ListProductsResponse.prototype.nextPageToken = ""; + ExportMetadata.prototype.createTime = null; /** - * ListProductsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * ExportMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.retail.v2alpha.ExportMetadata * @instance */ - ListProductsResponse.prototype.totalSize = 0; + ExportMetadata.prototype.updateTime = null; /** - * Creates a new ListProductsResponse instance using the specified properties. + * Creates a new ExportMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.ExportMetadata * @static - * @param {google.cloud.retail.v2alpha.IListProductsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ListProductsResponse} ListProductsResponse instance + * @param {google.cloud.retail.v2alpha.IExportMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ExportMetadata} ExportMetadata instance */ - ListProductsResponse.create = function create(properties) { - return new ListProductsResponse(properties); + ExportMetadata.create = function create(properties) { + return new ExportMetadata(properties); }; /** - * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsResponse.verify|verify} messages. + * Encodes the specified ExportMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.ExportMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.ExportMetadata * @static - * @param {google.cloud.retail.v2alpha.IListProductsResponse} message ListProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IExportMetadata} message ExportMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListProductsResponse.encode = function encode(message, writer) { + ExportMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.products != null && message.products.length) - for (var i = 0; i < message.products.length; ++i) - $root.google.cloud.retail.v2alpha.Product.encode(message.products[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsResponse.verify|verify} messages. + * Encodes the specified ExportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExportMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.ExportMetadata * @static - * @param {google.cloud.retail.v2alpha.IListProductsResponse} message ListProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IExportMetadata} message ExportMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ExportMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListProductsResponse message from the specified reader or buffer. + * Decodes an ExportMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.ExportMetadata * @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.ListProductsResponse} ListProductsResponse + * @returns {google.cloud.retail.v2alpha.ExportMetadata} ExportMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListProductsResponse.decode = function decode(reader, length) { + ExportMetadata.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.ListProductsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ExportMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.products && message.products.length)) - message.products = []; - message.products.push($root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32())); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 2: - message.nextPageToken = reader.string(); - break; - case 3: - message.totalSize = reader.int32(); + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -43264,145 +41963,128 @@ }; /** - * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. + * Decodes an ExportMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.ExportMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ListProductsResponse} ListProductsResponse + * @returns {google.cloud.retail.v2alpha.ExportMetadata} ExportMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListProductsResponse.decodeDelimited = function decodeDelimited(reader) { + ExportMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListProductsResponse message. + * Verifies an ExportMetadata message. * @function verify - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.ExportMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListProductsResponse.verify = function verify(message) { + ExportMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.products != null && message.hasOwnProperty("products")) { - if (!Array.isArray(message.products)) - return "products: array expected"; - for (var i = 0; i < message.products.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Product.verify(message.products[i]); - if (error) - return "products." + error; - } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; return null; }; /** - * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ExportMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.ExportMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ListProductsResponse} ListProductsResponse + * @returns {google.cloud.retail.v2alpha.ExportMetadata} ExportMetadata */ - ListProductsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ListProductsResponse) + ExportMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ExportMetadata) return object; - var message = new $root.google.cloud.retail.v2alpha.ListProductsResponse(); - if (object.products) { - if (!Array.isArray(object.products)) - throw TypeError(".google.cloud.retail.v2alpha.ListProductsResponse.products: array expected"); - message.products = []; - for (var i = 0; i < object.products.length; ++i) { - if (typeof object.products[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ListProductsResponse.products: object expected"); - message.products[i] = $root.google.cloud.retail.v2alpha.Product.fromObject(object.products[i]); - } + var message = new $root.google.cloud.retail.v2alpha.ExportMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ExportMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ExportMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. + * Creates a plain object from an ExportMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.ExportMetadata * @static - * @param {google.cloud.retail.v2alpha.ListProductsResponse} message ListProductsResponse + * @param {google.cloud.retail.v2alpha.ExportMetadata} message ExportMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListProductsResponse.toObject = function toObject(message, options) { + ExportMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.products = []; if (options.defaults) { - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.products && message.products.length) { - object.products = []; - for (var j = 0; j < message.products.length; ++j) - object.products[j] = $root.google.cloud.retail.v2alpha.Product.toObject(message.products[j], options); + object.createTime = null; + object.updateTime = null; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; /** - * Converts this ListProductsResponse to JSON. + * Converts this ExportMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.ExportMetadata * @instance * @returns {Object.} JSON object */ - ListProductsResponse.prototype.toJSON = function toJSON() { + ExportMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListProductsResponse; + return ExportMetadata; })(); - v2alpha.SetInventoryRequest = (function() { + v2alpha.ExportProductsResponse = (function() { /** - * Properties of a SetInventoryRequest. + * Properties of an ExportProductsResponse. * @memberof google.cloud.retail.v2alpha - * @interface ISetInventoryRequest - * @property {google.cloud.retail.v2alpha.IProduct|null} [inventory] SetInventoryRequest inventory - * @property {google.protobuf.IFieldMask|null} [setMask] SetInventoryRequest setMask - * @property {google.protobuf.ITimestamp|null} [setTime] SetInventoryRequest setTime - * @property {boolean|null} [allowMissing] SetInventoryRequest allowMissing + * @interface IExportProductsResponse + * @property {Array.|null} [errorSamples] ExportProductsResponse errorSamples + * @property {google.cloud.retail.v2alpha.IExportErrorsConfig|null} [errorsConfig] ExportProductsResponse errorsConfig */ /** - * Constructs a new SetInventoryRequest. + * Constructs a new ExportProductsResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a SetInventoryRequest. - * @implements ISetInventoryRequest + * @classdesc Represents an ExportProductsResponse. + * @implements IExportProductsResponse * @constructor - * @param {google.cloud.retail.v2alpha.ISetInventoryRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IExportProductsResponse=} [properties] Properties to set */ - function SetInventoryRequest(properties) { + function ExportProductsResponse(properties) { + this.errorSamples = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43410,114 +42092,91 @@ } /** - * SetInventoryRequest inventory. - * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} inventory - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest - * @instance - */ - SetInventoryRequest.prototype.inventory = null; - - /** - * SetInventoryRequest setMask. - * @member {google.protobuf.IFieldMask|null|undefined} setMask - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest - * @instance - */ - SetInventoryRequest.prototype.setMask = null; - - /** - * SetInventoryRequest setTime. - * @member {google.protobuf.ITimestamp|null|undefined} setTime - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * ExportProductsResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.retail.v2alpha.ExportProductsResponse * @instance */ - SetInventoryRequest.prototype.setTime = null; + ExportProductsResponse.prototype.errorSamples = $util.emptyArray; /** - * SetInventoryRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * ExportProductsResponse errorsConfig. + * @member {google.cloud.retail.v2alpha.IExportErrorsConfig|null|undefined} errorsConfig + * @memberof google.cloud.retail.v2alpha.ExportProductsResponse * @instance */ - SetInventoryRequest.prototype.allowMissing = false; + ExportProductsResponse.prototype.errorsConfig = null; /** - * Creates a new SetInventoryRequest instance using the specified properties. + * Creates a new ExportProductsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.ExportProductsResponse * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SetInventoryRequest} SetInventoryRequest instance + * @param {google.cloud.retail.v2alpha.IExportProductsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ExportProductsResponse} ExportProductsResponse instance */ - SetInventoryRequest.create = function create(properties) { - return new SetInventoryRequest(properties); + ExportProductsResponse.create = function create(properties) { + return new ExportProductsResponse(properties); }; /** - * Encodes the specified SetInventoryRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryRequest.verify|verify} messages. + * Encodes the specified ExportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ExportProductsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.ExportProductsResponse * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryRequest} message SetInventoryRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IExportProductsResponse} message ExportProductsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetInventoryRequest.encode = function encode(message, writer) { + ExportProductsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.inventory != null && Object.hasOwnProperty.call(message, "inventory")) - $root.google.cloud.retail.v2alpha.Product.encode(message.inventory, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.setMask != null && Object.hasOwnProperty.call(message, "setMask")) - $root.google.protobuf.FieldMask.encode(message.setMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.setTime != null && Object.hasOwnProperty.call(message, "setTime")) - $root.google.protobuf.Timestamp.encode(message.setTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + if (message.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) + $root.google.cloud.retail.v2alpha.ExportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified SetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryRequest.verify|verify} messages. + * Encodes the specified ExportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExportProductsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.ExportProductsResponse * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryRequest} message SetInventoryRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IExportProductsResponse} message ExportProductsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetInventoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + ExportProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetInventoryRequest message from the specified reader or buffer. + * Decodes an ExportProductsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.ExportProductsResponse * @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.SetInventoryRequest} SetInventoryRequest + * @returns {google.cloud.retail.v2alpha.ExportProductsResponse} ExportProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetInventoryRequest.decode = function decode(reader, length) { + ExportProductsResponse.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.SetInventoryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ExportProductsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.inventory = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); break; case 2: - message.setMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 3: - message.setTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 4: - message.allowMissing = reader.bool(); + message.errorsConfig = $root.google.cloud.retail.v2alpha.ExportErrorsConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -43528,146 +42187,140 @@ }; /** - * Decodes a SetInventoryRequest message from the specified reader or buffer, length delimited. + * Decodes an ExportProductsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.ExportProductsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SetInventoryRequest} SetInventoryRequest + * @returns {google.cloud.retail.v2alpha.ExportProductsResponse} ExportProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetInventoryRequest.decodeDelimited = function decodeDelimited(reader) { + ExportProductsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetInventoryRequest message. + * Verifies an ExportProductsResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.ExportProductsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetInventoryRequest.verify = function verify(message) { + ExportProductsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.inventory != null && message.hasOwnProperty("inventory")) { - var error = $root.google.cloud.retail.v2alpha.Product.verify(message.inventory); - if (error) - return "inventory." + error; - } - if (message.setMask != null && message.hasOwnProperty("setMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.setMask); - if (error) - return "setMask." + error; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } } - if (message.setTime != null && message.hasOwnProperty("setTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.setTime); + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { + var error = $root.google.cloud.retail.v2alpha.ExportErrorsConfig.verify(message.errorsConfig); if (error) - return "setTime." + error; + return "errorsConfig." + error; } - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; return null; }; /** - * Creates a SetInventoryRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExportProductsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.ExportProductsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SetInventoryRequest} SetInventoryRequest + * @returns {google.cloud.retail.v2alpha.ExportProductsResponse} ExportProductsResponse */ - SetInventoryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SetInventoryRequest) + ExportProductsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ExportProductsResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.SetInventoryRequest(); - if (object.inventory != null) { - if (typeof object.inventory !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SetInventoryRequest.inventory: object expected"); - message.inventory = $root.google.cloud.retail.v2alpha.Product.fromObject(object.inventory); - } - if (object.setMask != null) { - if (typeof object.setMask !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SetInventoryRequest.setMask: object expected"); - message.setMask = $root.google.protobuf.FieldMask.fromObject(object.setMask); + var message = new $root.google.cloud.retail.v2alpha.ExportProductsResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.retail.v2alpha.ExportProductsResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ExportProductsResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } } - if (object.setTime != null) { - if (typeof object.setTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SetInventoryRequest.setTime: object expected"); - message.setTime = $root.google.protobuf.Timestamp.fromObject(object.setTime); + if (object.errorsConfig != null) { + if (typeof object.errorsConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ExportProductsResponse.errorsConfig: object expected"); + message.errorsConfig = $root.google.cloud.retail.v2alpha.ExportErrorsConfig.fromObject(object.errorsConfig); } - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a SetInventoryRequest message. Also converts values to other types if specified. + * Creates a plain object from an ExportProductsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.ExportProductsResponse * @static - * @param {google.cloud.retail.v2alpha.SetInventoryRequest} message SetInventoryRequest + * @param {google.cloud.retail.v2alpha.ExportProductsResponse} message ExportProductsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetInventoryRequest.toObject = function toObject(message, options) { + ExportProductsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.inventory = null; - object.setMask = null; - object.setTime = null; - object.allowMissing = false; + if (options.arrays || options.defaults) + object.errorSamples = []; + if (options.defaults) + object.errorsConfig = null; + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); } - if (message.inventory != null && message.hasOwnProperty("inventory")) - object.inventory = $root.google.cloud.retail.v2alpha.Product.toObject(message.inventory, options); - if (message.setMask != null && message.hasOwnProperty("setMask")) - object.setMask = $root.google.protobuf.FieldMask.toObject(message.setMask, options); - if (message.setTime != null && message.hasOwnProperty("setTime")) - object.setTime = $root.google.protobuf.Timestamp.toObject(message.setTime, options); - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) + object.errorsConfig = $root.google.cloud.retail.v2alpha.ExportErrorsConfig.toObject(message.errorsConfig, options); return object; }; /** - * Converts this SetInventoryRequest to JSON. + * Converts this ExportProductsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.ExportProductsResponse * @instance * @returns {Object.} JSON object */ - SetInventoryRequest.prototype.toJSON = function toJSON() { + ExportProductsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SetInventoryRequest; + return ExportProductsResponse; })(); - v2alpha.SetInventoryMetadata = (function() { + v2alpha.ExportUserEventsResponse = (function() { /** - * Properties of a SetInventoryMetadata. + * Properties of an ExportUserEventsResponse. * @memberof google.cloud.retail.v2alpha - * @interface ISetInventoryMetadata + * @interface IExportUserEventsResponse + * @property {Array.|null} [errorSamples] ExportUserEventsResponse errorSamples + * @property {google.cloud.retail.v2alpha.IExportErrorsConfig|null} [errorsConfig] ExportUserEventsResponse errorsConfig */ /** - * Constructs a new SetInventoryMetadata. + * Constructs a new ExportUserEventsResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a SetInventoryMetadata. - * @implements ISetInventoryMetadata + * @classdesc Represents an ExportUserEventsResponse. + * @implements IExportUserEventsResponse * @constructor - * @param {google.cloud.retail.v2alpha.ISetInventoryMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IExportUserEventsResponse=} [properties] Properties to set */ - function SetInventoryMetadata(properties) { + function ExportUserEventsResponse(properties) { + this.errorSamples = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43675,63 +42328,92 @@ } /** - * Creates a new SetInventoryMetadata instance using the specified properties. + * ExportUserEventsResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse + * @instance + */ + ExportUserEventsResponse.prototype.errorSamples = $util.emptyArray; + + /** + * ExportUserEventsResponse errorsConfig. + * @member {google.cloud.retail.v2alpha.IExportErrorsConfig|null|undefined} errorsConfig + * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse + * @instance + */ + ExportUserEventsResponse.prototype.errorsConfig = null; + + /** + * Creates a new ExportUserEventsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SetInventoryMetadata} SetInventoryMetadata instance + * @param {google.cloud.retail.v2alpha.IExportUserEventsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ExportUserEventsResponse} ExportUserEventsResponse instance */ - SetInventoryMetadata.create = function create(properties) { - return new SetInventoryMetadata(properties); + ExportUserEventsResponse.create = function create(properties) { + return new ExportUserEventsResponse(properties); }; /** - * Encodes the specified SetInventoryMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryMetadata.verify|verify} messages. + * Encodes the specified ExportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ExportUserEventsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryMetadata} message SetInventoryMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IExportUserEventsResponse} message ExportUserEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetInventoryMetadata.encode = function encode(message, writer) { + ExportUserEventsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) + $root.google.cloud.retail.v2alpha.ExportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified SetInventoryMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryMetadata.verify|verify} messages. + * Encodes the specified ExportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExportUserEventsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryMetadata} message SetInventoryMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IExportUserEventsResponse} message ExportUserEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetInventoryMetadata.encodeDelimited = function encodeDelimited(message, writer) { + ExportUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetInventoryMetadata message from the specified reader or buffer. + * Decodes an ExportUserEventsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse * @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.SetInventoryMetadata} SetInventoryMetadata + * @returns {google.cloud.retail.v2alpha.ExportUserEventsResponse} ExportUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetInventoryMetadata.decode = function decode(reader, length) { + ExportUserEventsResponse.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.SetInventoryMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ExportUserEventsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + case 2: + message.errorsConfig = $root.google.cloud.retail.v2alpha.ExportErrorsConfig.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -43741,259 +42423,215 @@ }; /** - * Decodes a SetInventoryMetadata message from the specified reader or buffer, length delimited. + * Decodes an ExportUserEventsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SetInventoryMetadata} SetInventoryMetadata + * @returns {google.cloud.retail.v2alpha.ExportUserEventsResponse} ExportUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetInventoryMetadata.decodeDelimited = function decodeDelimited(reader) { + ExportUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetInventoryMetadata message. + * Verifies an ExportUserEventsResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetInventoryMetadata.verify = function verify(message) { + ExportUserEventsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } + } + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { + var error = $root.google.cloud.retail.v2alpha.ExportErrorsConfig.verify(message.errorsConfig); + if (error) + return "errorsConfig." + error; + } return null; }; /** - * Creates a SetInventoryMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an ExportUserEventsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SetInventoryMetadata} SetInventoryMetadata + * @returns {google.cloud.retail.v2alpha.ExportUserEventsResponse} ExportUserEventsResponse */ - SetInventoryMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SetInventoryMetadata) + ExportUserEventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ExportUserEventsResponse) return object; - return new $root.google.cloud.retail.v2alpha.SetInventoryMetadata(); + var message = new $root.google.cloud.retail.v2alpha.ExportUserEventsResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.retail.v2alpha.ExportUserEventsResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ExportUserEventsResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } + } + if (object.errorsConfig != null) { + if (typeof object.errorsConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ExportUserEventsResponse.errorsConfig: object expected"); + message.errorsConfig = $root.google.cloud.retail.v2alpha.ExportErrorsConfig.fromObject(object.errorsConfig); + } + return message; }; /** - * Creates a plain object from a SetInventoryMetadata message. Also converts values to other types if specified. + * Creates a plain object from an ExportUserEventsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.SetInventoryMetadata} message SetInventoryMetadata + * @param {google.cloud.retail.v2alpha.ExportUserEventsResponse} message ExportUserEventsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetInventoryMetadata.toObject = function toObject() { - return {}; - }; - - /** - * Converts this SetInventoryMetadata to JSON. + ExportUserEventsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errorSamples = []; + if (options.defaults) + object.errorsConfig = null; + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + } + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) + object.errorsConfig = $root.google.cloud.retail.v2alpha.ExportErrorsConfig.toObject(message.errorsConfig, options); + return object; + }; + + /** + * Converts this ExportUserEventsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.ExportUserEventsResponse * @instance * @returns {Object.} JSON object */ - SetInventoryMetadata.prototype.toJSON = function toJSON() { + ExportUserEventsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SetInventoryMetadata; + return ExportUserEventsResponse; })(); - v2alpha.SetInventoryResponse = (function() { - - /** - * Properties of a SetInventoryResponse. - * @memberof google.cloud.retail.v2alpha - * @interface ISetInventoryResponse - */ + v2alpha.PredictionService = (function() { /** - * Constructs a new SetInventoryResponse. + * Constructs a new PredictionService service. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a SetInventoryResponse. - * @implements ISetInventoryResponse + * @classdesc Represents a PredictionService + * @extends $protobuf.rpc.Service * @constructor - * @param {google.cloud.retail.v2alpha.ISetInventoryResponse=} [properties] Properties to set + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ - function SetInventoryResponse(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]]; + function PredictionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - /** - * Creates a new SetInventoryResponse instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse - * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SetInventoryResponse} SetInventoryResponse instance - */ - SetInventoryResponse.create = function create(properties) { - return new SetInventoryResponse(properties); - }; - - /** - * Encodes the specified SetInventoryResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse - * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryResponse} message SetInventoryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetInventoryResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified SetInventoryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse - * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryResponse} message SetInventoryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetInventoryResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetInventoryResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse - * @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.SetInventoryResponse} SetInventoryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetInventoryResponse.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.SetInventoryResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SetInventoryResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SetInventoryResponse} SetInventoryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetInventoryResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + (PredictionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PredictionService; /** - * Verifies a SetInventoryResponse message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse + * Creates new PredictionService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2alpha.PredictionService * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {PredictionService} RPC service. Useful where requests and/or responses are streamed. */ - SetInventoryResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; + PredictionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Creates a SetInventoryResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SetInventoryResponse} SetInventoryResponse + * Callback as used by {@link google.cloud.retail.v2alpha.PredictionService#predict}. + * @memberof google.cloud.retail.v2alpha.PredictionService + * @typedef PredictCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.PredictResponse} [response] PredictResponse */ - SetInventoryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SetInventoryResponse) - return object; - return new $root.google.cloud.retail.v2alpha.SetInventoryResponse(); - }; /** - * Creates a plain object from a SetInventoryResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse - * @static - * @param {google.cloud.retail.v2alpha.SetInventoryResponse} message SetInventoryResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls Predict. + * @function predict + * @memberof google.cloud.retail.v2alpha.PredictionService + * @instance + * @param {google.cloud.retail.v2alpha.IPredictRequest} request PredictRequest message or plain object + * @param {google.cloud.retail.v2alpha.PredictionService.PredictCallback} callback Node-style callback called with the error, if any, and PredictResponse + * @returns {undefined} + * @variation 1 */ - SetInventoryResponse.toObject = function toObject() { - return {}; - }; + Object.defineProperty(PredictionService.prototype.predict = function predict(request, callback) { + return this.rpcCall(predict, $root.google.cloud.retail.v2alpha.PredictRequest, $root.google.cloud.retail.v2alpha.PredictResponse, request, callback); + }, "name", { value: "Predict" }); /** - * Converts this SetInventoryResponse to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse + * Calls Predict. + * @function predict + * @memberof google.cloud.retail.v2alpha.PredictionService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.retail.v2alpha.IPredictRequest} request PredictRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - SetInventoryResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return SetInventoryResponse; + return PredictionService; })(); - v2alpha.AddFulfillmentPlacesRequest = (function() { + v2alpha.PredictRequest = (function() { /** - * Properties of an AddFulfillmentPlacesRequest. + * Properties of a PredictRequest. * @memberof google.cloud.retail.v2alpha - * @interface IAddFulfillmentPlacesRequest - * @property {string|null} [product] AddFulfillmentPlacesRequest product - * @property {string|null} [type] AddFulfillmentPlacesRequest type - * @property {Array.|null} [placeIds] AddFulfillmentPlacesRequest placeIds - * @property {google.protobuf.ITimestamp|null} [addTime] AddFulfillmentPlacesRequest addTime - * @property {boolean|null} [allowMissing] AddFulfillmentPlacesRequest allowMissing + * @interface IPredictRequest + * @property {string|null} [placement] PredictRequest placement + * @property {google.cloud.retail.v2alpha.IUserEvent|null} [userEvent] PredictRequest userEvent + * @property {number|null} [pageSize] PredictRequest pageSize + * @property {string|null} [pageToken] PredictRequest pageToken + * @property {string|null} [filter] PredictRequest filter + * @property {boolean|null} [validateOnly] PredictRequest validateOnly + * @property {Object.|null} [params] PredictRequest params + * @property {Object.|null} [labels] PredictRequest labels */ /** - * Constructs a new AddFulfillmentPlacesRequest. + * Constructs a new PredictRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an AddFulfillmentPlacesRequest. - * @implements IAddFulfillmentPlacesRequest + * @classdesc Represents a PredictRequest. + * @implements IPredictRequest * @constructor - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IPredictRequest=} [properties] Properties to set */ - function AddFulfillmentPlacesRequest(properties) { - this.placeIds = []; + function PredictRequest(properties) { + this.params = {}; + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -44001,130 +42639,208 @@ } /** - * AddFulfillmentPlacesRequest product. - * @member {string} product - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * PredictRequest placement. + * @member {string} placement + * @memberof google.cloud.retail.v2alpha.PredictRequest * @instance */ - AddFulfillmentPlacesRequest.prototype.product = ""; + PredictRequest.prototype.placement = ""; /** - * AddFulfillmentPlacesRequest type. - * @member {string} type - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * PredictRequest userEvent. + * @member {google.cloud.retail.v2alpha.IUserEvent|null|undefined} userEvent + * @memberof google.cloud.retail.v2alpha.PredictRequest * @instance */ - AddFulfillmentPlacesRequest.prototype.type = ""; + PredictRequest.prototype.userEvent = null; /** - * AddFulfillmentPlacesRequest placeIds. - * @member {Array.} placeIds - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * PredictRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.retail.v2alpha.PredictRequest * @instance */ - AddFulfillmentPlacesRequest.prototype.placeIds = $util.emptyArray; + PredictRequest.prototype.pageSize = 0; /** - * AddFulfillmentPlacesRequest addTime. - * @member {google.protobuf.ITimestamp|null|undefined} addTime - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * PredictRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.retail.v2alpha.PredictRequest * @instance */ - AddFulfillmentPlacesRequest.prototype.addTime = null; + PredictRequest.prototype.pageToken = ""; /** - * AddFulfillmentPlacesRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * PredictRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2alpha.PredictRequest * @instance */ - AddFulfillmentPlacesRequest.prototype.allowMissing = false; + PredictRequest.prototype.filter = ""; /** - * Creates a new AddFulfillmentPlacesRequest instance using the specified properties. + * PredictRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.retail.v2alpha.PredictRequest + * @instance + */ + PredictRequest.prototype.validateOnly = false; + + /** + * PredictRequest params. + * @member {Object.} params + * @memberof google.cloud.retail.v2alpha.PredictRequest + * @instance + */ + PredictRequest.prototype.params = $util.emptyObject; + + /** + * PredictRequest labels. + * @member {Object.} labels + * @memberof google.cloud.retail.v2alpha.PredictRequest + * @instance + */ + PredictRequest.prototype.labels = $util.emptyObject; + + /** + * Creates a new PredictRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest instance + * @param {google.cloud.retail.v2alpha.IPredictRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PredictRequest} PredictRequest instance */ - AddFulfillmentPlacesRequest.create = function create(properties) { - return new AddFulfillmentPlacesRequest(properties); + PredictRequest.create = function create(properties) { + return new PredictRequest(properties); }; /** - * Encodes the specified AddFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.verify|verify} messages. + * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPredictRequest} message PredictRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddFulfillmentPlacesRequest.encode = function encode(message, writer) { + PredictRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.placeIds != null && message.placeIds.length) - for (var i = 0; i < message.placeIds.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.placeIds[i]); - if (message.addTime != null && Object.hasOwnProperty.call(message, "addTime")) - $root.google.protobuf.Timestamp.encode(message.addTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.placement); + 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.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.params[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified AddFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.verify|verify} messages. + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPredictRequest} message PredictRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddFulfillmentPlacesRequest.encodeDelimited = function encodeDelimited(message, writer) { + PredictRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer. + * Decodes a PredictRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @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.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2alpha.PredictRequest} PredictRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddFulfillmentPlacesRequest.decode = function decode(reader, length) { + PredictRequest.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.AddFulfillmentPlacesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PredictRequest(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.product = reader.string(); + message.placement = reader.string(); break; case 2: - message.type = reader.string(); + message.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.decode(reader, reader.uint32()); break; case 3: - if (!(message.placeIds && message.placeIds.length)) - message.placeIds = []; - message.placeIds.push(reader.string()); + message.pageSize = reader.int32(); break; case 4: - message.addTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; case 5: - message.allowMissing = reader.bool(); + message.filter = reader.string(); + break; + case 6: + message.validateOnly = reader.bool(); + break; + case 7: + if (message.params === $util.emptyObject) + message.params = {}; + 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.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.params[key] = value; + break; + case 8: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; break; default: reader.skipType(tag & 7); @@ -44135,157 +42851,208 @@ }; /** - * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2alpha.PredictRequest} PredictRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddFulfillmentPlacesRequest.decodeDelimited = function decodeDelimited(reader) { + PredictRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AddFulfillmentPlacesRequest message. + * Verifies a PredictRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AddFulfillmentPlacesRequest.verify = function verify(message) { + PredictRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.product != null && message.hasOwnProperty("product")) - if (!$util.isString(message.product)) - return "product: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.placeIds != null && message.hasOwnProperty("placeIds")) { - if (!Array.isArray(message.placeIds)) - return "placeIds: array expected"; - for (var i = 0; i < message.placeIds.length; ++i) - if (!$util.isString(message.placeIds[i])) - return "placeIds: string[] expected"; - } - if (message.addTime != null && message.hasOwnProperty("addTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.addTime); + if (message.placement != null && message.hasOwnProperty("placement")) + if (!$util.isString(message.placement)) + return "placement: string expected"; + if (message.userEvent != null && message.hasOwnProperty("userEvent")) { + var error = $root.google.cloud.retail.v2alpha.UserEvent.verify(message.userEvent); if (error) - return "addTime." + error; + return "userEvent." + error; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.params[key[i]]); + if (error) + return "params." + error; + } + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; } - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; return null; }; /** - * Creates an AddFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2alpha.PredictRequest} PredictRequest */ - AddFulfillmentPlacesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest) + PredictRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PredictRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest(); - if (object.product != null) - message.product = String(object.product); - if (object.type != null) - message.type = String(object.type); - if (object.placeIds) { - if (!Array.isArray(object.placeIds)) - throw TypeError(".google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.placeIds: array expected"); - message.placeIds = []; - for (var i = 0; i < object.placeIds.length; ++i) - message.placeIds[i] = String(object.placeIds[i]); + var message = new $root.google.cloud.retail.v2alpha.PredictRequest(); + if (object.placement != null) + message.placement = String(object.placement); + if (object.userEvent != null) { + if (typeof object.userEvent !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PredictRequest.userEvent: object expected"); + message.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.fromObject(object.userEvent); } - if (object.addTime != null) { - if (typeof object.addTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.addTime: object expected"); - message.addTime = $root.google.protobuf.Timestamp.fromObject(object.addTime); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PredictRequest.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) { + if (typeof object.params[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PredictRequest.params: object expected"); + message.params[keys[i]] = $root.google.protobuf.Value.fromObject(object.params[keys[i]]); + } + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PredictRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); } - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from an AddFulfillmentPlacesRequest message. Also converts values to other types if specified. + * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @static - * @param {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest + * @param {google.cloud.retail.v2alpha.PredictRequest} message PredictRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddFulfillmentPlacesRequest.toObject = function toObject(message, options) { + PredictRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.placeIds = []; + if (options.objects || options.defaults) { + object.params = {}; + object.labels = {}; + } if (options.defaults) { - object.product = ""; - object.type = ""; - object.addTime = null; - object.allowMissing = false; + object.placement = ""; + object.userEvent = null; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.validateOnly = false; } - if (message.product != null && message.hasOwnProperty("product")) - object.product = message.product; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.placeIds && message.placeIds.length) { - object.placeIds = []; - for (var j = 0; j < message.placeIds.length; ++j) - object.placeIds[j] = message.placeIds[j]; + if (message.placement != null && message.hasOwnProperty("placement")) + object.placement = message.placement; + if (message.userEvent != null && message.hasOwnProperty("userEvent")) + object.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.toObject(message.userEvent, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = $root.google.protobuf.Value.toObject(message.params[keys2[j]], options); + } + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; } - if (message.addTime != null && message.hasOwnProperty("addTime")) - object.addTime = $root.google.protobuf.Timestamp.toObject(message.addTime, options); - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; return object; }; /** - * Converts this AddFulfillmentPlacesRequest to JSON. + * Converts this PredictRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @instance * @returns {Object.} JSON object */ - AddFulfillmentPlacesRequest.prototype.toJSON = function toJSON() { + PredictRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AddFulfillmentPlacesRequest; + return PredictRequest; })(); - v2alpha.AddFulfillmentPlacesMetadata = (function() { + v2alpha.PredictResponse = (function() { /** - * Properties of an AddFulfillmentPlacesMetadata. + * Properties of a PredictResponse. * @memberof google.cloud.retail.v2alpha - * @interface IAddFulfillmentPlacesMetadata + * @interface IPredictResponse + * @property {Array.|null} [results] PredictResponse results + * @property {string|null} [attributionToken] PredictResponse attributionToken + * @property {Array.|null} [missingIds] PredictResponse missingIds + * @property {boolean|null} [validateOnly] PredictResponse validateOnly */ /** - * Constructs a new AddFulfillmentPlacesMetadata. + * Constructs a new PredictResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an AddFulfillmentPlacesMetadata. - * @implements IAddFulfillmentPlacesMetadata + * @classdesc Represents a PredictResponse. + * @implements IPredictResponse * @constructor - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IPredictResponse=} [properties] Properties to set */ - function AddFulfillmentPlacesMetadata(properties) { + function PredictResponse(properties) { + this.results = []; + this.missingIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -44293,223 +43060,121 @@ } /** - * Creates a new AddFulfillmentPlacesMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata - * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata instance - */ - AddFulfillmentPlacesMetadata.create = function create(properties) { - return new AddFulfillmentPlacesMetadata(properties); - }; - - /** - * Encodes the specified AddFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata - * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddFulfillmentPlacesMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified AddFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata - * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddFulfillmentPlacesMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata - * @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.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddFulfillmentPlacesMetadata.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.AddFulfillmentPlacesMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddFulfillmentPlacesMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AddFulfillmentPlacesMetadata message. - * @function verify - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AddFulfillmentPlacesMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an AddFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata - */ - AddFulfillmentPlacesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata) - return object; - return new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata(); - }; - - /** - * Creates a plain object from an AddFulfillmentPlacesMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata - * @static - * @param {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * PredictResponse results. + * @member {Array.} results + * @memberof google.cloud.retail.v2alpha.PredictResponse + * @instance */ - AddFulfillmentPlacesMetadata.toObject = function toObject() { - return {}; - }; + PredictResponse.prototype.results = $util.emptyArray; /** - * Converts this AddFulfillmentPlacesMetadata to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * PredictResponse attributionToken. + * @member {string} attributionToken + * @memberof google.cloud.retail.v2alpha.PredictResponse * @instance - * @returns {Object.} JSON object */ - AddFulfillmentPlacesMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return AddFulfillmentPlacesMetadata; - })(); - - v2alpha.AddFulfillmentPlacesResponse = (function() { + PredictResponse.prototype.attributionToken = ""; /** - * Properties of an AddFulfillmentPlacesResponse. - * @memberof google.cloud.retail.v2alpha - * @interface IAddFulfillmentPlacesResponse + * PredictResponse missingIds. + * @member {Array.} missingIds + * @memberof google.cloud.retail.v2alpha.PredictResponse + * @instance */ + PredictResponse.prototype.missingIds = $util.emptyArray; /** - * Constructs a new AddFulfillmentPlacesResponse. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an AddFulfillmentPlacesResponse. - * @implements IAddFulfillmentPlacesResponse - * @constructor - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse=} [properties] Properties to set + * PredictResponse validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.retail.v2alpha.PredictResponse + * @instance */ - function AddFulfillmentPlacesResponse(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]]; - } + PredictResponse.prototype.validateOnly = false; /** - * Creates a new AddFulfillmentPlacesResponse instance using the specified properties. + * Creates a new PredictResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PredictResponse * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse instance + * @param {google.cloud.retail.v2alpha.IPredictResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PredictResponse} PredictResponse instance */ - AddFulfillmentPlacesResponse.create = function create(properties) { - return new AddFulfillmentPlacesResponse(properties); + PredictResponse.create = function create(properties) { + return new PredictResponse(properties); }; /** - * Encodes the specified AddFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.verify|verify} messages. + * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PredictResponse * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPredictResponse} message PredictResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddFulfillmentPlacesResponse.encode = function encode(message, writer) { + PredictResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributionToken); + if (message.missingIds != null && message.missingIds.length) + for (var i = 0; i < message.missingIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.missingIds[i]); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); return writer; }; /** - * Encodes the specified AddFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.verify|verify} messages. + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PredictResponse * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPredictResponse} message PredictResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddFulfillmentPlacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + PredictResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer. + * Decodes a PredictResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PredictResponse * @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.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2alpha.PredictResponse} PredictResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddFulfillmentPlacesResponse.decode = function decode(reader, length) { + PredictResponse.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.AddFulfillmentPlacesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PredictResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.decode(reader, reader.uint32())); + break; + case 2: + message.attributionToken = reader.string(); + break; + case 3: + if (!(message.missingIds && message.missingIds.length)) + message.missingIds = []; + message.missingIds.push(reader.string()); + break; + case 4: + message.validateOnly = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -44519,401 +43184,815 @@ }; /** - * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. + * Decodes a PredictResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PredictResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2alpha.PredictResponse} PredictResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddFulfillmentPlacesResponse.decodeDelimited = function decodeDelimited(reader) { + PredictResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AddFulfillmentPlacesResponse message. + * Verifies a PredictResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PredictResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AddFulfillmentPlacesResponse.verify = function verify(message) { + PredictResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + if (!$util.isString(message.attributionToken)) + return "attributionToken: string expected"; + if (message.missingIds != null && message.hasOwnProperty("missingIds")) { + if (!Array.isArray(message.missingIds)) + return "missingIds: array expected"; + for (var i = 0; i < message.missingIds.length; ++i) + if (!$util.isString(message.missingIds[i])) + return "missingIds: string[] expected"; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates an AddFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PredictResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2alpha.PredictResponse} PredictResponse */ - AddFulfillmentPlacesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse) + PredictResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PredictResponse) return object; - return new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse(); + var message = new $root.google.cloud.retail.v2alpha.PredictResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.results: object expected"); + message.results[i] = $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.fromObject(object.results[i]); + } + } + if (object.attributionToken != null) + message.attributionToken = String(object.attributionToken); + if (object.missingIds) { + if (!Array.isArray(object.missingIds)) + throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.missingIds: array expected"); + message.missingIds = []; + for (var i = 0; i < object.missingIds.length; ++i) + message.missingIds[i] = String(object.missingIds[i]); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; }; /** - * Creates a plain object from an AddFulfillmentPlacesResponse message. Also converts values to other types if specified. + * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PredictResponse * @static - * @param {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse + * @param {google.cloud.retail.v2alpha.PredictResponse} message PredictResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddFulfillmentPlacesResponse.toObject = function toObject() { - return {}; + PredictResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.results = []; + object.missingIds = []; + } + if (options.defaults) { + object.attributionToken = ""; + object.validateOnly = false; + } + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.toObject(message.results[j], options); + } + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + object.attributionToken = message.attributionToken; + if (message.missingIds && message.missingIds.length) { + object.missingIds = []; + for (var j = 0; j < message.missingIds.length; ++j) + object.missingIds[j] = message.missingIds[j]; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; }; /** - * Converts this AddFulfillmentPlacesResponse to JSON. + * Converts this PredictResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PredictResponse * @instance * @returns {Object.} JSON object */ - AddFulfillmentPlacesResponse.prototype.toJSON = function toJSON() { + PredictResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AddFulfillmentPlacesResponse; - })(); + PredictResponse.PredictionResult = (function() { - v2alpha.AddLocalInventoriesRequest = (function() { + /** + * Properties of a PredictionResult. + * @memberof google.cloud.retail.v2alpha.PredictResponse + * @interface IPredictionResult + * @property {string|null} [id] PredictionResult id + * @property {Object.|null} [metadata] PredictionResult metadata + */ - /** - * Properties of an AddLocalInventoriesRequest. - * @memberof google.cloud.retail.v2alpha - * @interface IAddLocalInventoriesRequest - * @property {string|null} [product] AddLocalInventoriesRequest product - * @property {Array.|null} [localInventories] AddLocalInventoriesRequest localInventories - * @property {google.protobuf.IFieldMask|null} [addMask] AddLocalInventoriesRequest addMask - * @property {google.protobuf.ITimestamp|null} [addTime] AddLocalInventoriesRequest addTime - * @property {boolean|null} [allowMissing] AddLocalInventoriesRequest allowMissing - */ + /** + * Constructs a new PredictionResult. + * @memberof google.cloud.retail.v2alpha.PredictResponse + * @classdesc Represents a PredictionResult. + * @implements IPredictionResult + * @constructor + * @param {google.cloud.retail.v2alpha.PredictResponse.IPredictionResult=} [properties] Properties to set + */ + function PredictionResult(properties) { + this.metadata = {}; + 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]]; + } - /** - * Constructs a new AddLocalInventoriesRequest. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an AddLocalInventoriesRequest. - * @implements IAddLocalInventoriesRequest + /** + * PredictionResult id. + * @member {string} id + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @instance + */ + PredictionResult.prototype.id = ""; + + /** + * PredictionResult metadata. + * @member {Object.} metadata + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @instance + */ + PredictionResult.prototype.metadata = $util.emptyObject; + + /** + * Creates a new PredictionResult instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @static + * @param {google.cloud.retail.v2alpha.PredictResponse.IPredictionResult=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} PredictionResult instance + */ + PredictionResult.create = function create(properties) { + return new PredictionResult(properties); + }; + + /** + * Encodes the specified PredictionResult message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @static + * @param {google.cloud.retail.v2alpha.PredictResponse.IPredictionResult} message PredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.metadata[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified PredictionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @static + * @param {google.cloud.retail.v2alpha.PredictResponse.IPredictionResult} message PredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PredictionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @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.PredictResponse.PredictionResult} PredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictionResult.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.PredictResponse.PredictionResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.metadata[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PredictionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} PredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PredictionResult message. + * @function verify + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PredictionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.metadata[key[i]]); + if (error) + return "metadata." + error; + } + } + return null; + }; + + /** + * Creates a PredictionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} PredictionResult + */ + PredictionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult) + return object; + var message = new $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult(); + if (object.id != null) + message.id = String(object.id); + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.PredictionResult.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) { + if (typeof object.metadata[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.PredictionResult.metadata: object expected"); + message.metadata[keys[i]] = $root.google.protobuf.Value.fromObject(object.metadata[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a PredictionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @static + * @param {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} message PredictionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PredictionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = $root.google.protobuf.Value.toObject(message.metadata[keys2[j]], options); + } + return object; + }; + + /** + * Converts this PredictionResult to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @instance + * @returns {Object.} JSON object + */ + PredictionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PredictionResult; + })(); + + return PredictResponse; + })(); + + v2alpha.ProductService = (function() { + + /** + * Constructs a new ProductService service. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a ProductService + * @extends $protobuf.rpc.Service * @constructor - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest=} [properties] Properties to set + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ - function AddLocalInventoriesRequest(properties) { - this.localInventories = []; - 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]]; + function ProductService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } + (ProductService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ProductService; + /** - * AddLocalInventoriesRequest product. - * @member {string} product - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest - * @instance + * Creates new ProductService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2alpha.ProductService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {ProductService} RPC service. Useful where requests and/or responses are streamed. */ - AddLocalInventoriesRequest.prototype.product = ""; + ProductService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * AddLocalInventoriesRequest localInventories. - * @member {Array.} localInventories - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#createProduct}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef CreateProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Product} [response] Product + */ + + /** + * Calls CreateProduct. + * @function createProduct + * @memberof google.cloud.retail.v2alpha.ProductService * @instance + * @param {google.cloud.retail.v2alpha.ICreateProductRequest} request CreateProductRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.CreateProductCallback} callback Node-style callback called with the error, if any, and Product + * @returns {undefined} + * @variation 1 */ - AddLocalInventoriesRequest.prototype.localInventories = $util.emptyArray; + Object.defineProperty(ProductService.prototype.createProduct = function createProduct(request, callback) { + return this.rpcCall(createProduct, $root.google.cloud.retail.v2alpha.CreateProductRequest, $root.google.cloud.retail.v2alpha.Product, request, callback); + }, "name", { value: "CreateProduct" }); /** - * AddLocalInventoriesRequest addMask. - * @member {google.protobuf.IFieldMask|null|undefined} addMask - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * Calls CreateProduct. + * @function createProduct + * @memberof google.cloud.retail.v2alpha.ProductService * @instance + * @param {google.cloud.retail.v2alpha.ICreateProductRequest} request CreateProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - AddLocalInventoriesRequest.prototype.addMask = null; /** - * AddLocalInventoriesRequest addTime. - * @member {google.protobuf.ITimestamp|null|undefined} addTime - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#getProduct}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef GetProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Product} [response] Product + */ + + /** + * Calls GetProduct. + * @function getProduct + * @memberof google.cloud.retail.v2alpha.ProductService * @instance + * @param {google.cloud.retail.v2alpha.IGetProductRequest} request GetProductRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.GetProductCallback} callback Node-style callback called with the error, if any, and Product + * @returns {undefined} + * @variation 1 */ - AddLocalInventoriesRequest.prototype.addTime = null; + Object.defineProperty(ProductService.prototype.getProduct = function getProduct(request, callback) { + return this.rpcCall(getProduct, $root.google.cloud.retail.v2alpha.GetProductRequest, $root.google.cloud.retail.v2alpha.Product, request, callback); + }, "name", { value: "GetProduct" }); /** - * AddLocalInventoriesRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * Calls GetProduct. + * @function getProduct + * @memberof google.cloud.retail.v2alpha.ProductService * @instance + * @param {google.cloud.retail.v2alpha.IGetProductRequest} request GetProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - AddLocalInventoriesRequest.prototype.allowMissing = false; /** - * Creates a new AddLocalInventoriesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest - * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} AddLocalInventoriesRequest instance + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#listProducts}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef ListProductsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.ListProductsResponse} [response] ListProductsResponse */ - AddLocalInventoriesRequest.create = function create(properties) { - return new AddLocalInventoriesRequest(properties); - }; /** - * Encodes the specified AddLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest - * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest} message AddLocalInventoriesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ListProducts. + * @function listProducts + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IListProductsRequest} request ListProductsRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.ListProductsCallback} callback Node-style callback called with the error, if any, and ListProductsResponse + * @returns {undefined} + * @variation 1 */ - AddLocalInventoriesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); - 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 2, wireType 2 =*/18).fork()).ldelim(); - if (message.addMask != null && Object.hasOwnProperty.call(message, "addMask")) - $root.google.protobuf.FieldMask.encode(message.addMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.addTime != null && Object.hasOwnProperty.call(message, "addTime")) - $root.google.protobuf.Timestamp.encode(message.addTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowMissing); - return writer; - }; + Object.defineProperty(ProductService.prototype.listProducts = function listProducts(request, callback) { + return this.rpcCall(listProducts, $root.google.cloud.retail.v2alpha.ListProductsRequest, $root.google.cloud.retail.v2alpha.ListProductsResponse, request, callback); + }, "name", { value: "ListProducts" }); /** - * Encodes the specified AddLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest - * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest} message AddLocalInventoriesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ListProducts. + * @function listProducts + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IListProductsRequest} request ListProductsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - AddLocalInventoriesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest - * @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.AddLocalInventoriesRequest} AddLocalInventoriesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#updateProduct}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef UpdateProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Product} [response] Product */ - AddLocalInventoriesRequest.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.AddLocalInventoriesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.product = reader.string(); - break; - case 2: - if (!(message.localInventories && message.localInventories.length)) - message.localInventories = []; - message.localInventories.push($root.google.cloud.retail.v2alpha.LocalInventory.decode(reader, reader.uint32())); - break; - case 4: - message.addMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 5: - message.addTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.allowMissing = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} AddLocalInventoriesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls UpdateProduct. + * @function updateProduct + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateProductRequest} request UpdateProductRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.UpdateProductCallback} callback Node-style callback called with the error, if any, and Product + * @returns {undefined} + * @variation 1 */ - AddLocalInventoriesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(ProductService.prototype.updateProduct = function updateProduct(request, callback) { + return this.rpcCall(updateProduct, $root.google.cloud.retail.v2alpha.UpdateProductRequest, $root.google.cloud.retail.v2alpha.Product, request, callback); + }, "name", { value: "UpdateProduct" }); /** - * Verifies an AddLocalInventoriesRequest message. - * @function verify - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls UpdateProduct. + * @function updateProduct + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateProductRequest} request UpdateProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - AddLocalInventoriesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.product != null && message.hasOwnProperty("product")) - if (!$util.isString(message.product)) - return "product: string expected"; - 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; - } - } - if (message.addMask != null && message.hasOwnProperty("addMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.addMask); - if (error) - return "addMask." + error; - } - if (message.addTime != null && message.hasOwnProperty("addTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.addTime); - if (error) - return "addTime." + error; - } - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; /** - * Creates an AddLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} AddLocalInventoriesRequest + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#deleteProduct}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef DeleteProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty */ - AddLocalInventoriesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.AddLocalInventoriesRequest) - return object; - var message = new $root.google.cloud.retail.v2alpha.AddLocalInventoriesRequest(); - if (object.product != null) - message.product = String(object.product); - if (object.localInventories) { - if (!Array.isArray(object.localInventories)) - throw TypeError(".google.cloud.retail.v2alpha.AddLocalInventoriesRequest.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.AddLocalInventoriesRequest.localInventories: object expected"); - message.localInventories[i] = $root.google.cloud.retail.v2alpha.LocalInventory.fromObject(object.localInventories[i]); - } - } - if (object.addMask != null) { - if (typeof object.addMask !== "object") - throw TypeError(".google.cloud.retail.v2alpha.AddLocalInventoriesRequest.addMask: object expected"); - message.addMask = $root.google.protobuf.FieldMask.fromObject(object.addMask); - } - if (object.addTime != null) { - if (typeof object.addTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.AddLocalInventoriesRequest.addTime: object expected"); - message.addTime = $root.google.protobuf.Timestamp.fromObject(object.addTime); - } - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; /** - * Creates a plain object from an AddLocalInventoriesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest - * @static - * @param {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} message AddLocalInventoriesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls DeleteProduct. + * @function deleteProduct + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IDeleteProductRequest} request DeleteProductRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.DeleteProductCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 */ - AddLocalInventoriesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.localInventories = []; - if (options.defaults) { - object.product = ""; - object.addMask = null; - object.addTime = null; - object.allowMissing = false; - } - if (message.product != null && message.hasOwnProperty("product")) - object.product = message.product; - 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); - } - if (message.addMask != null && message.hasOwnProperty("addMask")) - object.addMask = $root.google.protobuf.FieldMask.toObject(message.addMask, options); - if (message.addTime != null && message.hasOwnProperty("addTime")) - object.addTime = $root.google.protobuf.Timestamp.toObject(message.addTime, options); - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; + Object.defineProperty(ProductService.prototype.deleteProduct = function deleteProduct(request, callback) { + return this.rpcCall(deleteProduct, $root.google.cloud.retail.v2alpha.DeleteProductRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteProduct" }); /** - * Converts this AddLocalInventoriesRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * Calls DeleteProduct. + * @function deleteProduct + * @memberof google.cloud.retail.v2alpha.ProductService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.retail.v2alpha.IDeleteProductRequest} request DeleteProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - AddLocalInventoriesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return AddLocalInventoriesRequest; + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#importProducts}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef ImportProductsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportProducts. + * @function importProducts + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IImportProductsRequest} request ImportProductsRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.ImportProductsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductService.prototype.importProducts = function importProducts(request, callback) { + return this.rpcCall(importProducts, $root.google.cloud.retail.v2alpha.ImportProductsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportProducts" }); + + /** + * Calls ImportProducts. + * @function importProducts + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IImportProductsRequest} request ImportProductsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#setInventory}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef SetInventoryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls SetInventory. + * @function setInventory + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.ISetInventoryRequest} request SetInventoryRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.SetInventoryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductService.prototype.setInventory = function setInventory(request, callback) { + return this.rpcCall(setInventory, $root.google.cloud.retail.v2alpha.SetInventoryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "SetInventory" }); + + /** + * Calls SetInventory. + * @function setInventory + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.ISetInventoryRequest} request SetInventoryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#addFulfillmentPlaces}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef AddFulfillmentPlacesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AddFulfillmentPlaces. + * @function addFulfillmentPlaces + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest} request AddFulfillmentPlacesRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlacesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductService.prototype.addFulfillmentPlaces = function addFulfillmentPlaces(request, callback) { + return this.rpcCall(addFulfillmentPlaces, $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AddFulfillmentPlaces" }); + + /** + * Calls AddFulfillmentPlaces. + * @function addFulfillmentPlaces + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest} request AddFulfillmentPlacesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#removeFulfillmentPlaces}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef RemoveFulfillmentPlacesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RemoveFulfillmentPlaces. + * @function removeFulfillmentPlaces + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest} request RemoveFulfillmentPlacesRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlacesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductService.prototype.removeFulfillmentPlaces = function removeFulfillmentPlaces(request, callback) { + return this.rpcCall(removeFulfillmentPlaces, $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RemoveFulfillmentPlaces" }); + + /** + * Calls RemoveFulfillmentPlaces. + * @function removeFulfillmentPlaces + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest} request RemoveFulfillmentPlacesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#addLocalInventories}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef AddLocalInventoriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AddLocalInventories. + * @function addLocalInventories + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest} request AddLocalInventoriesRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.AddLocalInventoriesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductService.prototype.addLocalInventories = function addLocalInventories(request, callback) { + return this.rpcCall(addLocalInventories, $root.google.cloud.retail.v2alpha.AddLocalInventoriesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AddLocalInventories" }); + + /** + * Calls AddLocalInventories. + * @function addLocalInventories + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest} request AddLocalInventoriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService#removeLocalInventories}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef RemoveLocalInventoriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RemoveLocalInventories. + * @function removeLocalInventories + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest} request RemoveLocalInventoriesRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.RemoveLocalInventoriesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductService.prototype.removeLocalInventories = function removeLocalInventories(request, callback) { + return this.rpcCall(removeLocalInventories, $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RemoveLocalInventories" }); + + /** + * Calls RemoveLocalInventories. + * @function removeLocalInventories + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest} request RemoveLocalInventoriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ProductService; })(); - v2alpha.AddLocalInventoriesMetadata = (function() { + v2alpha.CreateProductRequest = (function() { /** - * Properties of an AddLocalInventoriesMetadata. + * Properties of a CreateProductRequest. * @memberof google.cloud.retail.v2alpha - * @interface IAddLocalInventoriesMetadata + * @interface ICreateProductRequest + * @property {string|null} [parent] CreateProductRequest parent + * @property {google.cloud.retail.v2alpha.IProduct|null} [product] CreateProductRequest product + * @property {string|null} [productId] CreateProductRequest productId */ /** - * Constructs a new AddLocalInventoriesMetadata. + * Constructs a new CreateProductRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an AddLocalInventoriesMetadata. - * @implements IAddLocalInventoriesMetadata + * @classdesc Represents a CreateProductRequest. + * @implements ICreateProductRequest * @constructor - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ICreateProductRequest=} [properties] Properties to set */ - function AddLocalInventoriesMetadata(properties) { + function CreateProductRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -44921,63 +44000,102 @@ } /** - * Creates a new AddLocalInventoriesMetadata instance using the specified properties. + * CreateProductRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @instance + */ + CreateProductRequest.prototype.parent = ""; + + /** + * CreateProductRequest product. + * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} product + * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @instance + */ + CreateProductRequest.prototype.product = null; + + /** + * CreateProductRequest productId. + * @member {string} productId + * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @instance + */ + CreateProductRequest.prototype.productId = ""; + + /** + * Creates a new CreateProductRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata instance + * @param {google.cloud.retail.v2alpha.ICreateProductRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CreateProductRequest} CreateProductRequest instance */ - AddLocalInventoriesMetadata.create = function create(properties) { - return new AddLocalInventoriesMetadata(properties); + CreateProductRequest.create = function create(properties) { + return new CreateProductRequest(properties); }; /** - * Encodes the specified AddLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.verify|verify} messages. + * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateProductRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata} message AddLocalInventoriesMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICreateProductRequest} message CreateProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddLocalInventoriesMetadata.encode = function encode(message, writer) { + CreateProductRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + $root.google.cloud.retail.v2alpha.Product.encode(message.product, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.productId != null && Object.hasOwnProperty.call(message, "productId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.productId); return writer; }; /** - * Encodes the specified AddLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.verify|verify} messages. + * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateProductRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata} message AddLocalInventoriesMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICreateProductRequest} message CreateProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddLocalInventoriesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + CreateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer. + * Decodes a CreateProductRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @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.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata + * @returns {google.cloud.retail.v2alpha.CreateProductRequest} CreateProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddLocalInventoriesMetadata.decode = function decode(reader, length) { + CreateProductRequest.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.AddLocalInventoriesMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CreateProductRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.product = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); + break; + case 3: + message.productId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -44987,93 +44105,129 @@ }; /** - * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer, length delimited. + * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata + * @returns {google.cloud.retail.v2alpha.CreateProductRequest} CreateProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddLocalInventoriesMetadata.decodeDelimited = function decodeDelimited(reader) { + CreateProductRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AddLocalInventoriesMetadata message. + * Verifies a CreateProductRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AddLocalInventoriesMetadata.verify = function verify(message) { + CreateProductRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.retail.v2alpha.Product.verify(message.product); + if (error) + return "product." + error; + } + if (message.productId != null && message.hasOwnProperty("productId")) + if (!$util.isString(message.productId)) + return "productId: string expected"; return null; }; /** - * Creates an AddLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a CreateProductRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata + * @returns {google.cloud.retail.v2alpha.CreateProductRequest} CreateProductRequest */ - AddLocalInventoriesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata) + CreateProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CreateProductRequest) return object; - return new $root.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata(); + var message = new $root.google.cloud.retail.v2alpha.CreateProductRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CreateProductRequest.product: object expected"); + message.product = $root.google.cloud.retail.v2alpha.Product.fromObject(object.product); + } + if (object.productId != null) + message.productId = String(object.productId); + return message; }; /** - * Creates a plain object from an AddLocalInventoriesMetadata message. Also converts values to other types if specified. + * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @static - * @param {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} message AddLocalInventoriesMetadata + * @param {google.cloud.retail.v2alpha.CreateProductRequest} message CreateProductRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddLocalInventoriesMetadata.toObject = function toObject() { - return {}; + CreateProductRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.product = null; + object.productId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.retail.v2alpha.Product.toObject(message.product, options); + if (message.productId != null && message.hasOwnProperty("productId")) + object.productId = message.productId; + return object; }; /** - * Converts this AddLocalInventoriesMetadata to JSON. + * Converts this CreateProductRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @instance * @returns {Object.} JSON object */ - AddLocalInventoriesMetadata.prototype.toJSON = function toJSON() { + CreateProductRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AddLocalInventoriesMetadata; + return CreateProductRequest; })(); - v2alpha.AddLocalInventoriesResponse = (function() { + v2alpha.GetProductRequest = (function() { /** - * Properties of an AddLocalInventoriesResponse. + * Properties of a GetProductRequest. * @memberof google.cloud.retail.v2alpha - * @interface IAddLocalInventoriesResponse + * @interface IGetProductRequest + * @property {string|null} [name] GetProductRequest name */ /** - * Constructs a new AddLocalInventoriesResponse. + * Constructs a new GetProductRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an AddLocalInventoriesResponse. - * @implements IAddLocalInventoriesResponse + * @classdesc Represents a GetProductRequest. + * @implements IGetProductRequest * @constructor - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IGetProductRequest=} [properties] Properties to set */ - function AddLocalInventoriesResponse(properties) { + function GetProductRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45081,63 +44235,76 @@ } /** - * Creates a new AddLocalInventoriesResponse instance using the specified properties. + * GetProductRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @instance + */ + GetProductRequest.prototype.name = ""; + + /** + * Creates a new GetProductRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} AddLocalInventoriesResponse instance + * @param {google.cloud.retail.v2alpha.IGetProductRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.GetProductRequest} GetProductRequest instance */ - AddLocalInventoriesResponse.create = function create(properties) { - return new AddLocalInventoriesResponse(properties); + GetProductRequest.create = function create(properties) { + return new GetProductRequest(properties); }; /** - * Encodes the specified AddLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesResponse.verify|verify} messages. + * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetProductRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesResponse} message AddLocalInventoriesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetProductRequest} message GetProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddLocalInventoriesResponse.encode = function encode(message, writer) { + GetProductRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified AddLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesResponse.verify|verify} messages. + * Encodes the specified GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetProductRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesResponse} message AddLocalInventoriesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetProductRequest} message GetProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddLocalInventoriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetProductRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer. + * Decodes a GetProductRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @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.AddLocalInventoriesResponse} AddLocalInventoriesResponse + * @returns {google.cloud.retail.v2alpha.GetProductRequest} GetProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddLocalInventoriesResponse.decode = function decode(reader, length) { + GetProductRequest.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.AddLocalInventoriesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetProductRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -45147,98 +44314,109 @@ }; /** - * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer, length delimited. + * Decodes a GetProductRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} AddLocalInventoriesResponse + * @returns {google.cloud.retail.v2alpha.GetProductRequest} GetProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddLocalInventoriesResponse.decodeDelimited = function decodeDelimited(reader) { + GetProductRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AddLocalInventoriesResponse message. + * Verifies a GetProductRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AddLocalInventoriesResponse.verify = function verify(message) { + GetProductRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an AddLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetProductRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} AddLocalInventoriesResponse + * @returns {google.cloud.retail.v2alpha.GetProductRequest} GetProductRequest */ - AddLocalInventoriesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.AddLocalInventoriesResponse) + GetProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.GetProductRequest) return object; - return new $root.google.cloud.retail.v2alpha.AddLocalInventoriesResponse(); + var message = new $root.google.cloud.retail.v2alpha.GetProductRequest(); + if (object.name != null) + message.name = String(object.name); + return message; }; /** - * Creates a plain object from an AddLocalInventoriesResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @static - * @param {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} message AddLocalInventoriesResponse + * @param {google.cloud.retail.v2alpha.GetProductRequest} message GetProductRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddLocalInventoriesResponse.toObject = function toObject() { - return {}; + GetProductRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; }; /** - * Converts this AddLocalInventoriesResponse to JSON. + * Converts this GetProductRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @instance * @returns {Object.} JSON object */ - AddLocalInventoriesResponse.prototype.toJSON = function toJSON() { + GetProductRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AddLocalInventoriesResponse; + return GetProductRequest; })(); - v2alpha.RemoveLocalInventoriesRequest = (function() { + v2alpha.UpdateProductRequest = (function() { /** - * Properties of a RemoveLocalInventoriesRequest. + * Properties of an UpdateProductRequest. * @memberof google.cloud.retail.v2alpha - * @interface IRemoveLocalInventoriesRequest - * @property {string|null} [product] RemoveLocalInventoriesRequest product - * @property {Array.|null} [placeIds] RemoveLocalInventoriesRequest placeIds - * @property {google.protobuf.ITimestamp|null} [removeTime] RemoveLocalInventoriesRequest removeTime - * @property {boolean|null} [allowMissing] RemoveLocalInventoriesRequest allowMissing + * @interface IUpdateProductRequest + * @property {google.cloud.retail.v2alpha.IProduct|null} [product] UpdateProductRequest product + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProductRequest updateMask + * @property {boolean|null} [allowMissing] UpdateProductRequest allowMissing */ /** - * Constructs a new RemoveLocalInventoriesRequest. + * Constructs a new UpdateProductRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a RemoveLocalInventoriesRequest. - * @implements IRemoveLocalInventoriesRequest + * @classdesc Represents an UpdateProductRequest. + * @implements IUpdateProductRequest * @constructor - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IUpdateProductRequest=} [properties] Properties to set */ - function RemoveLocalInventoriesRequest(properties) { - this.placeIds = []; + function UpdateProductRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45246,114 +44424,98 @@ } /** - * RemoveLocalInventoriesRequest product. - * @member {string} product - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest - * @instance - */ - RemoveLocalInventoriesRequest.prototype.product = ""; - - /** - * RemoveLocalInventoriesRequest placeIds. - * @member {Array.} placeIds - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * UpdateProductRequest product. + * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} product + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @instance */ - RemoveLocalInventoriesRequest.prototype.placeIds = $util.emptyArray; + UpdateProductRequest.prototype.product = null; /** - * RemoveLocalInventoriesRequest removeTime. - * @member {google.protobuf.ITimestamp|null|undefined} removeTime - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * UpdateProductRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @instance */ - RemoveLocalInventoriesRequest.prototype.removeTime = null; + UpdateProductRequest.prototype.updateMask = null; /** - * RemoveLocalInventoriesRequest allowMissing. + * UpdateProductRequest allowMissing. * @member {boolean} allowMissing - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @instance */ - RemoveLocalInventoriesRequest.prototype.allowMissing = false; + UpdateProductRequest.prototype.allowMissing = false; /** - * Creates a new RemoveLocalInventoriesRequest instance using the specified properties. + * Creates a new UpdateProductRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest instance + * @param {google.cloud.retail.v2alpha.IUpdateProductRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UpdateProductRequest} UpdateProductRequest instance */ - RemoveLocalInventoriesRequest.create = function create(properties) { - return new RemoveLocalInventoriesRequest(properties); + UpdateProductRequest.create = function create(properties) { + return new UpdateProductRequest(properties); }; /** - * Encodes the specified RemoveLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.verify|verify} messages. + * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateProductRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveLocalInventoriesRequest.encode = function encode(message, writer) { + UpdateProductRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.product != null && Object.hasOwnProperty.call(message, "product")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); - if (message.placeIds != null && message.placeIds.length) - for (var i = 0; i < message.placeIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.placeIds[i]); + $root.google.cloud.retail.v2alpha.Product.encode(message.product, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); - if (message.removeTime != null && Object.hasOwnProperty.call(message, "removeTime")) - $root.google.protobuf.Timestamp.encode(message.removeTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified RemoveLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.verify|verify} messages. + * Encodes the specified UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateProductRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveLocalInventoriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer. + * Decodes an UpdateProductRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @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.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest + * @returns {google.cloud.retail.v2alpha.UpdateProductRequest} UpdateProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveLocalInventoriesRequest.decode = function decode(reader, length) { + UpdateProductRequest.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.RemoveLocalInventoriesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UpdateProductRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.product = reader.string(); + message.product = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); break; case 2: - if (!(message.placeIds && message.placeIds.length)) - message.placeIds = []; - message.placeIds.push(reader.string()); - break; - case 5: - message.removeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; case 3: message.allowMissing = reader.bool(); @@ -45367,46 +44529,41 @@ }; /** - * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest + * @returns {google.cloud.retail.v2alpha.UpdateProductRequest} UpdateProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveLocalInventoriesRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateProductRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveLocalInventoriesRequest message. + * Verifies an UpdateProductRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveLocalInventoriesRequest.verify = function verify(message) { + UpdateProductRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.product != null && message.hasOwnProperty("product")) - if (!$util.isString(message.product)) - return "product: string expected"; - if (message.placeIds != null && message.hasOwnProperty("placeIds")) { - if (!Array.isArray(message.placeIds)) - return "placeIds: array expected"; - for (var i = 0; i < message.placeIds.length; ++i) - if (!$util.isString(message.placeIds[i])) - return "placeIds: string[] expected"; + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.retail.v2alpha.Product.verify(message.product); + if (error) + return "product." + error; } - if (message.removeTime != null && message.hasOwnProperty("removeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.removeTime); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) - return "removeTime." + error; + return "updateMask." + error; } if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) if (typeof message.allowMissing !== "boolean") @@ -45415,30 +44572,26 @@ }; /** - * Creates a RemoveLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateProductRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest + * @returns {google.cloud.retail.v2alpha.UpdateProductRequest} UpdateProductRequest */ - RemoveLocalInventoriesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest) + UpdateProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UpdateProductRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest(); - if (object.product != null) - message.product = String(object.product); - if (object.placeIds) { - if (!Array.isArray(object.placeIds)) - throw TypeError(".google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.placeIds: array expected"); - message.placeIds = []; - for (var i = 0; i < object.placeIds.length; ++i) - message.placeIds[i] = String(object.placeIds[i]); + var message = new $root.google.cloud.retail.v2alpha.UpdateProductRequest(); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateProductRequest.product: object expected"); + message.product = $root.google.cloud.retail.v2alpha.Product.fromObject(object.product); } - if (object.removeTime != null) { - if (typeof object.removeTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.removeTime: object expected"); - message.removeTime = $root.google.protobuf.Timestamp.fromObject(object.removeTime); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateProductRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } if (object.allowMissing != null) message.allowMissing = Boolean(object.allowMissing); @@ -45446,70 +44599,64 @@ }; /** - * Creates a plain object from a RemoveLocalInventoriesRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @static - * @param {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest + * @param {google.cloud.retail.v2alpha.UpdateProductRequest} message UpdateProductRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveLocalInventoriesRequest.toObject = function toObject(message, options) { + UpdateProductRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.placeIds = []; if (options.defaults) { - object.product = ""; + object.product = null; + object.updateMask = null; object.allowMissing = false; - object.removeTime = null; } if (message.product != null && message.hasOwnProperty("product")) - object.product = message.product; - if (message.placeIds && message.placeIds.length) { - object.placeIds = []; - for (var j = 0; j < message.placeIds.length; ++j) - object.placeIds[j] = message.placeIds[j]; - } + object.product = $root.google.cloud.retail.v2alpha.Product.toObject(message.product, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) object.allowMissing = message.allowMissing; - if (message.removeTime != null && message.hasOwnProperty("removeTime")) - object.removeTime = $root.google.protobuf.Timestamp.toObject(message.removeTime, options); return object; }; /** - * Converts this RemoveLocalInventoriesRequest to JSON. + * Converts this UpdateProductRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @instance * @returns {Object.} JSON object */ - RemoveLocalInventoriesRequest.prototype.toJSON = function toJSON() { + UpdateProductRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RemoveLocalInventoriesRequest; + return UpdateProductRequest; })(); - v2alpha.RemoveLocalInventoriesMetadata = (function() { + v2alpha.DeleteProductRequest = (function() { /** - * Properties of a RemoveLocalInventoriesMetadata. + * Properties of a DeleteProductRequest. * @memberof google.cloud.retail.v2alpha - * @interface IRemoveLocalInventoriesMetadata + * @interface IDeleteProductRequest + * @property {string|null} [name] DeleteProductRequest name */ /** - * Constructs a new RemoveLocalInventoriesMetadata. + * Constructs a new DeleteProductRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a RemoveLocalInventoriesMetadata. - * @implements IRemoveLocalInventoriesMetadata + * @classdesc Represents a DeleteProductRequest. + * @implements IDeleteProductRequest * @constructor - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IDeleteProductRequest=} [properties] Properties to set */ - function RemoveLocalInventoriesMetadata(properties) { + function DeleteProductRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45517,63 +44664,76 @@ } /** - * Creates a new RemoveLocalInventoriesMetadata instance using the specified properties. + * DeleteProductRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest + * @instance + */ + DeleteProductRequest.prototype.name = ""; + + /** + * Creates a new DeleteProductRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata instance + * @param {google.cloud.retail.v2alpha.IDeleteProductRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.DeleteProductRequest} DeleteProductRequest instance */ - RemoveLocalInventoriesMetadata.create = function create(properties) { - return new RemoveLocalInventoriesMetadata(properties); + DeleteProductRequest.create = function create(properties) { + return new DeleteProductRequest(properties); }; /** - * Encodes the specified RemoveLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.verify|verify} messages. + * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteProductRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveLocalInventoriesMetadata.encode = function encode(message, writer) { + DeleteProductRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified RemoveLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.verify|verify} messages. + * Encodes the specified DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteProductRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveLocalInventoriesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + DeleteProductRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer. + * Decodes a DeleteProductRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @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.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata + * @returns {google.cloud.retail.v2alpha.DeleteProductRequest} DeleteProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveLocalInventoriesMetadata.decode = function decode(reader, length) { + DeleteProductRequest.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.RemoveLocalInventoriesMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.DeleteProductRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -45583,93 +44743,112 @@ }; /** - * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer, length delimited. + * Decodes a DeleteProductRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata + * @returns {google.cloud.retail.v2alpha.DeleteProductRequest} DeleteProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveLocalInventoriesMetadata.decodeDelimited = function decodeDelimited(reader) { + DeleteProductRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveLocalInventoriesMetadata message. + * Verifies a DeleteProductRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveLocalInventoriesMetadata.verify = function verify(message) { + DeleteProductRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a RemoveLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteProductRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata + * @returns {google.cloud.retail.v2alpha.DeleteProductRequest} DeleteProductRequest */ - RemoveLocalInventoriesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata) + DeleteProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.DeleteProductRequest) return object; - return new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata(); + var message = new $root.google.cloud.retail.v2alpha.DeleteProductRequest(); + if (object.name != null) + message.name = String(object.name); + return message; }; /** - * Creates a plain object from a RemoveLocalInventoriesMetadata message. Also converts values to other types if specified. + * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @static - * @param {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata + * @param {google.cloud.retail.v2alpha.DeleteProductRequest} message DeleteProductRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveLocalInventoriesMetadata.toObject = function toObject() { - return {}; + DeleteProductRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; }; /** - * Converts this RemoveLocalInventoriesMetadata to JSON. + * Converts this DeleteProductRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @instance * @returns {Object.} JSON object */ - RemoveLocalInventoriesMetadata.prototype.toJSON = function toJSON() { + DeleteProductRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RemoveLocalInventoriesMetadata; + return DeleteProductRequest; })(); - v2alpha.RemoveLocalInventoriesResponse = (function() { + v2alpha.ListProductsRequest = (function() { /** - * Properties of a RemoveLocalInventoriesResponse. + * Properties of a ListProductsRequest. * @memberof google.cloud.retail.v2alpha - * @interface IRemoveLocalInventoriesResponse + * @interface IListProductsRequest + * @property {string|null} [parent] ListProductsRequest parent + * @property {number|null} [pageSize] ListProductsRequest pageSize + * @property {string|null} [pageToken] ListProductsRequest pageToken + * @property {string|null} [filter] ListProductsRequest filter + * @property {google.protobuf.IFieldMask|null} [readMask] ListProductsRequest readMask + * @property {boolean|null} [requireTotalSize] ListProductsRequest requireTotalSize */ /** - * Constructs a new RemoveLocalInventoriesResponse. + * Constructs a new ListProductsRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a RemoveLocalInventoriesResponse. - * @implements IRemoveLocalInventoriesResponse + * @classdesc Represents a ListProductsRequest. + * @implements IListProductsRequest * @constructor - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IListProductsRequest=} [properties] Properties to set */ - function RemoveLocalInventoriesResponse(properties) { + function ListProductsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45677,63 +44856,141 @@ } /** - * Creates a new RemoveLocalInventoriesResponse instance using the specified properties. + * ListProductsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.parent = ""; + + /** + * ListProductsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.pageSize = 0; + + /** + * ListProductsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.pageToken = ""; + + /** + * ListProductsRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.filter = ""; + + /** + * ListProductsRequest readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.readMask = null; + + /** + * ListProductsRequest requireTotalSize. + * @member {boolean} requireTotalSize + * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.requireTotalSize = false; + + /** + * Creates a new ListProductsRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse instance + * @param {google.cloud.retail.v2alpha.IListProductsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListProductsRequest} ListProductsRequest instance */ - RemoveLocalInventoriesResponse.create = function create(properties) { - return new RemoveLocalInventoriesResponse(properties); + ListProductsRequest.create = function create(properties) { + return new ListProductsRequest(properties); }; /** - * Encodes the specified RemoveLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.verify|verify} messages. + * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListProductsRequest} message ListProductsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveLocalInventoriesResponse.encode = function encode(message, writer) { + ListProductsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - return writer; + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.requireTotalSize != null && Object.hasOwnProperty.call(message, "requireTotalSize")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requireTotalSize); + return writer; }; /** - * Encodes the specified RemoveLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.verify|verify} messages. + * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListProductsRequest} message ListProductsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveLocalInventoriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer. + * Decodes a ListProductsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @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.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse + * @returns {google.cloud.retail.v2alpha.ListProductsRequest} ListProductsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveLocalInventoriesResponse.decode = function decode(reader, length) { + ListProductsRequest.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.RemoveLocalInventoriesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListProductsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + case 5: + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 6: + message.requireTotalSize = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -45743,99 +45000,156 @@ }; /** - * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer, length delimited. + * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse + * @returns {google.cloud.retail.v2alpha.ListProductsRequest} ListProductsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveLocalInventoriesResponse.decodeDelimited = function decodeDelimited(reader) { + ListProductsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveLocalInventoriesResponse message. + * Verifies a ListProductsRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveLocalInventoriesResponse.verify = function verify(message) { + ListProductsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.readMask != null && message.hasOwnProperty("readMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.readMask); + if (error) + return "readMask." + error; + } + if (message.requireTotalSize != null && message.hasOwnProperty("requireTotalSize")) + if (typeof message.requireTotalSize !== "boolean") + return "requireTotalSize: boolean expected"; return null; }; /** - * Creates a RemoveLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListProductsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse + * @returns {google.cloud.retail.v2alpha.ListProductsRequest} ListProductsRequest */ - RemoveLocalInventoriesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse) + ListProductsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListProductsRequest) return object; - return new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse(); + var message = new $root.google.cloud.retail.v2alpha.ListProductsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ListProductsRequest.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + } + if (object.requireTotalSize != null) + message.requireTotalSize = Boolean(object.requireTotalSize); + return message; }; /** - * Creates a plain object from a RemoveLocalInventoriesResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @static - * @param {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse + * @param {google.cloud.retail.v2alpha.ListProductsRequest} message ListProductsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveLocalInventoriesResponse.toObject = function toObject() { - return {}; + ListProductsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.readMask = null; + object.requireTotalSize = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.readMask != null && message.hasOwnProperty("readMask")) + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); + if (message.requireTotalSize != null && message.hasOwnProperty("requireTotalSize")) + object.requireTotalSize = message.requireTotalSize; + return object; }; /** - * Converts this RemoveLocalInventoriesResponse to JSON. + * Converts this ListProductsRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @instance * @returns {Object.} JSON object */ - RemoveLocalInventoriesResponse.prototype.toJSON = function toJSON() { + ListProductsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RemoveLocalInventoriesResponse; + return ListProductsRequest; })(); - v2alpha.RemoveFulfillmentPlacesRequest = (function() { + v2alpha.ListProductsResponse = (function() { /** - * Properties of a RemoveFulfillmentPlacesRequest. + * Properties of a ListProductsResponse. * @memberof google.cloud.retail.v2alpha - * @interface IRemoveFulfillmentPlacesRequest - * @property {string|null} [product] RemoveFulfillmentPlacesRequest product - * @property {string|null} [type] RemoveFulfillmentPlacesRequest type - * @property {Array.|null} [placeIds] RemoveFulfillmentPlacesRequest placeIds - * @property {google.protobuf.ITimestamp|null} [removeTime] RemoveFulfillmentPlacesRequest removeTime - * @property {boolean|null} [allowMissing] RemoveFulfillmentPlacesRequest allowMissing + * @interface IListProductsResponse + * @property {Array.|null} [products] ListProductsResponse products + * @property {string|null} [nextPageToken] ListProductsResponse nextPageToken + * @property {number|null} [totalSize] ListProductsResponse totalSize */ /** - * Constructs a new RemoveFulfillmentPlacesRequest. + * Constructs a new ListProductsResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a RemoveFulfillmentPlacesRequest. - * @implements IRemoveFulfillmentPlacesRequest + * @classdesc Represents a ListProductsResponse. + * @implements IListProductsResponse * @constructor - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IListProductsResponse=} [properties] Properties to set */ - function RemoveFulfillmentPlacesRequest(properties) { - this.placeIds = []; + function ListProductsResponse(properties) { + this.products = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45843,130 +45157,104 @@ } /** - * RemoveFulfillmentPlacesRequest product. - * @member {string} product - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest - * @instance - */ - RemoveFulfillmentPlacesRequest.prototype.product = ""; - - /** - * RemoveFulfillmentPlacesRequest type. - * @member {string} type - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest - * @instance - */ - RemoveFulfillmentPlacesRequest.prototype.type = ""; - - /** - * RemoveFulfillmentPlacesRequest placeIds. - * @member {Array.} placeIds - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * ListProductsResponse products. + * @member {Array.} products + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @instance */ - RemoveFulfillmentPlacesRequest.prototype.placeIds = $util.emptyArray; + ListProductsResponse.prototype.products = $util.emptyArray; /** - * RemoveFulfillmentPlacesRequest removeTime. - * @member {google.protobuf.ITimestamp|null|undefined} removeTime - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * ListProductsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @instance */ - RemoveFulfillmentPlacesRequest.prototype.removeTime = null; + ListProductsResponse.prototype.nextPageToken = ""; /** - * RemoveFulfillmentPlacesRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * ListProductsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @instance */ - RemoveFulfillmentPlacesRequest.prototype.allowMissing = false; + ListProductsResponse.prototype.totalSize = 0; /** - * Creates a new RemoveFulfillmentPlacesRequest instance using the specified properties. + * Creates a new ListProductsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest instance + * @param {google.cloud.retail.v2alpha.IListProductsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListProductsResponse} ListProductsResponse instance */ - RemoveFulfillmentPlacesRequest.create = function create(properties) { - return new RemoveFulfillmentPlacesRequest(properties); + ListProductsResponse.create = function create(properties) { + return new ListProductsResponse(properties); }; /** - * Encodes the specified RemoveFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.verify|verify} messages. + * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListProductsResponse} message ListProductsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesRequest.encode = function encode(message, writer) { + ListProductsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.placeIds != null && message.placeIds.length) - for (var i = 0; i < message.placeIds.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.placeIds[i]); - if (message.removeTime != null && Object.hasOwnProperty.call(message, "removeTime")) - $root.google.protobuf.Timestamp.encode(message.removeTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + if (message.products != null && message.products.length) + for (var i = 0; i < message.products.length; ++i) + $root.google.cloud.retail.v2alpha.Product.encode(message.products[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); return writer; }; /** - * Encodes the specified RemoveFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.verify|verify} messages. + * Encodes the specified ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListProductsResponse} message ListProductsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer. + * Decodes a ListProductsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @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.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2alpha.ListProductsResponse} ListProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesRequest.decode = function decode(reader, length) { + ListProductsResponse.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.RemoveFulfillmentPlacesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListProductsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.product = reader.string(); + if (!(message.products && message.products.length)) + message.products = []; + message.products.push($root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32())); break; case 2: - message.type = reader.string(); + message.nextPageToken = reader.string(); break; case 3: - if (!(message.placeIds && message.placeIds.length)) - message.placeIds = []; - message.placeIds.push(reader.string()); - break; - case 4: - message.removeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.allowMissing = reader.bool(); + message.totalSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -45977,157 +45265,145 @@ }; /** - * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. + * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2alpha.ListProductsResponse} ListProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesRequest.decodeDelimited = function decodeDelimited(reader) { + ListProductsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveFulfillmentPlacesRequest message. + * Verifies a ListProductsResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveFulfillmentPlacesRequest.verify = function verify(message) { + ListProductsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.product != null && message.hasOwnProperty("product")) - if (!$util.isString(message.product)) - return "product: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.placeIds != null && message.hasOwnProperty("placeIds")) { - if (!Array.isArray(message.placeIds)) - return "placeIds: array expected"; - for (var i = 0; i < message.placeIds.length; ++i) - if (!$util.isString(message.placeIds[i])) - return "placeIds: string[] expected"; - } - if (message.removeTime != null && message.hasOwnProperty("removeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.removeTime); - if (error) - return "removeTime." + error; + if (message.products != null && message.hasOwnProperty("products")) { + if (!Array.isArray(message.products)) + return "products: array expected"; + for (var i = 0; i < message.products.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Product.verify(message.products[i]); + if (error) + return "products." + error; + } } - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; return null; }; /** - * Creates a RemoveFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2alpha.ListProductsResponse} ListProductsResponse */ - RemoveFulfillmentPlacesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest) + ListProductsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListProductsResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest(); - if (object.product != null) - message.product = String(object.product); - if (object.type != null) - message.type = String(object.type); - if (object.placeIds) { - if (!Array.isArray(object.placeIds)) - throw TypeError(".google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.placeIds: array expected"); - message.placeIds = []; - for (var i = 0; i < object.placeIds.length; ++i) - message.placeIds[i] = String(object.placeIds[i]); - } - if (object.removeTime != null) { - if (typeof object.removeTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.removeTime: object expected"); - message.removeTime = $root.google.protobuf.Timestamp.fromObject(object.removeTime); + var message = new $root.google.cloud.retail.v2alpha.ListProductsResponse(); + if (object.products) { + if (!Array.isArray(object.products)) + throw TypeError(".google.cloud.retail.v2alpha.ListProductsResponse.products: array expected"); + message.products = []; + for (var i = 0; i < object.products.length; ++i) { + if (typeof object.products[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ListProductsResponse.products: object expected"); + message.products[i] = $root.google.cloud.retail.v2alpha.Product.fromObject(object.products[i]); + } } - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a RemoveFulfillmentPlacesRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @static - * @param {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest + * @param {google.cloud.retail.v2alpha.ListProductsResponse} message ListProductsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveFulfillmentPlacesRequest.toObject = function toObject(message, options) { + ListProductsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.placeIds = []; + object.products = []; if (options.defaults) { - object.product = ""; - object.type = ""; - object.removeTime = null; - object.allowMissing = false; + object.nextPageToken = ""; + object.totalSize = 0; } - if (message.product != null && message.hasOwnProperty("product")) - object.product = message.product; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.placeIds && message.placeIds.length) { - object.placeIds = []; - for (var j = 0; j < message.placeIds.length; ++j) - object.placeIds[j] = message.placeIds[j]; + if (message.products && message.products.length) { + object.products = []; + for (var j = 0; j < message.products.length; ++j) + object.products[j] = $root.google.cloud.retail.v2alpha.Product.toObject(message.products[j], options); } - if (message.removeTime != null && message.hasOwnProperty("removeTime")) - object.removeTime = $root.google.protobuf.Timestamp.toObject(message.removeTime, options); - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; return object; }; /** - * Converts this RemoveFulfillmentPlacesRequest to JSON. + * Converts this ListProductsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @instance * @returns {Object.} JSON object */ - RemoveFulfillmentPlacesRequest.prototype.toJSON = function toJSON() { + ListProductsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RemoveFulfillmentPlacesRequest; + return ListProductsResponse; })(); - v2alpha.RemoveFulfillmentPlacesMetadata = (function() { + v2alpha.SetInventoryRequest = (function() { /** - * Properties of a RemoveFulfillmentPlacesMetadata. + * Properties of a SetInventoryRequest. * @memberof google.cloud.retail.v2alpha - * @interface IRemoveFulfillmentPlacesMetadata + * @interface ISetInventoryRequest + * @property {google.cloud.retail.v2alpha.IProduct|null} [inventory] SetInventoryRequest inventory + * @property {google.protobuf.IFieldMask|null} [setMask] SetInventoryRequest setMask + * @property {google.protobuf.ITimestamp|null} [setTime] SetInventoryRequest setTime + * @property {boolean|null} [allowMissing] SetInventoryRequest allowMissing */ /** - * Constructs a new RemoveFulfillmentPlacesMetadata. + * Constructs a new SetInventoryRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a RemoveFulfillmentPlacesMetadata. - * @implements IRemoveFulfillmentPlacesMetadata + * @classdesc Represents a SetInventoryRequest. + * @implements ISetInventoryRequest * @constructor - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ISetInventoryRequest=} [properties] Properties to set */ - function RemoveFulfillmentPlacesMetadata(properties) { + function SetInventoryRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -46135,63 +45411,115 @@ } /** - * Creates a new RemoveFulfillmentPlacesMetadata instance using the specified properties. + * SetInventoryRequest inventory. + * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} inventory + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @instance + */ + SetInventoryRequest.prototype.inventory = null; + + /** + * SetInventoryRequest setMask. + * @member {google.protobuf.IFieldMask|null|undefined} setMask + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @instance + */ + SetInventoryRequest.prototype.setMask = null; + + /** + * SetInventoryRequest setTime. + * @member {google.protobuf.ITimestamp|null|undefined} setTime + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @instance + */ + SetInventoryRequest.prototype.setTime = null; + + /** + * SetInventoryRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @instance + */ + SetInventoryRequest.prototype.allowMissing = false; + + /** + * Creates a new SetInventoryRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata instance + * @param {google.cloud.retail.v2alpha.ISetInventoryRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SetInventoryRequest} SetInventoryRequest instance */ - RemoveFulfillmentPlacesMetadata.create = function create(properties) { - return new RemoveFulfillmentPlacesMetadata(properties); + SetInventoryRequest.create = function create(properties) { + return new SetInventoryRequest(properties); }; /** - * Encodes the specified RemoveFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.verify|verify} messages. + * Encodes the specified SetInventoryRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISetInventoryRequest} message SetInventoryRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesMetadata.encode = function encode(message, writer) { + SetInventoryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.inventory != null && Object.hasOwnProperty.call(message, "inventory")) + $root.google.cloud.retail.v2alpha.Product.encode(message.inventory, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.setMask != null && Object.hasOwnProperty.call(message, "setMask")) + $root.google.protobuf.FieldMask.encode(message.setMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.setTime != null && Object.hasOwnProperty.call(message, "setTime")) + $root.google.protobuf.Timestamp.encode(message.setTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); return writer; }; /** - * Encodes the specified RemoveFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.verify|verify} messages. + * Encodes the specified SetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISetInventoryRequest} message SetInventoryRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + SetInventoryRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer. + * Decodes a SetInventoryRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @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.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2alpha.SetInventoryRequest} SetInventoryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesMetadata.decode = function decode(reader, length) { + SetInventoryRequest.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.RemoveFulfillmentPlacesMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SetInventoryRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.inventory = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); + break; + case 2: + message.setMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.setTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.allowMissing = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -46201,93 +45529,146 @@ }; /** - * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. + * Decodes a SetInventoryRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2alpha.SetInventoryRequest} SetInventoryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesMetadata.decodeDelimited = function decodeDelimited(reader) { + SetInventoryRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveFulfillmentPlacesMetadata message. + * Verifies a SetInventoryRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveFulfillmentPlacesMetadata.verify = function verify(message) { + SetInventoryRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.inventory != null && message.hasOwnProperty("inventory")) { + var error = $root.google.cloud.retail.v2alpha.Product.verify(message.inventory); + if (error) + return "inventory." + error; + } + if (message.setMask != null && message.hasOwnProperty("setMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.setMask); + if (error) + return "setMask." + error; + } + if (message.setTime != null && message.hasOwnProperty("setTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.setTime); + if (error) + return "setTime." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a RemoveFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a SetInventoryRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2alpha.SetInventoryRequest} SetInventoryRequest */ - RemoveFulfillmentPlacesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata) + SetInventoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SetInventoryRequest) return object; - return new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata(); + var message = new $root.google.cloud.retail.v2alpha.SetInventoryRequest(); + if (object.inventory != null) { + if (typeof object.inventory !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SetInventoryRequest.inventory: object expected"); + message.inventory = $root.google.cloud.retail.v2alpha.Product.fromObject(object.inventory); + } + if (object.setMask != null) { + if (typeof object.setMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SetInventoryRequest.setMask: object expected"); + message.setMask = $root.google.protobuf.FieldMask.fromObject(object.setMask); + } + if (object.setTime != null) { + if (typeof object.setTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SetInventoryRequest.setTime: object expected"); + message.setTime = $root.google.protobuf.Timestamp.fromObject(object.setTime); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; }; /** - * Creates a plain object from a RemoveFulfillmentPlacesMetadata message. Also converts values to other types if specified. + * Creates a plain object from a SetInventoryRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @static - * @param {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata + * @param {google.cloud.retail.v2alpha.SetInventoryRequest} message SetInventoryRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveFulfillmentPlacesMetadata.toObject = function toObject() { - return {}; + SetInventoryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inventory = null; + object.setMask = null; + object.setTime = null; + object.allowMissing = false; + } + if (message.inventory != null && message.hasOwnProperty("inventory")) + object.inventory = $root.google.cloud.retail.v2alpha.Product.toObject(message.inventory, options); + if (message.setMask != null && message.hasOwnProperty("setMask")) + object.setMask = $root.google.protobuf.FieldMask.toObject(message.setMask, options); + if (message.setTime != null && message.hasOwnProperty("setTime")) + object.setTime = $root.google.protobuf.Timestamp.toObject(message.setTime, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; }; /** - * Converts this RemoveFulfillmentPlacesMetadata to JSON. + * Converts this SetInventoryRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @instance * @returns {Object.} JSON object */ - RemoveFulfillmentPlacesMetadata.prototype.toJSON = function toJSON() { + SetInventoryRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RemoveFulfillmentPlacesMetadata; + return SetInventoryRequest; })(); - v2alpha.RemoveFulfillmentPlacesResponse = (function() { + v2alpha.SetInventoryMetadata = (function() { /** - * Properties of a RemoveFulfillmentPlacesResponse. + * Properties of a SetInventoryMetadata. * @memberof google.cloud.retail.v2alpha - * @interface IRemoveFulfillmentPlacesResponse + * @interface ISetInventoryMetadata */ /** - * Constructs a new RemoveFulfillmentPlacesResponse. + * Constructs a new SetInventoryMetadata. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a RemoveFulfillmentPlacesResponse. - * @implements IRemoveFulfillmentPlacesResponse + * @classdesc Represents a SetInventoryMetadata. + * @implements ISetInventoryMetadata * @constructor - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ISetInventoryMetadata=} [properties] Properties to set */ - function RemoveFulfillmentPlacesResponse(properties) { + function SetInventoryMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -46295,60 +45676,60 @@ } /** - * Creates a new RemoveFulfillmentPlacesResponse instance using the specified properties. + * Creates a new SetInventoryMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse instance + * @param {google.cloud.retail.v2alpha.ISetInventoryMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SetInventoryMetadata} SetInventoryMetadata instance */ - RemoveFulfillmentPlacesResponse.create = function create(properties) { - return new RemoveFulfillmentPlacesResponse(properties); + SetInventoryMetadata.create = function create(properties) { + return new SetInventoryMetadata(properties); }; /** - * Encodes the specified RemoveFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * Encodes the specified SetInventoryMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISetInventoryMetadata} message SetInventoryMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesResponse.encode = function encode(message, writer) { + SetInventoryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** - * Encodes the specified RemoveFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * Encodes the specified SetInventoryMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISetInventoryMetadata} message SetInventoryMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + SetInventoryMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer. + * Decodes a SetInventoryMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata * @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.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2alpha.SetInventoryMetadata} SetInventoryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesResponse.decode = function decode(reader, length) { + SetInventoryMetadata.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.RemoveFulfillmentPlacesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SetInventoryMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -46361,93 +45742,93 @@ }; /** - * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. + * Decodes a SetInventoryMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2alpha.SetInventoryMetadata} SetInventoryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesResponse.decodeDelimited = function decodeDelimited(reader) { + SetInventoryMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveFulfillmentPlacesResponse message. + * Verifies a SetInventoryMetadata message. * @function verify - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveFulfillmentPlacesResponse.verify = function verify(message) { + SetInventoryMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** - * Creates a RemoveFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SetInventoryMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2alpha.SetInventoryMetadata} SetInventoryMetadata */ - RemoveFulfillmentPlacesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse) + SetInventoryMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SetInventoryMetadata) return object; - return new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse(); + return new $root.google.cloud.retail.v2alpha.SetInventoryMetadata(); }; /** - * Creates a plain object from a RemoveFulfillmentPlacesResponse message. Also converts values to other types if specified. + * Creates a plain object from a SetInventoryMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata * @static - * @param {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse + * @param {google.cloud.retail.v2alpha.SetInventoryMetadata} message SetInventoryMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveFulfillmentPlacesResponse.toObject = function toObject() { + SetInventoryMetadata.toObject = function toObject() { return {}; }; /** - * Converts this RemoveFulfillmentPlacesResponse to JSON. + * Converts this SetInventoryMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata * @instance * @returns {Object.} JSON object */ - RemoveFulfillmentPlacesResponse.prototype.toJSON = function toJSON() { + SetInventoryMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RemoveFulfillmentPlacesResponse; + return SetInventoryMetadata; })(); - v2alpha.PurgeMetadata = (function() { + v2alpha.SetInventoryResponse = (function() { /** - * Properties of a PurgeMetadata. + * Properties of a SetInventoryResponse. * @memberof google.cloud.retail.v2alpha - * @interface IPurgeMetadata + * @interface ISetInventoryResponse */ /** - * Constructs a new PurgeMetadata. + * Constructs a new SetInventoryResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PurgeMetadata. - * @implements IPurgeMetadata + * @classdesc Represents a SetInventoryResponse. + * @implements ISetInventoryResponse * @constructor - * @param {google.cloud.retail.v2alpha.IPurgeMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ISetInventoryResponse=} [properties] Properties to set */ - function PurgeMetadata(properties) { + function SetInventoryResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -46455,60 +45836,60 @@ } /** - * Creates a new PurgeMetadata instance using the specified properties. + * Creates a new SetInventoryResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @static - * @param {google.cloud.retail.v2alpha.IPurgeMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PurgeMetadata} PurgeMetadata instance + * @param {google.cloud.retail.v2alpha.ISetInventoryResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SetInventoryResponse} SetInventoryResponse instance */ - PurgeMetadata.create = function create(properties) { - return new PurgeMetadata(properties); + SetInventoryResponse.create = function create(properties) { + return new SetInventoryResponse(properties); }; /** - * Encodes the specified PurgeMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeMetadata.verify|verify} messages. + * Encodes the specified SetInventoryResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @static - * @param {google.cloud.retail.v2alpha.IPurgeMetadata} message PurgeMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISetInventoryResponse} message SetInventoryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeMetadata.encode = function encode(message, writer) { + SetInventoryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** - * Encodes the specified PurgeMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeMetadata.verify|verify} messages. + * Encodes the specified SetInventoryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @static - * @param {google.cloud.retail.v2alpha.IPurgeMetadata} message PurgeMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISetInventoryResponse} message SetInventoryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeMetadata.encodeDelimited = function encodeDelimited(message, writer) { + SetInventoryResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PurgeMetadata message from the specified reader or buffer. + * Decodes a SetInventoryResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @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.PurgeMetadata} PurgeMetadata + * @returns {google.cloud.retail.v2alpha.SetInventoryResponse} SetInventoryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeMetadata.decode = function decode(reader, length) { + SetInventoryResponse.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.PurgeMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SetInventoryResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -46521,96 +45902,99 @@ }; /** - * Decodes a PurgeMetadata message from the specified reader or buffer, length delimited. + * Decodes a SetInventoryResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PurgeMetadata} PurgeMetadata + * @returns {google.cloud.retail.v2alpha.SetInventoryResponse} SetInventoryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeMetadata.decodeDelimited = function decodeDelimited(reader) { + SetInventoryResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PurgeMetadata message. + * Verifies a SetInventoryResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PurgeMetadata.verify = function verify(message) { + SetInventoryResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** - * Creates a PurgeMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a SetInventoryResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PurgeMetadata} PurgeMetadata + * @returns {google.cloud.retail.v2alpha.SetInventoryResponse} SetInventoryResponse */ - PurgeMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PurgeMetadata) + SetInventoryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SetInventoryResponse) return object; - return new $root.google.cloud.retail.v2alpha.PurgeMetadata(); + return new $root.google.cloud.retail.v2alpha.SetInventoryResponse(); }; /** - * Creates a plain object from a PurgeMetadata message. Also converts values to other types if specified. + * Creates a plain object from a SetInventoryResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @static - * @param {google.cloud.retail.v2alpha.PurgeMetadata} message PurgeMetadata + * @param {google.cloud.retail.v2alpha.SetInventoryResponse} message SetInventoryResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PurgeMetadata.toObject = function toObject() { + SetInventoryResponse.toObject = function toObject() { return {}; }; /** - * Converts this PurgeMetadata to JSON. + * Converts this SetInventoryResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @instance * @returns {Object.} JSON object */ - PurgeMetadata.prototype.toJSON = function toJSON() { + SetInventoryResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PurgeMetadata; + return SetInventoryResponse; })(); - v2alpha.PurgeUserEventsRequest = (function() { + v2alpha.AddFulfillmentPlacesRequest = (function() { /** - * Properties of a PurgeUserEventsRequest. + * Properties of an AddFulfillmentPlacesRequest. * @memberof google.cloud.retail.v2alpha - * @interface IPurgeUserEventsRequest - * @property {string|null} [parent] PurgeUserEventsRequest parent - * @property {string|null} [filter] PurgeUserEventsRequest filter - * @property {boolean|null} [force] PurgeUserEventsRequest force + * @interface IAddFulfillmentPlacesRequest + * @property {string|null} [product] AddFulfillmentPlacesRequest product + * @property {string|null} [type] AddFulfillmentPlacesRequest type + * @property {Array.|null} [placeIds] AddFulfillmentPlacesRequest placeIds + * @property {google.protobuf.ITimestamp|null} [addTime] AddFulfillmentPlacesRequest addTime + * @property {boolean|null} [allowMissing] AddFulfillmentPlacesRequest allowMissing */ /** - * Constructs a new PurgeUserEventsRequest. + * Constructs a new AddFulfillmentPlacesRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PurgeUserEventsRequest. - * @implements IPurgeUserEventsRequest + * @classdesc Represents an AddFulfillmentPlacesRequest. + * @implements IAddFulfillmentPlacesRequest * @constructor - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest=} [properties] Properties to set */ - function PurgeUserEventsRequest(properties) { + function AddFulfillmentPlacesRequest(properties) { + this.placeIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -46618,101 +46002,130 @@ } /** - * PurgeUserEventsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * AddFulfillmentPlacesRequest product. + * @member {string} product + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @instance */ - PurgeUserEventsRequest.prototype.parent = ""; + AddFulfillmentPlacesRequest.prototype.product = ""; /** - * PurgeUserEventsRequest filter. - * @member {string} filter - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * AddFulfillmentPlacesRequest type. + * @member {string} type + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @instance */ - PurgeUserEventsRequest.prototype.filter = ""; + AddFulfillmentPlacesRequest.prototype.type = ""; /** - * PurgeUserEventsRequest force. - * @member {boolean} force - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * AddFulfillmentPlacesRequest placeIds. + * @member {Array.} placeIds + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @instance */ - PurgeUserEventsRequest.prototype.force = false; + AddFulfillmentPlacesRequest.prototype.placeIds = $util.emptyArray; /** - * Creates a new PurgeUserEventsRequest instance using the specified properties. + * AddFulfillmentPlacesRequest addTime. + * @member {google.protobuf.ITimestamp|null|undefined} addTime + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @instance + */ + AddFulfillmentPlacesRequest.prototype.addTime = null; + + /** + * AddFulfillmentPlacesRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @instance + */ + AddFulfillmentPlacesRequest.prototype.allowMissing = false; + + /** + * Creates a new AddFulfillmentPlacesRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PurgeUserEventsRequest} PurgeUserEventsRequest instance + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest instance */ - PurgeUserEventsRequest.create = function create(properties) { - return new PurgeUserEventsRequest(properties); + AddFulfillmentPlacesRequest.create = function create(properties) { + return new AddFulfillmentPlacesRequest(properties); }; /** - * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsRequest.verify|verify} messages. + * Encodes the specified AddFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsRequest.encode = function encode(message, writer) { + AddFulfillmentPlacesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.placeIds != null && message.placeIds.length) + for (var i = 0; i < message.placeIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.placeIds[i]); + if (message.addTime != null && Object.hasOwnProperty.call(message, "addTime")) + $root.google.protobuf.Timestamp.encode(message.addTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); return writer; }; /** - * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsRequest.verify|verify} messages. + * Encodes the specified AddFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + AddFulfillmentPlacesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. + * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @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.PurgeUserEventsRequest} PurgeUserEventsRequest + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeUserEventsRequest.decode = function decode(reader, length) { + AddFulfillmentPlacesRequest.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.PurgeUserEventsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.product = reader.string(); break; case 2: - message.filter = reader.string(); + message.type = reader.string(); break; case 3: - message.force = reader.bool(); + if (!(message.placeIds && message.placeIds.length)) + message.placeIds = []; + message.placeIds.push(reader.string()); + break; + case 4: + message.addTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.allowMissing = reader.bool(); break; default: reader.skipType(tag & 7); @@ -46723,124 +46136,157 @@ }; /** - * Decodes a PurgeUserEventsRequest message from the specified reader or buffer, length delimited. + * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PurgeUserEventsRequest} PurgeUserEventsRequest + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { + AddFulfillmentPlacesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PurgeUserEventsRequest message. + * Verifies an AddFulfillmentPlacesRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PurgeUserEventsRequest.verify = function verify(message) { + AddFulfillmentPlacesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; + if (message.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.placeIds != null && message.hasOwnProperty("placeIds")) { + if (!Array.isArray(message.placeIds)) + return "placeIds: array expected"; + for (var i = 0; i < message.placeIds.length; ++i) + if (!$util.isString(message.placeIds[i])) + return "placeIds: string[] expected"; + } + if (message.addTime != null && message.hasOwnProperty("addTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.addTime); + if (error) + return "addTime." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a PurgeUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AddFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PurgeUserEventsRequest} PurgeUserEventsRequest + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest */ - PurgeUserEventsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PurgeUserEventsRequest) + AddFulfillmentPlacesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.PurgeUserEventsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.force != null) - message.force = Boolean(object.force); - return message; - }; - - /** - * Creates a plain object from a PurgeUserEventsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + var message = new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest(); + if (object.product != null) + message.product = String(object.product); + if (object.type != null) + message.type = String(object.type); + if (object.placeIds) { + if (!Array.isArray(object.placeIds)) + throw TypeError(".google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.placeIds: array expected"); + message.placeIds = []; + for (var i = 0; i < object.placeIds.length; ++i) + message.placeIds[i] = String(object.placeIds[i]); + } + if (object.addTime != null) { + if (typeof object.addTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.addTime: object expected"); + message.addTime = $root.google.protobuf.Timestamp.fromObject(object.addTime); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an AddFulfillmentPlacesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2alpha.PurgeUserEventsRequest} message PurgeUserEventsRequest + * @param {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PurgeUserEventsRequest.toObject = function toObject(message, options) { + AddFulfillmentPlacesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.placeIds = []; if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.force = false; + object.product = ""; + object.type = ""; + object.addTime = null; + object.allowMissing = false; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.placeIds && message.placeIds.length) { + object.placeIds = []; + for (var j = 0; j < message.placeIds.length; ++j) + object.placeIds[j] = message.placeIds[j]; + } + if (message.addTime != null && message.hasOwnProperty("addTime")) + object.addTime = $root.google.protobuf.Timestamp.toObject(message.addTime, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; return object; }; /** - * Converts this PurgeUserEventsRequest to JSON. + * Converts this AddFulfillmentPlacesRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @instance * @returns {Object.} JSON object */ - PurgeUserEventsRequest.prototype.toJSON = function toJSON() { + AddFulfillmentPlacesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PurgeUserEventsRequest; + return AddFulfillmentPlacesRequest; })(); - v2alpha.PurgeUserEventsResponse = (function() { + v2alpha.AddFulfillmentPlacesMetadata = (function() { /** - * Properties of a PurgeUserEventsResponse. + * Properties of an AddFulfillmentPlacesMetadata. * @memberof google.cloud.retail.v2alpha - * @interface IPurgeUserEventsResponse - * @property {number|Long|null} [purgedEventsCount] PurgeUserEventsResponse purgedEventsCount + * @interface IAddFulfillmentPlacesMetadata */ /** - * Constructs a new PurgeUserEventsResponse. + * Constructs a new AddFulfillmentPlacesMetadata. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PurgeUserEventsResponse. - * @implements IPurgeUserEventsResponse + * @classdesc Represents an AddFulfillmentPlacesMetadata. + * @implements IAddFulfillmentPlacesMetadata * @constructor - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata=} [properties] Properties to set */ - function PurgeUserEventsResponse(properties) { + function AddFulfillmentPlacesMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -46848,76 +46294,63 @@ } /** - * PurgeUserEventsResponse purgedEventsCount. - * @member {number|Long} purgedEventsCount - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse - * @instance - */ - PurgeUserEventsResponse.prototype.purgedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new PurgeUserEventsResponse instance using the specified properties. + * Creates a new AddFulfillmentPlacesMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PurgeUserEventsResponse} PurgeUserEventsResponse instance + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata instance */ - PurgeUserEventsResponse.create = function create(properties) { - return new PurgeUserEventsResponse(properties); + AddFulfillmentPlacesMetadata.create = function create(properties) { + return new AddFulfillmentPlacesMetadata(properties); }; /** - * Encodes the specified PurgeUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsResponse.verify|verify} messages. + * Encodes the specified AddFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsResponse} message PurgeUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsResponse.encode = function encode(message, writer) { + AddFulfillmentPlacesMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.purgedEventsCount != null && Object.hasOwnProperty.call(message, "purgedEventsCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.purgedEventsCount); return writer; }; /** - * Encodes the specified PurgeUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsResponse.verify|verify} messages. + * Encodes the specified AddFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsResponse} message PurgeUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + AddFulfillmentPlacesMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PurgeUserEventsResponse message from the specified reader or buffer. + * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata * @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.PurgeUserEventsResponse} PurgeUserEventsResponse + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeUserEventsResponse.decode = function decode(reader, length) { + AddFulfillmentPlacesMetadata.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.PurgeUserEventsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.purgedEventsCount = reader.int64(); - break; default: reader.skipType(tag & 7); break; @@ -46927,529 +46360,390 @@ }; /** - * Decodes a PurgeUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PurgeUserEventsResponse} PurgeUserEventsResponse + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { + AddFulfillmentPlacesMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PurgeUserEventsResponse message. + * Verifies an AddFulfillmentPlacesMetadata message. * @function verify - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PurgeUserEventsResponse.verify = function verify(message) { + AddFulfillmentPlacesMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.purgedEventsCount != null && message.hasOwnProperty("purgedEventsCount")) - if (!$util.isInteger(message.purgedEventsCount) && !(message.purgedEventsCount && $util.isInteger(message.purgedEventsCount.low) && $util.isInteger(message.purgedEventsCount.high))) - return "purgedEventsCount: integer|Long expected"; return null; }; /** - * Creates a PurgeUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AddFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PurgeUserEventsResponse} PurgeUserEventsResponse + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata */ - PurgeUserEventsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PurgeUserEventsResponse) + AddFulfillmentPlacesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata) return object; - var message = new $root.google.cloud.retail.v2alpha.PurgeUserEventsResponse(); - if (object.purgedEventsCount != null) - if ($util.Long) - (message.purgedEventsCount = $util.Long.fromValue(object.purgedEventsCount)).unsigned = false; - else if (typeof object.purgedEventsCount === "string") - message.purgedEventsCount = parseInt(object.purgedEventsCount, 10); - else if (typeof object.purgedEventsCount === "number") - message.purgedEventsCount = object.purgedEventsCount; - else if (typeof object.purgedEventsCount === "object") - message.purgedEventsCount = new $util.LongBits(object.purgedEventsCount.low >>> 0, object.purgedEventsCount.high >>> 0).toNumber(); - return message; + return new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata(); }; /** - * Creates a plain object from a PurgeUserEventsResponse message. Also converts values to other types if specified. + * Creates a plain object from an AddFulfillmentPlacesMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2alpha.PurgeUserEventsResponse} message PurgeUserEventsResponse + * @param {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PurgeUserEventsResponse.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.purgedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.purgedEventsCount = options.longs === String ? "0" : 0; - if (message.purgedEventsCount != null && message.hasOwnProperty("purgedEventsCount")) - if (typeof message.purgedEventsCount === "number") - object.purgedEventsCount = options.longs === String ? String(message.purgedEventsCount) : message.purgedEventsCount; - else - object.purgedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.purgedEventsCount) : options.longs === Number ? new $util.LongBits(message.purgedEventsCount.low >>> 0, message.purgedEventsCount.high >>> 0).toNumber() : message.purgedEventsCount; - return object; + AddFulfillmentPlacesMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this PurgeUserEventsResponse to JSON. + * Converts this AddFulfillmentPlacesMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata * @instance * @returns {Object.} JSON object */ - PurgeUserEventsResponse.prototype.toJSON = function toJSON() { + AddFulfillmentPlacesMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PurgeUserEventsResponse; + return AddFulfillmentPlacesMetadata; })(); - v2alpha.SearchService = (function() { + v2alpha.AddFulfillmentPlacesResponse = (function() { /** - * Constructs a new SearchService service. + * Properties of an AddFulfillmentPlacesResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a SearchService - * @extends $protobuf.rpc.Service + * @interface IAddFulfillmentPlacesResponse + */ + + /** + * Constructs a new AddFulfillmentPlacesResponse. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an AddFulfillmentPlacesResponse. + * @implements IAddFulfillmentPlacesResponse * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse=} [properties] Properties to set */ - function SearchService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function AddFulfillmentPlacesResponse(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]]; } - (SearchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SearchService; - /** - * Creates new SearchService service using the specified rpc implementation. + * Creates a new AddFulfillmentPlacesResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.SearchService + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {SearchService} RPC service. Useful where requests and/or responses are streamed. + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse instance */ - SearchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + AddFulfillmentPlacesResponse.create = function create(properties) { + return new AddFulfillmentPlacesResponse(properties); }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.SearchService#search}. - * @memberof google.cloud.retail.v2alpha.SearchService - * @typedef SearchCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.SearchResponse} [response] SearchResponse + * Encodes the specified AddFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @static + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + AddFulfillmentPlacesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; /** - * Calls Search. - * @function search - * @memberof google.cloud.retail.v2alpha.SearchService - * @instance - * @param {google.cloud.retail.v2alpha.ISearchRequest} request SearchRequest message or plain object - * @param {google.cloud.retail.v2alpha.SearchService.SearchCallback} callback Node-style callback called with the error, if any, and SearchResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified AddFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @static + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SearchService.prototype.search = function search(request, callback) { - return this.rpcCall(search, $root.google.cloud.retail.v2alpha.SearchRequest, $root.google.cloud.retail.v2alpha.SearchResponse, request, callback); - }, "name", { value: "Search" }); + AddFulfillmentPlacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls Search. - * @function search - * @memberof google.cloud.retail.v2alpha.SearchService - * @instance - * @param {google.cloud.retail.v2alpha.ISearchRequest} request SearchRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @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.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - - return SearchService; - })(); - - v2alpha.SearchRequest = (function() { + AddFulfillmentPlacesResponse.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.AddFulfillmentPlacesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Properties of a SearchRequest. - * @memberof google.cloud.retail.v2alpha - * @interface ISearchRequest - * @property {string|null} [placement] SearchRequest placement - * @property {string|null} [branch] SearchRequest branch - * @property {string|null} [query] SearchRequest query - * @property {string|null} [visitorId] SearchRequest visitorId - * @property {google.cloud.retail.v2alpha.IUserInfo|null} [userInfo] SearchRequest userInfo - * @property {number|null} [pageSize] SearchRequest pageSize - * @property {string|null} [pageToken] SearchRequest pageToken - * @property {number|null} [offset] SearchRequest offset - * @property {string|null} [filter] SearchRequest filter - * @property {string|null} [canonicalFilter] SearchRequest canonicalFilter - * @property {string|null} [orderBy] SearchRequest orderBy - * @property {Array.|null} [facetSpecs] SearchRequest facetSpecs - * @property {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec|null} [dynamicFacetSpec] SearchRequest dynamicFacetSpec - * @property {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec|null} [boostSpec] SearchRequest boostSpec - * @property {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec|null} [queryExpansionSpec] SearchRequest queryExpansionSpec - * @property {google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold|null} [relevanceThreshold] SearchRequest relevanceThreshold - * @property {Array.|null} [variantRollupKeys] SearchRequest variantRollupKeys - * @property {Array.|null} [pageCategories] SearchRequest pageCategories - * @property {google.cloud.retail.v2alpha.SearchRequest.SearchMode|null} [searchMode] SearchRequest searchMode + * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AddFulfillmentPlacesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Constructs a new SearchRequest. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a SearchRequest. - * @implements ISearchRequest - * @constructor - * @param {google.cloud.retail.v2alpha.ISearchRequest=} [properties] Properties to set + * Verifies an AddFulfillmentPlacesResponse message. + * @function verify + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - function SearchRequest(properties) { - this.facetSpecs = []; - this.variantRollupKeys = []; - this.pageCategories = []; - 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]]; - } + AddFulfillmentPlacesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; /** - * SearchRequest placement. - * @member {string} placement - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance + * Creates an AddFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse */ - SearchRequest.prototype.placement = ""; + AddFulfillmentPlacesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse) + return object; + return new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse(); + }; /** - * SearchRequest branch. - * @member {string} branch - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance + * Creates a plain object from an AddFulfillmentPlacesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @static + * @param {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - SearchRequest.prototype.branch = ""; + AddFulfillmentPlacesResponse.toObject = function toObject() { + return {}; + }; /** - * SearchRequest query. - * @member {string} query - * @memberof google.cloud.retail.v2alpha.SearchRequest + * Converts this AddFulfillmentPlacesResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse * @instance + * @returns {Object.} JSON object */ - SearchRequest.prototype.query = ""; + AddFulfillmentPlacesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * SearchRequest visitorId. - * @member {string} visitorId - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance - */ - SearchRequest.prototype.visitorId = ""; + return AddFulfillmentPlacesResponse; + })(); - /** - * SearchRequest userInfo. - * @member {google.cloud.retail.v2alpha.IUserInfo|null|undefined} userInfo - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance - */ - SearchRequest.prototype.userInfo = null; + v2alpha.AddLocalInventoriesRequest = (function() { /** - * SearchRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance + * Properties of an AddLocalInventoriesRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IAddLocalInventoriesRequest + * @property {string|null} [product] AddLocalInventoriesRequest product + * @property {Array.|null} [localInventories] AddLocalInventoriesRequest localInventories + * @property {google.protobuf.IFieldMask|null} [addMask] AddLocalInventoriesRequest addMask + * @property {google.protobuf.ITimestamp|null} [addTime] AddLocalInventoriesRequest addTime + * @property {boolean|null} [allowMissing] AddLocalInventoriesRequest allowMissing */ - SearchRequest.prototype.pageSize = 0; /** - * SearchRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance + * Constructs a new AddLocalInventoriesRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an AddLocalInventoriesRequest. + * @implements IAddLocalInventoriesRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest=} [properties] Properties to set */ - SearchRequest.prototype.pageToken = ""; + function AddLocalInventoriesRequest(properties) { + this.localInventories = []; + 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]]; + } /** - * SearchRequest offset. - * @member {number} offset - * @memberof google.cloud.retail.v2alpha.SearchRequest + * AddLocalInventoriesRequest product. + * @member {string} product + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @instance */ - SearchRequest.prototype.offset = 0; + AddLocalInventoriesRequest.prototype.product = ""; /** - * SearchRequest filter. - * @member {string} filter - * @memberof google.cloud.retail.v2alpha.SearchRequest + * AddLocalInventoriesRequest localInventories. + * @member {Array.} localInventories + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @instance */ - SearchRequest.prototype.filter = ""; + AddLocalInventoriesRequest.prototype.localInventories = $util.emptyArray; /** - * SearchRequest canonicalFilter. - * @member {string} canonicalFilter - * @memberof google.cloud.retail.v2alpha.SearchRequest + * AddLocalInventoriesRequest addMask. + * @member {google.protobuf.IFieldMask|null|undefined} addMask + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @instance */ - SearchRequest.prototype.canonicalFilter = ""; + AddLocalInventoriesRequest.prototype.addMask = null; /** - * SearchRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.retail.v2alpha.SearchRequest + * AddLocalInventoriesRequest addTime. + * @member {google.protobuf.ITimestamp|null|undefined} addTime + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @instance */ - SearchRequest.prototype.orderBy = ""; + AddLocalInventoriesRequest.prototype.addTime = null; /** - * SearchRequest facetSpecs. - * @member {Array.} facetSpecs - * @memberof google.cloud.retail.v2alpha.SearchRequest + * AddLocalInventoriesRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @instance */ - SearchRequest.prototype.facetSpecs = $util.emptyArray; + AddLocalInventoriesRequest.prototype.allowMissing = false; /** - * SearchRequest dynamicFacetSpec. - * @member {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec|null|undefined} dynamicFacetSpec - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance - */ - SearchRequest.prototype.dynamicFacetSpec = null; - - /** - * SearchRequest boostSpec. - * @member {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec|null|undefined} boostSpec - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance - */ - SearchRequest.prototype.boostSpec = null; - - /** - * SearchRequest queryExpansionSpec. - * @member {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec|null|undefined} queryExpansionSpec - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance - */ - SearchRequest.prototype.queryExpansionSpec = null; - - /** - * SearchRequest relevanceThreshold. - * @member {google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold} relevanceThreshold - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance - */ - SearchRequest.prototype.relevanceThreshold = 0; - - /** - * SearchRequest variantRollupKeys. - * @member {Array.} variantRollupKeys - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance - */ - SearchRequest.prototype.variantRollupKeys = $util.emptyArray; - - /** - * SearchRequest pageCategories. - * @member {Array.} pageCategories - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance - */ - SearchRequest.prototype.pageCategories = $util.emptyArray; - - /** - * SearchRequest searchMode. - * @member {google.cloud.retail.v2alpha.SearchRequest.SearchMode} searchMode - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance - */ - SearchRequest.prototype.searchMode = 0; - - /** - * Creates a new SearchRequest instance using the specified properties. + * Creates a new AddLocalInventoriesRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2alpha.ISearchRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchRequest} SearchRequest instance + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} AddLocalInventoriesRequest instance */ - SearchRequest.create = function create(properties) { - return new SearchRequest(properties); + AddLocalInventoriesRequest.create = function create(properties) { + return new AddLocalInventoriesRequest(properties); }; /** - * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.verify|verify} messages. + * Encodes the specified AddLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2alpha.ISearchRequest} message SearchRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest} message AddLocalInventoriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchRequest.encode = function encode(message, writer) { + AddLocalInventoriesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.placement); - if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.branch); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); - if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.visitorId); - if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) - $root.google.cloud.retail.v2alpha.UserInfo.encode(message.userInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.offset); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.orderBy); - if (message.facetSpecs != null && message.facetSpecs.length) - for (var i = 0; i < message.facetSpecs.length; ++i) - $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.encode(message.facetSpecs[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.boostSpec != null && Object.hasOwnProperty.call(message, "boostSpec")) - $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.encode(message.boostSpec, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.queryExpansionSpec != null && Object.hasOwnProperty.call(message, "queryExpansionSpec")) - $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.encode(message.queryExpansionSpec, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.relevanceThreshold != null && Object.hasOwnProperty.call(message, "relevanceThreshold")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.relevanceThreshold); - if (message.variantRollupKeys != null && message.variantRollupKeys.length) - for (var i = 0; i < message.variantRollupKeys.length; ++i) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.variantRollupKeys[i]); - if (message.dynamicFacetSpec != null && Object.hasOwnProperty.call(message, "dynamicFacetSpec")) - $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.encode(message.dynamicFacetSpec, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.pageCategories != null && message.pageCategories.length) - for (var i = 0; i < message.pageCategories.length; ++i) - writer.uint32(/* id 23, wireType 2 =*/186).string(message.pageCategories[i]); - if (message.canonicalFilter != null && Object.hasOwnProperty.call(message, "canonicalFilter")) - writer.uint32(/* id 28, wireType 2 =*/226).string(message.canonicalFilter); - if (message.searchMode != null && Object.hasOwnProperty.call(message, "searchMode")) - writer.uint32(/* id 31, wireType 0 =*/248).int32(message.searchMode); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); + 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 2, wireType 2 =*/18).fork()).ldelim(); + if (message.addMask != null && Object.hasOwnProperty.call(message, "addMask")) + $root.google.protobuf.FieldMask.encode(message.addMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.addTime != null && Object.hasOwnProperty.call(message, "addTime")) + $root.google.protobuf.Timestamp.encode(message.addTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowMissing); return writer; }; /** - * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.verify|verify} messages. + * Encodes the specified AddLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2alpha.ISearchRequest} message SearchRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest} message AddLocalInventoriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchRequest.encodeDelimited = function encodeDelimited(message, writer) { + AddLocalInventoriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchRequest message from the specified reader or buffer. + * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @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.SearchRequest} SearchRequest + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} AddLocalInventoriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchRequest.decode = function decode(reader, length) { + AddLocalInventoriesRequest.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.SearchRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AddLocalInventoriesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.placement = reader.string(); + message.product = reader.string(); break; case 2: - message.branch = reader.string(); - break; - case 3: - message.query = reader.string(); + if (!(message.localInventories && message.localInventories.length)) + message.localInventories = []; + message.localInventories.push($root.google.cloud.retail.v2alpha.LocalInventory.decode(reader, reader.uint32())); break; case 4: - message.visitorId = reader.string(); + message.addMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; case 5: - message.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.decode(reader, reader.uint32()); - break; - case 7: - message.pageSize = reader.int32(); - break; - case 8: - message.pageToken = reader.string(); - break; - case 9: - message.offset = reader.int32(); - break; - case 10: - message.filter = reader.string(); - break; - case 28: - message.canonicalFilter = reader.string(); - break; - case 11: - message.orderBy = reader.string(); - break; - case 12: - if (!(message.facetSpecs && message.facetSpecs.length)) - message.facetSpecs = []; - message.facetSpecs.push($root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.decode(reader, reader.uint32())); - break; - case 21: - message.dynamicFacetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.decode(reader, reader.uint32()); - break; - case 13: - message.boostSpec = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.decode(reader, reader.uint32()); - break; - case 14: - message.queryExpansionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.decode(reader, reader.uint32()); - break; - case 15: - message.relevanceThreshold = reader.int32(); - break; - case 17: - if (!(message.variantRollupKeys && message.variantRollupKeys.length)) - message.variantRollupKeys = []; - message.variantRollupKeys.push(reader.string()); - break; - case 23: - if (!(message.pageCategories && message.pageCategories.length)) - message.pageCategories = []; - message.pageCategories.push(reader.string()); + message.addTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; - case 31: - message.searchMode = reader.int32(); + case 6: + message.allowMissing = reader.bool(); break; default: reader.skipType(tag & 7); @@ -47460,1958 +46754,1089 @@ }; /** - * Decodes a SearchRequest message from the specified reader or buffer, length delimited. + * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchRequest} SearchRequest + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} AddLocalInventoriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchRequest.decodeDelimited = function decodeDelimited(reader) { + AddLocalInventoriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchRequest message. + * Verifies an AddLocalInventoriesRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchRequest.verify = function verify(message) { + AddLocalInventoriesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.placement != null && message.hasOwnProperty("placement")) - if (!$util.isString(message.placement)) - return "placement: string expected"; - if (message.branch != null && message.hasOwnProperty("branch")) - if (!$util.isString(message.branch)) - return "branch: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: string expected"; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - if (!$util.isString(message.visitorId)) - return "visitorId: string expected"; - if (message.userInfo != null && message.hasOwnProperty("userInfo")) { - var error = $root.google.cloud.retail.v2alpha.UserInfo.verify(message.userInfo); - if (error) - return "userInfo." + error; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset)) - return "offset: integer expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) - if (!$util.isString(message.canonicalFilter)) - return "canonicalFilter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.facetSpecs != null && message.hasOwnProperty("facetSpecs")) { - if (!Array.isArray(message.facetSpecs)) - return "facetSpecs: array expected"; - for (var i = 0; i < message.facetSpecs.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify(message.facetSpecs[i]); + if (message.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + 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 "facetSpecs." + error; + return "localInventories." + error; } } - if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) { - var error = $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify(message.dynamicFacetSpec); - if (error) - return "dynamicFacetSpec." + error; - } - if (message.boostSpec != null && message.hasOwnProperty("boostSpec")) { - var error = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify(message.boostSpec); + if (message.addMask != null && message.hasOwnProperty("addMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.addMask); if (error) - return "boostSpec." + error; + return "addMask." + error; } - if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) { - var error = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify(message.queryExpansionSpec); + if (message.addTime != null && message.hasOwnProperty("addTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.addTime); if (error) - return "queryExpansionSpec." + error; - } - if (message.relevanceThreshold != null && message.hasOwnProperty("relevanceThreshold")) - switch (message.relevanceThreshold) { - default: - return "relevanceThreshold: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.variantRollupKeys != null && message.hasOwnProperty("variantRollupKeys")) { - if (!Array.isArray(message.variantRollupKeys)) - return "variantRollupKeys: array expected"; - for (var i = 0; i < message.variantRollupKeys.length; ++i) - if (!$util.isString(message.variantRollupKeys[i])) - return "variantRollupKeys: string[] expected"; - } - if (message.pageCategories != null && message.hasOwnProperty("pageCategories")) { - if (!Array.isArray(message.pageCategories)) - return "pageCategories: array expected"; - for (var i = 0; i < message.pageCategories.length; ++i) - if (!$util.isString(message.pageCategories[i])) - return "pageCategories: string[] expected"; + return "addTime." + error; } - if (message.searchMode != null && message.hasOwnProperty("searchMode")) - switch (message.searchMode) { - default: - return "searchMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a SearchRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AddLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchRequest} SearchRequest + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} AddLocalInventoriesRequest */ - SearchRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest) + AddLocalInventoriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AddLocalInventoriesRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.SearchRequest(); - if (object.placement != null) - message.placement = String(object.placement); - if (object.branch != null) - message.branch = String(object.branch); - if (object.query != null) - message.query = String(object.query); - if (object.visitorId != null) - message.visitorId = String(object.visitorId); - if (object.userInfo != null) { - if (typeof object.userInfo !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.userInfo: object expected"); - message.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.fromObject(object.userInfo); - } - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.offset != null) - message.offset = object.offset | 0; - if (object.filter != null) - message.filter = String(object.filter); - if (object.canonicalFilter != null) - message.canonicalFilter = String(object.canonicalFilter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.facetSpecs) { - if (!Array.isArray(object.facetSpecs)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.facetSpecs: array expected"); - message.facetSpecs = []; - for (var i = 0; i < object.facetSpecs.length; ++i) { - if (typeof object.facetSpecs[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.facetSpecs: object expected"); - message.facetSpecs[i] = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.fromObject(object.facetSpecs[i]); + var message = new $root.google.cloud.retail.v2alpha.AddLocalInventoriesRequest(); + if (object.product != null) + message.product = String(object.product); + if (object.localInventories) { + if (!Array.isArray(object.localInventories)) + throw TypeError(".google.cloud.retail.v2alpha.AddLocalInventoriesRequest.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.AddLocalInventoriesRequest.localInventories: object expected"); + message.localInventories[i] = $root.google.cloud.retail.v2alpha.LocalInventory.fromObject(object.localInventories[i]); } } - if (object.dynamicFacetSpec != null) { - if (typeof object.dynamicFacetSpec !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.dynamicFacetSpec: object expected"); - message.dynamicFacetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.fromObject(object.dynamicFacetSpec); - } - if (object.boostSpec != null) { - if (typeof object.boostSpec !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.boostSpec: object expected"); - message.boostSpec = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.fromObject(object.boostSpec); - } - if (object.queryExpansionSpec != null) { - if (typeof object.queryExpansionSpec !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.queryExpansionSpec: object expected"); - message.queryExpansionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.fromObject(object.queryExpansionSpec); - } - switch (object.relevanceThreshold) { - case "RELEVANCE_THRESHOLD_UNSPECIFIED": - case 0: - message.relevanceThreshold = 0; - break; - case "HIGH": - case 1: - message.relevanceThreshold = 1; - break; - case "MEDIUM": - case 2: - message.relevanceThreshold = 2; - break; - case "LOW": - case 3: - message.relevanceThreshold = 3; - break; - case "LOWEST": - case 4: - message.relevanceThreshold = 4; - break; - } - if (object.variantRollupKeys) { - if (!Array.isArray(object.variantRollupKeys)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.variantRollupKeys: array expected"); - message.variantRollupKeys = []; - for (var i = 0; i < object.variantRollupKeys.length; ++i) - message.variantRollupKeys[i] = String(object.variantRollupKeys[i]); - } - if (object.pageCategories) { - if (!Array.isArray(object.pageCategories)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.pageCategories: array expected"); - message.pageCategories = []; - for (var i = 0; i < object.pageCategories.length; ++i) - message.pageCategories[i] = String(object.pageCategories[i]); + if (object.addMask != null) { + if (typeof object.addMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.AddLocalInventoriesRequest.addMask: object expected"); + message.addMask = $root.google.protobuf.FieldMask.fromObject(object.addMask); } - switch (object.searchMode) { - case "SEARCH_MODE_UNSPECIFIED": - case 0: - message.searchMode = 0; - break; - case "PRODUCT_SEARCH_ONLY": - case 1: - message.searchMode = 1; - break; - case "FACETED_SEARCH_ONLY": - case 2: - message.searchMode = 2; - break; + if (object.addTime != null) { + if (typeof object.addTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.AddLocalInventoriesRequest.addTime: object expected"); + message.addTime = $root.google.protobuf.Timestamp.fromObject(object.addTime); } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. + * Creates a plain object from an AddLocalInventoriesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2alpha.SearchRequest} message SearchRequest + * @param {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} message AddLocalInventoriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchRequest.toObject = function toObject(message, options) { + AddLocalInventoriesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.facetSpecs = []; - object.variantRollupKeys = []; - object.pageCategories = []; - } + if (options.arrays || options.defaults) + object.localInventories = []; if (options.defaults) { - object.placement = ""; - object.branch = ""; - object.query = ""; - object.visitorId = ""; - object.userInfo = null; - object.pageSize = 0; - object.pageToken = ""; - object.offset = 0; - object.filter = ""; - object.orderBy = ""; - object.boostSpec = null; - object.queryExpansionSpec = null; - object.relevanceThreshold = options.enums === String ? "RELEVANCE_THRESHOLD_UNSPECIFIED" : 0; - object.dynamicFacetSpec = null; - object.canonicalFilter = ""; - object.searchMode = options.enums === String ? "SEARCH_MODE_UNSPECIFIED" : 0; + object.product = ""; + object.addMask = null; + object.addTime = null; + object.allowMissing = false; } - if (message.placement != null && message.hasOwnProperty("placement")) - object.placement = message.placement; - if (message.branch != null && message.hasOwnProperty("branch")) - object.branch = message.branch; - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - object.visitorId = message.visitorId; - if (message.userInfo != null && message.hasOwnProperty("userInfo")) - object.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.toObject(message.userInfo, options); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = message.offset; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.facetSpecs && message.facetSpecs.length) { - object.facetSpecs = []; - for (var j = 0; j < message.facetSpecs.length; ++j) - object.facetSpecs[j] = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.toObject(message.facetSpecs[j], options); - } - if (message.boostSpec != null && message.hasOwnProperty("boostSpec")) - object.boostSpec = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.toObject(message.boostSpec, options); - if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) - object.queryExpansionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.toObject(message.queryExpansionSpec, options); - if (message.relevanceThreshold != null && message.hasOwnProperty("relevanceThreshold")) - object.relevanceThreshold = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold[message.relevanceThreshold] : message.relevanceThreshold; - if (message.variantRollupKeys && message.variantRollupKeys.length) { - object.variantRollupKeys = []; - for (var j = 0; j < message.variantRollupKeys.length; ++j) - object.variantRollupKeys[j] = message.variantRollupKeys[j]; - } - if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) - object.dynamicFacetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.toObject(message.dynamicFacetSpec, options); - if (message.pageCategories && message.pageCategories.length) { - object.pageCategories = []; - for (var j = 0; j < message.pageCategories.length; ++j) - object.pageCategories[j] = message.pageCategories[j]; + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + 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); } - if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) - object.canonicalFilter = message.canonicalFilter; - if (message.searchMode != null && message.hasOwnProperty("searchMode")) - object.searchMode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.SearchMode[message.searchMode] : message.searchMode; + if (message.addMask != null && message.hasOwnProperty("addMask")) + object.addMask = $root.google.protobuf.FieldMask.toObject(message.addMask, options); + if (message.addTime != null && message.hasOwnProperty("addTime")) + object.addTime = $root.google.protobuf.Timestamp.toObject(message.addTime, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; return object; }; /** - * Converts this SearchRequest to JSON. + * Converts this AddLocalInventoriesRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @instance * @returns {Object.} JSON object */ - SearchRequest.prototype.toJSON = function toJSON() { + AddLocalInventoriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - SearchRequest.FacetSpec = (function() { - - /** - * Properties of a FacetSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @interface IFacetSpec - * @property {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey|null} [facetKey] FacetSpec facetKey - * @property {number|null} [limit] FacetSpec limit - * @property {Array.|null} [excludedFilterKeys] FacetSpec excludedFilterKeys - * @property {boolean|null} [enableDynamicPosition] FacetSpec enableDynamicPosition - */ - - /** - * Constructs a new FacetSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @classdesc Represents a FacetSpec. - * @implements IFacetSpec - * @constructor - * @param {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec=} [properties] Properties to set - */ - function FacetSpec(properties) { - this.excludedFilterKeys = []; - 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]]; - } - - /** - * FacetSpec facetKey. - * @member {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey|null|undefined} facetKey - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @instance - */ - FacetSpec.prototype.facetKey = null; + return AddLocalInventoriesRequest; + })(); - /** - * FacetSpec limit. - * @member {number} limit - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @instance - */ - FacetSpec.prototype.limit = 0; + v2alpha.AddLocalInventoriesMetadata = (function() { - /** - * FacetSpec excludedFilterKeys. - * @member {Array.} excludedFilterKeys - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @instance - */ - FacetSpec.prototype.excludedFilterKeys = $util.emptyArray; + /** + * Properties of an AddLocalInventoriesMetadata. + * @memberof google.cloud.retail.v2alpha + * @interface IAddLocalInventoriesMetadata + */ - /** - * FacetSpec enableDynamicPosition. - * @member {boolean} enableDynamicPosition - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @instance - */ - FacetSpec.prototype.enableDynamicPosition = false; + /** + * Constructs a new AddLocalInventoriesMetadata. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an AddLocalInventoriesMetadata. + * @implements IAddLocalInventoriesMetadata + * @constructor + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata=} [properties] Properties to set + */ + function AddLocalInventoriesMetadata(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]]; + } - /** - * Creates a new FacetSpec instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} FacetSpec instance - */ - FacetSpec.create = function create(properties) { - return new FacetSpec(properties); - }; + /** + * Creates a new AddLocalInventoriesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @static + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata instance + */ + AddLocalInventoriesMetadata.create = function create(properties) { + return new AddLocalInventoriesMetadata(properties); + }; - /** - * Encodes the specified FacetSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec} message FacetSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.facetKey != null && Object.hasOwnProperty.call(message, "facetKey")) - $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.encode(message.facetKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.limit); - if (message.excludedFilterKeys != null && message.excludedFilterKeys.length) - for (var i = 0; i < message.excludedFilterKeys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.excludedFilterKeys[i]); - if (message.enableDynamicPosition != null && Object.hasOwnProperty.call(message, "enableDynamicPosition")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableDynamicPosition); - return writer; - }; + /** + * Encodes the specified AddLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @static + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata} message AddLocalInventoriesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddLocalInventoriesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * Encodes the specified FacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec} message FacetSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified AddLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @static + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata} message AddLocalInventoriesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddLocalInventoriesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a FacetSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @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.SearchRequest.FacetSpec} FacetSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetSpec.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.SearchRequest.FacetSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.facetKey = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.decode(reader, reader.uint32()); - break; - case 2: - message.limit = reader.int32(); - break; - case 3: - if (!(message.excludedFilterKeys && message.excludedFilterKeys.length)) - message.excludedFilterKeys = []; - message.excludedFilterKeys.push(reader.string()); - break; - case 4: - message.enableDynamicPosition = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @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.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddLocalInventoriesMetadata.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.AddLocalInventoriesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a FacetSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} FacetSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a FacetSpec message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FacetSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.facetKey != null && message.hasOwnProperty("facetKey")) { - var error = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify(message.facetKey); - if (error) - return "facetKey." + error; - } - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit)) - return "limit: integer expected"; - if (message.excludedFilterKeys != null && message.hasOwnProperty("excludedFilterKeys")) { - if (!Array.isArray(message.excludedFilterKeys)) - return "excludedFilterKeys: array expected"; - for (var i = 0; i < message.excludedFilterKeys.length; ++i) - if (!$util.isString(message.excludedFilterKeys[i])) - return "excludedFilterKeys: string[] expected"; - } - if (message.enableDynamicPosition != null && message.hasOwnProperty("enableDynamicPosition")) - if (typeof message.enableDynamicPosition !== "boolean") - return "enableDynamicPosition: boolean expected"; - return null; - }; + /** + * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddLocalInventoriesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a FacetSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} FacetSpec - */ - FacetSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec) - return object; - var message = new $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec(); - if (object.facetKey != null) { - if (typeof object.facetKey !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.facetKey: object expected"); - message.facetKey = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.fromObject(object.facetKey); - } - if (object.limit != null) - message.limit = object.limit | 0; - if (object.excludedFilterKeys) { - if (!Array.isArray(object.excludedFilterKeys)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.excludedFilterKeys: array expected"); - message.excludedFilterKeys = []; - for (var i = 0; i < object.excludedFilterKeys.length; ++i) - message.excludedFilterKeys[i] = String(object.excludedFilterKeys[i]); - } - if (object.enableDynamicPosition != null) - message.enableDynamicPosition = Boolean(object.enableDynamicPosition); - return message; - }; + /** + * Verifies an AddLocalInventoriesMetadata message. + * @function verify + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddLocalInventoriesMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - /** - * Creates a plain object from a FacetSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} message FacetSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FacetSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.excludedFilterKeys = []; - if (options.defaults) { - object.facetKey = null; - object.limit = 0; - object.enableDynamicPosition = false; - } - if (message.facetKey != null && message.hasOwnProperty("facetKey")) - object.facetKey = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.toObject(message.facetKey, options); - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = message.limit; - if (message.excludedFilterKeys && message.excludedFilterKeys.length) { - object.excludedFilterKeys = []; - for (var j = 0; j < message.excludedFilterKeys.length; ++j) - object.excludedFilterKeys[j] = message.excludedFilterKeys[j]; - } - if (message.enableDynamicPosition != null && message.hasOwnProperty("enableDynamicPosition")) - object.enableDynamicPosition = message.enableDynamicPosition; + /** + * Creates an AddLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata + */ + AddLocalInventoriesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata) return object; - }; + return new $root.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata(); + }; - /** - * Converts this FacetSpec to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @instance - * @returns {Object.} JSON object - */ - FacetSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an AddLocalInventoriesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @static + * @param {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} message AddLocalInventoriesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddLocalInventoriesMetadata.toObject = function toObject() { + return {}; + }; - FacetSpec.FacetKey = (function() { + /** + * Converts this AddLocalInventoriesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @instance + * @returns {Object.} JSON object + */ + AddLocalInventoriesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a FacetKey. - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @interface IFacetKey - * @property {string|null} [key] FacetKey key - * @property {Array.|null} [intervals] FacetKey intervals - * @property {Array.|null} [restrictedValues] FacetKey restrictedValues - * @property {Array.|null} [prefixes] FacetKey prefixes - * @property {Array.|null} [contains] FacetKey contains - * @property {string|null} [orderBy] FacetKey orderBy - * @property {string|null} [query] FacetKey query - */ + return AddLocalInventoriesMetadata; + })(); - /** - * Constructs a new FacetKey. - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @classdesc Represents a FacetKey. - * @implements IFacetKey - * @constructor - * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey=} [properties] Properties to set - */ - function FacetKey(properties) { - this.intervals = []; - this.restrictedValues = []; - this.prefixes = []; - this.contains = []; - 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]]; - } + v2alpha.AddLocalInventoriesResponse = (function() { - /** - * FacetKey key. - * @member {string} key - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.key = ""; + /** + * Properties of an AddLocalInventoriesResponse. + * @memberof google.cloud.retail.v2alpha + * @interface IAddLocalInventoriesResponse + */ - /** - * FacetKey intervals. - * @member {Array.} intervals - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.intervals = $util.emptyArray; + /** + * Constructs a new AddLocalInventoriesResponse. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an AddLocalInventoriesResponse. + * @implements IAddLocalInventoriesResponse + * @constructor + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesResponse=} [properties] Properties to set + */ + function AddLocalInventoriesResponse(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]]; + } - /** - * FacetKey restrictedValues. - * @member {Array.} restrictedValues - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.restrictedValues = $util.emptyArray; + /** + * Creates a new AddLocalInventoriesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @static + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} AddLocalInventoriesResponse instance + */ + AddLocalInventoriesResponse.create = function create(properties) { + return new AddLocalInventoriesResponse(properties); + }; - /** - * FacetKey prefixes. - * @member {Array.} prefixes - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.prefixes = $util.emptyArray; + /** + * Encodes the specified AddLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @static + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesResponse} message AddLocalInventoriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddLocalInventoriesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * FacetKey contains. - * @member {Array.} contains - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.contains = $util.emptyArray; + /** + * Encodes the specified AddLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @static + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesResponse} message AddLocalInventoriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddLocalInventoriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * FacetKey orderBy. - * @member {string} orderBy - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.orderBy = ""; + /** + * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @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.AddLocalInventoriesResponse} AddLocalInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddLocalInventoriesResponse.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.AddLocalInventoriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * FacetKey query. - * @member {string} query - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.query = ""; + /** + * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} AddLocalInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddLocalInventoriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new FacetKey instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} FacetKey instance - */ - FacetKey.create = function create(properties) { - return new FacetKey(properties); - }; + /** + * Verifies an AddLocalInventoriesResponse message. + * @function verify + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddLocalInventoriesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - /** - * Encodes the specified FacetKey message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey} message FacetKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); - if (message.intervals != null && message.intervals.length) - for (var i = 0; i < message.intervals.length; ++i) - $root.google.cloud.retail.v2alpha.Interval.encode(message.intervals[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.restrictedValues != null && message.restrictedValues.length) - for (var i = 0; i < message.restrictedValues.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.restrictedValues[i]); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.query); - if (message.prefixes != null && message.prefixes.length) - for (var i = 0; i < message.prefixes.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.prefixes[i]); - if (message.contains != null && message.contains.length) - for (var i = 0; i < message.contains.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.contains[i]); - return writer; - }; + /** + * Creates an AddLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} AddLocalInventoriesResponse + */ + AddLocalInventoriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AddLocalInventoriesResponse) + return object; + return new $root.google.cloud.retail.v2alpha.AddLocalInventoriesResponse(); + }; - /** - * Encodes the specified FacetKey message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey} message FacetKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from an AddLocalInventoriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @static + * @param {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} message AddLocalInventoriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddLocalInventoriesResponse.toObject = function toObject() { + return {}; + }; - /** - * Decodes a FacetKey message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @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.SearchRequest.FacetSpec.FacetKey} FacetKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetKey.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.SearchRequest.FacetSpec.FacetKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - if (!(message.intervals && message.intervals.length)) - message.intervals = []; - message.intervals.push($root.google.cloud.retail.v2alpha.Interval.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.restrictedValues && message.restrictedValues.length)) - message.restrictedValues = []; - message.restrictedValues.push(reader.string()); - break; - case 8: - if (!(message.prefixes && message.prefixes.length)) - message.prefixes = []; - message.prefixes.push(reader.string()); - break; - case 9: - if (!(message.contains && message.contains.length)) - message.contains = []; - message.contains.push(reader.string()); - break; - case 4: - message.orderBy = reader.string(); - break; - case 5: - message.query = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this AddLocalInventoriesResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @instance + * @returns {Object.} JSON object + */ + AddLocalInventoriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a FacetKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} FacetKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return AddLocalInventoriesResponse; + })(); - /** - * Verifies a FacetKey message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FacetKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; - if (message.intervals != null && message.hasOwnProperty("intervals")) { - if (!Array.isArray(message.intervals)) - return "intervals: array expected"; - for (var i = 0; i < message.intervals.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Interval.verify(message.intervals[i]); - if (error) - return "intervals." + error; - } - } - if (message.restrictedValues != null && message.hasOwnProperty("restrictedValues")) { - if (!Array.isArray(message.restrictedValues)) - return "restrictedValues: array expected"; - for (var i = 0; i < message.restrictedValues.length; ++i) - if (!$util.isString(message.restrictedValues[i])) - return "restrictedValues: string[] expected"; - } - if (message.prefixes != null && message.hasOwnProperty("prefixes")) { - if (!Array.isArray(message.prefixes)) - return "prefixes: array expected"; - for (var i = 0; i < message.prefixes.length; ++i) - if (!$util.isString(message.prefixes[i])) - return "prefixes: string[] expected"; - } - if (message.contains != null && message.hasOwnProperty("contains")) { - if (!Array.isArray(message.contains)) - return "contains: array expected"; - for (var i = 0; i < message.contains.length; ++i) - if (!$util.isString(message.contains[i])) - return "contains: string[] expected"; - } - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: string expected"; - return null; - }; + v2alpha.RemoveLocalInventoriesRequest = (function() { - /** - * Creates a FacetKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} FacetKey - */ - FacetKey.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey) - return object; - var message = new $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey(); - if (object.key != null) - message.key = String(object.key); - if (object.intervals) { - if (!Array.isArray(object.intervals)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals: array expected"); - message.intervals = []; - for (var i = 0; i < object.intervals.length; ++i) { - if (typeof object.intervals[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals: object expected"); - message.intervals[i] = $root.google.cloud.retail.v2alpha.Interval.fromObject(object.intervals[i]); - } - } - if (object.restrictedValues) { - if (!Array.isArray(object.restrictedValues)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.restrictedValues: array expected"); - message.restrictedValues = []; - for (var i = 0; i < object.restrictedValues.length; ++i) - message.restrictedValues[i] = String(object.restrictedValues[i]); - } - if (object.prefixes) { - if (!Array.isArray(object.prefixes)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.prefixes: array expected"); - message.prefixes = []; - for (var i = 0; i < object.prefixes.length; ++i) - message.prefixes[i] = String(object.prefixes[i]); - } - if (object.contains) { - if (!Array.isArray(object.contains)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.contains: array expected"); - message.contains = []; - for (var i = 0; i < object.contains.length; ++i) - message.contains[i] = String(object.contains[i]); - } - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.query != null) - message.query = String(object.query); - return message; - }; + /** + * Properties of a RemoveLocalInventoriesRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IRemoveLocalInventoriesRequest + * @property {string|null} [product] RemoveLocalInventoriesRequest product + * @property {Array.|null} [placeIds] RemoveLocalInventoriesRequest placeIds + * @property {google.protobuf.ITimestamp|null} [removeTime] RemoveLocalInventoriesRequest removeTime + * @property {boolean|null} [allowMissing] RemoveLocalInventoriesRequest allowMissing + */ - /** - * Creates a plain object from a FacetKey message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} message FacetKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FacetKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.intervals = []; - object.restrictedValues = []; - object.prefixes = []; - object.contains = []; - } - if (options.defaults) { - object.key = ""; - object.orderBy = ""; - object.query = ""; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.intervals && message.intervals.length) { - object.intervals = []; - for (var j = 0; j < message.intervals.length; ++j) - object.intervals[j] = $root.google.cloud.retail.v2alpha.Interval.toObject(message.intervals[j], options); - } - if (message.restrictedValues && message.restrictedValues.length) { - object.restrictedValues = []; - for (var j = 0; j < message.restrictedValues.length; ++j) - object.restrictedValues[j] = message.restrictedValues[j]; - } - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.prefixes && message.prefixes.length) { - object.prefixes = []; - for (var j = 0; j < message.prefixes.length; ++j) - object.prefixes[j] = message.prefixes[j]; - } - if (message.contains && message.contains.length) { - object.contains = []; - for (var j = 0; j < message.contains.length; ++j) - object.contains[j] = message.contains[j]; - } - return object; - }; + /** + * Constructs a new RemoveLocalInventoriesRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a RemoveLocalInventoriesRequest. + * @implements IRemoveLocalInventoriesRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest=} [properties] Properties to set + */ + function RemoveLocalInventoriesRequest(properties) { + this.placeIds = []; + 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]]; + } - /** - * Converts this FacetKey to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - * @returns {Object.} JSON object - */ - FacetKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * RemoveLocalInventoriesRequest product. + * @member {string} product + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @instance + */ + RemoveLocalInventoriesRequest.prototype.product = ""; - return FacetKey; - })(); + /** + * RemoveLocalInventoriesRequest placeIds. + * @member {Array.} placeIds + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @instance + */ + RemoveLocalInventoriesRequest.prototype.placeIds = $util.emptyArray; - return FacetSpec; - })(); + /** + * RemoveLocalInventoriesRequest removeTime. + * @member {google.protobuf.ITimestamp|null|undefined} removeTime + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @instance + */ + RemoveLocalInventoriesRequest.prototype.removeTime = null; - SearchRequest.DynamicFacetSpec = (function() { + /** + * RemoveLocalInventoriesRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @instance + */ + RemoveLocalInventoriesRequest.prototype.allowMissing = false; - /** - * Properties of a DynamicFacetSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @interface IDynamicFacetSpec - * @property {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode|null} [mode] DynamicFacetSpec mode - */ - - /** - * Constructs a new DynamicFacetSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @classdesc Represents a DynamicFacetSpec. - * @implements IDynamicFacetSpec - * @constructor - * @param {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec=} [properties] Properties to set - */ - function DynamicFacetSpec(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]]; - } - - /** - * DynamicFacetSpec mode. - * @member {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode} mode - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec - * @instance - */ - DynamicFacetSpec.prototype.mode = 0; - - /** - * Creates a new DynamicFacetSpec instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} DynamicFacetSpec instance - */ - DynamicFacetSpec.create = function create(properties) { - return new DynamicFacetSpec(properties); - }; - - /** - * Encodes the specified DynamicFacetSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec} message DynamicFacetSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DynamicFacetSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); - return writer; - }; - - /** - * Encodes the specified DynamicFacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec} message DynamicFacetSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DynamicFacetSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DynamicFacetSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec - * @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.SearchRequest.DynamicFacetSpec} DynamicFacetSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DynamicFacetSpec.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.SearchRequest.DynamicFacetSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.mode = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new RemoveLocalInventoriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @static + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest instance + */ + RemoveLocalInventoriesRequest.create = function create(properties) { + return new RemoveLocalInventoriesRequest(properties); + }; - /** - * Decodes a DynamicFacetSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} DynamicFacetSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DynamicFacetSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified RemoveLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @static + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveLocalInventoriesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); + if (message.placeIds != null && message.placeIds.length) + for (var i = 0; i < message.placeIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.placeIds[i]); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + if (message.removeTime != null && Object.hasOwnProperty.call(message, "removeTime")) + $root.google.protobuf.Timestamp.encode(message.removeTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; - /** - * Verifies a DynamicFacetSpec message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DynamicFacetSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mode != null && message.hasOwnProperty("mode")) - switch (message.mode) { - default: - return "mode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; + /** + * Encodes the specified RemoveLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @static + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveLocalInventoriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a DynamicFacetSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} DynamicFacetSpec - */ - DynamicFacetSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec) - return object; - var message = new $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec(); - switch (object.mode) { - case "MODE_UNSPECIFIED": - case 0: - message.mode = 0; - break; - case "DISABLED": + /** + * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @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.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveLocalInventoriesRequest.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.RemoveLocalInventoriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { case 1: - message.mode = 1; + message.product = reader.string(); break; - case "ENABLED": case 2: - message.mode = 2; + if (!(message.placeIds && message.placeIds.length)) + message.placeIds = []; + message.placeIds.push(reader.string()); + break; + case 5: + message.removeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.allowMissing = reader.bool(); + break; + default: + reader.skipType(tag & 7); break; } - return message; - }; - - /** - * Creates a plain object from a DynamicFacetSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} message DynamicFacetSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DynamicFacetSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; - if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode[message.mode] : message.mode; - return object; - }; + } + return message; + }; - /** - * Converts this DynamicFacetSpec to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec - * @instance - * @returns {Object.} JSON object - */ - DynamicFacetSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveLocalInventoriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Mode enum. - * @name google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode - * @enum {number} - * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value - * @property {number} DISABLED=1 DISABLED value - * @property {number} ENABLED=2 ENABLED value - */ - DynamicFacetSpec.Mode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DISABLED"] = 1; - values[valuesById[2] = "ENABLED"] = 2; - return values; - })(); + /** + * Verifies a RemoveLocalInventoriesRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveLocalInventoriesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + if (message.placeIds != null && message.hasOwnProperty("placeIds")) { + if (!Array.isArray(message.placeIds)) + return "placeIds: array expected"; + for (var i = 0; i < message.placeIds.length; ++i) + if (!$util.isString(message.placeIds[i])) + return "placeIds: string[] expected"; + } + if (message.removeTime != null && message.hasOwnProperty("removeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.removeTime); + if (error) + return "removeTime." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; - return DynamicFacetSpec; - })(); + /** + * Creates a RemoveLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest + */ + RemoveLocalInventoriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest(); + if (object.product != null) + message.product = String(object.product); + if (object.placeIds) { + if (!Array.isArray(object.placeIds)) + throw TypeError(".google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.placeIds: array expected"); + message.placeIds = []; + for (var i = 0; i < object.placeIds.length; ++i) + message.placeIds[i] = String(object.placeIds[i]); + } + if (object.removeTime != null) { + if (typeof object.removeTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.removeTime: object expected"); + message.removeTime = $root.google.protobuf.Timestamp.fromObject(object.removeTime); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; - SearchRequest.BoostSpec = (function() { + /** + * Creates a plain object from a RemoveLocalInventoriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @static + * @param {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveLocalInventoriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.placeIds = []; + if (options.defaults) { + object.product = ""; + object.allowMissing = false; + object.removeTime = null; + } + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + if (message.placeIds && message.placeIds.length) { + object.placeIds = []; + for (var j = 0; j < message.placeIds.length; ++j) + object.placeIds[j] = message.placeIds[j]; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.removeTime != null && message.hasOwnProperty("removeTime")) + object.removeTime = $root.google.protobuf.Timestamp.toObject(message.removeTime, options); + return object; + }; - /** - * Properties of a BoostSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @interface IBoostSpec - * @property {Array.|null} [conditionBoostSpecs] BoostSpec conditionBoostSpecs - */ + /** + * Converts this RemoveLocalInventoriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveLocalInventoriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new BoostSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @classdesc Represents a BoostSpec. - * @implements IBoostSpec - * @constructor - * @param {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec=} [properties] Properties to set - */ - function BoostSpec(properties) { - this.conditionBoostSpecs = []; - 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]]; - } + return RemoveLocalInventoriesRequest; + })(); - /** - * BoostSpec conditionBoostSpecs. - * @member {Array.} conditionBoostSpecs - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec - * @instance - */ - BoostSpec.prototype.conditionBoostSpecs = $util.emptyArray; + v2alpha.RemoveLocalInventoriesMetadata = (function() { - /** - * Creates a new BoostSpec instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} BoostSpec instance - */ - BoostSpec.create = function create(properties) { - return new BoostSpec(properties); - }; + /** + * Properties of a RemoveLocalInventoriesMetadata. + * @memberof google.cloud.retail.v2alpha + * @interface IRemoveLocalInventoriesMetadata + */ - /** - * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec} message BoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.conditionBoostSpecs != null && message.conditionBoostSpecs.length) - for (var i = 0; i < message.conditionBoostSpecs.length; ++i) - $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.encode(message.conditionBoostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Constructs a new RemoveLocalInventoriesMetadata. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a RemoveLocalInventoriesMetadata. + * @implements IRemoveLocalInventoriesMetadata + * @constructor + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata=} [properties] Properties to set + */ + function RemoveLocalInventoriesMetadata(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]]; + } - /** - * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec} message BoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new RemoveLocalInventoriesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @static + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata instance + */ + RemoveLocalInventoriesMetadata.create = function create(properties) { + return new RemoveLocalInventoriesMetadata(properties); + }; - /** - * Decodes a BoostSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec - * @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.SearchRequest.BoostSpec} BoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostSpec.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.SearchRequest.BoostSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.conditionBoostSpecs && message.conditionBoostSpecs.length)) - message.conditionBoostSpecs = []; - message.conditionBoostSpecs.push($root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified RemoveLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @static + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveLocalInventoriesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * Decodes a BoostSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} BoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified RemoveLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @static + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveLocalInventoriesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a BoostSpec message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoostSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.conditionBoostSpecs != null && message.hasOwnProperty("conditionBoostSpecs")) { - if (!Array.isArray(message.conditionBoostSpecs)) - return "conditionBoostSpecs: array expected"; - for (var i = 0; i < message.conditionBoostSpecs.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify(message.conditionBoostSpecs[i]); - if (error) - return "conditionBoostSpecs." + error; - } + /** + * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @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.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveLocalInventoriesMetadata.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.RemoveLocalInventoriesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; } - return null; - }; + } + return message; + }; - /** - * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} BoostSpec - */ - BoostSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec) - return object; - var message = new $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec(); - if (object.conditionBoostSpecs) { - if (!Array.isArray(object.conditionBoostSpecs)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.BoostSpec.conditionBoostSpecs: array expected"); - message.conditionBoostSpecs = []; - for (var i = 0; i < object.conditionBoostSpecs.length; ++i) { - if (typeof object.conditionBoostSpecs[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.BoostSpec.conditionBoostSpecs: object expected"); - message.conditionBoostSpecs[i] = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.fromObject(object.conditionBoostSpecs[i]); - } - } - return message; - }; + /** + * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveLocalInventoriesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} message BoostSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoostSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.conditionBoostSpecs = []; - if (message.conditionBoostSpecs && message.conditionBoostSpecs.length) { - object.conditionBoostSpecs = []; - for (var j = 0; j < message.conditionBoostSpecs.length; ++j) - object.conditionBoostSpecs[j] = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.toObject(message.conditionBoostSpecs[j], options); - } + /** + * Verifies a RemoveLocalInventoriesMetadata message. + * @function verify + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveLocalInventoriesMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RemoveLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata + */ + RemoveLocalInventoriesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata) return object; - }; + return new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata(); + }; - /** - * Converts this BoostSpec to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec - * @instance - * @returns {Object.} JSON object - */ - BoostSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a RemoveLocalInventoriesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @static + * @param {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveLocalInventoriesMetadata.toObject = function toObject() { + return {}; + }; - BoostSpec.ConditionBoostSpec = (function() { + /** + * Converts this RemoveLocalInventoriesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @instance + * @returns {Object.} JSON object + */ + RemoveLocalInventoriesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a ConditionBoostSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec - * @interface IConditionBoostSpec - * @property {string|null} [condition] ConditionBoostSpec condition - * @property {number|null} [boost] ConditionBoostSpec boost - */ + return RemoveLocalInventoriesMetadata; + })(); - /** - * Constructs a new ConditionBoostSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec - * @classdesc Represents a ConditionBoostSpec. - * @implements IConditionBoostSpec - * @constructor - * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec=} [properties] Properties to set - */ - function ConditionBoostSpec(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]]; - } + v2alpha.RemoveLocalInventoriesResponse = (function() { - /** - * ConditionBoostSpec condition. - * @member {string} condition - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec - * @instance - */ - ConditionBoostSpec.prototype.condition = ""; + /** + * Properties of a RemoveLocalInventoriesResponse. + * @memberof google.cloud.retail.v2alpha + * @interface IRemoveLocalInventoriesResponse + */ - /** - * ConditionBoostSpec boost. - * @member {number} boost - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec - * @instance - */ - ConditionBoostSpec.prototype.boost = 0; + /** + * Constructs a new RemoveLocalInventoriesResponse. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a RemoveLocalInventoriesResponse. + * @implements IRemoveLocalInventoriesResponse + * @constructor + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse=} [properties] Properties to set + */ + function RemoveLocalInventoriesResponse(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]]; + } - /** - * Creates a new ConditionBoostSpec instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec instance - */ - ConditionBoostSpec.create = function create(properties) { - return new ConditionBoostSpec(properties); - }; + /** + * Creates a new RemoveLocalInventoriesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @static + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse instance + */ + RemoveLocalInventoriesResponse.create = function create(properties) { + return new RemoveLocalInventoriesResponse(properties); + }; - /** - * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConditionBoostSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); - if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); - return writer; - }; + /** + * Encodes the specified RemoveLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @static + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveLocalInventoriesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConditionBoostSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified RemoveLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @static + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveLocalInventoriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec - * @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.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConditionBoostSpec.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.SearchRequest.BoostSpec.ConditionBoostSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.condition = reader.string(); - break; - case 2: - message.boost = reader.float(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @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.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveLocalInventoriesResponse.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.RemoveLocalInventoriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConditionBoostSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveLocalInventoriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a ConditionBoostSpec message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConditionBoostSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.condition != null && message.hasOwnProperty("condition")) - if (!$util.isString(message.condition)) - return "condition: string expected"; - if (message.boost != null && message.hasOwnProperty("boost")) - if (typeof message.boost !== "number") - return "boost: number expected"; - return null; - }; + /** + * Verifies a RemoveLocalInventoriesResponse message. + * @function verify + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveLocalInventoriesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - /** - * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec - */ - ConditionBoostSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec) - return object; - var message = new $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec(); - if (object.condition != null) - message.condition = String(object.condition); - if (object.boost != null) - message.boost = Number(object.boost); - return message; - }; - - /** - * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} message ConditionBoostSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConditionBoostSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.condition = ""; - object.boost = 0; - } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = message.condition; - if (message.boost != null && message.hasOwnProperty("boost")) - object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; - return object; - }; - - /** - * Converts this ConditionBoostSpec to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec - * @instance - * @returns {Object.} JSON object - */ - ConditionBoostSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConditionBoostSpec; - })(); - - return BoostSpec; - })(); - - SearchRequest.QueryExpansionSpec = (function() { - - /** - * Properties of a QueryExpansionSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @interface IQueryExpansionSpec - * @property {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition|null} [condition] QueryExpansionSpec condition - * @property {boolean|null} [pinUnexpandedResults] QueryExpansionSpec pinUnexpandedResults - */ - - /** - * Constructs a new QueryExpansionSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @classdesc Represents a QueryExpansionSpec. - * @implements IQueryExpansionSpec - * @constructor - * @param {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set - */ - function QueryExpansionSpec(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]]; - } - - /** - * QueryExpansionSpec condition. - * @member {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition} condition - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec - * @instance - */ - QueryExpansionSpec.prototype.condition = 0; - - /** - * QueryExpansionSpec pinUnexpandedResults. - * @member {boolean} pinUnexpandedResults - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec - * @instance - */ - QueryExpansionSpec.prototype.pinUnexpandedResults = false; - - /** - * Creates a new QueryExpansionSpec instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} QueryExpansionSpec instance - */ - QueryExpansionSpec.create = function create(properties) { - return new QueryExpansionSpec(properties); - }; - - /** - * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryExpansionSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.condition); - if (message.pinUnexpandedResults != null && Object.hasOwnProperty.call(message, "pinUnexpandedResults")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.pinUnexpandedResults); - return writer; - }; - - /** - * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryExpansionSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryExpansionSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec - * @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.SearchRequest.QueryExpansionSpec} QueryExpansionSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryExpansionSpec.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.SearchRequest.QueryExpansionSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.condition = reader.int32(); - break; - case 2: - message.pinUnexpandedResults = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} QueryExpansionSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryExpansionSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryExpansionSpec message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryExpansionSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.condition != null && message.hasOwnProperty("condition")) - switch (message.condition) { - default: - return "condition: enum value expected"; - case 0: - case 1: - case 3: - break; - } - if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) - if (typeof message.pinUnexpandedResults !== "boolean") - return "pinUnexpandedResults: boolean expected"; - return null; - }; - - /** - * Creates a QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} QueryExpansionSpec - */ - QueryExpansionSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec) - return object; - var message = new $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec(); - switch (object.condition) { - case "CONDITION_UNSPECIFIED": - case 0: - message.condition = 0; - break; - case "DISABLED": - case 1: - message.condition = 1; - break; - case "AUTO": - case 3: - message.condition = 3; - break; - } - if (object.pinUnexpandedResults != null) - message.pinUnexpandedResults = Boolean(object.pinUnexpandedResults); - return message; - }; - - /** - * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} message QueryExpansionSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryExpansionSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.condition = options.enums === String ? "CONDITION_UNSPECIFIED" : 0; - object.pinUnexpandedResults = false; - } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition[message.condition] : message.condition; - if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) - object.pinUnexpandedResults = message.pinUnexpandedResults; - return object; - }; - - /** - * Converts this QueryExpansionSpec to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec - * @instance - * @returns {Object.} JSON object - */ - QueryExpansionSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Condition enum. - * @name google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition - * @enum {number} - * @property {number} CONDITION_UNSPECIFIED=0 CONDITION_UNSPECIFIED value - * @property {number} DISABLED=1 DISABLED value - * @property {number} AUTO=3 AUTO value - */ - QueryExpansionSpec.Condition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONDITION_UNSPECIFIED"] = 0; - values[valuesById[1] = "DISABLED"] = 1; - values[valuesById[3] = "AUTO"] = 3; - return values; - })(); - - return QueryExpansionSpec; - })(); + /** + * Creates a RemoveLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse + */ + RemoveLocalInventoriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse) + return object; + return new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse(); + }; /** - * RelevanceThreshold enum. - * @name google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold - * @enum {number} - * @property {number} RELEVANCE_THRESHOLD_UNSPECIFIED=0 RELEVANCE_THRESHOLD_UNSPECIFIED value - * @property {number} HIGH=1 HIGH value - * @property {number} MEDIUM=2 MEDIUM value - * @property {number} LOW=3 LOW value - * @property {number} LOWEST=4 LOWEST value + * Creates a plain object from a RemoveLocalInventoriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @static + * @param {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - SearchRequest.RelevanceThreshold = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RELEVANCE_THRESHOLD_UNSPECIFIED"] = 0; - values[valuesById[1] = "HIGH"] = 1; - values[valuesById[2] = "MEDIUM"] = 2; - values[valuesById[3] = "LOW"] = 3; - values[valuesById[4] = "LOWEST"] = 4; - return values; - })(); + RemoveLocalInventoriesResponse.toObject = function toObject() { + return {}; + }; /** - * SearchMode enum. - * @name google.cloud.retail.v2alpha.SearchRequest.SearchMode - * @enum {number} - * @property {number} SEARCH_MODE_UNSPECIFIED=0 SEARCH_MODE_UNSPECIFIED value - * @property {number} PRODUCT_SEARCH_ONLY=1 PRODUCT_SEARCH_ONLY value - * @property {number} FACETED_SEARCH_ONLY=2 FACETED_SEARCH_ONLY value + * Converts this RemoveLocalInventoriesResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @instance + * @returns {Object.} JSON object */ - SearchRequest.SearchMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEARCH_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRODUCT_SEARCH_ONLY"] = 1; - values[valuesById[2] = "FACETED_SEARCH_ONLY"] = 2; - return values; - })(); + RemoveLocalInventoriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return SearchRequest; + return RemoveLocalInventoriesResponse; })(); - v2alpha.SearchResponse = (function() { + v2alpha.RemoveFulfillmentPlacesRequest = (function() { /** - * Properties of a SearchResponse. + * Properties of a RemoveFulfillmentPlacesRequest. * @memberof google.cloud.retail.v2alpha - * @interface ISearchResponse - * @property {Array.|null} [results] SearchResponse results - * @property {Array.|null} [facets] SearchResponse facets - * @property {number|null} [totalSize] SearchResponse totalSize - * @property {string|null} [correctedQuery] SearchResponse correctedQuery - * @property {string|null} [attributionToken] SearchResponse attributionToken - * @property {string|null} [nextPageToken] SearchResponse nextPageToken - * @property {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo|null} [queryExpansionInfo] SearchResponse queryExpansionInfo - * @property {string|null} [redirectUri] SearchResponse redirectUri - * @property {Array.|null} [appliedControls] SearchResponse appliedControls + * @interface IRemoveFulfillmentPlacesRequest + * @property {string|null} [product] RemoveFulfillmentPlacesRequest product + * @property {string|null} [type] RemoveFulfillmentPlacesRequest type + * @property {Array.|null} [placeIds] RemoveFulfillmentPlacesRequest placeIds + * @property {google.protobuf.ITimestamp|null} [removeTime] RemoveFulfillmentPlacesRequest removeTime + * @property {boolean|null} [allowMissing] RemoveFulfillmentPlacesRequest allowMissing */ /** - * Constructs a new SearchResponse. + * Constructs a new RemoveFulfillmentPlacesRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a SearchResponse. - * @implements ISearchResponse + * @classdesc Represents a RemoveFulfillmentPlacesRequest. + * @implements IRemoveFulfillmentPlacesRequest * @constructor - * @param {google.cloud.retail.v2alpha.ISearchResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest=} [properties] Properties to set */ - function SearchResponse(properties) { - this.results = []; - this.facets = []; - this.appliedControls = []; + function RemoveFulfillmentPlacesRequest(properties) { + this.placeIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -49419,188 +47844,130 @@ } /** - * SearchResponse results. - * @member {Array.} results - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @instance - */ - SearchResponse.prototype.results = $util.emptyArray; - - /** - * SearchResponse facets. - * @member {Array.} facets - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @instance - */ - SearchResponse.prototype.facets = $util.emptyArray; - - /** - * SearchResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @instance - */ - SearchResponse.prototype.totalSize = 0; - - /** - * SearchResponse correctedQuery. - * @member {string} correctedQuery - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @instance - */ - SearchResponse.prototype.correctedQuery = ""; - - /** - * SearchResponse attributionToken. - * @member {string} attributionToken - * @memberof google.cloud.retail.v2alpha.SearchResponse + * RemoveFulfillmentPlacesRequest product. + * @member {string} product + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @instance */ - SearchResponse.prototype.attributionToken = ""; + RemoveFulfillmentPlacesRequest.prototype.product = ""; /** - * SearchResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.retail.v2alpha.SearchResponse + * RemoveFulfillmentPlacesRequest type. + * @member {string} type + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @instance */ - SearchResponse.prototype.nextPageToken = ""; + RemoveFulfillmentPlacesRequest.prototype.type = ""; /** - * SearchResponse queryExpansionInfo. - * @member {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo|null|undefined} queryExpansionInfo - * @memberof google.cloud.retail.v2alpha.SearchResponse + * RemoveFulfillmentPlacesRequest placeIds. + * @member {Array.} placeIds + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @instance */ - SearchResponse.prototype.queryExpansionInfo = null; + RemoveFulfillmentPlacesRequest.prototype.placeIds = $util.emptyArray; /** - * SearchResponse redirectUri. - * @member {string} redirectUri - * @memberof google.cloud.retail.v2alpha.SearchResponse + * RemoveFulfillmentPlacesRequest removeTime. + * @member {google.protobuf.ITimestamp|null|undefined} removeTime + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @instance */ - SearchResponse.prototype.redirectUri = ""; + RemoveFulfillmentPlacesRequest.prototype.removeTime = null; /** - * SearchResponse appliedControls. - * @member {Array.} appliedControls - * @memberof google.cloud.retail.v2alpha.SearchResponse + * RemoveFulfillmentPlacesRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @instance */ - SearchResponse.prototype.appliedControls = $util.emptyArray; + RemoveFulfillmentPlacesRequest.prototype.allowMissing = false; /** - * Creates a new SearchResponse instance using the specified properties. + * Creates a new RemoveFulfillmentPlacesRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.SearchResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2alpha.ISearchResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchResponse} SearchResponse instance + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest instance */ - SearchResponse.create = function create(properties) { - return new SearchResponse(properties); + RemoveFulfillmentPlacesRequest.create = function create(properties) { + return new RemoveFulfillmentPlacesRequest(properties); }; /** - * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.verify|verify} messages. + * Encodes the specified RemoveFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.SearchResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2alpha.ISearchResponse} message SearchResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchResponse.encode = function encode(message, writer) { + RemoveFulfillmentPlacesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.results != null && message.results.length) - for (var i = 0; i < message.results.length; ++i) - $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.facets != null && message.facets.length) - for (var i = 0; i < message.facets.length; ++i) - $root.google.cloud.retail.v2alpha.SearchResponse.Facet.encode(message.facets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); - if (message.correctedQuery != null && Object.hasOwnProperty.call(message, "correctedQuery")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.correctedQuery); - if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.attributionToken); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.nextPageToken); - if (message.queryExpansionInfo != null && Object.hasOwnProperty.call(message, "queryExpansionInfo")) - $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.encode(message.queryExpansionInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.redirectUri != null && Object.hasOwnProperty.call(message, "redirectUri")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.redirectUri); - if (message.appliedControls != null && message.appliedControls.length) - for (var i = 0; i < message.appliedControls.length; ++i) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.appliedControls[i]); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.placeIds != null && message.placeIds.length) + for (var i = 0; i < message.placeIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.placeIds[i]); + if (message.removeTime != null && Object.hasOwnProperty.call(message, "removeTime")) + $root.google.protobuf.Timestamp.encode(message.removeTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); return writer; }; /** - * Encodes the specified SearchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.verify|verify} messages. + * Encodes the specified RemoveFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2alpha.ISearchResponse} message SearchResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchResponse.encodeDelimited = function encodeDelimited(message, writer) { + RemoveFulfillmentPlacesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchResponse message from the specified reader or buffer. + * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.SearchResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @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.SearchResponse} SearchResponse + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchResponse.decode = function decode(reader, length) { + RemoveFulfillmentPlacesRequest.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.SearchResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.results && message.results.length)) - message.results = []; - message.results.push($root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.decode(reader, reader.uint32())); + message.product = reader.string(); break; case 2: - if (!(message.facets && message.facets.length)) - message.facets = []; - message.facets.push($root.google.cloud.retail.v2alpha.SearchResponse.Facet.decode(reader, reader.uint32())); + message.type = reader.string(); break; case 3: - message.totalSize = reader.int32(); + if (!(message.placeIds && message.placeIds.length)) + message.placeIds = []; + message.placeIds.push(reader.string()); break; case 4: - message.correctedQuery = reader.string(); + message.removeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 5: - message.attributionToken = reader.string(); - break; - case 6: - message.nextPageToken = reader.string(); - break; - case 7: - message.queryExpansionInfo = $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.decode(reader, reader.uint32()); - break; - case 10: - message.redirectUri = reader.string(); - break; - case 12: - if (!(message.appliedControls && message.appliedControls.length)) - message.appliedControls = []; - message.appliedControls.push(reader.string()); + message.allowMissing = reader.bool(); break; default: reader.skipType(tag & 7); @@ -49611,1635 +47978,946 @@ }; /** - * Decodes a SearchResponse message from the specified reader or buffer, length delimited. + * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchResponse} SearchResponse + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchResponse.decodeDelimited = function decodeDelimited(reader) { + RemoveFulfillmentPlacesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchResponse message. + * Verifies a RemoveFulfillmentPlacesRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.SearchResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchResponse.verify = function verify(message) { + RemoveFulfillmentPlacesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.results != null && message.hasOwnProperty("results")) { - if (!Array.isArray(message.results)) - return "results: array expected"; - for (var i = 0; i < message.results.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify(message.results[i]); - if (error) - return "results." + error; - } - } - if (message.facets != null && message.hasOwnProperty("facets")) { - if (!Array.isArray(message.facets)) - return "facets: array expected"; - for (var i = 0; i < message.facets.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.verify(message.facets[i]); - if (error) - return "facets." + error; - } + if (message.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.placeIds != null && message.hasOwnProperty("placeIds")) { + if (!Array.isArray(message.placeIds)) + return "placeIds: array expected"; + for (var i = 0; i < message.placeIds.length; ++i) + if (!$util.isString(message.placeIds[i])) + return "placeIds: string[] expected"; } - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; - if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) - if (!$util.isString(message.correctedQuery)) - return "correctedQuery: string expected"; - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - if (!$util.isString(message.attributionToken)) - return "attributionToken: string expected"; - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.queryExpansionInfo != null && message.hasOwnProperty("queryExpansionInfo")) { - var error = $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify(message.queryExpansionInfo); + if (message.removeTime != null && message.hasOwnProperty("removeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.removeTime); if (error) - return "queryExpansionInfo." + error; - } - if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) - if (!$util.isString(message.redirectUri)) - return "redirectUri: string expected"; - if (message.appliedControls != null && message.hasOwnProperty("appliedControls")) { - if (!Array.isArray(message.appliedControls)) - return "appliedControls: array expected"; - for (var i = 0; i < message.appliedControls.length; ++i) - if (!$util.isString(message.appliedControls[i])) - return "appliedControls: string[] expected"; + return "removeTime." + error; } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a SearchResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchResponse} SearchResponse + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest */ - SearchResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse) + RemoveFulfillmentPlacesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.SearchResponse(); - if (object.results) { - if (!Array.isArray(object.results)) - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.results: array expected"); - message.results = []; - for (var i = 0; i < object.results.length; ++i) { - if (typeof object.results[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.results: object expected"); - message.results[i] = $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.fromObject(object.results[i]); - } - } - if (object.facets) { - if (!Array.isArray(object.facets)) - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.facets: array expected"); - message.facets = []; - for (var i = 0; i < object.facets.length; ++i) { - if (typeof object.facets[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.facets: object expected"); - message.facets[i] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.fromObject(object.facets[i]); - } - } - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; - if (object.correctedQuery != null) - message.correctedQuery = String(object.correctedQuery); - if (object.attributionToken != null) - message.attributionToken = String(object.attributionToken); - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.queryExpansionInfo != null) { - if (typeof object.queryExpansionInfo !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.queryExpansionInfo: object expected"); - message.queryExpansionInfo = $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.fromObject(object.queryExpansionInfo); + var message = new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest(); + if (object.product != null) + message.product = String(object.product); + if (object.type != null) + message.type = String(object.type); + if (object.placeIds) { + if (!Array.isArray(object.placeIds)) + throw TypeError(".google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.placeIds: array expected"); + message.placeIds = []; + for (var i = 0; i < object.placeIds.length; ++i) + message.placeIds[i] = String(object.placeIds[i]); } - if (object.redirectUri != null) - message.redirectUri = String(object.redirectUri); - if (object.appliedControls) { - if (!Array.isArray(object.appliedControls)) - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.appliedControls: array expected"); - message.appliedControls = []; - for (var i = 0; i < object.appliedControls.length; ++i) - message.appliedControls[i] = String(object.appliedControls[i]); + if (object.removeTime != null) { + if (typeof object.removeTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.removeTime: object expected"); + message.removeTime = $root.google.protobuf.Timestamp.fromObject(object.removeTime); } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. + * Creates a plain object from a RemoveFulfillmentPlacesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2alpha.SearchResponse} message SearchResponse + * @param {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchResponse.toObject = function toObject(message, options) { + RemoveFulfillmentPlacesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.results = []; - object.facets = []; - object.appliedControls = []; - } + if (options.arrays || options.defaults) + object.placeIds = []; if (options.defaults) { - object.totalSize = 0; - object.correctedQuery = ""; - object.attributionToken = ""; - object.nextPageToken = ""; - object.queryExpansionInfo = null; - object.redirectUri = ""; - } - if (message.results && message.results.length) { - object.results = []; - for (var j = 0; j < message.results.length; ++j) - object.results[j] = $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.toObject(message.results[j], options); - } - if (message.facets && message.facets.length) { - object.facets = []; - for (var j = 0; j < message.facets.length; ++j) - object.facets[j] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.toObject(message.facets[j], options); + object.product = ""; + object.type = ""; + object.removeTime = null; + object.allowMissing = false; } - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; - if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) - object.correctedQuery = message.correctedQuery; - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - object.attributionToken = message.attributionToken; - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.queryExpansionInfo != null && message.hasOwnProperty("queryExpansionInfo")) - object.queryExpansionInfo = $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.toObject(message.queryExpansionInfo, options); - if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) - object.redirectUri = message.redirectUri; - if (message.appliedControls && message.appliedControls.length) { - object.appliedControls = []; - for (var j = 0; j < message.appliedControls.length; ++j) - object.appliedControls[j] = message.appliedControls[j]; + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.placeIds && message.placeIds.length) { + object.placeIds = []; + for (var j = 0; j < message.placeIds.length; ++j) + object.placeIds[j] = message.placeIds[j]; } + if (message.removeTime != null && message.hasOwnProperty("removeTime")) + object.removeTime = $root.google.protobuf.Timestamp.toObject(message.removeTime, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; return object; }; /** - * Converts this SearchResponse to JSON. + * Converts this RemoveFulfillmentPlacesRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @instance * @returns {Object.} JSON object */ - SearchResponse.prototype.toJSON = function toJSON() { + RemoveFulfillmentPlacesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - SearchResponse.SearchResult = (function() { + return RemoveFulfillmentPlacesRequest; + })(); - /** - * Properties of a SearchResult. - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @interface ISearchResult - * @property {string|null} [id] SearchResult id - * @property {google.cloud.retail.v2alpha.IProduct|null} [product] SearchResult product - * @property {number|null} [matchingVariantCount] SearchResult matchingVariantCount - * @property {Object.|null} [matchingVariantFields] SearchResult matchingVariantFields - * @property {Object.|null} [variantRollupValues] SearchResult variantRollupValues - */ + v2alpha.RemoveFulfillmentPlacesMetadata = (function() { - /** - * Constructs a new SearchResult. - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @classdesc Represents a SearchResult. - * @implements ISearchResult - * @constructor - * @param {google.cloud.retail.v2alpha.SearchResponse.ISearchResult=} [properties] Properties to set - */ - function SearchResult(properties) { - this.matchingVariantFields = {}; - this.variantRollupValues = {}; - 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]]; - } + /** + * Properties of a RemoveFulfillmentPlacesMetadata. + * @memberof google.cloud.retail.v2alpha + * @interface IRemoveFulfillmentPlacesMetadata + */ - /** - * SearchResult id. - * @member {string} id - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @instance - */ - SearchResult.prototype.id = ""; + /** + * Constructs a new RemoveFulfillmentPlacesMetadata. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a RemoveFulfillmentPlacesMetadata. + * @implements IRemoveFulfillmentPlacesMetadata + * @constructor + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata=} [properties] Properties to set + */ + function RemoveFulfillmentPlacesMetadata(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]]; + } - /** - * SearchResult product. - * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} product - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @instance - */ - SearchResult.prototype.product = null; + /** + * Creates a new RemoveFulfillmentPlacesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @static + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata instance + */ + RemoveFulfillmentPlacesMetadata.create = function create(properties) { + return new RemoveFulfillmentPlacesMetadata(properties); + }; - /** - * SearchResult matchingVariantCount. - * @member {number} matchingVariantCount - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @instance - */ - SearchResult.prototype.matchingVariantCount = 0; + /** + * Encodes the specified RemoveFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @static + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveFulfillmentPlacesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * SearchResult matchingVariantFields. - * @member {Object.} matchingVariantFields - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @instance - */ - SearchResult.prototype.matchingVariantFields = $util.emptyObject; + /** + * Encodes the specified RemoveFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @static + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveFulfillmentPlacesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * SearchResult variantRollupValues. - * @member {Object.} variantRollupValues - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @instance - */ - SearchResult.prototype.variantRollupValues = $util.emptyObject; + /** + * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @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.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveFulfillmentPlacesMetadata.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.RemoveFulfillmentPlacesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new SearchResult instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.ISearchResult=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchResponse.SearchResult} SearchResult instance - */ - SearchResult.create = function create(properties) { - return new SearchResult(properties); - }; + /** + * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveFulfillmentPlacesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.ISearchResult} message SearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - $root.google.cloud.retail.v2alpha.Product.encode(message.product, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.matchingVariantCount != null && Object.hasOwnProperty.call(message, "matchingVariantCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.matchingVariantCount); - if (message.matchingVariantFields != null && Object.hasOwnProperty.call(message, "matchingVariantFields")) - for (var keys = Object.keys(message.matchingVariantFields), 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.protobuf.FieldMask.encode(message.matchingVariantFields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.variantRollupValues != null && Object.hasOwnProperty.call(message, "variantRollupValues")) - for (var keys = Object.keys(message.variantRollupValues), i = 0; i < keys.length; ++i) { - 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(); - } - return writer; - }; + /** + * Verifies a RemoveFulfillmentPlacesMetadata message. + * @function verify + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveFulfillmentPlacesMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - /** - * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.ISearchResult} message SearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a RemoveFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata + */ + RemoveFulfillmentPlacesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata) + return object; + return new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata(); + }; - /** - * Decodes a SearchResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @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.SearchResponse.SearchResult} SearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResult.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.SearchResponse.SearchResult(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - message.product = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); - break; - case 3: - message.matchingVariantCount = reader.int32(); - break; - case 4: - if (message.matchingVariantFields === $util.emptyObject) - message.matchingVariantFields = {}; - 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.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.matchingVariantFields[key] = value; - break; - case 5: - if (message.variantRollupValues === $util.emptyObject) - message.variantRollupValues = {}; - 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.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.variantRollupValues[key] = value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a plain object from a RemoveFulfillmentPlacesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @static + * @param {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveFulfillmentPlacesMetadata.toObject = function toObject() { + return {}; + }; - /** - * Decodes a SearchResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchResponse.SearchResult} SearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this RemoveFulfillmentPlacesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @instance + * @returns {Object.} JSON object + */ + RemoveFulfillmentPlacesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a SearchResult message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.product != null && message.hasOwnProperty("product")) { - var error = $root.google.cloud.retail.v2alpha.Product.verify(message.product); - if (error) - return "product." + error; - } - if (message.matchingVariantCount != null && message.hasOwnProperty("matchingVariantCount")) - if (!$util.isInteger(message.matchingVariantCount)) - return "matchingVariantCount: integer expected"; - if (message.matchingVariantFields != null && message.hasOwnProperty("matchingVariantFields")) { - if (!$util.isObject(message.matchingVariantFields)) - return "matchingVariantFields: object expected"; - var key = Object.keys(message.matchingVariantFields); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.FieldMask.verify(message.matchingVariantFields[key[i]]); - if (error) - return "matchingVariantFields." + error; - } - } - if (message.variantRollupValues != null && message.hasOwnProperty("variantRollupValues")) { - if (!$util.isObject(message.variantRollupValues)) - return "variantRollupValues: object expected"; - var key = Object.keys(message.variantRollupValues); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.variantRollupValues[key[i]]); - if (error) - return "variantRollupValues." + error; - } - } - return null; - }; + return RemoveFulfillmentPlacesMetadata; + })(); - /** - * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchResponse.SearchResult} SearchResult - */ - SearchResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult) - return object; - var message = new $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult(); - if (object.id != null) - message.id = String(object.id); - if (object.product != null) { - if (typeof object.product !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.product: object expected"); - message.product = $root.google.cloud.retail.v2alpha.Product.fromObject(object.product); - } - if (object.matchingVariantCount != null) - message.matchingVariantCount = object.matchingVariantCount | 0; - if (object.matchingVariantFields) { - if (typeof object.matchingVariantFields !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.matchingVariantFields: object expected"); - message.matchingVariantFields = {}; - for (var keys = Object.keys(object.matchingVariantFields), i = 0; i < keys.length; ++i) { - if (typeof object.matchingVariantFields[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.matchingVariantFields: object expected"); - message.matchingVariantFields[keys[i]] = $root.google.protobuf.FieldMask.fromObject(object.matchingVariantFields[keys[i]]); - } - } - if (object.variantRollupValues) { - if (typeof object.variantRollupValues !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.variantRollupValues: object expected"); - message.variantRollupValues = {}; - for (var keys = Object.keys(object.variantRollupValues), i = 0; i < keys.length; ++i) { - if (typeof object.variantRollupValues[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.variantRollupValues: object expected"); - message.variantRollupValues[keys[i]] = $root.google.protobuf.Value.fromObject(object.variantRollupValues[keys[i]]); - } - } - return message; - }; + v2alpha.RemoveFulfillmentPlacesResponse = (function() { - /** - * Creates a plain object from a SearchResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.SearchResult} message SearchResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.matchingVariantFields = {}; - object.variantRollupValues = {}; - } - if (options.defaults) { - object.id = ""; - object.product = null; - object.matchingVariantCount = 0; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.product != null && message.hasOwnProperty("product")) - object.product = $root.google.cloud.retail.v2alpha.Product.toObject(message.product, options); - if (message.matchingVariantCount != null && message.hasOwnProperty("matchingVariantCount")) - object.matchingVariantCount = message.matchingVariantCount; - var keys2; - if (message.matchingVariantFields && (keys2 = Object.keys(message.matchingVariantFields)).length) { - object.matchingVariantFields = {}; - for (var j = 0; j < keys2.length; ++j) - object.matchingVariantFields[keys2[j]] = $root.google.protobuf.FieldMask.toObject(message.matchingVariantFields[keys2[j]], options); - } - if (message.variantRollupValues && (keys2 = Object.keys(message.variantRollupValues)).length) { - object.variantRollupValues = {}; - for (var j = 0; j < keys2.length; ++j) - object.variantRollupValues[keys2[j]] = $root.google.protobuf.Value.toObject(message.variantRollupValues[keys2[j]], options); - } - return object; - }; + /** + * Properties of a RemoveFulfillmentPlacesResponse. + * @memberof google.cloud.retail.v2alpha + * @interface IRemoveFulfillmentPlacesResponse + */ - /** - * Converts this SearchResult to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @instance - * @returns {Object.} JSON object - */ - SearchResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new RemoveFulfillmentPlacesResponse. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a RemoveFulfillmentPlacesResponse. + * @implements IRemoveFulfillmentPlacesResponse + * @constructor + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse=} [properties] Properties to set + */ + function RemoveFulfillmentPlacesResponse(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]]; + } - return SearchResult; - })(); + /** + * Creates a new RemoveFulfillmentPlacesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @static + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse instance + */ + RemoveFulfillmentPlacesResponse.create = function create(properties) { + return new RemoveFulfillmentPlacesResponse(properties); + }; - SearchResponse.Facet = (function() { + /** + * Encodes the specified RemoveFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @static + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveFulfillmentPlacesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * Properties of a Facet. - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @interface IFacet - * @property {string|null} [key] Facet key - * @property {Array.|null} [values] Facet values - * @property {boolean|null} [dynamicFacet] Facet dynamicFacet - */ + /** + * Encodes the specified RemoveFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @static + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveFulfillmentPlacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new Facet. - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @classdesc Represents a Facet. - * @implements IFacet - * @constructor - * @param {google.cloud.retail.v2alpha.SearchResponse.IFacet=} [properties] Properties to set - */ - function Facet(properties) { - this.values = []; - 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]]; + /** + * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @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.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveFulfillmentPlacesResponse.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.RemoveFulfillmentPlacesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } } + return message; + }; - /** - * Facet key. - * @member {string} key - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @instance - */ - Facet.prototype.key = ""; - - /** - * Facet values. - * @member {Array.} values - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @instance - */ - Facet.prototype.values = $util.emptyArray; + /** + * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveFulfillmentPlacesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Facet dynamicFacet. - * @member {boolean} dynamicFacet - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @instance - */ - Facet.prototype.dynamicFacet = false; + /** + * Verifies a RemoveFulfillmentPlacesResponse message. + * @function verify + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveFulfillmentPlacesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - /** - * Creates a new Facet instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.IFacet=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet} Facet instance - */ - Facet.create = function create(properties) { - return new Facet(properties); - }; + /** + * Creates a RemoveFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + */ + RemoveFulfillmentPlacesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse) + return object; + return new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse(); + }; - /** - * Encodes the specified Facet message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.IFacet} message Facet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Facet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.encode(message.values[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.dynamicFacet != null && Object.hasOwnProperty.call(message, "dynamicFacet")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.dynamicFacet); - return writer; - }; + /** + * Creates a plain object from a RemoveFulfillmentPlacesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @static + * @param {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveFulfillmentPlacesResponse.toObject = function toObject() { + return {}; + }; - /** - * Encodes the specified Facet message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.IFacet} message Facet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Facet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this RemoveFulfillmentPlacesResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @instance + * @returns {Object.} JSON object + */ + RemoveFulfillmentPlacesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a Facet message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @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.SearchResponse.Facet} Facet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Facet.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.SearchResponse.Facet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.decode(reader, reader.uint32())); - break; - case 3: - message.dynamicFacet = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return RemoveFulfillmentPlacesResponse; + })(); - /** - * Decodes a Facet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet} Facet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Facet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + v2alpha.PurgeMetadata = (function() { - /** - * Verifies a Facet message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Facet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify(message.values[i]); - if (error) - return "values." + error; - } - } - if (message.dynamicFacet != null && message.hasOwnProperty("dynamicFacet")) - if (typeof message.dynamicFacet !== "boolean") - return "dynamicFacet: boolean expected"; - return null; - }; - - /** - * Creates a Facet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet} Facet - */ - Facet.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse.Facet) - return object; - var message = new $root.google.cloud.retail.v2alpha.SearchResponse.Facet(); - if (object.key != null) - message.key = String(object.key); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.Facet.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.Facet.values: object expected"); - message.values[i] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.fromObject(object.values[i]); - } - } - if (object.dynamicFacet != null) - message.dynamicFacet = Boolean(object.dynamicFacet); - return message; - }; + /** + * Properties of a PurgeMetadata. + * @memberof google.cloud.retail.v2alpha + * @interface IPurgeMetadata + */ - /** - * Creates a plain object from a Facet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.Facet} message Facet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Facet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (options.defaults) { - object.key = ""; - object.dynamicFacet = false; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.toObject(message.values[j], options); - } - if (message.dynamicFacet != null && message.hasOwnProperty("dynamicFacet")) - object.dynamicFacet = message.dynamicFacet; - return object; - }; + /** + * Constructs a new PurgeMetadata. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a PurgeMetadata. + * @implements IPurgeMetadata + * @constructor + * @param {google.cloud.retail.v2alpha.IPurgeMetadata=} [properties] Properties to set + */ + function PurgeMetadata(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]]; + } - /** - * Converts this Facet to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @instance - * @returns {Object.} JSON object - */ - Facet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new PurgeMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @static + * @param {google.cloud.retail.v2alpha.IPurgeMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PurgeMetadata} PurgeMetadata instance + */ + PurgeMetadata.create = function create(properties) { + return new PurgeMetadata(properties); + }; - Facet.FacetValue = (function() { + /** + * Encodes the specified PurgeMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @static + * @param {google.cloud.retail.v2alpha.IPurgeMetadata} message PurgeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * Properties of a FacetValue. - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @interface IFacetValue - * @property {string|null} [value] FacetValue value - * @property {google.cloud.retail.v2alpha.IInterval|null} [interval] FacetValue interval - * @property {number|Long|null} [count] FacetValue count - */ + /** + * Encodes the specified PurgeMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @static + * @param {google.cloud.retail.v2alpha.IPurgeMetadata} message PurgeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new FacetValue. - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @classdesc Represents a FacetValue. - * @implements IFacetValue - * @constructor - * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue=} [properties] Properties to set - */ - function FacetValue(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]]; + /** + * Decodes a PurgeMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @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.PurgeMetadata} PurgeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeMetadata.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.PurgeMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * FacetValue value. - * @member {string|null|undefined} value - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @instance - */ - FacetValue.prototype.value = null; + /** + * Decodes a PurgeMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.PurgeMetadata} PurgeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * FacetValue interval. - * @member {google.cloud.retail.v2alpha.IInterval|null|undefined} interval - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @instance - */ - FacetValue.prototype.interval = null; + /** + * Verifies a PurgeMetadata message. + * @function verify + * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurgeMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - /** - * FacetValue count. - * @member {number|Long} count - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @instance - */ - FacetValue.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Creates a PurgeMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.PurgeMetadata} PurgeMetadata + */ + PurgeMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PurgeMetadata) + return object; + return new $root.google.cloud.retail.v2alpha.PurgeMetadata(); + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Creates a plain object from a PurgeMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @static + * @param {google.cloud.retail.v2alpha.PurgeMetadata} message PurgeMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurgeMetadata.toObject = function toObject() { + return {}; + }; - /** - * FacetValue facetValue. - * @member {"value"|"interval"|undefined} facetValue - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @instance - */ - Object.defineProperty(FacetValue.prototype, "facetValue", { - get: $util.oneOfGetter($oneOfFields = ["value", "interval"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Converts this PurgeMetadata to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @instance + * @returns {Object.} JSON object + */ + PurgeMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new FacetValue instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} FacetValue instance - */ - FacetValue.create = function create(properties) { - return new FacetValue(properties); - }; + return PurgeMetadata; + })(); - /** - * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue} message FacetValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) - $root.google.cloud.retail.v2alpha.Interval.encode(message.interval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.count); - return writer; - }; + v2alpha.PurgeUserEventsRequest = (function() { - /** - * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue} message FacetValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a PurgeUserEventsRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IPurgeUserEventsRequest + * @property {string|null} [parent] PurgeUserEventsRequest parent + * @property {string|null} [filter] PurgeUserEventsRequest filter + * @property {boolean|null} [force] PurgeUserEventsRequest force + */ - /** - * Decodes a FacetValue message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @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.SearchResponse.Facet.FacetValue} FacetValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetValue.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.SearchResponse.Facet.FacetValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.string(); - break; - case 2: - message.interval = $root.google.cloud.retail.v2alpha.Interval.decode(reader, reader.uint32()); - break; - case 3: - message.count = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Constructs a new PurgeUserEventsRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a PurgeUserEventsRequest. + * @implements IPurgeUserEventsRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest=} [properties] Properties to set + */ + function PurgeUserEventsRequest(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]]; + } - /** - * Decodes a FacetValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} FacetValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * PurgeUserEventsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @instance + */ + PurgeUserEventsRequest.prototype.parent = ""; - /** - * Verifies a FacetValue message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FacetValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.value != null && message.hasOwnProperty("value")) { - properties.facetValue = 1; - if (!$util.isString(message.value)) - return "value: string expected"; - } - if (message.interval != null && message.hasOwnProperty("interval")) { - if (properties.facetValue === 1) - return "facetValue: multiple values"; - properties.facetValue = 1; - { - var error = $root.google.cloud.retail.v2alpha.Interval.verify(message.interval); - if (error) - return "interval." + error; - } - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; - return null; - }; + /** + * PurgeUserEventsRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @instance + */ + PurgeUserEventsRequest.prototype.filter = ""; - /** - * Creates a FacetValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} FacetValue - */ - FacetValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue) - return object; - var message = new $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue(); - if (object.value != null) - message.value = String(object.value); - if (object.interval != null) { - if (typeof object.interval !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.interval: object expected"); - message.interval = $root.google.cloud.retail.v2alpha.Interval.fromObject(object.interval); - } - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); - return message; - }; + /** + * PurgeUserEventsRequest force. + * @member {boolean} force + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @instance + */ + PurgeUserEventsRequest.prototype.force = false; - /** - * Creates a plain object from a FacetValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} message FacetValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FacetValue.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.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) { - object.value = message.value; - if (options.oneofs) - object.facetValue = "value"; - } - if (message.interval != null && message.hasOwnProperty("interval")) { - object.interval = $root.google.cloud.retail.v2alpha.Interval.toObject(message.interval, options); - if (options.oneofs) - object.facetValue = "interval"; - } - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - return object; - }; - - /** - * Converts this FacetValue to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @instance - * @returns {Object.} JSON object - */ - FacetValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FacetValue; - })(); - - return Facet; - })(); - - SearchResponse.QueryExpansionInfo = (function() { - - /** - * Properties of a QueryExpansionInfo. - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @interface IQueryExpansionInfo - * @property {boolean|null} [expandedQuery] QueryExpansionInfo expandedQuery - * @property {number|Long|null} [pinnedResultCount] QueryExpansionInfo pinnedResultCount - */ - - /** - * Constructs a new QueryExpansionInfo. - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @classdesc Represents a QueryExpansionInfo. - * @implements IQueryExpansionInfo - * @constructor - * @param {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo=} [properties] Properties to set - */ - function QueryExpansionInfo(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]]; - } - - /** - * QueryExpansionInfo expandedQuery. - * @member {boolean} expandedQuery - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @instance - */ - QueryExpansionInfo.prototype.expandedQuery = false; - - /** - * QueryExpansionInfo pinnedResultCount. - * @member {number|Long} pinnedResultCount - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @instance - */ - QueryExpansionInfo.prototype.pinnedResultCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new QueryExpansionInfo instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} QueryExpansionInfo instance - */ - QueryExpansionInfo.create = function create(properties) { - return new QueryExpansionInfo(properties); - }; - - /** - * Encodes the specified QueryExpansionInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo} message QueryExpansionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryExpansionInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expandedQuery != null && Object.hasOwnProperty.call(message, "expandedQuery")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandedQuery); - if (message.pinnedResultCount != null && Object.hasOwnProperty.call(message, "pinnedResultCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.pinnedResultCount); - return writer; - }; - - /** - * Encodes the specified QueryExpansionInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo} message QueryExpansionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryExpansionInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryExpansionInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @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.SearchResponse.QueryExpansionInfo} QueryExpansionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryExpansionInfo.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.SearchResponse.QueryExpansionInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.expandedQuery = reader.bool(); - break; - case 2: - message.pinnedResultCount = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryExpansionInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} QueryExpansionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryExpansionInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new PurgeUserEventsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @static + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PurgeUserEventsRequest} PurgeUserEventsRequest instance + */ + PurgeUserEventsRequest.create = function create(properties) { + return new PurgeUserEventsRequest(properties); + }; - /** - * Verifies a QueryExpansionInfo message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryExpansionInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expandedQuery != null && message.hasOwnProperty("expandedQuery")) - if (typeof message.expandedQuery !== "boolean") - return "expandedQuery: boolean expected"; - if (message.pinnedResultCount != null && message.hasOwnProperty("pinnedResultCount")) - if (!$util.isInteger(message.pinnedResultCount) && !(message.pinnedResultCount && $util.isInteger(message.pinnedResultCount.low) && $util.isInteger(message.pinnedResultCount.high))) - return "pinnedResultCount: integer|Long expected"; - return null; - }; + /** + * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @static + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeUserEventsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + return writer; + }; - /** - * Creates a QueryExpansionInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} QueryExpansionInfo - */ - QueryExpansionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo) - return object; - var message = new $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo(); - if (object.expandedQuery != null) - message.expandedQuery = Boolean(object.expandedQuery); - if (object.pinnedResultCount != null) - if ($util.Long) - (message.pinnedResultCount = $util.Long.fromValue(object.pinnedResultCount)).unsigned = false; - else if (typeof object.pinnedResultCount === "string") - message.pinnedResultCount = parseInt(object.pinnedResultCount, 10); - else if (typeof object.pinnedResultCount === "number") - message.pinnedResultCount = object.pinnedResultCount; - else if (typeof object.pinnedResultCount === "object") - message.pinnedResultCount = new $util.LongBits(object.pinnedResultCount.low >>> 0, object.pinnedResultCount.high >>> 0).toNumber(); - return message; - }; + /** + * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @static + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from a QueryExpansionInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} message QueryExpansionInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryExpansionInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expandedQuery = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.pinnedResultCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.pinnedResultCount = options.longs === String ? "0" : 0; + /** + * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @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.PurgeUserEventsRequest} PurgeUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeUserEventsRequest.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.PurgeUserEventsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.force = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.expandedQuery != null && message.hasOwnProperty("expandedQuery")) - object.expandedQuery = message.expandedQuery; - if (message.pinnedResultCount != null && message.hasOwnProperty("pinnedResultCount")) - if (typeof message.pinnedResultCount === "number") - object.pinnedResultCount = options.longs === String ? String(message.pinnedResultCount) : message.pinnedResultCount; - else - object.pinnedResultCount = options.longs === String ? $util.Long.prototype.toString.call(message.pinnedResultCount) : options.longs === Number ? new $util.LongBits(message.pinnedResultCount.low >>> 0, message.pinnedResultCount.high >>> 0).toNumber() : message.pinnedResultCount; - return object; - }; - - /** - * Converts this QueryExpansionInfo to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @instance - * @returns {Object.} JSON object - */ - QueryExpansionInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryExpansionInfo; - })(); - - return SearchResponse; - })(); - - v2alpha.UserEventService = (function() { + } + return message; + }; /** - * Constructs a new UserEventService service. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a UserEventService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * Decodes a PurgeUserEventsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.PurgeUserEventsRequest} PurgeUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - function UserEventService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (UserEventService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = UserEventService; + PurgeUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Creates new UserEventService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.retail.v2alpha.UserEventService + * Verifies a PurgeUserEventsRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {UserEventService} RPC service. Useful where requests and/or responses are streamed. + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserEventService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + PurgeUserEventsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#writeUserEvent}. - * @memberof google.cloud.retail.v2alpha.UserEventService - * @typedef WriteUserEventCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.UserEvent} [response] UserEvent + * Creates a PurgeUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.PurgeUserEventsRequest} PurgeUserEventsRequest */ + PurgeUserEventsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PurgeUserEventsRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.PurgeUserEventsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; /** - * Calls WriteUserEvent. - * @function writeUserEvent - * @memberof google.cloud.retail.v2alpha.UserEventService - * @instance - * @param {google.cloud.retail.v2alpha.IWriteUserEventRequest} request WriteUserEventRequest message or plain object - * @param {google.cloud.retail.v2alpha.UserEventService.WriteUserEventCallback} callback Node-style callback called with the error, if any, and UserEvent - * @returns {undefined} - * @variation 1 + * Creates a plain object from a PurgeUserEventsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @static + * @param {google.cloud.retail.v2alpha.PurgeUserEventsRequest} message PurgeUserEventsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(UserEventService.prototype.writeUserEvent = function writeUserEvent(request, callback) { - return this.rpcCall(writeUserEvent, $root.google.cloud.retail.v2alpha.WriteUserEventRequest, $root.google.cloud.retail.v2alpha.UserEvent, request, callback); - }, "name", { value: "WriteUserEvent" }); + PurgeUserEventsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.force = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; /** - * Calls WriteUserEvent. - * @function writeUserEvent - * @memberof google.cloud.retail.v2alpha.UserEventService + * Converts this PurgeUserEventsRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest * @instance - * @param {google.cloud.retail.v2alpha.IWriteUserEventRequest} request WriteUserEventRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + PurgeUserEventsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PurgeUserEventsRequest; + })(); + + v2alpha.PurgeUserEventsResponse = (function() { /** - * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#collectUserEvent}. - * @memberof google.cloud.retail.v2alpha.UserEventService - * @typedef CollectUserEventCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.api.HttpBody} [response] HttpBody + * Properties of a PurgeUserEventsResponse. + * @memberof google.cloud.retail.v2alpha + * @interface IPurgeUserEventsResponse + * @property {number|Long|null} [purgedEventsCount] PurgeUserEventsResponse purgedEventsCount */ /** - * Calls CollectUserEvent. - * @function collectUserEvent - * @memberof google.cloud.retail.v2alpha.UserEventService - * @instance - * @param {google.cloud.retail.v2alpha.ICollectUserEventRequest} request CollectUserEventRequest message or plain object - * @param {google.cloud.retail.v2alpha.UserEventService.CollectUserEventCallback} callback Node-style callback called with the error, if any, and HttpBody - * @returns {undefined} - * @variation 1 + * Constructs a new PurgeUserEventsResponse. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a PurgeUserEventsResponse. + * @implements IPurgeUserEventsResponse + * @constructor + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsResponse=} [properties] Properties to set */ - Object.defineProperty(UserEventService.prototype.collectUserEvent = function collectUserEvent(request, callback) { - return this.rpcCall(collectUserEvent, $root.google.cloud.retail.v2alpha.CollectUserEventRequest, $root.google.api.HttpBody, request, callback); - }, "name", { value: "CollectUserEvent" }); + function PurgeUserEventsResponse(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]]; + } /** - * Calls CollectUserEvent. - * @function collectUserEvent - * @memberof google.cloud.retail.v2alpha.UserEventService + * PurgeUserEventsResponse purgedEventsCount. + * @member {number|Long} purgedEventsCount + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @instance - * @param {google.cloud.retail.v2alpha.ICollectUserEventRequest} request CollectUserEventRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + PurgeUserEventsResponse.prototype.purgedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#purgeUserEvents}. - * @memberof google.cloud.retail.v2alpha.UserEventService - * @typedef PurgeUserEventsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls PurgeUserEvents. - * @function purgeUserEvents - * @memberof google.cloud.retail.v2alpha.UserEventService - * @instance - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest} request PurgeUserEventsRequest message or plain object - * @param {google.cloud.retail.v2alpha.UserEventService.PurgeUserEventsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UserEventService.prototype.purgeUserEvents = function purgeUserEvents(request, callback) { - return this.rpcCall(purgeUserEvents, $root.google.cloud.retail.v2alpha.PurgeUserEventsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "PurgeUserEvents" }); - - /** - * Calls PurgeUserEvents. - * @function purgeUserEvents - * @memberof google.cloud.retail.v2alpha.UserEventService - * @instance - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest} request PurgeUserEventsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#importUserEvents}. - * @memberof google.cloud.retail.v2alpha.UserEventService - * @typedef ImportUserEventsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ImportUserEvents. - * @function importUserEvents - * @memberof google.cloud.retail.v2alpha.UserEventService - * @instance - * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest} request ImportUserEventsRequest message or plain object - * @param {google.cloud.retail.v2alpha.UserEventService.ImportUserEventsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UserEventService.prototype.importUserEvents = function importUserEvents(request, callback) { - return this.rpcCall(importUserEvents, $root.google.cloud.retail.v2alpha.ImportUserEventsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportUserEvents" }); - - /** - * Calls ImportUserEvents. - * @function importUserEvents - * @memberof google.cloud.retail.v2alpha.UserEventService - * @instance - * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest} request ImportUserEventsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#rejoinUserEvents}. - * @memberof google.cloud.retail.v2alpha.UserEventService - * @typedef RejoinUserEventsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RejoinUserEvents. - * @function rejoinUserEvents - * @memberof google.cloud.retail.v2alpha.UserEventService - * @instance - * @param {google.cloud.retail.v2alpha.IRejoinUserEventsRequest} request RejoinUserEventsRequest message or plain object - * @param {google.cloud.retail.v2alpha.UserEventService.RejoinUserEventsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UserEventService.prototype.rejoinUserEvents = function rejoinUserEvents(request, callback) { - return this.rpcCall(rejoinUserEvents, $root.google.cloud.retail.v2alpha.RejoinUserEventsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RejoinUserEvents" }); - - /** - * Calls RejoinUserEvents. - * @function rejoinUserEvents - * @memberof google.cloud.retail.v2alpha.UserEventService - * @instance - * @param {google.cloud.retail.v2alpha.IRejoinUserEventsRequest} request RejoinUserEventsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return UserEventService; - })(); - - v2alpha.WriteUserEventRequest = (function() { - - /** - * Properties of a WriteUserEventRequest. - * @memberof google.cloud.retail.v2alpha - * @interface IWriteUserEventRequest - * @property {string|null} [parent] WriteUserEventRequest parent - * @property {google.cloud.retail.v2alpha.IUserEvent|null} [userEvent] WriteUserEventRequest userEvent - */ - - /** - * Constructs a new WriteUserEventRequest. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a WriteUserEventRequest. - * @implements IWriteUserEventRequest - * @constructor - * @param {google.cloud.retail.v2alpha.IWriteUserEventRequest=} [properties] Properties to set - */ - function WriteUserEventRequest(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]]; - } - - /** - * WriteUserEventRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest - * @instance - */ - WriteUserEventRequest.prototype.parent = ""; - - /** - * WriteUserEventRequest userEvent. - * @member {google.cloud.retail.v2alpha.IUserEvent|null|undefined} userEvent - * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest - * @instance - */ - WriteUserEventRequest.prototype.userEvent = null; - - /** - * Creates a new WriteUserEventRequest instance using the specified properties. + * Creates a new PurgeUserEventsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.IWriteUserEventRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.WriteUserEventRequest} WriteUserEventRequest instance + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PurgeUserEventsResponse} PurgeUserEventsResponse instance */ - WriteUserEventRequest.create = function create(properties) { - return new WriteUserEventRequest(properties); + PurgeUserEventsResponse.create = function create(properties) { + return new PurgeUserEventsResponse(properties); }; /** - * Encodes the specified WriteUserEventRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.WriteUserEventRequest.verify|verify} messages. + * Encodes the specified PurgeUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.IWriteUserEventRequest} message WriteUserEventRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsResponse} message PurgeUserEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WriteUserEventRequest.encode = function encode(message, writer) { + PurgeUserEventsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - 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.purgedEventsCount != null && Object.hasOwnProperty.call(message, "purgedEventsCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.purgedEventsCount); return writer; }; /** - * Encodes the specified WriteUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.WriteUserEventRequest.verify|verify} messages. + * Encodes the specified PurgeUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.IWriteUserEventRequest} message WriteUserEventRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsResponse} message PurgeUserEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WriteUserEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + PurgeUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WriteUserEventRequest message from the specified reader or buffer. + * Decodes a PurgeUserEventsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @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.WriteUserEventRequest} WriteUserEventRequest + * @returns {google.cloud.retail.v2alpha.PurgeUserEventsResponse} PurgeUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WriteUserEventRequest.decode = function decode(reader, length) { + PurgeUserEventsResponse.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.WriteUserEventRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PurgeUserEventsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.decode(reader, reader.uint32()); + message.purgedEventsCount = reader.int64(); break; default: reader.skipType(tag & 7); @@ -51250,124 +48928,210 @@ }; /** - * Decodes a WriteUserEventRequest message from the specified reader or buffer, length delimited. + * Decodes a PurgeUserEventsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.WriteUserEventRequest} WriteUserEventRequest + * @returns {google.cloud.retail.v2alpha.PurgeUserEventsResponse} PurgeUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WriteUserEventRequest.decodeDelimited = function decodeDelimited(reader) { + PurgeUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WriteUserEventRequest message. + * Verifies a PurgeUserEventsResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WriteUserEventRequest.verify = function verify(message) { + PurgeUserEventsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.userEvent != null && message.hasOwnProperty("userEvent")) { - var error = $root.google.cloud.retail.v2alpha.UserEvent.verify(message.userEvent); - if (error) - return "userEvent." + error; - } + if (message.purgedEventsCount != null && message.hasOwnProperty("purgedEventsCount")) + if (!$util.isInteger(message.purgedEventsCount) && !(message.purgedEventsCount && $util.isInteger(message.purgedEventsCount.low) && $util.isInteger(message.purgedEventsCount.high))) + return "purgedEventsCount: integer|Long expected"; return null; }; /** - * Creates a WriteUserEventRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeUserEventsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.WriteUserEventRequest} WriteUserEventRequest + * @returns {google.cloud.retail.v2alpha.PurgeUserEventsResponse} PurgeUserEventsResponse */ - WriteUserEventRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.WriteUserEventRequest) + PurgeUserEventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PurgeUserEventsResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.WriteUserEventRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.userEvent != null) { - if (typeof object.userEvent !== "object") - throw TypeError(".google.cloud.retail.v2alpha.WriteUserEventRequest.userEvent: object expected"); - message.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.fromObject(object.userEvent); - } + var message = new $root.google.cloud.retail.v2alpha.PurgeUserEventsResponse(); + if (object.purgedEventsCount != null) + if ($util.Long) + (message.purgedEventsCount = $util.Long.fromValue(object.purgedEventsCount)).unsigned = false; + else if (typeof object.purgedEventsCount === "string") + message.purgedEventsCount = parseInt(object.purgedEventsCount, 10); + else if (typeof object.purgedEventsCount === "number") + message.purgedEventsCount = object.purgedEventsCount; + else if (typeof object.purgedEventsCount === "object") + message.purgedEventsCount = new $util.LongBits(object.purgedEventsCount.low >>> 0, object.purgedEventsCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a WriteUserEventRequest message. Also converts values to other types if specified. + * Creates a plain object from a PurgeUserEventsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.WriteUserEventRequest} message WriteUserEventRequest + * @param {google.cloud.retail.v2alpha.PurgeUserEventsResponse} message PurgeUserEventsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WriteUserEventRequest.toObject = function toObject(message, options) { + PurgeUserEventsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.userEvent = null; - } - 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 (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.purgedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.purgedEventsCount = options.longs === String ? "0" : 0; + if (message.purgedEventsCount != null && message.hasOwnProperty("purgedEventsCount")) + if (typeof message.purgedEventsCount === "number") + object.purgedEventsCount = options.longs === String ? String(message.purgedEventsCount) : message.purgedEventsCount; + else + object.purgedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.purgedEventsCount) : options.longs === Number ? new $util.LongBits(message.purgedEventsCount.low >>> 0, message.purgedEventsCount.high >>> 0).toNumber() : message.purgedEventsCount; return object; }; /** - * Converts this WriteUserEventRequest to JSON. + * Converts this PurgeUserEventsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @instance * @returns {Object.} JSON object */ - WriteUserEventRequest.prototype.toJSON = function toJSON() { + PurgeUserEventsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return WriteUserEventRequest; + return PurgeUserEventsResponse; })(); - v2alpha.CollectUserEventRequest = (function() { + v2alpha.SearchService = (function() { /** - * Properties of a CollectUserEventRequest. + * Constructs a new SearchService service. * @memberof google.cloud.retail.v2alpha - * @interface ICollectUserEventRequest - * @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 + * @classdesc Represents a SearchService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ + function SearchService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SearchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SearchService; /** - * Constructs a new CollectUserEventRequest. + * Creates new SearchService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2alpha.SearchService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {SearchService} RPC service. Useful where requests and/or responses are streamed. + */ + SearchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.SearchService#search}. + * @memberof google.cloud.retail.v2alpha.SearchService + * @typedef SearchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.SearchResponse} [response] SearchResponse + */ + + /** + * Calls Search. + * @function search + * @memberof google.cloud.retail.v2alpha.SearchService + * @instance + * @param {google.cloud.retail.v2alpha.ISearchRequest} request SearchRequest message or plain object + * @param {google.cloud.retail.v2alpha.SearchService.SearchCallback} callback Node-style callback called with the error, if any, and SearchResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SearchService.prototype.search = function search(request, callback) { + return this.rpcCall(search, $root.google.cloud.retail.v2alpha.SearchRequest, $root.google.cloud.retail.v2alpha.SearchResponse, request, callback); + }, "name", { value: "Search" }); + + /** + * Calls Search. + * @function search + * @memberof google.cloud.retail.v2alpha.SearchService + * @instance + * @param {google.cloud.retail.v2alpha.ISearchRequest} request SearchRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SearchService; + })(); + + v2alpha.SearchRequest = (function() { + + /** + * Properties of a SearchRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CollectUserEventRequest. - * @implements ICollectUserEventRequest + * @interface ISearchRequest + * @property {string|null} [placement] SearchRequest placement + * @property {string|null} [branch] SearchRequest branch + * @property {string|null} [query] SearchRequest query + * @property {string|null} [visitorId] SearchRequest visitorId + * @property {google.cloud.retail.v2alpha.IUserInfo|null} [userInfo] SearchRequest userInfo + * @property {number|null} [pageSize] SearchRequest pageSize + * @property {string|null} [pageToken] SearchRequest pageToken + * @property {number|null} [offset] SearchRequest offset + * @property {string|null} [filter] SearchRequest filter + * @property {string|null} [canonicalFilter] SearchRequest canonicalFilter + * @property {string|null} [orderBy] SearchRequest orderBy + * @property {Array.|null} [facetSpecs] SearchRequest facetSpecs + * @property {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec|null} [dynamicFacetSpec] SearchRequest dynamicFacetSpec + * @property {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec|null} [boostSpec] SearchRequest boostSpec + * @property {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec|null} [queryExpansionSpec] SearchRequest queryExpansionSpec + * @property {google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold|null} [relevanceThreshold] SearchRequest relevanceThreshold + * @property {Array.|null} [variantRollupKeys] SearchRequest variantRollupKeys + * @property {Array.|null} [pageCategories] SearchRequest pageCategories + * @property {google.cloud.retail.v2alpha.SearchRequest.SearchMode|null} [searchMode] SearchRequest searchMode + */ + + /** + * Constructs a new SearchRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a SearchRequest. + * @implements ISearchRequest * @constructor - * @param {google.cloud.retail.v2alpha.ICollectUserEventRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ISearchRequest=} [properties] Properties to set */ - function CollectUserEventRequest(properties) { + function SearchRequest(properties) { + this.facetSpecs = []; + this.variantRollupKeys = []; + this.pageCategories = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -51375,354 +49139,318 @@ } /** - * CollectUserEventRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * SearchRequest placement. + * @member {string} placement + * @memberof google.cloud.retail.v2alpha.SearchRequest * @instance */ - CollectUserEventRequest.prototype.parent = ""; + SearchRequest.prototype.placement = ""; /** - * CollectUserEventRequest userEvent. - * @member {string} userEvent - * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * SearchRequest branch. + * @member {string} branch + * @memberof google.cloud.retail.v2alpha.SearchRequest * @instance */ - CollectUserEventRequest.prototype.userEvent = ""; + SearchRequest.prototype.branch = ""; /** - * CollectUserEventRequest uri. - * @member {string} uri - * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * SearchRequest query. + * @member {string} query + * @memberof google.cloud.retail.v2alpha.SearchRequest * @instance */ - CollectUserEventRequest.prototype.uri = ""; + SearchRequest.prototype.query = ""; /** - * CollectUserEventRequest ets. - * @member {number|Long} ets - * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * SearchRequest visitorId. + * @member {string} visitorId + * @memberof google.cloud.retail.v2alpha.SearchRequest * @instance */ - CollectUserEventRequest.prototype.ets = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + SearchRequest.prototype.visitorId = ""; /** - * Creates a new CollectUserEventRequest instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest - * @static - * @param {google.cloud.retail.v2alpha.ICollectUserEventRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CollectUserEventRequest} CollectUserEventRequest instance + * SearchRequest userInfo. + * @member {google.cloud.retail.v2alpha.IUserInfo|null|undefined} userInfo + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance */ - CollectUserEventRequest.create = function create(properties) { - return new CollectUserEventRequest(properties); - }; + SearchRequest.prototype.userInfo = null; /** - * Encodes the specified CollectUserEventRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CollectUserEventRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest - * @static - * @param {google.cloud.retail.v2alpha.ICollectUserEventRequest} message CollectUserEventRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * SearchRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance */ - CollectUserEventRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.userEvent != null && Object.hasOwnProperty.call(message, "userEvent")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.userEvent); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - 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); - return writer; - }; + SearchRequest.prototype.pageSize = 0; /** - * Encodes the specified CollectUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CollectUserEventRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest - * @static - * @param {google.cloud.retail.v2alpha.ICollectUserEventRequest} message CollectUserEventRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * SearchRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance */ - CollectUserEventRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + SearchRequest.prototype.pageToken = ""; /** - * Decodes a CollectUserEventRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest - * @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.CollectUserEventRequest} CollectUserEventRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * SearchRequest offset. + * @member {number} offset + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance */ - CollectUserEventRequest.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.CollectUserEventRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.userEvent = reader.string(); - break; - case 3: - message.uri = reader.string(); - break; - case 4: - message.ets = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + SearchRequest.prototype.offset = 0; /** - * Decodes a CollectUserEventRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CollectUserEventRequest} CollectUserEventRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * SearchRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance */ - CollectUserEventRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + SearchRequest.prototype.filter = ""; /** - * Verifies a CollectUserEventRequest message. - * @function verify - * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * SearchRequest canonicalFilter. + * @member {string} canonicalFilter + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance */ - CollectUserEventRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.userEvent != null && message.hasOwnProperty("userEvent")) - if (!$util.isString(message.userEvent)) - return "userEvent: string expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - 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"; - return null; - }; + SearchRequest.prototype.canonicalFilter = ""; /** - * Creates a CollectUserEventRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CollectUserEventRequest} CollectUserEventRequest + * SearchRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance */ - CollectUserEventRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CollectUserEventRequest) - return object; - var message = new $root.google.cloud.retail.v2alpha.CollectUserEventRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.userEvent != null) - message.userEvent = String(object.userEvent); - if (object.uri != null) - message.uri = String(object.uri); - if (object.ets != null) - if ($util.Long) - (message.ets = $util.Long.fromValue(object.ets)).unsigned = false; - else if (typeof object.ets === "string") - message.ets = parseInt(object.ets, 10); - else if (typeof object.ets === "number") - message.ets = object.ets; - else if (typeof object.ets === "object") - message.ets = new $util.LongBits(object.ets.low >>> 0, object.ets.high >>> 0).toNumber(); - return message; - }; + SearchRequest.prototype.orderBy = ""; /** - * Creates a plain object from a CollectUserEventRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest - * @static - * @param {google.cloud.retail.v2alpha.CollectUserEventRequest} message CollectUserEventRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * SearchRequest facetSpecs. + * @member {Array.} facetSpecs + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance */ - CollectUserEventRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.userEvent = ""; - object.uri = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.ets = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.ets = options.longs === String ? "0" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.userEvent != null && message.hasOwnProperty("userEvent")) - object.userEvent = message.userEvent; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - if (message.ets != null && message.hasOwnProperty("ets")) - if (typeof message.ets === "number") - 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; - return object; - }; + SearchRequest.prototype.facetSpecs = $util.emptyArray; /** - * Converts this CollectUserEventRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * SearchRequest dynamicFacetSpec. + * @member {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec|null|undefined} dynamicFacetSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest * @instance - * @returns {Object.} JSON object */ - CollectUserEventRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + SearchRequest.prototype.dynamicFacetSpec = null; - return CollectUserEventRequest; - })(); + /** + * SearchRequest boostSpec. + * @member {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec|null|undefined} boostSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.boostSpec = null; - v2alpha.RejoinUserEventsRequest = (function() { + /** + * SearchRequest queryExpansionSpec. + * @member {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec|null|undefined} queryExpansionSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.queryExpansionSpec = null; /** - * Properties of a RejoinUserEventsRequest. - * @memberof google.cloud.retail.v2alpha - * @interface IRejoinUserEventsRequest - * @property {string|null} [parent] RejoinUserEventsRequest parent - * @property {google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope|null} [userEventRejoinScope] RejoinUserEventsRequest userEventRejoinScope + * SearchRequest relevanceThreshold. + * @member {google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold} relevanceThreshold + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance */ + SearchRequest.prototype.relevanceThreshold = 0; /** - * Constructs a new RejoinUserEventsRequest. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a RejoinUserEventsRequest. - * @implements IRejoinUserEventsRequest - * @constructor - * @param {google.cloud.retail.v2alpha.IRejoinUserEventsRequest=} [properties] Properties to set + * SearchRequest variantRollupKeys. + * @member {Array.} variantRollupKeys + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance */ - function RejoinUserEventsRequest(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]]; - } + SearchRequest.prototype.variantRollupKeys = $util.emptyArray; /** - * RejoinUserEventsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest + * SearchRequest pageCategories. + * @member {Array.} pageCategories + * @memberof google.cloud.retail.v2alpha.SearchRequest * @instance */ - RejoinUserEventsRequest.prototype.parent = ""; + SearchRequest.prototype.pageCategories = $util.emptyArray; /** - * RejoinUserEventsRequest userEventRejoinScope. - * @member {google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope} userEventRejoinScope - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest + * SearchRequest searchMode. + * @member {google.cloud.retail.v2alpha.SearchRequest.SearchMode} searchMode + * @memberof google.cloud.retail.v2alpha.SearchRequest * @instance */ - RejoinUserEventsRequest.prototype.userEventRejoinScope = 0; + SearchRequest.prototype.searchMode = 0; /** - * Creates a new RejoinUserEventsRequest instance using the specified properties. + * Creates a new SearchRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest + * @memberof google.cloud.retail.v2alpha.SearchRequest * @static - * @param {google.cloud.retail.v2alpha.IRejoinUserEventsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.RejoinUserEventsRequest} RejoinUserEventsRequest instance + * @param {google.cloud.retail.v2alpha.ISearchRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchRequest} SearchRequest instance */ - RejoinUserEventsRequest.create = function create(properties) { - return new RejoinUserEventsRequest(properties); + SearchRequest.create = function create(properties) { + return new SearchRequest(properties); }; /** - * Encodes the specified RejoinUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsRequest.verify|verify} messages. + * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest + * @memberof google.cloud.retail.v2alpha.SearchRequest * @static - * @param {google.cloud.retail.v2alpha.IRejoinUserEventsRequest} message RejoinUserEventsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISearchRequest} message SearchRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RejoinUserEventsRequest.encode = function encode(message, writer) { + SearchRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.userEventRejoinScope != null && Object.hasOwnProperty.call(message, "userEventRejoinScope")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.userEventRejoinScope); + if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.placement); + if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.branch); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); + if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.visitorId); + if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) + $root.google.cloud.retail.v2alpha.UserInfo.encode(message.userInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.offset); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.orderBy); + if (message.facetSpecs != null && message.facetSpecs.length) + for (var i = 0; i < message.facetSpecs.length; ++i) + $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.encode(message.facetSpecs[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.boostSpec != null && Object.hasOwnProperty.call(message, "boostSpec")) + $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.encode(message.boostSpec, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.queryExpansionSpec != null && Object.hasOwnProperty.call(message, "queryExpansionSpec")) + $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.encode(message.queryExpansionSpec, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.relevanceThreshold != null && Object.hasOwnProperty.call(message, "relevanceThreshold")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.relevanceThreshold); + if (message.variantRollupKeys != null && message.variantRollupKeys.length) + for (var i = 0; i < message.variantRollupKeys.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.variantRollupKeys[i]); + if (message.dynamicFacetSpec != null && Object.hasOwnProperty.call(message, "dynamicFacetSpec")) + $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.encode(message.dynamicFacetSpec, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.pageCategories != null && message.pageCategories.length) + for (var i = 0; i < message.pageCategories.length; ++i) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.pageCategories[i]); + if (message.canonicalFilter != null && Object.hasOwnProperty.call(message, "canonicalFilter")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.canonicalFilter); + if (message.searchMode != null && Object.hasOwnProperty.call(message, "searchMode")) + writer.uint32(/* id 31, wireType 0 =*/248).int32(message.searchMode); return writer; }; /** - * Encodes the specified RejoinUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsRequest.verify|verify} messages. + * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest + * @memberof google.cloud.retail.v2alpha.SearchRequest * @static - * @param {google.cloud.retail.v2alpha.IRejoinUserEventsRequest} message RejoinUserEventsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISearchRequest} message SearchRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RejoinUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + SearchRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RejoinUserEventsRequest message from the specified reader or buffer. + * Decodes a SearchRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest + * @memberof google.cloud.retail.v2alpha.SearchRequest * @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.RejoinUserEventsRequest} RejoinUserEventsRequest + * @returns {google.cloud.retail.v2alpha.SearchRequest} SearchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RejoinUserEventsRequest.decode = function decode(reader, length) { + SearchRequest.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.RejoinUserEventsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.placement = reader.string(); break; case 2: - message.userEventRejoinScope = reader.int32(); + message.branch = reader.string(); + break; + case 3: + message.query = reader.string(); + break; + case 4: + message.visitorId = reader.string(); + break; + case 5: + message.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.decode(reader, reader.uint32()); + break; + case 7: + message.pageSize = reader.int32(); + break; + case 8: + message.pageToken = reader.string(); + break; + case 9: + message.offset = reader.int32(); + break; + case 10: + message.filter = reader.string(); + break; + case 28: + message.canonicalFilter = reader.string(); + break; + case 11: + message.orderBy = reader.string(); + break; + case 12: + if (!(message.facetSpecs && message.facetSpecs.length)) + message.facetSpecs = []; + message.facetSpecs.push($root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.decode(reader, reader.uint32())); + break; + case 21: + message.dynamicFacetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.decode(reader, reader.uint32()); + break; + case 13: + message.boostSpec = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.decode(reader, reader.uint32()); + break; + case 14: + message.queryExpansionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.decode(reader, reader.uint32()); + break; + case 15: + message.relevanceThreshold = reader.int32(); + break; + case 17: + if (!(message.variantRollupKeys && message.variantRollupKeys.length)) + message.variantRollupKeys = []; + message.variantRollupKeys.push(reader.string()); + break; + case 23: + if (!(message.pageCategories && message.pageCategories.length)) + message.pageCategories = []; + message.pageCategories.push(reader.string()); + break; + case 31: + message.searchMode = reader.int32(); break; default: reader.skipType(tag & 7); @@ -51733,39 +49461,120 @@ }; /** - * Decodes a RejoinUserEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest + * @memberof google.cloud.retail.v2alpha.SearchRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.RejoinUserEventsRequest} RejoinUserEventsRequest + * @returns {google.cloud.retail.v2alpha.SearchRequest} SearchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RejoinUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { + SearchRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RejoinUserEventsRequest message. + * Verifies a SearchRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest + * @memberof google.cloud.retail.v2alpha.SearchRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RejoinUserEventsRequest.verify = function verify(message) { + SearchRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.userEventRejoinScope != null && message.hasOwnProperty("userEventRejoinScope")) - switch (message.userEventRejoinScope) { + if (message.placement != null && message.hasOwnProperty("placement")) + if (!$util.isString(message.placement)) + return "placement: string expected"; + if (message.branch != null && message.hasOwnProperty("branch")) + if (!$util.isString(message.branch)) + return "branch: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + if (!$util.isString(message.visitorId)) + return "visitorId: string expected"; + if (message.userInfo != null && message.hasOwnProperty("userInfo")) { + var error = $root.google.cloud.retail.v2alpha.UserInfo.verify(message.userInfo); + if (error) + return "userInfo." + error; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) + if (!$util.isString(message.canonicalFilter)) + return "canonicalFilter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.facetSpecs != null && message.hasOwnProperty("facetSpecs")) { + if (!Array.isArray(message.facetSpecs)) + return "facetSpecs: array expected"; + for (var i = 0; i < message.facetSpecs.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify(message.facetSpecs[i]); + if (error) + return "facetSpecs." + error; + } + } + if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) { + var error = $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify(message.dynamicFacetSpec); + if (error) + return "dynamicFacetSpec." + error; + } + if (message.boostSpec != null && message.hasOwnProperty("boostSpec")) { + var error = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify(message.boostSpec); + if (error) + return "boostSpec." + error; + } + if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) { + var error = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify(message.queryExpansionSpec); + if (error) + return "queryExpansionSpec." + error; + } + if (message.relevanceThreshold != null && message.hasOwnProperty("relevanceThreshold")) + switch (message.relevanceThreshold) { default: - return "userEventRejoinScope: enum value expected"; + return "relevanceThreshold: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.variantRollupKeys != null && message.hasOwnProperty("variantRollupKeys")) { + if (!Array.isArray(message.variantRollupKeys)) + return "variantRollupKeys: array expected"; + for (var i = 0; i < message.variantRollupKeys.length; ++i) + if (!$util.isString(message.variantRollupKeys[i])) + return "variantRollupKeys: string[] expected"; + } + if (message.pageCategories != null && message.hasOwnProperty("pageCategories")) { + if (!Array.isArray(message.pageCategories)) + return "pageCategories: array expected"; + for (var i = 0; i < message.pageCategories.length; ++i) + if (!$util.isString(message.pageCategories[i])) + return "pageCategories: string[] expected"; + } + if (message.searchMode != null && message.hasOwnProperty("searchMode")) + switch (message.searchMode) { + default: + return "searchMode: enum value expected"; case 0: case 1: case 2: @@ -51775,1194 +49584,1124 @@ }; /** - * Creates a RejoinUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest + * @memberof google.cloud.retail.v2alpha.SearchRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.RejoinUserEventsRequest} RejoinUserEventsRequest + * @returns {google.cloud.retail.v2alpha.SearchRequest} SearchRequest */ - RejoinUserEventsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.RejoinUserEventsRequest) + SearchRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.RejoinUserEventsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - switch (object.userEventRejoinScope) { - case "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED": + var message = new $root.google.cloud.retail.v2alpha.SearchRequest(); + if (object.placement != null) + message.placement = String(object.placement); + if (object.branch != null) + message.branch = String(object.branch); + if (object.query != null) + message.query = String(object.query); + if (object.visitorId != null) + message.visitorId = String(object.visitorId); + if (object.userInfo != null) { + if (typeof object.userInfo !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.userInfo: object expected"); + message.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.fromObject(object.userInfo); + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.offset != null) + message.offset = object.offset | 0; + if (object.filter != null) + message.filter = String(object.filter); + if (object.canonicalFilter != null) + message.canonicalFilter = String(object.canonicalFilter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.facetSpecs) { + if (!Array.isArray(object.facetSpecs)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.facetSpecs: array expected"); + message.facetSpecs = []; + for (var i = 0; i < object.facetSpecs.length; ++i) { + if (typeof object.facetSpecs[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.facetSpecs: object expected"); + message.facetSpecs[i] = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.fromObject(object.facetSpecs[i]); + } + } + if (object.dynamicFacetSpec != null) { + if (typeof object.dynamicFacetSpec !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.dynamicFacetSpec: object expected"); + message.dynamicFacetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.fromObject(object.dynamicFacetSpec); + } + if (object.boostSpec != null) { + if (typeof object.boostSpec !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.boostSpec: object expected"); + message.boostSpec = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.fromObject(object.boostSpec); + } + if (object.queryExpansionSpec != null) { + if (typeof object.queryExpansionSpec !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.queryExpansionSpec: object expected"); + message.queryExpansionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.fromObject(object.queryExpansionSpec); + } + switch (object.relevanceThreshold) { + case "RELEVANCE_THRESHOLD_UNSPECIFIED": case 0: - message.userEventRejoinScope = 0; + message.relevanceThreshold = 0; break; - case "JOINED_EVENTS": + case "HIGH": case 1: - message.userEventRejoinScope = 1; + message.relevanceThreshold = 1; break; - case "UNJOINED_EVENTS": + case "MEDIUM": case 2: - message.userEventRejoinScope = 2; + message.relevanceThreshold = 2; + break; + case "LOW": + case 3: + message.relevanceThreshold = 3; + break; + case "LOWEST": + case 4: + message.relevanceThreshold = 4; + break; + } + if (object.variantRollupKeys) { + if (!Array.isArray(object.variantRollupKeys)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.variantRollupKeys: array expected"); + message.variantRollupKeys = []; + for (var i = 0; i < object.variantRollupKeys.length; ++i) + message.variantRollupKeys[i] = String(object.variantRollupKeys[i]); + } + if (object.pageCategories) { + if (!Array.isArray(object.pageCategories)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.pageCategories: array expected"); + message.pageCategories = []; + for (var i = 0; i < object.pageCategories.length; ++i) + message.pageCategories[i] = String(object.pageCategories[i]); + } + switch (object.searchMode) { + case "SEARCH_MODE_UNSPECIFIED": + case 0: + message.searchMode = 0; + break; + case "PRODUCT_SEARCH_ONLY": + case 1: + message.searchMode = 1; + break; + case "FACETED_SEARCH_ONLY": + case 2: + message.searchMode = 2; break; } return message; }; /** - * Creates a plain object from a RejoinUserEventsRequest message. Also converts values to other types if specified. + * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest + * @memberof google.cloud.retail.v2alpha.SearchRequest * @static - * @param {google.cloud.retail.v2alpha.RejoinUserEventsRequest} message RejoinUserEventsRequest + * @param {google.cloud.retail.v2alpha.SearchRequest} message SearchRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RejoinUserEventsRequest.toObject = function toObject(message, options) { + SearchRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.facetSpecs = []; + object.variantRollupKeys = []; + object.pageCategories = []; + } if (options.defaults) { - object.parent = ""; - object.userEventRejoinScope = options.enums === String ? "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED" : 0; + object.placement = ""; + object.branch = ""; + object.query = ""; + object.visitorId = ""; + object.userInfo = null; + object.pageSize = 0; + object.pageToken = ""; + object.offset = 0; + object.filter = ""; + object.orderBy = ""; + object.boostSpec = null; + object.queryExpansionSpec = null; + object.relevanceThreshold = options.enums === String ? "RELEVANCE_THRESHOLD_UNSPECIFIED" : 0; + object.dynamicFacetSpec = null; + object.canonicalFilter = ""; + object.searchMode = options.enums === String ? "SEARCH_MODE_UNSPECIFIED" : 0; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.userEventRejoinScope != null && message.hasOwnProperty("userEventRejoinScope")) - object.userEventRejoinScope = options.enums === String ? $root.google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope[message.userEventRejoinScope] : message.userEventRejoinScope; + if (message.placement != null && message.hasOwnProperty("placement")) + object.placement = message.placement; + if (message.branch != null && message.hasOwnProperty("branch")) + object.branch = message.branch; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + object.visitorId = message.visitorId; + if (message.userInfo != null && message.hasOwnProperty("userInfo")) + object.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.toObject(message.userInfo, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.facetSpecs && message.facetSpecs.length) { + object.facetSpecs = []; + for (var j = 0; j < message.facetSpecs.length; ++j) + object.facetSpecs[j] = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.toObject(message.facetSpecs[j], options); + } + if (message.boostSpec != null && message.hasOwnProperty("boostSpec")) + object.boostSpec = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.toObject(message.boostSpec, options); + if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) + object.queryExpansionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.toObject(message.queryExpansionSpec, options); + if (message.relevanceThreshold != null && message.hasOwnProperty("relevanceThreshold")) + object.relevanceThreshold = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold[message.relevanceThreshold] : message.relevanceThreshold; + if (message.variantRollupKeys && message.variantRollupKeys.length) { + object.variantRollupKeys = []; + for (var j = 0; j < message.variantRollupKeys.length; ++j) + object.variantRollupKeys[j] = message.variantRollupKeys[j]; + } + if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) + object.dynamicFacetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.toObject(message.dynamicFacetSpec, options); + if (message.pageCategories && message.pageCategories.length) { + object.pageCategories = []; + for (var j = 0; j < message.pageCategories.length; ++j) + object.pageCategories[j] = message.pageCategories[j]; + } + if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) + object.canonicalFilter = message.canonicalFilter; + if (message.searchMode != null && message.hasOwnProperty("searchMode")) + object.searchMode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.SearchMode[message.searchMode] : message.searchMode; return object; }; /** - * Converts this RejoinUserEventsRequest to JSON. + * Converts this SearchRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest + * @memberof google.cloud.retail.v2alpha.SearchRequest * @instance * @returns {Object.} JSON object */ - RejoinUserEventsRequest.prototype.toJSON = function toJSON() { + SearchRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * UserEventRejoinScope enum. - * @name google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope - * @enum {number} - * @property {number} USER_EVENT_REJOIN_SCOPE_UNSPECIFIED=0 USER_EVENT_REJOIN_SCOPE_UNSPECIFIED value - * @property {number} JOINED_EVENTS=1 JOINED_EVENTS value - * @property {number} UNJOINED_EVENTS=2 UNJOINED_EVENTS value - */ - RejoinUserEventsRequest.UserEventRejoinScope = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "JOINED_EVENTS"] = 1; - values[valuesById[2] = "UNJOINED_EVENTS"] = 2; - return values; - })(); + SearchRequest.FacetSpec = (function() { - return RejoinUserEventsRequest; - })(); + /** + * Properties of a FacetSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @interface IFacetSpec + * @property {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey|null} [facetKey] FacetSpec facetKey + * @property {number|null} [limit] FacetSpec limit + * @property {Array.|null} [excludedFilterKeys] FacetSpec excludedFilterKeys + * @property {boolean|null} [enableDynamicPosition] FacetSpec enableDynamicPosition + */ - v2alpha.RejoinUserEventsResponse = (function() { + /** + * Constructs a new FacetSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @classdesc Represents a FacetSpec. + * @implements IFacetSpec + * @constructor + * @param {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec=} [properties] Properties to set + */ + function FacetSpec(properties) { + this.excludedFilterKeys = []; + 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]]; + } - /** - * Properties of a RejoinUserEventsResponse. - * @memberof google.cloud.retail.v2alpha - * @interface IRejoinUserEventsResponse - * @property {number|Long|null} [rejoinedUserEventsCount] RejoinUserEventsResponse rejoinedUserEventsCount - */ + /** + * FacetSpec facetKey. + * @member {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey|null|undefined} facetKey + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @instance + */ + FacetSpec.prototype.facetKey = null; - /** - * Constructs a new RejoinUserEventsResponse. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a RejoinUserEventsResponse. - * @implements IRejoinUserEventsResponse - * @constructor - * @param {google.cloud.retail.v2alpha.IRejoinUserEventsResponse=} [properties] Properties to set - */ - function RejoinUserEventsResponse(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]]; - } + /** + * FacetSpec limit. + * @member {number} limit + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @instance + */ + FacetSpec.prototype.limit = 0; - /** - * RejoinUserEventsResponse rejoinedUserEventsCount. - * @member {number|Long} rejoinedUserEventsCount - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse - * @instance - */ - RejoinUserEventsResponse.prototype.rejoinedUserEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * FacetSpec excludedFilterKeys. + * @member {Array.} excludedFilterKeys + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @instance + */ + FacetSpec.prototype.excludedFilterKeys = $util.emptyArray; - /** - * Creates a new RejoinUserEventsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse - * @static - * @param {google.cloud.retail.v2alpha.IRejoinUserEventsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.RejoinUserEventsResponse} RejoinUserEventsResponse instance - */ - RejoinUserEventsResponse.create = function create(properties) { - return new RejoinUserEventsResponse(properties); - }; + /** + * FacetSpec enableDynamicPosition. + * @member {boolean} enableDynamicPosition + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @instance + */ + FacetSpec.prototype.enableDynamicPosition = false; - /** - * Encodes the specified RejoinUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse - * @static - * @param {google.cloud.retail.v2alpha.IRejoinUserEventsResponse} message RejoinUserEventsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RejoinUserEventsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rejoinedUserEventsCount != null && Object.hasOwnProperty.call(message, "rejoinedUserEventsCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.rejoinedUserEventsCount); - return writer; - }; + /** + * Creates a new FacetSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} FacetSpec instance + */ + FacetSpec.create = function create(properties) { + return new FacetSpec(properties); + }; - /** - * Encodes the specified RejoinUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse - * @static - * @param {google.cloud.retail.v2alpha.IRejoinUserEventsResponse} message RejoinUserEventsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RejoinUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified FacetSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec} message FacetSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.facetKey != null && Object.hasOwnProperty.call(message, "facetKey")) + $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.encode(message.facetKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.limit); + if (message.excludedFilterKeys != null && message.excludedFilterKeys.length) + for (var i = 0; i < message.excludedFilterKeys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.excludedFilterKeys[i]); + if (message.enableDynamicPosition != null && Object.hasOwnProperty.call(message, "enableDynamicPosition")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableDynamicPosition); + return writer; + }; - /** - * Decodes a RejoinUserEventsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse - * @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.RejoinUserEventsResponse} RejoinUserEventsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RejoinUserEventsResponse.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.RejoinUserEventsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.rejoinedUserEventsCount = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Encodes the specified FacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec} message FacetSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FacetSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @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.SearchRequest.FacetSpec} FacetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetSpec.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.SearchRequest.FacetSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.facetKey = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.decode(reader, reader.uint32()); + break; + case 2: + message.limit = reader.int32(); + break; + case 3: + if (!(message.excludedFilterKeys && message.excludedFilterKeys.length)) + message.excludedFilterKeys = []; + message.excludedFilterKeys.push(reader.string()); + break; + case 4: + message.enableDynamicPosition = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a RejoinUserEventsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.RejoinUserEventsResponse} RejoinUserEventsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RejoinUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a FacetSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} FacetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a RejoinUserEventsResponse message. - * @function verify - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RejoinUserEventsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rejoinedUserEventsCount != null && message.hasOwnProperty("rejoinedUserEventsCount")) - if (!$util.isInteger(message.rejoinedUserEventsCount) && !(message.rejoinedUserEventsCount && $util.isInteger(message.rejoinedUserEventsCount.low) && $util.isInteger(message.rejoinedUserEventsCount.high))) - return "rejoinedUserEventsCount: integer|Long expected"; - return null; - }; + /** + * Verifies a FacetSpec message. + * @function verify + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.facetKey != null && message.hasOwnProperty("facetKey")) { + var error = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify(message.facetKey); + if (error) + return "facetKey." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.excludedFilterKeys != null && message.hasOwnProperty("excludedFilterKeys")) { + if (!Array.isArray(message.excludedFilterKeys)) + return "excludedFilterKeys: array expected"; + for (var i = 0; i < message.excludedFilterKeys.length; ++i) + if (!$util.isString(message.excludedFilterKeys[i])) + return "excludedFilterKeys: string[] expected"; + } + if (message.enableDynamicPosition != null && message.hasOwnProperty("enableDynamicPosition")) + if (typeof message.enableDynamicPosition !== "boolean") + return "enableDynamicPosition: boolean expected"; + return null; + }; - /** - * Creates a RejoinUserEventsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.RejoinUserEventsResponse} RejoinUserEventsResponse - */ - RejoinUserEventsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.RejoinUserEventsResponse) - return object; - var message = new $root.google.cloud.retail.v2alpha.RejoinUserEventsResponse(); - if (object.rejoinedUserEventsCount != null) - if ($util.Long) - (message.rejoinedUserEventsCount = $util.Long.fromValue(object.rejoinedUserEventsCount)).unsigned = false; - else if (typeof object.rejoinedUserEventsCount === "string") - message.rejoinedUserEventsCount = parseInt(object.rejoinedUserEventsCount, 10); - else if (typeof object.rejoinedUserEventsCount === "number") - message.rejoinedUserEventsCount = object.rejoinedUserEventsCount; - else if (typeof object.rejoinedUserEventsCount === "object") - message.rejoinedUserEventsCount = new $util.LongBits(object.rejoinedUserEventsCount.low >>> 0, object.rejoinedUserEventsCount.high >>> 0).toNumber(); - return message; - }; + /** + * Creates a FacetSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} FacetSpec + */ + FacetSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec) + return object; + var message = new $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec(); + if (object.facetKey != null) { + if (typeof object.facetKey !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.facetKey: object expected"); + message.facetKey = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.fromObject(object.facetKey); + } + if (object.limit != null) + message.limit = object.limit | 0; + if (object.excludedFilterKeys) { + if (!Array.isArray(object.excludedFilterKeys)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.excludedFilterKeys: array expected"); + message.excludedFilterKeys = []; + for (var i = 0; i < object.excludedFilterKeys.length; ++i) + message.excludedFilterKeys[i] = String(object.excludedFilterKeys[i]); + } + if (object.enableDynamicPosition != null) + message.enableDynamicPosition = Boolean(object.enableDynamicPosition); + return message; + }; - /** - * Creates a plain object from a RejoinUserEventsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse - * @static - * @param {google.cloud.retail.v2alpha.RejoinUserEventsResponse} message RejoinUserEventsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RejoinUserEventsResponse.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.rejoinedUserEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.rejoinedUserEventsCount = options.longs === String ? "0" : 0; - if (message.rejoinedUserEventsCount != null && message.hasOwnProperty("rejoinedUserEventsCount")) - if (typeof message.rejoinedUserEventsCount === "number") - object.rejoinedUserEventsCount = options.longs === String ? String(message.rejoinedUserEventsCount) : message.rejoinedUserEventsCount; - else - object.rejoinedUserEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.rejoinedUserEventsCount) : options.longs === Number ? new $util.LongBits(message.rejoinedUserEventsCount.low >>> 0, message.rejoinedUserEventsCount.high >>> 0).toNumber() : message.rejoinedUserEventsCount; - return object; - }; - - /** - * Converts this RejoinUserEventsResponse to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse - * @instance - * @returns {Object.} JSON object - */ - RejoinUserEventsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RejoinUserEventsResponse; - })(); - - v2alpha.RejoinUserEventsMetadata = (function() { - - /** - * Properties of a RejoinUserEventsMetadata. - * @memberof google.cloud.retail.v2alpha - * @interface IRejoinUserEventsMetadata - */ - - /** - * Constructs a new RejoinUserEventsMetadata. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a RejoinUserEventsMetadata. - * @implements IRejoinUserEventsMetadata - * @constructor - * @param {google.cloud.retail.v2alpha.IRejoinUserEventsMetadata=} [properties] Properties to set - */ - function RejoinUserEventsMetadata(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]]; - } - - /** - * Creates a new RejoinUserEventsMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata - * @static - * @param {google.cloud.retail.v2alpha.IRejoinUserEventsMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.RejoinUserEventsMetadata} RejoinUserEventsMetadata instance - */ - RejoinUserEventsMetadata.create = function create(properties) { - return new RejoinUserEventsMetadata(properties); - }; - - /** - * Encodes the specified RejoinUserEventsMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata - * @static - * @param {google.cloud.retail.v2alpha.IRejoinUserEventsMetadata} message RejoinUserEventsMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RejoinUserEventsMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified RejoinUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata - * @static - * @param {google.cloud.retail.v2alpha.IRejoinUserEventsMetadata} message RejoinUserEventsMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RejoinUserEventsMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RejoinUserEventsMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata - * @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.RejoinUserEventsMetadata} RejoinUserEventsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RejoinUserEventsMetadata.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.RejoinUserEventsMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; + /** + * Creates a plain object from a FacetSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} message FacetSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.excludedFilterKeys = []; + if (options.defaults) { + object.facetKey = null; + object.limit = 0; + object.enableDynamicPosition = false; } - } - return message; - }; + if (message.facetKey != null && message.hasOwnProperty("facetKey")) + object.facetKey = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.toObject(message.facetKey, options); + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.excludedFilterKeys && message.excludedFilterKeys.length) { + object.excludedFilterKeys = []; + for (var j = 0; j < message.excludedFilterKeys.length; ++j) + object.excludedFilterKeys[j] = message.excludedFilterKeys[j]; + } + if (message.enableDynamicPosition != null && message.hasOwnProperty("enableDynamicPosition")) + object.enableDynamicPosition = message.enableDynamicPosition; + return object; + }; - /** - * Decodes a RejoinUserEventsMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.RejoinUserEventsMetadata} RejoinUserEventsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RejoinUserEventsMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this FacetSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @instance + * @returns {Object.} JSON object + */ + FacetSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a RejoinUserEventsMetadata message. - * @function verify - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RejoinUserEventsMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; + FacetSpec.FacetKey = (function() { - /** - * Creates a RejoinUserEventsMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.RejoinUserEventsMetadata} RejoinUserEventsMetadata - */ - RejoinUserEventsMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.RejoinUserEventsMetadata) - return object; - return new $root.google.cloud.retail.v2alpha.RejoinUserEventsMetadata(); - }; + /** + * Properties of a FacetKey. + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @interface IFacetKey + * @property {string|null} [key] FacetKey key + * @property {Array.|null} [intervals] FacetKey intervals + * @property {Array.|null} [restrictedValues] FacetKey restrictedValues + * @property {Array.|null} [prefixes] FacetKey prefixes + * @property {Array.|null} [contains] FacetKey contains + * @property {string|null} [orderBy] FacetKey orderBy + * @property {string|null} [query] FacetKey query + */ - /** - * Creates a plain object from a RejoinUserEventsMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata - * @static - * @param {google.cloud.retail.v2alpha.RejoinUserEventsMetadata} message RejoinUserEventsMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RejoinUserEventsMetadata.toObject = function toObject() { - return {}; - }; + /** + * Constructs a new FacetKey. + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @classdesc Represents a FacetKey. + * @implements IFacetKey + * @constructor + * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey=} [properties] Properties to set + */ + function FacetKey(properties) { + this.intervals = []; + this.restrictedValues = []; + this.prefixes = []; + this.contains = []; + 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]]; + } - /** - * Converts this RejoinUserEventsMetadata to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata - * @instance - * @returns {Object.} JSON object - */ - RejoinUserEventsMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * FacetKey key. + * @member {string} key + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.key = ""; - return RejoinUserEventsMetadata; - })(); + /** + * FacetKey intervals. + * @member {Array.} intervals + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.intervals = $util.emptyArray; - return v2alpha; - })(); + /** + * FacetKey restrictedValues. + * @member {Array.} restrictedValues + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.restrictedValues = $util.emptyArray; - retail.v2beta = (function() { + /** + * FacetKey prefixes. + * @member {Array.} prefixes + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.prefixes = $util.emptyArray; - /** - * Namespace v2beta. - * @memberof google.cloud.retail - * @namespace - */ - var v2beta = {}; + /** + * FacetKey contains. + * @member {Array.} contains + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.contains = $util.emptyArray; - v2beta.ProductLevelConfig = (function() { + /** + * FacetKey orderBy. + * @member {string} orderBy + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.orderBy = ""; - /** - * Properties of a ProductLevelConfig. - * @memberof google.cloud.retail.v2beta - * @interface IProductLevelConfig - * @property {string|null} [ingestionProductType] ProductLevelConfig ingestionProductType - * @property {string|null} [merchantCenterProductIdField] ProductLevelConfig merchantCenterProductIdField - */ + /** + * FacetKey query. + * @member {string} query + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.query = ""; - /** - * Constructs a new ProductLevelConfig. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a ProductLevelConfig. - * @implements IProductLevelConfig - * @constructor - * @param {google.cloud.retail.v2beta.IProductLevelConfig=} [properties] Properties to set - */ - function ProductLevelConfig(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]]; - } + /** + * Creates a new FacetKey instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} FacetKey instance + */ + FacetKey.create = function create(properties) { + return new FacetKey(properties); + }; - /** - * ProductLevelConfig ingestionProductType. - * @member {string} ingestionProductType - * @memberof google.cloud.retail.v2beta.ProductLevelConfig - * @instance - */ - ProductLevelConfig.prototype.ingestionProductType = ""; + /** + * Encodes the specified FacetKey message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey} message FacetKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.intervals != null && message.intervals.length) + for (var i = 0; i < message.intervals.length; ++i) + $root.google.cloud.retail.v2alpha.Interval.encode(message.intervals[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.restrictedValues != null && message.restrictedValues.length) + for (var i = 0; i < message.restrictedValues.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.restrictedValues[i]); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.query); + if (message.prefixes != null && message.prefixes.length) + for (var i = 0; i < message.prefixes.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.prefixes[i]); + if (message.contains != null && message.contains.length) + for (var i = 0; i < message.contains.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.contains[i]); + return writer; + }; - /** - * ProductLevelConfig merchantCenterProductIdField. - * @member {string} merchantCenterProductIdField - * @memberof google.cloud.retail.v2beta.ProductLevelConfig - * @instance - */ - ProductLevelConfig.prototype.merchantCenterProductIdField = ""; + /** + * Encodes the specified FacetKey message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey} message FacetKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new ProductLevelConfig instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.ProductLevelConfig - * @static - * @param {google.cloud.retail.v2beta.IProductLevelConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ProductLevelConfig} ProductLevelConfig instance - */ - ProductLevelConfig.create = function create(properties) { - return new ProductLevelConfig(properties); - }; + /** + * Decodes a FacetKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @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.SearchRequest.FacetSpec.FacetKey} FacetKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetKey.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.SearchRequest.FacetSpec.FacetKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + if (!(message.intervals && message.intervals.length)) + message.intervals = []; + message.intervals.push($root.google.cloud.retail.v2alpha.Interval.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.restrictedValues && message.restrictedValues.length)) + message.restrictedValues = []; + message.restrictedValues.push(reader.string()); + break; + case 8: + if (!(message.prefixes && message.prefixes.length)) + message.prefixes = []; + message.prefixes.push(reader.string()); + break; + case 9: + if (!(message.contains && message.contains.length)) + message.contains = []; + message.contains.push(reader.string()); + break; + case 4: + message.orderBy = reader.string(); + break; + case 5: + message.query = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified ProductLevelConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ProductLevelConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.ProductLevelConfig - * @static - * @param {google.cloud.retail.v2beta.IProductLevelConfig} message ProductLevelConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProductLevelConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ingestionProductType != null && Object.hasOwnProperty.call(message, "ingestionProductType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ingestionProductType); - if (message.merchantCenterProductIdField != null && Object.hasOwnProperty.call(message, "merchantCenterProductIdField")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.merchantCenterProductIdField); - return writer; - }; + /** + * Decodes a FacetKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} FacetKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified ProductLevelConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ProductLevelConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ProductLevelConfig - * @static - * @param {google.cloud.retail.v2beta.IProductLevelConfig} message ProductLevelConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProductLevelConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies a FacetKey message. + * @function verify + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.intervals != null && message.hasOwnProperty("intervals")) { + if (!Array.isArray(message.intervals)) + return "intervals: array expected"; + for (var i = 0; i < message.intervals.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Interval.verify(message.intervals[i]); + if (error) + return "intervals." + error; + } + } + if (message.restrictedValues != null && message.hasOwnProperty("restrictedValues")) { + if (!Array.isArray(message.restrictedValues)) + return "restrictedValues: array expected"; + for (var i = 0; i < message.restrictedValues.length; ++i) + if (!$util.isString(message.restrictedValues[i])) + return "restrictedValues: string[] expected"; + } + if (message.prefixes != null && message.hasOwnProperty("prefixes")) { + if (!Array.isArray(message.prefixes)) + return "prefixes: array expected"; + for (var i = 0; i < message.prefixes.length; ++i) + if (!$util.isString(message.prefixes[i])) + return "prefixes: string[] expected"; + } + if (message.contains != null && message.hasOwnProperty("contains")) { + if (!Array.isArray(message.contains)) + return "contains: array expected"; + for (var i = 0; i < message.contains.length; ++i) + if (!$util.isString(message.contains[i])) + return "contains: string[] expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + return null; + }; - /** - * Decodes a ProductLevelConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.ProductLevelConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ProductLevelConfig} ProductLevelConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProductLevelConfig.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.v2beta.ProductLevelConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ingestionProductType = reader.string(); - break; - case 2: - message.merchantCenterProductIdField = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a FacetKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} FacetKey + */ + FacetKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey) + return object; + var message = new $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey(); + if (object.key != null) + message.key = String(object.key); + if (object.intervals) { + if (!Array.isArray(object.intervals)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals: array expected"); + message.intervals = []; + for (var i = 0; i < object.intervals.length; ++i) { + if (typeof object.intervals[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals: object expected"); + message.intervals[i] = $root.google.cloud.retail.v2alpha.Interval.fromObject(object.intervals[i]); + } + } + if (object.restrictedValues) { + if (!Array.isArray(object.restrictedValues)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.restrictedValues: array expected"); + message.restrictedValues = []; + for (var i = 0; i < object.restrictedValues.length; ++i) + message.restrictedValues[i] = String(object.restrictedValues[i]); + } + if (object.prefixes) { + if (!Array.isArray(object.prefixes)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.prefixes: array expected"); + message.prefixes = []; + for (var i = 0; i < object.prefixes.length; ++i) + message.prefixes[i] = String(object.prefixes[i]); + } + if (object.contains) { + if (!Array.isArray(object.contains)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.contains: array expected"); + message.contains = []; + for (var i = 0; i < object.contains.length; ++i) + message.contains[i] = String(object.contains[i]); + } + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.query != null) + message.query = String(object.query); + return message; + }; - /** - * Decodes a ProductLevelConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ProductLevelConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ProductLevelConfig} ProductLevelConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProductLevelConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from a FacetKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} message FacetKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.intervals = []; + object.restrictedValues = []; + object.prefixes = []; + object.contains = []; + } + if (options.defaults) { + object.key = ""; + object.orderBy = ""; + object.query = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.intervals && message.intervals.length) { + object.intervals = []; + for (var j = 0; j < message.intervals.length; ++j) + object.intervals[j] = $root.google.cloud.retail.v2alpha.Interval.toObject(message.intervals[j], options); + } + if (message.restrictedValues && message.restrictedValues.length) { + object.restrictedValues = []; + for (var j = 0; j < message.restrictedValues.length; ++j) + object.restrictedValues[j] = message.restrictedValues[j]; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.prefixes && message.prefixes.length) { + object.prefixes = []; + for (var j = 0; j < message.prefixes.length; ++j) + object.prefixes[j] = message.prefixes[j]; + } + if (message.contains && message.contains.length) { + object.contains = []; + for (var j = 0; j < message.contains.length; ++j) + object.contains[j] = message.contains[j]; + } + return object; + }; - /** - * Verifies a ProductLevelConfig message. - * @function verify - * @memberof google.cloud.retail.v2beta.ProductLevelConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProductLevelConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ingestionProductType != null && message.hasOwnProperty("ingestionProductType")) - if (!$util.isString(message.ingestionProductType)) - return "ingestionProductType: string expected"; - if (message.merchantCenterProductIdField != null && message.hasOwnProperty("merchantCenterProductIdField")) - if (!$util.isString(message.merchantCenterProductIdField)) - return "merchantCenterProductIdField: string expected"; - return null; - }; + /** + * Converts this FacetKey to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + * @returns {Object.} JSON object + */ + FacetKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a ProductLevelConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.ProductLevelConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ProductLevelConfig} ProductLevelConfig - */ - ProductLevelConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ProductLevelConfig) - return object; - var message = new $root.google.cloud.retail.v2beta.ProductLevelConfig(); - if (object.ingestionProductType != null) - message.ingestionProductType = String(object.ingestionProductType); - if (object.merchantCenterProductIdField != null) - message.merchantCenterProductIdField = String(object.merchantCenterProductIdField); - return message; - }; + return FacetKey; + })(); - /** - * Creates a plain object from a ProductLevelConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.ProductLevelConfig - * @static - * @param {google.cloud.retail.v2beta.ProductLevelConfig} message ProductLevelConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProductLevelConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.ingestionProductType = ""; - object.merchantCenterProductIdField = ""; - } - if (message.ingestionProductType != null && message.hasOwnProperty("ingestionProductType")) - object.ingestionProductType = message.ingestionProductType; - if (message.merchantCenterProductIdField != null && message.hasOwnProperty("merchantCenterProductIdField")) - object.merchantCenterProductIdField = message.merchantCenterProductIdField; - return object; - }; + return FacetSpec; + })(); - /** - * Converts this ProductLevelConfig to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.ProductLevelConfig - * @instance - * @returns {Object.} JSON object - */ - ProductLevelConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + SearchRequest.DynamicFacetSpec = (function() { - return ProductLevelConfig; - })(); + /** + * Properties of a DynamicFacetSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @interface IDynamicFacetSpec + * @property {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode|null} [mode] DynamicFacetSpec mode + */ - v2beta.Catalog = (function() { + /** + * Constructs a new DynamicFacetSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @classdesc Represents a DynamicFacetSpec. + * @implements IDynamicFacetSpec + * @constructor + * @param {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec=} [properties] Properties to set + */ + function DynamicFacetSpec(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]]; + } - /** - * Properties of a Catalog. - * @memberof google.cloud.retail.v2beta - * @interface ICatalog - * @property {string|null} [name] Catalog name - * @property {string|null} [displayName] Catalog displayName - * @property {google.cloud.retail.v2beta.IProductLevelConfig|null} [productLevelConfig] Catalog productLevelConfig - */ + /** + * DynamicFacetSpec mode. + * @member {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode} mode + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @instance + */ + DynamicFacetSpec.prototype.mode = 0; - /** - * Constructs a new Catalog. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a Catalog. - * @implements ICatalog - * @constructor - * @param {google.cloud.retail.v2beta.ICatalog=} [properties] Properties to set - */ - function Catalog(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]]; - } + /** + * Creates a new DynamicFacetSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} DynamicFacetSpec instance + */ + DynamicFacetSpec.create = function create(properties) { + return new DynamicFacetSpec(properties); + }; - /** - * Catalog name. - * @member {string} name - * @memberof google.cloud.retail.v2beta.Catalog - * @instance - */ - Catalog.prototype.name = ""; + /** + * Encodes the specified DynamicFacetSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec} message DynamicFacetSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DynamicFacetSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + return writer; + }; - /** - * Catalog displayName. - * @member {string} displayName - * @memberof google.cloud.retail.v2beta.Catalog - * @instance - */ - Catalog.prototype.displayName = ""; + /** + * Encodes the specified DynamicFacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec} message DynamicFacetSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DynamicFacetSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Catalog productLevelConfig. - * @member {google.cloud.retail.v2beta.IProductLevelConfig|null|undefined} productLevelConfig - * @memberof google.cloud.retail.v2beta.Catalog - * @instance - */ - Catalog.prototype.productLevelConfig = null; + /** + * Decodes a DynamicFacetSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @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.SearchRequest.DynamicFacetSpec} DynamicFacetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DynamicFacetSpec.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.SearchRequest.DynamicFacetSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new Catalog instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.Catalog - * @static - * @param {google.cloud.retail.v2beta.ICatalog=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Catalog} Catalog instance - */ - Catalog.create = function create(properties) { - return new Catalog(properties); - }; + /** + * Decodes a DynamicFacetSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} DynamicFacetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DynamicFacetSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified Catalog message. Does not implicitly {@link google.cloud.retail.v2beta.Catalog.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.Catalog - * @static - * @param {google.cloud.retail.v2beta.ICatalog} message Catalog message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Catalog.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.productLevelConfig != null && Object.hasOwnProperty.call(message, "productLevelConfig")) - $root.google.cloud.retail.v2beta.ProductLevelConfig.encode(message.productLevelConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * Verifies a DynamicFacetSpec message. + * @function verify + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DynamicFacetSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; - /** - * Encodes the specified Catalog message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Catalog.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Catalog - * @static - * @param {google.cloud.retail.v2beta.ICatalog} message Catalog message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Catalog.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Catalog message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.Catalog - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Catalog} Catalog - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Catalog.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.v2beta.Catalog(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { + /** + * Creates a DynamicFacetSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} DynamicFacetSpec + */ + DynamicFacetSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec) + return object; + var message = new $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec(); + switch (object.mode) { + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "DISABLED": case 1: - message.name = reader.string(); + message.mode = 1; break; + case "ENABLED": case 2: - message.displayName = reader.string(); - break; - case 4: - message.productLevelConfig = $root.google.cloud.retail.v2beta.ProductLevelConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); + message.mode = 2; break; } - } - return message; - }; - - /** - * Decodes a Catalog message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Catalog - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Catalog} Catalog - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Catalog.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Catalog message. - * @function verify - * @memberof google.cloud.retail.v2beta.Catalog - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Catalog.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.productLevelConfig != null && message.hasOwnProperty("productLevelConfig")) { - var error = $root.google.cloud.retail.v2beta.ProductLevelConfig.verify(message.productLevelConfig); - if (error) - return "productLevelConfig." + error; - } - return null; - }; + return message; + }; - /** - * Creates a Catalog message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.Catalog - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Catalog} Catalog - */ - Catalog.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Catalog) + /** + * Creates a plain object from a DynamicFacetSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} message DynamicFacetSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DynamicFacetSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode[message.mode] : message.mode; return object; - var message = new $root.google.cloud.retail.v2beta.Catalog(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.productLevelConfig != null) { - if (typeof object.productLevelConfig !== "object") - throw TypeError(".google.cloud.retail.v2beta.Catalog.productLevelConfig: object expected"); - message.productLevelConfig = $root.google.cloud.retail.v2beta.ProductLevelConfig.fromObject(object.productLevelConfig); - } - return message; - }; - - /** - * Creates a plain object from a Catalog message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.Catalog - * @static - * @param {google.cloud.retail.v2beta.Catalog} message Catalog - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Catalog.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.productLevelConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.productLevelConfig != null && message.hasOwnProperty("productLevelConfig")) - object.productLevelConfig = $root.google.cloud.retail.v2beta.ProductLevelConfig.toObject(message.productLevelConfig, options); - return object; - }; - - /** - * Converts this Catalog to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.Catalog - * @instance - * @returns {Object.} JSON object - */ - Catalog.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Catalog; - })(); - - /** - * SolutionType enum. - * @name google.cloud.retail.v2beta.SolutionType - * @enum {number} - * @property {number} SOLUTION_TYPE_UNSPECIFIED=0 SOLUTION_TYPE_UNSPECIFIED value - * @property {number} SOLUTION_TYPE_RECOMMENDATION=1 SOLUTION_TYPE_RECOMMENDATION value - * @property {number} SOLUTION_TYPE_SEARCH=2 SOLUTION_TYPE_SEARCH value - */ - v2beta.SolutionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SOLUTION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SOLUTION_TYPE_RECOMMENDATION"] = 1; - values[valuesById[2] = "SOLUTION_TYPE_SEARCH"] = 2; - return values; - })(); - - v2beta.Condition = (function() { - - /** - * Properties of a Condition. - * @memberof google.cloud.retail.v2beta - * @interface ICondition - * @property {Array.|null} [queryTerms] Condition queryTerms - * @property {Array.|null} [activeTimeRange] Condition activeTimeRange - */ - - /** - * Constructs a new Condition. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a Condition. - * @implements ICondition - * @constructor - * @param {google.cloud.retail.v2beta.ICondition=} [properties] Properties to set - */ - function Condition(properties) { - this.queryTerms = []; - this.activeTimeRange = []; - 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]]; - } - - /** - * Condition queryTerms. - * @member {Array.} queryTerms - * @memberof google.cloud.retail.v2beta.Condition - * @instance - */ - Condition.prototype.queryTerms = $util.emptyArray; - - /** - * Condition activeTimeRange. - * @member {Array.} activeTimeRange - * @memberof google.cloud.retail.v2beta.Condition - * @instance - */ - Condition.prototype.activeTimeRange = $util.emptyArray; - - /** - * Creates a new Condition instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.Condition - * @static - * @param {google.cloud.retail.v2beta.ICondition=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Condition} Condition instance - */ - Condition.create = function create(properties) { - return new Condition(properties); - }; - - /** - * Encodes the specified Condition message. Does not implicitly {@link google.cloud.retail.v2beta.Condition.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.Condition - * @static - * @param {google.cloud.retail.v2beta.ICondition} message Condition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Condition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queryTerms != null && message.queryTerms.length) - for (var i = 0; i < message.queryTerms.length; ++i) - $root.google.cloud.retail.v2beta.Condition.QueryTerm.encode(message.queryTerms[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.activeTimeRange != null && message.activeTimeRange.length) - for (var i = 0; i < message.activeTimeRange.length; ++i) - $root.google.cloud.retail.v2beta.Condition.TimeRange.encode(message.activeTimeRange[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Condition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Condition - * @static - * @param {google.cloud.retail.v2beta.ICondition} message Condition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Condition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Condition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.Condition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Condition} Condition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Condition.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.v2beta.Condition(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.queryTerms && message.queryTerms.length)) - message.queryTerms = []; - message.queryTerms.push($root.google.cloud.retail.v2beta.Condition.QueryTerm.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.activeTimeRange && message.activeTimeRange.length)) - message.activeTimeRange = []; - message.activeTimeRange.push($root.google.cloud.retail.v2beta.Condition.TimeRange.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Condition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Condition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Condition} Condition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Condition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Condition message. - * @function verify - * @memberof google.cloud.retail.v2beta.Condition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Condition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { - if (!Array.isArray(message.queryTerms)) - return "queryTerms: array expected"; - for (var i = 0; i < message.queryTerms.length; ++i) { - var error = $root.google.cloud.retail.v2beta.Condition.QueryTerm.verify(message.queryTerms[i]); - if (error) - return "queryTerms." + error; - } - } - if (message.activeTimeRange != null && message.hasOwnProperty("activeTimeRange")) { - if (!Array.isArray(message.activeTimeRange)) - return "activeTimeRange: array expected"; - for (var i = 0; i < message.activeTimeRange.length; ++i) { - var error = $root.google.cloud.retail.v2beta.Condition.TimeRange.verify(message.activeTimeRange[i]); - if (error) - return "activeTimeRange." + error; - } - } - return null; - }; + }; - /** - * Creates a Condition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.Condition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Condition} Condition - */ - Condition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Condition) - return object; - var message = new $root.google.cloud.retail.v2beta.Condition(); - if (object.queryTerms) { - if (!Array.isArray(object.queryTerms)) - throw TypeError(".google.cloud.retail.v2beta.Condition.queryTerms: array expected"); - message.queryTerms = []; - for (var i = 0; i < object.queryTerms.length; ++i) { - if (typeof object.queryTerms[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.Condition.queryTerms: object expected"); - message.queryTerms[i] = $root.google.cloud.retail.v2beta.Condition.QueryTerm.fromObject(object.queryTerms[i]); - } - } - if (object.activeTimeRange) { - if (!Array.isArray(object.activeTimeRange)) - throw TypeError(".google.cloud.retail.v2beta.Condition.activeTimeRange: array expected"); - message.activeTimeRange = []; - for (var i = 0; i < object.activeTimeRange.length; ++i) { - if (typeof object.activeTimeRange[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.Condition.activeTimeRange: object expected"); - message.activeTimeRange[i] = $root.google.cloud.retail.v2beta.Condition.TimeRange.fromObject(object.activeTimeRange[i]); - } - } - return message; - }; + /** + * Converts this DynamicFacetSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @instance + * @returns {Object.} JSON object + */ + DynamicFacetSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from a Condition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.Condition - * @static - * @param {google.cloud.retail.v2beta.Condition} message Condition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Condition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.queryTerms = []; - object.activeTimeRange = []; - } - if (message.queryTerms && message.queryTerms.length) { - object.queryTerms = []; - for (var j = 0; j < message.queryTerms.length; ++j) - object.queryTerms[j] = $root.google.cloud.retail.v2beta.Condition.QueryTerm.toObject(message.queryTerms[j], options); - } - if (message.activeTimeRange && message.activeTimeRange.length) { - object.activeTimeRange = []; - for (var j = 0; j < message.activeTimeRange.length; ++j) - object.activeTimeRange[j] = $root.google.cloud.retail.v2beta.Condition.TimeRange.toObject(message.activeTimeRange[j], options); - } - return object; - }; + /** + * Mode enum. + * @name google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} ENABLED=2 ENABLED value + */ + DynamicFacetSpec.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[2] = "ENABLED"] = 2; + return values; + })(); - /** - * Converts this Condition to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.Condition - * @instance - * @returns {Object.} JSON object - */ - Condition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return DynamicFacetSpec; + })(); - Condition.QueryTerm = (function() { + SearchRequest.BoostSpec = (function() { /** - * Properties of a QueryTerm. - * @memberof google.cloud.retail.v2beta.Condition - * @interface IQueryTerm - * @property {string|null} [value] QueryTerm value - * @property {boolean|null} [fullMatch] QueryTerm fullMatch + * Properties of a BoostSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @interface IBoostSpec + * @property {Array.|null} [conditionBoostSpecs] BoostSpec conditionBoostSpecs */ /** - * Constructs a new QueryTerm. - * @memberof google.cloud.retail.v2beta.Condition - * @classdesc Represents a QueryTerm. - * @implements IQueryTerm + * Constructs a new BoostSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @classdesc Represents a BoostSpec. + * @implements IBoostSpec * @constructor - * @param {google.cloud.retail.v2beta.Condition.IQueryTerm=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec=} [properties] Properties to set */ - function QueryTerm(properties) { + function BoostSpec(properties) { + this.conditionBoostSpecs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52970,88 +50709,78 @@ } /** - * QueryTerm value. - * @member {string} value - * @memberof google.cloud.retail.v2beta.Condition.QueryTerm - * @instance - */ - QueryTerm.prototype.value = ""; - - /** - * QueryTerm fullMatch. - * @member {boolean} fullMatch - * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * BoostSpec conditionBoostSpecs. + * @member {Array.} conditionBoostSpecs + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec * @instance */ - QueryTerm.prototype.fullMatch = false; + BoostSpec.prototype.conditionBoostSpecs = $util.emptyArray; /** - * Creates a new QueryTerm instance using the specified properties. + * Creates a new BoostSpec instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec * @static - * @param {google.cloud.retail.v2beta.Condition.IQueryTerm=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Condition.QueryTerm} QueryTerm instance + * @param {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} BoostSpec instance */ - QueryTerm.create = function create(properties) { - return new QueryTerm(properties); + BoostSpec.create = function create(properties) { + return new BoostSpec(properties); }; /** - * Encodes the specified QueryTerm message. Does not implicitly {@link google.cloud.retail.v2beta.Condition.QueryTerm.verify|verify} messages. + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec * @static - * @param {google.cloud.retail.v2beta.Condition.IQueryTerm} message QueryTerm message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec} message BoostSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryTerm.encode = function encode(message, writer) { + BoostSpec.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - if (message.fullMatch != null && Object.hasOwnProperty.call(message, "fullMatch")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullMatch); + if (message.conditionBoostSpecs != null && message.conditionBoostSpecs.length) + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) + $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.encode(message.conditionBoostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified QueryTerm message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Condition.QueryTerm.verify|verify} messages. + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec * @static - * @param {google.cloud.retail.v2beta.Condition.IQueryTerm} message QueryTerm message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec} message BoostSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryTerm.encodeDelimited = function encodeDelimited(message, writer) { + BoostSpec.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QueryTerm message from the specified reader or buffer. + * Decodes a BoostSpec message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Condition.QueryTerm} QueryTerm + * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} BoostSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryTerm.decode = function decode(reader, length) { + BoostSpec.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.v2beta.Condition.QueryTerm(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.value = reader.string(); - break; - case 2: - message.fullMatch = reader.bool(); + if (!(message.conditionBoostSpecs && message.conditionBoostSpecs.length)) + message.conditionBoostSpecs = []; + message.conditionBoostSpecs.push($root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -53062,117 +50791,335 @@ }; /** - * Decodes a QueryTerm message from the specified reader or buffer, length delimited. + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Condition.QueryTerm} QueryTerm + * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} BoostSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryTerm.decodeDelimited = function decodeDelimited(reader) { + BoostSpec.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QueryTerm message. + * Verifies a BoostSpec message. * @function verify - * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QueryTerm.verify = function verify(message) { + BoostSpec.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - if (message.fullMatch != null && message.hasOwnProperty("fullMatch")) - if (typeof message.fullMatch !== "boolean") - return "fullMatch: boolean expected"; + if (message.conditionBoostSpecs != null && message.hasOwnProperty("conditionBoostSpecs")) { + if (!Array.isArray(message.conditionBoostSpecs)) + return "conditionBoostSpecs: array expected"; + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify(message.conditionBoostSpecs[i]); + if (error) + return "conditionBoostSpecs." + error; + } + } return null; }; /** - * Creates a QueryTerm message from a plain object. Also converts values to their respective internal types. + * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Condition.QueryTerm} QueryTerm + * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} BoostSpec */ - QueryTerm.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Condition.QueryTerm) + BoostSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec) return object; - var message = new $root.google.cloud.retail.v2beta.Condition.QueryTerm(); - if (object.value != null) - message.value = String(object.value); - if (object.fullMatch != null) - message.fullMatch = Boolean(object.fullMatch); + var message = new $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec(); + if (object.conditionBoostSpecs) { + if (!Array.isArray(object.conditionBoostSpecs)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.BoostSpec.conditionBoostSpecs: array expected"); + message.conditionBoostSpecs = []; + for (var i = 0; i < object.conditionBoostSpecs.length; ++i) { + if (typeof object.conditionBoostSpecs[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.BoostSpec.conditionBoostSpecs: object expected"); + message.conditionBoostSpecs[i] = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.fromObject(object.conditionBoostSpecs[i]); + } + } return message; }; /** - * Creates a plain object from a QueryTerm message. Also converts values to other types if specified. + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec * @static - * @param {google.cloud.retail.v2beta.Condition.QueryTerm} message QueryTerm + * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} message BoostSpec * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryTerm.toObject = function toObject(message, options) { + BoostSpec.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.value = ""; - object.fullMatch = false; + if (options.arrays || options.defaults) + object.conditionBoostSpecs = []; + if (message.conditionBoostSpecs && message.conditionBoostSpecs.length) { + object.conditionBoostSpecs = []; + for (var j = 0; j < message.conditionBoostSpecs.length; ++j) + object.conditionBoostSpecs[j] = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.toObject(message.conditionBoostSpecs[j], options); } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.fullMatch != null && message.hasOwnProperty("fullMatch")) - object.fullMatch = message.fullMatch; return object; }; /** - * Converts this QueryTerm to JSON. + * Converts this BoostSpec to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec * @instance * @returns {Object.} JSON object */ - QueryTerm.prototype.toJSON = function toJSON() { + BoostSpec.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return QueryTerm; + BoostSpec.ConditionBoostSpec = (function() { + + /** + * Properties of a ConditionBoostSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @interface IConditionBoostSpec + * @property {string|null} [condition] ConditionBoostSpec condition + * @property {number|null} [boost] ConditionBoostSpec boost + */ + + /** + * Constructs a new ConditionBoostSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @classdesc Represents a ConditionBoostSpec. + * @implements IConditionBoostSpec + * @constructor + * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + */ + function ConditionBoostSpec(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]]; + } + + /** + * ConditionBoostSpec condition. + * @member {string} condition + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.condition = ""; + + /** + * ConditionBoostSpec boost. + * @member {number} boost + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.boost = 0; + + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec instance + */ + ConditionBoostSpec.create = function create(properties) { + return new ConditionBoostSpec(properties); + }; + + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + return writer; + }; + + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @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.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.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.SearchRequest.BoostSpec.ConditionBoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.condition = reader.string(); + break; + case 2: + message.boost = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionBoostSpec message. + * @function verify + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionBoostSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + return null; + }; + + /** + * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + */ + ConditionBoostSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec) + return object; + var message = new $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec(); + if (object.condition != null) + message.condition = String(object.condition); + if (object.boost != null) + message.boost = Number(object.boost); + return message; + }; + + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} message ConditionBoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionBoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.condition = ""; + object.boost = 0; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + return object; + }; + + /** + * Converts this ConditionBoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @instance + * @returns {Object.} JSON object + */ + ConditionBoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConditionBoostSpec; + })(); + + return BoostSpec; })(); - Condition.TimeRange = (function() { + SearchRequest.QueryExpansionSpec = (function() { /** - * Properties of a TimeRange. - * @memberof google.cloud.retail.v2beta.Condition - * @interface ITimeRange - * @property {google.protobuf.ITimestamp|null} [startTime] TimeRange startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TimeRange endTime + * Properties of a QueryExpansionSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @interface IQueryExpansionSpec + * @property {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition|null} [condition] QueryExpansionSpec condition + * @property {boolean|null} [pinUnexpandedResults] QueryExpansionSpec pinUnexpandedResults */ /** - * Constructs a new TimeRange. - * @memberof google.cloud.retail.v2beta.Condition - * @classdesc Represents a TimeRange. - * @implements ITimeRange + * Constructs a new QueryExpansionSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @classdesc Represents a QueryExpansionSpec. + * @implements IQueryExpansionSpec * @constructor - * @param {google.cloud.retail.v2beta.Condition.ITimeRange=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set */ - function TimeRange(properties) { + function QueryExpansionSpec(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53180,88 +51127,88 @@ } /** - * TimeRange startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * QueryExpansionSpec condition. + * @member {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition} condition + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @instance */ - TimeRange.prototype.startTime = null; + QueryExpansionSpec.prototype.condition = 0; /** - * TimeRange endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * QueryExpansionSpec pinUnexpandedResults. + * @member {boolean} pinUnexpandedResults + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @instance */ - TimeRange.prototype.endTime = null; + QueryExpansionSpec.prototype.pinUnexpandedResults = false; /** - * Creates a new TimeRange instance using the specified properties. + * Creates a new QueryExpansionSpec instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @static - * @param {google.cloud.retail.v2beta.Condition.ITimeRange=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Condition.TimeRange} TimeRange instance + * @param {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} QueryExpansionSpec instance */ - TimeRange.create = function create(properties) { - return new TimeRange(properties); + QueryExpansionSpec.create = function create(properties) { + return new QueryExpansionSpec(properties); }; /** - * Encodes the specified TimeRange message. Does not implicitly {@link google.cloud.retail.v2beta.Condition.TimeRange.verify|verify} messages. + * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @static - * @param {google.cloud.retail.v2beta.Condition.ITimeRange} message TimeRange message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeRange.encode = function encode(message, writer) { + QueryExpansionSpec.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.condition); + if (message.pinUnexpandedResults != null && Object.hasOwnProperty.call(message, "pinUnexpandedResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.pinUnexpandedResults); return writer; }; /** - * Encodes the specified TimeRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Condition.TimeRange.verify|verify} messages. + * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @static - * @param {google.cloud.retail.v2beta.Condition.ITimeRange} message TimeRange message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeRange.encodeDelimited = function encodeDelimited(message, writer) { + QueryExpansionSpec.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeRange message from the specified reader or buffer. + * Decodes a QueryExpansionSpec message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Condition.TimeRange} TimeRange + * @returns {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} QueryExpansionSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeRange.decode = function decode(reader, length) { + QueryExpansionSpec.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.v2beta.Condition.TimeRange(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.condition = reader.int32(); break; case 2: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.pinUnexpandedResults = reader.bool(); break; default: reader.skipType(tag & 7); @@ -53272,137 +51219,200 @@ }; /** - * Decodes a TimeRange message from the specified reader or buffer, length delimited. + * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Condition.TimeRange} TimeRange + * @returns {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} QueryExpansionSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeRange.decodeDelimited = function decodeDelimited(reader) { + QueryExpansionSpec.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeRange message. + * Verifies a QueryExpansionSpec message. * @function verify - * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TimeRange.verify = function verify(message) { + QueryExpansionSpec.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } + if (message.condition != null && message.hasOwnProperty("condition")) + switch (message.condition) { + default: + return "condition: enum value expected"; + case 0: + case 1: + case 3: + break; + } + if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) + if (typeof message.pinUnexpandedResults !== "boolean") + return "pinUnexpandedResults: boolean expected"; return null; }; /** - * Creates a TimeRange message from a plain object. Also converts values to their respective internal types. + * Creates a QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Condition.TimeRange} TimeRange + * @returns {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} QueryExpansionSpec */ - TimeRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Condition.TimeRange) + QueryExpansionSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec) return object; - var message = new $root.google.cloud.retail.v2beta.Condition.TimeRange(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.retail.v2beta.Condition.TimeRange.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.retail.v2beta.Condition.TimeRange.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + var message = new $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec(); + switch (object.condition) { + case "CONDITION_UNSPECIFIED": + case 0: + message.condition = 0; + break; + case "DISABLED": + case 1: + message.condition = 1; + break; + case "AUTO": + case 3: + message.condition = 3; + break; } + if (object.pinUnexpandedResults != null) + message.pinUnexpandedResults = Boolean(object.pinUnexpandedResults); return message; }; /** - * Creates a plain object from a TimeRange message. Also converts values to other types if specified. + * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @static - * @param {google.cloud.retail.v2beta.Condition.TimeRange} message TimeRange + * @param {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} message QueryExpansionSpec * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeRange.toObject = function toObject(message, options) { + QueryExpansionSpec.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.startTime = null; - object.endTime = null; + object.condition = options.enums === String ? "CONDITION_UNSPECIFIED" : 0; + object.pinUnexpandedResults = false; } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition[message.condition] : message.condition; + if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) + object.pinUnexpandedResults = message.pinUnexpandedResults; return object; }; /** - * Converts this TimeRange to JSON. + * Converts this QueryExpansionSpec to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @instance * @returns {Object.} JSON object */ - TimeRange.prototype.toJSON = function toJSON() { + QueryExpansionSpec.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TimeRange; + /** + * Condition enum. + * @name google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition + * @enum {number} + * @property {number} CONDITION_UNSPECIFIED=0 CONDITION_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} AUTO=3 AUTO value + */ + QueryExpansionSpec.Condition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONDITION_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[3] = "AUTO"] = 3; + return values; + })(); + + return QueryExpansionSpec; })(); - return Condition; + /** + * RelevanceThreshold enum. + * @name google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold + * @enum {number} + * @property {number} RELEVANCE_THRESHOLD_UNSPECIFIED=0 RELEVANCE_THRESHOLD_UNSPECIFIED value + * @property {number} HIGH=1 HIGH value + * @property {number} MEDIUM=2 MEDIUM value + * @property {number} LOW=3 LOW value + * @property {number} LOWEST=4 LOWEST value + */ + SearchRequest.RelevanceThreshold = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RELEVANCE_THRESHOLD_UNSPECIFIED"] = 0; + values[valuesById[1] = "HIGH"] = 1; + values[valuesById[2] = "MEDIUM"] = 2; + values[valuesById[3] = "LOW"] = 3; + values[valuesById[4] = "LOWEST"] = 4; + return values; + })(); + + /** + * SearchMode enum. + * @name google.cloud.retail.v2alpha.SearchRequest.SearchMode + * @enum {number} + * @property {number} SEARCH_MODE_UNSPECIFIED=0 SEARCH_MODE_UNSPECIFIED value + * @property {number} PRODUCT_SEARCH_ONLY=1 PRODUCT_SEARCH_ONLY value + * @property {number} FACETED_SEARCH_ONLY=2 FACETED_SEARCH_ONLY value + */ + SearchRequest.SearchMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEARCH_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRODUCT_SEARCH_ONLY"] = 1; + values[valuesById[2] = "FACETED_SEARCH_ONLY"] = 2; + return values; + })(); + + return SearchRequest; })(); - v2beta.Rule = (function() { + v2alpha.SearchResponse = (function() { /** - * Properties of a Rule. - * @memberof google.cloud.retail.v2beta - * @interface IRule - * @property {google.cloud.retail.v2beta.Rule.IBoostAction|null} [boostAction] Rule boostAction - * @property {google.cloud.retail.v2beta.Rule.IRedirectAction|null} [redirectAction] Rule redirectAction - * @property {google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction|null} [onewaySynonymsAction] Rule onewaySynonymsAction - * @property {google.cloud.retail.v2beta.Rule.IDoNotAssociateAction|null} [doNotAssociateAction] Rule doNotAssociateAction - * @property {google.cloud.retail.v2beta.Rule.IReplacementAction|null} [replacementAction] Rule replacementAction - * @property {google.cloud.retail.v2beta.Rule.IIgnoreAction|null} [ignoreAction] Rule ignoreAction - * @property {google.cloud.retail.v2beta.Rule.IFilterAction|null} [filterAction] Rule filterAction - * @property {google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction|null} [twowaySynonymsAction] Rule twowaySynonymsAction - * @property {google.cloud.retail.v2beta.ICondition|null} [condition] Rule condition + * Properties of a SearchResponse. + * @memberof google.cloud.retail.v2alpha + * @interface ISearchResponse + * @property {Array.|null} [results] SearchResponse results + * @property {Array.|null} [facets] SearchResponse facets + * @property {number|null} [totalSize] SearchResponse totalSize + * @property {string|null} [correctedQuery] SearchResponse correctedQuery + * @property {string|null} [attributionToken] SearchResponse attributionToken + * @property {string|null} [nextPageToken] SearchResponse nextPageToken + * @property {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo|null} [queryExpansionInfo] SearchResponse queryExpansionInfo + * @property {string|null} [redirectUri] SearchResponse redirectUri + * @property {Array.|null} [appliedControls] SearchResponse appliedControls */ /** - * Constructs a new Rule. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a Rule. - * @implements IRule + * Constructs a new SearchResponse. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a SearchResponse. + * @implements ISearchResponse * @constructor - * @param {google.cloud.retail.v2beta.IRule=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ISearchResponse=} [properties] Properties to set */ - function Rule(properties) { + function SearchResponse(properties) { + this.results = []; + this.facets = []; + this.appliedControls = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53410,193 +51420,188 @@ } /** - * Rule boostAction. - * @member {google.cloud.retail.v2beta.Rule.IBoostAction|null|undefined} boostAction - * @memberof google.cloud.retail.v2beta.Rule - * @instance - */ - Rule.prototype.boostAction = null; - - /** - * Rule redirectAction. - * @member {google.cloud.retail.v2beta.Rule.IRedirectAction|null|undefined} redirectAction - * @memberof google.cloud.retail.v2beta.Rule + * SearchResponse results. + * @member {Array.} results + * @memberof google.cloud.retail.v2alpha.SearchResponse * @instance */ - Rule.prototype.redirectAction = null; + SearchResponse.prototype.results = $util.emptyArray; /** - * Rule onewaySynonymsAction. - * @member {google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction|null|undefined} onewaySynonymsAction - * @memberof google.cloud.retail.v2beta.Rule + * SearchResponse facets. + * @member {Array.} facets + * @memberof google.cloud.retail.v2alpha.SearchResponse * @instance */ - Rule.prototype.onewaySynonymsAction = null; + SearchResponse.prototype.facets = $util.emptyArray; /** - * Rule doNotAssociateAction. - * @member {google.cloud.retail.v2beta.Rule.IDoNotAssociateAction|null|undefined} doNotAssociateAction - * @memberof google.cloud.retail.v2beta.Rule + * SearchResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.retail.v2alpha.SearchResponse * @instance */ - Rule.prototype.doNotAssociateAction = null; + SearchResponse.prototype.totalSize = 0; /** - * Rule replacementAction. - * @member {google.cloud.retail.v2beta.Rule.IReplacementAction|null|undefined} replacementAction - * @memberof google.cloud.retail.v2beta.Rule + * SearchResponse correctedQuery. + * @member {string} correctedQuery + * @memberof google.cloud.retail.v2alpha.SearchResponse * @instance */ - Rule.prototype.replacementAction = null; + SearchResponse.prototype.correctedQuery = ""; /** - * Rule ignoreAction. - * @member {google.cloud.retail.v2beta.Rule.IIgnoreAction|null|undefined} ignoreAction - * @memberof google.cloud.retail.v2beta.Rule + * SearchResponse attributionToken. + * @member {string} attributionToken + * @memberof google.cloud.retail.v2alpha.SearchResponse * @instance */ - Rule.prototype.ignoreAction = null; + SearchResponse.prototype.attributionToken = ""; /** - * Rule filterAction. - * @member {google.cloud.retail.v2beta.Rule.IFilterAction|null|undefined} filterAction - * @memberof google.cloud.retail.v2beta.Rule + * SearchResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.retail.v2alpha.SearchResponse * @instance */ - Rule.prototype.filterAction = null; + SearchResponse.prototype.nextPageToken = ""; /** - * Rule twowaySynonymsAction. - * @member {google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction|null|undefined} twowaySynonymsAction - * @memberof google.cloud.retail.v2beta.Rule + * SearchResponse queryExpansionInfo. + * @member {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo|null|undefined} queryExpansionInfo + * @memberof google.cloud.retail.v2alpha.SearchResponse * @instance */ - Rule.prototype.twowaySynonymsAction = null; + SearchResponse.prototype.queryExpansionInfo = null; /** - * Rule condition. - * @member {google.cloud.retail.v2beta.ICondition|null|undefined} condition - * @memberof google.cloud.retail.v2beta.Rule + * SearchResponse redirectUri. + * @member {string} redirectUri + * @memberof google.cloud.retail.v2alpha.SearchResponse * @instance */ - Rule.prototype.condition = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + SearchResponse.prototype.redirectUri = ""; /** - * Rule action. - * @member {"boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"|undefined} action - * @memberof google.cloud.retail.v2beta.Rule + * SearchResponse appliedControls. + * @member {Array.} appliedControls + * @memberof google.cloud.retail.v2alpha.SearchResponse * @instance */ - Object.defineProperty(Rule.prototype, "action", { - get: $util.oneOfGetter($oneOfFields = ["boostAction", "redirectAction", "onewaySynonymsAction", "doNotAssociateAction", "replacementAction", "ignoreAction", "filterAction", "twowaySynonymsAction"]), - set: $util.oneOfSetter($oneOfFields) - }); + SearchResponse.prototype.appliedControls = $util.emptyArray; /** - * Creates a new Rule instance using the specified properties. + * Creates a new SearchResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.Rule + * @memberof google.cloud.retail.v2alpha.SearchResponse * @static - * @param {google.cloud.retail.v2beta.IRule=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Rule} Rule instance + * @param {google.cloud.retail.v2alpha.ISearchResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchResponse} SearchResponse instance */ - Rule.create = function create(properties) { - return new Rule(properties); + SearchResponse.create = function create(properties) { + return new SearchResponse(properties); }; /** - * Encodes the specified Rule message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.verify|verify} messages. + * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.Rule + * @memberof google.cloud.retail.v2alpha.SearchResponse * @static - * @param {google.cloud.retail.v2beta.IRule} message Rule message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISearchResponse} message SearchResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Rule.encode = function encode(message, writer) { + SearchResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.cloud.retail.v2beta.Condition.encode(message.condition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.boostAction != null && Object.hasOwnProperty.call(message, "boostAction")) - $root.google.cloud.retail.v2beta.Rule.BoostAction.encode(message.boostAction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.redirectAction != null && Object.hasOwnProperty.call(message, "redirectAction")) - $root.google.cloud.retail.v2beta.Rule.RedirectAction.encode(message.redirectAction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.onewaySynonymsAction != null && Object.hasOwnProperty.call(message, "onewaySynonymsAction")) - $root.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.encode(message.onewaySynonymsAction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.doNotAssociateAction != null && Object.hasOwnProperty.call(message, "doNotAssociateAction")) - $root.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.encode(message.doNotAssociateAction, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.replacementAction != null && Object.hasOwnProperty.call(message, "replacementAction")) - $root.google.cloud.retail.v2beta.Rule.ReplacementAction.encode(message.replacementAction, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.ignoreAction != null && Object.hasOwnProperty.call(message, "ignoreAction")) - $root.google.cloud.retail.v2beta.Rule.IgnoreAction.encode(message.ignoreAction, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.filterAction != null && Object.hasOwnProperty.call(message, "filterAction")) - $root.google.cloud.retail.v2beta.Rule.FilterAction.encode(message.filterAction, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.twowaySynonymsAction != null && Object.hasOwnProperty.call(message, "twowaySynonymsAction")) - $root.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.encode(message.twowaySynonymsAction, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.facets != null && message.facets.length) + for (var i = 0; i < message.facets.length; ++i) + $root.google.cloud.retail.v2alpha.SearchResponse.Facet.encode(message.facets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + if (message.correctedQuery != null && Object.hasOwnProperty.call(message, "correctedQuery")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.correctedQuery); + if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.attributionToken); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.nextPageToken); + if (message.queryExpansionInfo != null && Object.hasOwnProperty.call(message, "queryExpansionInfo")) + $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.encode(message.queryExpansionInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.redirectUri != null && Object.hasOwnProperty.call(message, "redirectUri")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.redirectUri); + if (message.appliedControls != null && message.appliedControls.length) + for (var i = 0; i < message.appliedControls.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.appliedControls[i]); return writer; }; /** - * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.verify|verify} messages. + * Encodes the specified SearchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Rule + * @memberof google.cloud.retail.v2alpha.SearchResponse * @static - * @param {google.cloud.retail.v2beta.IRule} message Rule message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISearchResponse} message SearchResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Rule.encodeDelimited = function encodeDelimited(message, writer) { + SearchResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Rule message from the specified reader or buffer. + * Decodes a SearchResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.Rule + * @memberof google.cloud.retail.v2alpha.SearchResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Rule} Rule + * @returns {google.cloud.retail.v2alpha.SearchResponse} SearchResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Rule.decode = function decode(reader, length) { + SearchResponse.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.v2beta.Rule(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.decode(reader, reader.uint32())); + break; case 2: - message.boostAction = $root.google.cloud.retail.v2beta.Rule.BoostAction.decode(reader, reader.uint32()); + if (!(message.facets && message.facets.length)) + message.facets = []; + message.facets.push($root.google.cloud.retail.v2alpha.SearchResponse.Facet.decode(reader, reader.uint32())); break; case 3: - message.redirectAction = $root.google.cloud.retail.v2beta.Rule.RedirectAction.decode(reader, reader.uint32()); + message.totalSize = reader.int32(); break; - case 6: - message.onewaySynonymsAction = $root.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.decode(reader, reader.uint32()); + case 4: + message.correctedQuery = reader.string(); break; - case 7: - message.doNotAssociateAction = $root.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.decode(reader, reader.uint32()); + case 5: + message.attributionToken = reader.string(); break; - case 8: - message.replacementAction = $root.google.cloud.retail.v2beta.Rule.ReplacementAction.decode(reader, reader.uint32()); + case 6: + message.nextPageToken = reader.string(); break; - case 9: - message.ignoreAction = $root.google.cloud.retail.v2beta.Rule.IgnoreAction.decode(reader, reader.uint32()); + case 7: + message.queryExpansionInfo = $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.decode(reader, reader.uint32()); break; case 10: - message.filterAction = $root.google.cloud.retail.v2beta.Rule.FilterAction.decode(reader, reader.uint32()); - break; - case 11: - message.twowaySynonymsAction = $root.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.decode(reader, reader.uint32()); + message.redirectUri = reader.string(); break; - case 1: - message.condition = $root.google.cloud.retail.v2beta.Condition.decode(reader, reader.uint32()); + case 12: + if (!(message.appliedControls && message.appliedControls.length)) + message.appliedControls = []; + message.appliedControls.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -53607,269 +51612,228 @@ }; /** - * Decodes a Rule message from the specified reader or buffer, length delimited. + * Decodes a SearchResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Rule + * @memberof google.cloud.retail.v2alpha.SearchResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Rule} Rule + * @returns {google.cloud.retail.v2alpha.SearchResponse} SearchResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Rule.decodeDelimited = function decodeDelimited(reader) { + SearchResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Rule message. + * Verifies a SearchResponse message. * @function verify - * @memberof google.cloud.retail.v2beta.Rule + * @memberof google.cloud.retail.v2alpha.SearchResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Rule.verify = function verify(message) { + SearchResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.boostAction != null && message.hasOwnProperty("boostAction")) { - properties.action = 1; - { - var error = $root.google.cloud.retail.v2beta.Rule.BoostAction.verify(message.boostAction); - if (error) - return "boostAction." + error; - } - } - if (message.redirectAction != null && message.hasOwnProperty("redirectAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2beta.Rule.RedirectAction.verify(message.redirectAction); - if (error) - return "redirectAction." + error; - } - } - if (message.onewaySynonymsAction != null && message.hasOwnProperty("onewaySynonymsAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.verify(message.onewaySynonymsAction); - if (error) - return "onewaySynonymsAction." + error; - } - } - if (message.doNotAssociateAction != null && message.hasOwnProperty("doNotAssociateAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.verify(message.doNotAssociateAction); - if (error) - return "doNotAssociateAction." + error; - } - } - if (message.replacementAction != null && message.hasOwnProperty("replacementAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2beta.Rule.ReplacementAction.verify(message.replacementAction); - if (error) - return "replacementAction." + error; - } - } - if (message.ignoreAction != null && message.hasOwnProperty("ignoreAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2beta.Rule.IgnoreAction.verify(message.ignoreAction); - if (error) - return "ignoreAction." + error; - } - } - if (message.filterAction != null && message.hasOwnProperty("filterAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2beta.Rule.FilterAction.verify(message.filterAction); + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify(message.results[i]); if (error) - return "filterAction." + error; + return "results." + error; } } - if (message.twowaySynonymsAction != null && message.hasOwnProperty("twowaySynonymsAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.verify(message.twowaySynonymsAction); + if (message.facets != null && message.hasOwnProperty("facets")) { + if (!Array.isArray(message.facets)) + return "facets: array expected"; + for (var i = 0; i < message.facets.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.verify(message.facets[i]); if (error) - return "twowaySynonymsAction." + error; + return "facets." + error; } } - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.cloud.retail.v2beta.Condition.verify(message.condition); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) + if (!$util.isString(message.correctedQuery)) + return "correctedQuery: string expected"; + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + if (!$util.isString(message.attributionToken)) + return "attributionToken: string expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.queryExpansionInfo != null && message.hasOwnProperty("queryExpansionInfo")) { + var error = $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify(message.queryExpansionInfo); if (error) - return "condition." + error; + return "queryExpansionInfo." + error; + } + if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) + if (!$util.isString(message.redirectUri)) + return "redirectUri: string expected"; + if (message.appliedControls != null && message.hasOwnProperty("appliedControls")) { + if (!Array.isArray(message.appliedControls)) + return "appliedControls: array expected"; + for (var i = 0; i < message.appliedControls.length; ++i) + if (!$util.isString(message.appliedControls[i])) + return "appliedControls: string[] expected"; } return null; }; /** - * Creates a Rule message from a plain object. Also converts values to their respective internal types. + * Creates a SearchResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.Rule + * @memberof google.cloud.retail.v2alpha.SearchResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Rule} Rule + * @returns {google.cloud.retail.v2alpha.SearchResponse} SearchResponse */ - Rule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Rule) + SearchResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse) return object; - var message = new $root.google.cloud.retail.v2beta.Rule(); - if (object.boostAction != null) { - if (typeof object.boostAction !== "object") - throw TypeError(".google.cloud.retail.v2beta.Rule.boostAction: object expected"); - message.boostAction = $root.google.cloud.retail.v2beta.Rule.BoostAction.fromObject(object.boostAction); + var message = new $root.google.cloud.retail.v2alpha.SearchResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.results: object expected"); + message.results[i] = $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.fromObject(object.results[i]); + } } - if (object.redirectAction != null) { - if (typeof object.redirectAction !== "object") - throw TypeError(".google.cloud.retail.v2beta.Rule.redirectAction: object expected"); - message.redirectAction = $root.google.cloud.retail.v2beta.Rule.RedirectAction.fromObject(object.redirectAction); + if (object.facets) { + if (!Array.isArray(object.facets)) + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.facets: array expected"); + message.facets = []; + for (var i = 0; i < object.facets.length; ++i) { + if (typeof object.facets[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.facets: object expected"); + message.facets[i] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.fromObject(object.facets[i]); + } } - if (object.onewaySynonymsAction != null) { - if (typeof object.onewaySynonymsAction !== "object") - throw TypeError(".google.cloud.retail.v2beta.Rule.onewaySynonymsAction: object expected"); - message.onewaySynonymsAction = $root.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.fromObject(object.onewaySynonymsAction); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + if (object.correctedQuery != null) + message.correctedQuery = String(object.correctedQuery); + if (object.attributionToken != null) + message.attributionToken = String(object.attributionToken); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.queryExpansionInfo != null) { + if (typeof object.queryExpansionInfo !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.queryExpansionInfo: object expected"); + message.queryExpansionInfo = $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.fromObject(object.queryExpansionInfo); } - if (object.doNotAssociateAction != null) { - if (typeof object.doNotAssociateAction !== "object") - throw TypeError(".google.cloud.retail.v2beta.Rule.doNotAssociateAction: object expected"); - message.doNotAssociateAction = $root.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.fromObject(object.doNotAssociateAction); - } - if (object.replacementAction != null) { - if (typeof object.replacementAction !== "object") - throw TypeError(".google.cloud.retail.v2beta.Rule.replacementAction: object expected"); - message.replacementAction = $root.google.cloud.retail.v2beta.Rule.ReplacementAction.fromObject(object.replacementAction); - } - if (object.ignoreAction != null) { - if (typeof object.ignoreAction !== "object") - throw TypeError(".google.cloud.retail.v2beta.Rule.ignoreAction: object expected"); - message.ignoreAction = $root.google.cloud.retail.v2beta.Rule.IgnoreAction.fromObject(object.ignoreAction); - } - if (object.filterAction != null) { - if (typeof object.filterAction !== "object") - throw TypeError(".google.cloud.retail.v2beta.Rule.filterAction: object expected"); - message.filterAction = $root.google.cloud.retail.v2beta.Rule.FilterAction.fromObject(object.filterAction); - } - if (object.twowaySynonymsAction != null) { - if (typeof object.twowaySynonymsAction !== "object") - throw TypeError(".google.cloud.retail.v2beta.Rule.twowaySynonymsAction: object expected"); - message.twowaySynonymsAction = $root.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.fromObject(object.twowaySynonymsAction); - } - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.cloud.retail.v2beta.Rule.condition: object expected"); - message.condition = $root.google.cloud.retail.v2beta.Condition.fromObject(object.condition); + if (object.redirectUri != null) + message.redirectUri = String(object.redirectUri); + if (object.appliedControls) { + if (!Array.isArray(object.appliedControls)) + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.appliedControls: array expected"); + message.appliedControls = []; + for (var i = 0; i < object.appliedControls.length; ++i) + message.appliedControls[i] = String(object.appliedControls[i]); } return message; }; /** - * Creates a plain object from a Rule message. Also converts values to other types if specified. + * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.Rule + * @memberof google.cloud.retail.v2alpha.SearchResponse * @static - * @param {google.cloud.retail.v2beta.Rule} message Rule + * @param {google.cloud.retail.v2alpha.SearchResponse} message SearchResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Rule.toObject = function toObject(message, options) { + SearchResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.condition = null; - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.cloud.retail.v2beta.Condition.toObject(message.condition, options); - if (message.boostAction != null && message.hasOwnProperty("boostAction")) { - object.boostAction = $root.google.cloud.retail.v2beta.Rule.BoostAction.toObject(message.boostAction, options); - if (options.oneofs) - object.action = "boostAction"; - } - if (message.redirectAction != null && message.hasOwnProperty("redirectAction")) { - object.redirectAction = $root.google.cloud.retail.v2beta.Rule.RedirectAction.toObject(message.redirectAction, options); - if (options.oneofs) - object.action = "redirectAction"; - } - if (message.onewaySynonymsAction != null && message.hasOwnProperty("onewaySynonymsAction")) { - object.onewaySynonymsAction = $root.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.toObject(message.onewaySynonymsAction, options); - if (options.oneofs) - object.action = "onewaySynonymsAction"; - } - if (message.doNotAssociateAction != null && message.hasOwnProperty("doNotAssociateAction")) { - object.doNotAssociateAction = $root.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.toObject(message.doNotAssociateAction, options); - if (options.oneofs) - object.action = "doNotAssociateAction"; + if (options.arrays || options.defaults) { + object.results = []; + object.facets = []; + object.appliedControls = []; } - if (message.replacementAction != null && message.hasOwnProperty("replacementAction")) { - object.replacementAction = $root.google.cloud.retail.v2beta.Rule.ReplacementAction.toObject(message.replacementAction, options); - if (options.oneofs) - object.action = "replacementAction"; + if (options.defaults) { + object.totalSize = 0; + object.correctedQuery = ""; + object.attributionToken = ""; + object.nextPageToken = ""; + object.queryExpansionInfo = null; + object.redirectUri = ""; } - if (message.ignoreAction != null && message.hasOwnProperty("ignoreAction")) { - object.ignoreAction = $root.google.cloud.retail.v2beta.Rule.IgnoreAction.toObject(message.ignoreAction, options); - if (options.oneofs) - object.action = "ignoreAction"; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.toObject(message.results[j], options); } - if (message.filterAction != null && message.hasOwnProperty("filterAction")) { - object.filterAction = $root.google.cloud.retail.v2beta.Rule.FilterAction.toObject(message.filterAction, options); - if (options.oneofs) - object.action = "filterAction"; + if (message.facets && message.facets.length) { + object.facets = []; + for (var j = 0; j < message.facets.length; ++j) + object.facets[j] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.toObject(message.facets[j], options); } - if (message.twowaySynonymsAction != null && message.hasOwnProperty("twowaySynonymsAction")) { - object.twowaySynonymsAction = $root.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.toObject(message.twowaySynonymsAction, options); - if (options.oneofs) - object.action = "twowaySynonymsAction"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) + object.correctedQuery = message.correctedQuery; + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + object.attributionToken = message.attributionToken; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.queryExpansionInfo != null && message.hasOwnProperty("queryExpansionInfo")) + object.queryExpansionInfo = $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.toObject(message.queryExpansionInfo, options); + if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) + object.redirectUri = message.redirectUri; + if (message.appliedControls && message.appliedControls.length) { + object.appliedControls = []; + for (var j = 0; j < message.appliedControls.length; ++j) + object.appliedControls[j] = message.appliedControls[j]; } return object; }; /** - * Converts this Rule to JSON. + * Converts this SearchResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.Rule + * @memberof google.cloud.retail.v2alpha.SearchResponse * @instance * @returns {Object.} JSON object */ - Rule.prototype.toJSON = function toJSON() { + SearchResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - Rule.BoostAction = (function() { + SearchResponse.SearchResult = (function() { /** - * Properties of a BoostAction. - * @memberof google.cloud.retail.v2beta.Rule - * @interface IBoostAction - * @property {number|null} [boost] BoostAction boost - * @property {string|null} [productsFilter] BoostAction productsFilter + * Properties of a SearchResult. + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @interface ISearchResult + * @property {string|null} [id] SearchResult id + * @property {google.cloud.retail.v2alpha.IProduct|null} [product] SearchResult product + * @property {number|null} [matchingVariantCount] SearchResult matchingVariantCount + * @property {Object.|null} [matchingVariantFields] SearchResult matchingVariantFields + * @property {Object.|null} [variantRollupValues] SearchResult variantRollupValues */ /** - * Constructs a new BoostAction. - * @memberof google.cloud.retail.v2beta.Rule - * @classdesc Represents a BoostAction. - * @implements IBoostAction + * Constructs a new SearchResult. + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @classdesc Represents a SearchResult. + * @implements ISearchResult * @constructor - * @param {google.cloud.retail.v2beta.Rule.IBoostAction=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.SearchResponse.ISearchResult=} [properties] Properties to set */ - function BoostAction(properties) { + function SearchResult(properties) { + this.matchingVariantFields = {}; + this.variantRollupValues = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53877,88 +51841,171 @@ } /** - * BoostAction boost. - * @member {number} boost - * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * SearchResult id. + * @member {string} id + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @instance */ - BoostAction.prototype.boost = 0; + SearchResult.prototype.id = ""; /** - * BoostAction productsFilter. - * @member {string} productsFilter - * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * SearchResult product. + * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} product + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @instance */ - BoostAction.prototype.productsFilter = ""; + SearchResult.prototype.product = null; /** - * Creates a new BoostAction instance using the specified properties. + * SearchResult matchingVariantCount. + * @member {number} matchingVariantCount + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.matchingVariantCount = 0; + + /** + * SearchResult matchingVariantFields. + * @member {Object.} matchingVariantFields + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.matchingVariantFields = $util.emptyObject; + + /** + * SearchResult variantRollupValues. + * @member {Object.} variantRollupValues + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.variantRollupValues = $util.emptyObject; + + /** + * Creates a new SearchResult instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @static - * @param {google.cloud.retail.v2beta.Rule.IBoostAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Rule.BoostAction} BoostAction instance + * @param {google.cloud.retail.v2alpha.SearchResponse.ISearchResult=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchResponse.SearchResult} SearchResult instance */ - BoostAction.create = function create(properties) { - return new BoostAction(properties); + SearchResult.create = function create(properties) { + return new SearchResult(properties); }; /** - * Encodes the specified BoostAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.BoostAction.verify|verify} messages. + * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @static - * @param {google.cloud.retail.v2beta.Rule.IBoostAction} message BoostAction message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchResponse.ISearchResult} message SearchResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BoostAction.encode = function encode(message, writer) { + SearchResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.boost); - if (message.productsFilter != null && Object.hasOwnProperty.call(message, "productsFilter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.productsFilter); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + $root.google.cloud.retail.v2alpha.Product.encode(message.product, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.matchingVariantCount != null && Object.hasOwnProperty.call(message, "matchingVariantCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.matchingVariantCount); + if (message.matchingVariantFields != null && Object.hasOwnProperty.call(message, "matchingVariantFields")) + for (var keys = Object.keys(message.matchingVariantFields), 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.protobuf.FieldMask.encode(message.matchingVariantFields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.variantRollupValues != null && Object.hasOwnProperty.call(message, "variantRollupValues")) + for (var keys = Object.keys(message.variantRollupValues), i = 0; i < keys.length; ++i) { + 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(); + } return writer; }; /** - * Encodes the specified BoostAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.BoostAction.verify|verify} messages. + * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @static - * @param {google.cloud.retail.v2beta.Rule.IBoostAction} message BoostAction message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchResponse.ISearchResult} message SearchResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BoostAction.encodeDelimited = function encodeDelimited(message, writer) { + SearchResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BoostAction message from the specified reader or buffer. + * Decodes a SearchResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Rule.BoostAction} BoostAction + * @returns {google.cloud.retail.v2alpha.SearchResponse.SearchResult} SearchResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BoostAction.decode = function decode(reader, length) { + SearchResult.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.v2beta.Rule.BoostAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.boost = reader.float(); + message.id = reader.string(); break; case 2: - message.productsFilter = reader.string(); + message.product = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); + break; + case 3: + message.matchingVariantCount = reader.int32(); + break; + case 4: + if (message.matchingVariantFields === $util.emptyObject) + message.matchingVariantFields = {}; + 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.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.matchingVariantFields[key] = value; + break; + case 5: + if (message.variantRollupValues === $util.emptyObject) + message.variantRollupValues = {}; + 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.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.variantRollupValues[key] = value; break; default: reader.skipType(tag & 7); @@ -53969,116 +52016,187 @@ }; /** - * Decodes a BoostAction message from the specified reader or buffer, length delimited. + * Decodes a SearchResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Rule.BoostAction} BoostAction + * @returns {google.cloud.retail.v2alpha.SearchResponse.SearchResult} SearchResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BoostAction.decodeDelimited = function decodeDelimited(reader) { + SearchResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BoostAction message. + * Verifies a SearchResult message. * @function verify - * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BoostAction.verify = function verify(message) { + SearchResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.boost != null && message.hasOwnProperty("boost")) - if (typeof message.boost !== "number") - return "boost: number expected"; - if (message.productsFilter != null && message.hasOwnProperty("productsFilter")) - if (!$util.isString(message.productsFilter)) - return "productsFilter: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.retail.v2alpha.Product.verify(message.product); + if (error) + return "product." + error; + } + if (message.matchingVariantCount != null && message.hasOwnProperty("matchingVariantCount")) + if (!$util.isInteger(message.matchingVariantCount)) + return "matchingVariantCount: integer expected"; + if (message.matchingVariantFields != null && message.hasOwnProperty("matchingVariantFields")) { + if (!$util.isObject(message.matchingVariantFields)) + return "matchingVariantFields: object expected"; + var key = Object.keys(message.matchingVariantFields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.FieldMask.verify(message.matchingVariantFields[key[i]]); + if (error) + return "matchingVariantFields." + error; + } + } + if (message.variantRollupValues != null && message.hasOwnProperty("variantRollupValues")) { + if (!$util.isObject(message.variantRollupValues)) + return "variantRollupValues: object expected"; + var key = Object.keys(message.variantRollupValues); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.variantRollupValues[key[i]]); + if (error) + return "variantRollupValues." + error; + } + } return null; }; /** - * Creates a BoostAction message from a plain object. Also converts values to their respective internal types. + * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Rule.BoostAction} BoostAction + * @returns {google.cloud.retail.v2alpha.SearchResponse.SearchResult} SearchResult */ - BoostAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Rule.BoostAction) + SearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult) return object; - var message = new $root.google.cloud.retail.v2beta.Rule.BoostAction(); - if (object.boost != null) - message.boost = Number(object.boost); - if (object.productsFilter != null) - message.productsFilter = String(object.productsFilter); + var message = new $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult(); + if (object.id != null) + message.id = String(object.id); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.product: object expected"); + message.product = $root.google.cloud.retail.v2alpha.Product.fromObject(object.product); + } + if (object.matchingVariantCount != null) + message.matchingVariantCount = object.matchingVariantCount | 0; + if (object.matchingVariantFields) { + if (typeof object.matchingVariantFields !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.matchingVariantFields: object expected"); + message.matchingVariantFields = {}; + for (var keys = Object.keys(object.matchingVariantFields), i = 0; i < keys.length; ++i) { + if (typeof object.matchingVariantFields[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.matchingVariantFields: object expected"); + message.matchingVariantFields[keys[i]] = $root.google.protobuf.FieldMask.fromObject(object.matchingVariantFields[keys[i]]); + } + } + if (object.variantRollupValues) { + if (typeof object.variantRollupValues !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.variantRollupValues: object expected"); + message.variantRollupValues = {}; + for (var keys = Object.keys(object.variantRollupValues), i = 0; i < keys.length; ++i) { + if (typeof object.variantRollupValues[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.variantRollupValues: object expected"); + message.variantRollupValues[keys[i]] = $root.google.protobuf.Value.fromObject(object.variantRollupValues[keys[i]]); + } + } return message; }; /** - * Creates a plain object from a BoostAction message. Also converts values to other types if specified. + * Creates a plain object from a SearchResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @static - * @param {google.cloud.retail.v2beta.Rule.BoostAction} message BoostAction + * @param {google.cloud.retail.v2alpha.SearchResponse.SearchResult} message SearchResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BoostAction.toObject = function toObject(message, options) { + SearchResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) { + object.matchingVariantFields = {}; + object.variantRollupValues = {}; + } if (options.defaults) { - object.boost = 0; - object.productsFilter = ""; + object.id = ""; + object.product = null; + object.matchingVariantCount = 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.retail.v2alpha.Product.toObject(message.product, options); + if (message.matchingVariantCount != null && message.hasOwnProperty("matchingVariantCount")) + object.matchingVariantCount = message.matchingVariantCount; + var keys2; + if (message.matchingVariantFields && (keys2 = Object.keys(message.matchingVariantFields)).length) { + object.matchingVariantFields = {}; + for (var j = 0; j < keys2.length; ++j) + object.matchingVariantFields[keys2[j]] = $root.google.protobuf.FieldMask.toObject(message.matchingVariantFields[keys2[j]], options); + } + if (message.variantRollupValues && (keys2 = Object.keys(message.variantRollupValues)).length) { + object.variantRollupValues = {}; + for (var j = 0; j < keys2.length; ++j) + object.variantRollupValues[keys2[j]] = $root.google.protobuf.Value.toObject(message.variantRollupValues[keys2[j]], options); } - if (message.boost != null && message.hasOwnProperty("boost")) - object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; - if (message.productsFilter != null && message.hasOwnProperty("productsFilter")) - object.productsFilter = message.productsFilter; return object; }; /** - * Converts this BoostAction to JSON. + * Converts this SearchResult to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @instance * @returns {Object.} JSON object */ - BoostAction.prototype.toJSON = function toJSON() { + SearchResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BoostAction; + return SearchResult; })(); - Rule.FilterAction = (function() { + SearchResponse.Facet = (function() { /** - * Properties of a FilterAction. - * @memberof google.cloud.retail.v2beta.Rule - * @interface IFilterAction - * @property {string|null} [filter] FilterAction filter + * Properties of a Facet. + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @interface IFacet + * @property {string|null} [key] Facet key + * @property {Array.|null} [values] Facet values + * @property {boolean|null} [dynamicFacet] Facet dynamicFacet */ /** - * Constructs a new FilterAction. - * @memberof google.cloud.retail.v2beta.Rule - * @classdesc Represents a FilterAction. - * @implements IFilterAction + * Constructs a new Facet. + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @classdesc Represents a Facet. + * @implements IFacet * @constructor - * @param {google.cloud.retail.v2beta.Rule.IFilterAction=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.SearchResponse.IFacet=} [properties] Properties to set */ - function FilterAction(properties) { + function Facet(properties) { + this.values = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -54086,75 +52204,104 @@ } /** - * FilterAction filter. - * @member {string} filter - * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * Facet key. + * @member {string} key + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @instance */ - FilterAction.prototype.filter = ""; + Facet.prototype.key = ""; /** - * Creates a new FilterAction instance using the specified properties. + * Facet values. + * @member {Array.} values + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet + * @instance + */ + Facet.prototype.values = $util.emptyArray; + + /** + * Facet dynamicFacet. + * @member {boolean} dynamicFacet + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet + * @instance + */ + Facet.prototype.dynamicFacet = false; + + /** + * Creates a new Facet instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @static - * @param {google.cloud.retail.v2beta.Rule.IFilterAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Rule.FilterAction} FilterAction instance + * @param {google.cloud.retail.v2alpha.SearchResponse.IFacet=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet} Facet instance */ - FilterAction.create = function create(properties) { - return new FilterAction(properties); + Facet.create = function create(properties) { + return new Facet(properties); }; /** - * Encodes the specified FilterAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.FilterAction.verify|verify} messages. + * Encodes the specified Facet message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @static - * @param {google.cloud.retail.v2beta.Rule.IFilterAction} message FilterAction message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchResponse.IFacet} message Facet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FilterAction.encode = function encode(message, writer) { + Facet.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.encode(message.values[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dynamicFacet != null && Object.hasOwnProperty.call(message, "dynamicFacet")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.dynamicFacet); return writer; }; /** - * Encodes the specified FilterAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.FilterAction.verify|verify} messages. + * Encodes the specified Facet message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @static - * @param {google.cloud.retail.v2beta.Rule.IFilterAction} message FilterAction message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchResponse.IFacet} message Facet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FilterAction.encodeDelimited = function encodeDelimited(message, writer) { + Facet.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FilterAction message from the specified reader or buffer. + * Decodes a Facet message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Rule.FilterAction} FilterAction + * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet} Facet * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FilterAction.decode = function decode(reader, length) { + Facet.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.v2beta.Rule.FilterAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchResponse.Facet(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.filter = reader.string(); + message.key = reader.string(); + break; + case 2: + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.decode(reader, reader.uint32())); + break; + case 3: + message.dynamicFacet = reader.bool(); break; default: reader.skipType(tag & 7); @@ -54165,107 +52312,419 @@ }; /** - * Decodes a FilterAction message from the specified reader or buffer, length delimited. + * Decodes a Facet message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Rule.FilterAction} FilterAction + * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet} Facet * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FilterAction.decodeDelimited = function decodeDelimited(reader) { + Facet.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FilterAction message. + * Verifies a Facet message. * @function verify - * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FilterAction.verify = function verify(message) { + Facet.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify(message.values[i]); + if (error) + return "values." + error; + } + } + if (message.dynamicFacet != null && message.hasOwnProperty("dynamicFacet")) + if (typeof message.dynamicFacet !== "boolean") + return "dynamicFacet: boolean expected"; return null; }; /** - * Creates a FilterAction message from a plain object. Also converts values to their respective internal types. + * Creates a Facet message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Rule.FilterAction} FilterAction + * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet} Facet */ - FilterAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Rule.FilterAction) + Facet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse.Facet) return object; - var message = new $root.google.cloud.retail.v2beta.Rule.FilterAction(); - if (object.filter != null) - message.filter = String(object.filter); + var message = new $root.google.cloud.retail.v2alpha.SearchResponse.Facet(); + if (object.key != null) + message.key = String(object.key); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.Facet.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.Facet.values: object expected"); + message.values[i] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.fromObject(object.values[i]); + } + } + if (object.dynamicFacet != null) + message.dynamicFacet = Boolean(object.dynamicFacet); return message; }; /** - * Creates a plain object from a FilterAction message. Also converts values to other types if specified. + * Creates a plain object from a Facet message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @static - * @param {google.cloud.retail.v2beta.Rule.FilterAction} message FilterAction + * @param {google.cloud.retail.v2alpha.SearchResponse.Facet} message Facet * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FilterAction.toObject = function toObject(message, options) { + Facet.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.filter = ""; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) { + object.key = ""; + object.dynamicFacet = false; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.toObject(message.values[j], options); + } + if (message.dynamicFacet != null && message.hasOwnProperty("dynamicFacet")) + object.dynamicFacet = message.dynamicFacet; return object; }; /** - * Converts this FilterAction to JSON. + * Converts this Facet to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @instance * @returns {Object.} JSON object */ - FilterAction.prototype.toJSON = function toJSON() { + Facet.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FilterAction; + Facet.FacetValue = (function() { + + /** + * Properties of a FacetValue. + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet + * @interface IFacetValue + * @property {string|null} [value] FacetValue value + * @property {google.cloud.retail.v2alpha.IInterval|null} [interval] FacetValue interval + * @property {number|Long|null} [count] FacetValue count + */ + + /** + * Constructs a new FacetValue. + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet + * @classdesc Represents a FacetValue. + * @implements IFacetValue + * @constructor + * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue=} [properties] Properties to set + */ + function FacetValue(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]]; + } + + /** + * FacetValue value. + * @member {string|null|undefined} value + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + * @instance + */ + FacetValue.prototype.value = null; + + /** + * FacetValue interval. + * @member {google.cloud.retail.v2alpha.IInterval|null|undefined} interval + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + * @instance + */ + FacetValue.prototype.interval = null; + + /** + * FacetValue count. + * @member {number|Long} count + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + * @instance + */ + FacetValue.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FacetValue facetValue. + * @member {"value"|"interval"|undefined} facetValue + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + * @instance + */ + Object.defineProperty(FacetValue.prototype, "facetValue", { + get: $util.oneOfGetter($oneOfFields = ["value", "interval"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FacetValue instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + * @static + * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} FacetValue instance + */ + FacetValue.create = function create(properties) { + return new FacetValue(properties); + }; + + /** + * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + * @static + * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue} message FacetValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + $root.google.cloud.retail.v2alpha.Interval.encode(message.interval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.count); + return writer; + }; + + /** + * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + * @static + * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue} message FacetValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FacetValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + * @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.SearchResponse.Facet.FacetValue} FacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetValue.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.SearchResponse.Facet.FacetValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.string(); + break; + case 2: + message.interval = $root.google.cloud.retail.v2alpha.Interval.decode(reader, reader.uint32()); + break; + case 3: + message.count = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FacetValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} FacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FacetValue message. + * @function verify + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) { + properties.facetValue = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + if (message.interval != null && message.hasOwnProperty("interval")) { + if (properties.facetValue === 1) + return "facetValue: multiple values"; + properties.facetValue = 1; + { + var error = $root.google.cloud.retail.v2alpha.Interval.verify(message.interval); + if (error) + return "interval." + error; + } + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates a FacetValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} FacetValue + */ + FacetValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue) + return object; + var message = new $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue(); + if (object.value != null) + message.value = String(object.value); + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.interval: object expected"); + message.interval = $root.google.cloud.retail.v2alpha.Interval.fromObject(object.interval); + } + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a FacetValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + * @static + * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} message FacetValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetValue.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.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object.facetValue = "value"; + } + if (message.interval != null && message.hasOwnProperty("interval")) { + object.interval = $root.google.cloud.retail.v2alpha.Interval.toObject(message.interval, options); + if (options.oneofs) + object.facetValue = "interval"; + } + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this FacetValue to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + * @instance + * @returns {Object.} JSON object + */ + FacetValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FacetValue; + })(); + + return Facet; })(); - Rule.RedirectAction = (function() { + SearchResponse.QueryExpansionInfo = (function() { /** - * Properties of a RedirectAction. - * @memberof google.cloud.retail.v2beta.Rule - * @interface IRedirectAction - * @property {string|null} [redirectUri] RedirectAction redirectUri + * Properties of a QueryExpansionInfo. + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @interface IQueryExpansionInfo + * @property {boolean|null} [expandedQuery] QueryExpansionInfo expandedQuery + * @property {number|Long|null} [pinnedResultCount] QueryExpansionInfo pinnedResultCount */ /** - * Constructs a new RedirectAction. - * @memberof google.cloud.retail.v2beta.Rule - * @classdesc Represents a RedirectAction. - * @implements IRedirectAction + * Constructs a new QueryExpansionInfo. + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @classdesc Represents a QueryExpansionInfo. + * @implements IQueryExpansionInfo * @constructor - * @param {google.cloud.retail.v2beta.Rule.IRedirectAction=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo=} [properties] Properties to set */ - function RedirectAction(properties) { + function QueryExpansionInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -54273,75 +52732,88 @@ } /** - * RedirectAction redirectUri. - * @member {string} redirectUri - * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * QueryExpansionInfo expandedQuery. + * @member {boolean} expandedQuery + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @instance */ - RedirectAction.prototype.redirectUri = ""; + QueryExpansionInfo.prototype.expandedQuery = false; /** - * Creates a new RedirectAction instance using the specified properties. + * QueryExpansionInfo pinnedResultCount. + * @member {number|Long} pinnedResultCount + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo + * @instance + */ + QueryExpansionInfo.prototype.pinnedResultCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new QueryExpansionInfo instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @static - * @param {google.cloud.retail.v2beta.Rule.IRedirectAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Rule.RedirectAction} RedirectAction instance + * @param {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} QueryExpansionInfo instance */ - RedirectAction.create = function create(properties) { - return new RedirectAction(properties); + QueryExpansionInfo.create = function create(properties) { + return new QueryExpansionInfo(properties); }; /** - * Encodes the specified RedirectAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.RedirectAction.verify|verify} messages. + * Encodes the specified QueryExpansionInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @static - * @param {google.cloud.retail.v2beta.Rule.IRedirectAction} message RedirectAction message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo} message QueryExpansionInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RedirectAction.encode = function encode(message, writer) { + QueryExpansionInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.redirectUri != null && Object.hasOwnProperty.call(message, "redirectUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.redirectUri); + if (message.expandedQuery != null && Object.hasOwnProperty.call(message, "expandedQuery")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandedQuery); + if (message.pinnedResultCount != null && Object.hasOwnProperty.call(message, "pinnedResultCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.pinnedResultCount); return writer; }; /** - * Encodes the specified RedirectAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.RedirectAction.verify|verify} messages. + * Encodes the specified QueryExpansionInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @static - * @param {google.cloud.retail.v2beta.Rule.IRedirectAction} message RedirectAction message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo} message QueryExpansionInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RedirectAction.encodeDelimited = function encodeDelimited(message, writer) { + QueryExpansionInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RedirectAction message from the specified reader or buffer. + * Decodes a QueryExpansionInfo message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Rule.RedirectAction} RedirectAction + * @returns {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} QueryExpansionInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RedirectAction.decode = function decode(reader, length) { + QueryExpansionInfo.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.v2beta.Rule.RedirectAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.redirectUri = reader.string(); + message.expandedQuery = reader.bool(); + break; + case 2: + message.pinnedResultCount = reader.int64(); break; default: reader.skipType(tag & 7); @@ -54352,1423 +52824,906 @@ }; /** - * Decodes a RedirectAction message from the specified reader or buffer, length delimited. + * Decodes a QueryExpansionInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Rule.RedirectAction} RedirectAction + * @returns {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} QueryExpansionInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RedirectAction.decodeDelimited = function decodeDelimited(reader) { + QueryExpansionInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RedirectAction message. + * Verifies a QueryExpansionInfo message. * @function verify - * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RedirectAction.verify = function verify(message) { + QueryExpansionInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) - if (!$util.isString(message.redirectUri)) - return "redirectUri: string expected"; + if (message.expandedQuery != null && message.hasOwnProperty("expandedQuery")) + if (typeof message.expandedQuery !== "boolean") + return "expandedQuery: boolean expected"; + if (message.pinnedResultCount != null && message.hasOwnProperty("pinnedResultCount")) + if (!$util.isInteger(message.pinnedResultCount) && !(message.pinnedResultCount && $util.isInteger(message.pinnedResultCount.low) && $util.isInteger(message.pinnedResultCount.high))) + return "pinnedResultCount: integer|Long expected"; return null; }; /** - * Creates a RedirectAction message from a plain object. Also converts values to their respective internal types. + * Creates a QueryExpansionInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Rule.RedirectAction} RedirectAction + * @returns {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} QueryExpansionInfo */ - RedirectAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Rule.RedirectAction) + QueryExpansionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo) return object; - var message = new $root.google.cloud.retail.v2beta.Rule.RedirectAction(); - if (object.redirectUri != null) - message.redirectUri = String(object.redirectUri); + var message = new $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo(); + if (object.expandedQuery != null) + message.expandedQuery = Boolean(object.expandedQuery); + if (object.pinnedResultCount != null) + if ($util.Long) + (message.pinnedResultCount = $util.Long.fromValue(object.pinnedResultCount)).unsigned = false; + else if (typeof object.pinnedResultCount === "string") + message.pinnedResultCount = parseInt(object.pinnedResultCount, 10); + else if (typeof object.pinnedResultCount === "number") + message.pinnedResultCount = object.pinnedResultCount; + else if (typeof object.pinnedResultCount === "object") + message.pinnedResultCount = new $util.LongBits(object.pinnedResultCount.low >>> 0, object.pinnedResultCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a RedirectAction message. Also converts values to other types if specified. + * Creates a plain object from a QueryExpansionInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @static - * @param {google.cloud.retail.v2beta.Rule.RedirectAction} message RedirectAction + * @param {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} message QueryExpansionInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RedirectAction.toObject = function toObject(message, options) { + QueryExpansionInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.redirectUri = ""; - if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) - object.redirectUri = message.redirectUri; + if (options.defaults) { + object.expandedQuery = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.pinnedResultCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.pinnedResultCount = options.longs === String ? "0" : 0; + } + if (message.expandedQuery != null && message.hasOwnProperty("expandedQuery")) + object.expandedQuery = message.expandedQuery; + if (message.pinnedResultCount != null && message.hasOwnProperty("pinnedResultCount")) + if (typeof message.pinnedResultCount === "number") + object.pinnedResultCount = options.longs === String ? String(message.pinnedResultCount) : message.pinnedResultCount; + else + object.pinnedResultCount = options.longs === String ? $util.Long.prototype.toString.call(message.pinnedResultCount) : options.longs === Number ? new $util.LongBits(message.pinnedResultCount.low >>> 0, message.pinnedResultCount.high >>> 0).toNumber() : message.pinnedResultCount; return object; }; /** - * Converts this RedirectAction to JSON. + * Converts this QueryExpansionInfo to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @instance * @returns {Object.} JSON object */ - RedirectAction.prototype.toJSON = function toJSON() { + QueryExpansionInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RedirectAction; + return QueryExpansionInfo; })(); - Rule.TwowaySynonymsAction = (function() { + return SearchResponse; + })(); - /** - * Properties of a TwowaySynonymsAction. - * @memberof google.cloud.retail.v2beta.Rule - * @interface ITwowaySynonymsAction - * @property {Array.|null} [synonyms] TwowaySynonymsAction synonyms - */ + v2alpha.UserEventService = (function() { - /** - * Constructs a new TwowaySynonymsAction. - * @memberof google.cloud.retail.v2beta.Rule - * @classdesc Represents a TwowaySynonymsAction. - * @implements ITwowaySynonymsAction - * @constructor - * @param {google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction=} [properties] Properties to set - */ - function TwowaySynonymsAction(properties) { - this.synonyms = []; - 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]]; - } + /** + * Constructs a new UserEventService service. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a UserEventService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function UserEventService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * TwowaySynonymsAction synonyms. - * @member {Array.} synonyms - * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction - * @instance - */ - TwowaySynonymsAction.prototype.synonyms = $util.emptyArray; + (UserEventService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = UserEventService; - /** - * Creates a new TwowaySynonymsAction instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction - * @static - * @param {google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Rule.TwowaySynonymsAction} TwowaySynonymsAction instance - */ - TwowaySynonymsAction.create = function create(properties) { - return new TwowaySynonymsAction(properties); - }; + /** + * Creates new UserEventService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2alpha.UserEventService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {UserEventService} RPC service. Useful where requests and/or responses are streamed. + */ + UserEventService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * Encodes the specified TwowaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction - * @static - * @param {google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction} message TwowaySynonymsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TwowaySynonymsAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.synonyms != null && message.synonyms.length) - for (var i = 0; i < message.synonyms.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.synonyms[i]); - return writer; - }; + /** + * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#writeUserEvent}. + * @memberof google.cloud.retail.v2alpha.UserEventService + * @typedef WriteUserEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.UserEvent} [response] UserEvent + */ - /** - * Encodes the specified TwowaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction - * @static - * @param {google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction} message TwowaySynonymsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TwowaySynonymsAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Calls WriteUserEvent. + * @function writeUserEvent + * @memberof google.cloud.retail.v2alpha.UserEventService + * @instance + * @param {google.cloud.retail.v2alpha.IWriteUserEventRequest} request WriteUserEventRequest message or plain object + * @param {google.cloud.retail.v2alpha.UserEventService.WriteUserEventCallback} callback Node-style callback called with the error, if any, and UserEvent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserEventService.prototype.writeUserEvent = function writeUserEvent(request, callback) { + return this.rpcCall(writeUserEvent, $root.google.cloud.retail.v2alpha.WriteUserEventRequest, $root.google.cloud.retail.v2alpha.UserEvent, request, callback); + }, "name", { value: "WriteUserEvent" }); - /** - * Decodes a TwowaySynonymsAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Rule.TwowaySynonymsAction} TwowaySynonymsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TwowaySynonymsAction.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.v2beta.Rule.TwowaySynonymsAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.synonyms && message.synonyms.length)) - message.synonyms = []; - message.synonyms.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Calls WriteUserEvent. + * @function writeUserEvent + * @memberof google.cloud.retail.v2alpha.UserEventService + * @instance + * @param {google.cloud.retail.v2alpha.IWriteUserEventRequest} request WriteUserEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes a TwowaySynonymsAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Rule.TwowaySynonymsAction} TwowaySynonymsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TwowaySynonymsAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#collectUserEvent}. + * @memberof google.cloud.retail.v2alpha.UserEventService + * @typedef CollectUserEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.HttpBody} [response] HttpBody + */ - /** - * Verifies a TwowaySynonymsAction message. - * @function verify - * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TwowaySynonymsAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.synonyms != null && message.hasOwnProperty("synonyms")) { - if (!Array.isArray(message.synonyms)) - return "synonyms: array expected"; - for (var i = 0; i < message.synonyms.length; ++i) - if (!$util.isString(message.synonyms[i])) - return "synonyms: string[] expected"; - } - return null; - }; + /** + * Calls CollectUserEvent. + * @function collectUserEvent + * @memberof google.cloud.retail.v2alpha.UserEventService + * @instance + * @param {google.cloud.retail.v2alpha.ICollectUserEventRequest} request CollectUserEventRequest message or plain object + * @param {google.cloud.retail.v2alpha.UserEventService.CollectUserEventCallback} callback Node-style callback called with the error, if any, and HttpBody + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserEventService.prototype.collectUserEvent = function collectUserEvent(request, callback) { + return this.rpcCall(collectUserEvent, $root.google.cloud.retail.v2alpha.CollectUserEventRequest, $root.google.api.HttpBody, request, callback); + }, "name", { value: "CollectUserEvent" }); - /** - * Creates a TwowaySynonymsAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Rule.TwowaySynonymsAction} TwowaySynonymsAction - */ - TwowaySynonymsAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) - return object; - var message = new $root.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction(); - if (object.synonyms) { - if (!Array.isArray(object.synonyms)) - throw TypeError(".google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.synonyms: array expected"); - message.synonyms = []; - for (var i = 0; i < object.synonyms.length; ++i) - message.synonyms[i] = String(object.synonyms[i]); - } - return message; - }; + /** + * Calls CollectUserEvent. + * @function collectUserEvent + * @memberof google.cloud.retail.v2alpha.UserEventService + * @instance + * @param {google.cloud.retail.v2alpha.ICollectUserEventRequest} request CollectUserEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a plain object from a TwowaySynonymsAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction - * @static - * @param {google.cloud.retail.v2beta.Rule.TwowaySynonymsAction} message TwowaySynonymsAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TwowaySynonymsAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.synonyms = []; - if (message.synonyms && message.synonyms.length) { - object.synonyms = []; - for (var j = 0; j < message.synonyms.length; ++j) - object.synonyms[j] = message.synonyms[j]; - } - return object; - }; + /** + * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#purgeUserEvents}. + * @memberof google.cloud.retail.v2alpha.UserEventService + * @typedef PurgeUserEventsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * Converts this TwowaySynonymsAction to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction - * @instance - * @returns {Object.} JSON object - */ - TwowaySynonymsAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Calls PurgeUserEvents. + * @function purgeUserEvents + * @memberof google.cloud.retail.v2alpha.UserEventService + * @instance + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest} request PurgeUserEventsRequest message or plain object + * @param {google.cloud.retail.v2alpha.UserEventService.PurgeUserEventsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserEventService.prototype.purgeUserEvents = function purgeUserEvents(request, callback) { + return this.rpcCall(purgeUserEvents, $root.google.cloud.retail.v2alpha.PurgeUserEventsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PurgeUserEvents" }); - return TwowaySynonymsAction; - })(); + /** + * Calls PurgeUserEvents. + * @function purgeUserEvents + * @memberof google.cloud.retail.v2alpha.UserEventService + * @instance + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest} request PurgeUserEventsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - Rule.OnewaySynonymsAction = (function() { + /** + * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#importUserEvents}. + * @memberof google.cloud.retail.v2alpha.UserEventService + * @typedef ImportUserEventsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * Properties of an OnewaySynonymsAction. - * @memberof google.cloud.retail.v2beta.Rule - * @interface IOnewaySynonymsAction - * @property {Array.|null} [queryTerms] OnewaySynonymsAction queryTerms - * @property {Array.|null} [synonyms] OnewaySynonymsAction synonyms - * @property {Array.|null} [onewayTerms] OnewaySynonymsAction onewayTerms - */ + /** + * Calls ImportUserEvents. + * @function importUserEvents + * @memberof google.cloud.retail.v2alpha.UserEventService + * @instance + * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest} request ImportUserEventsRequest message or plain object + * @param {google.cloud.retail.v2alpha.UserEventService.ImportUserEventsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserEventService.prototype.importUserEvents = function importUserEvents(request, callback) { + return this.rpcCall(importUserEvents, $root.google.cloud.retail.v2alpha.ImportUserEventsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportUserEvents" }); - /** - * Constructs a new OnewaySynonymsAction. - * @memberof google.cloud.retail.v2beta.Rule - * @classdesc Represents an OnewaySynonymsAction. - * @implements IOnewaySynonymsAction - * @constructor - * @param {google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction=} [properties] Properties to set - */ - function OnewaySynonymsAction(properties) { - this.queryTerms = []; - this.synonyms = []; - this.onewayTerms = []; - 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]]; - } + /** + * Calls ImportUserEvents. + * @function importUserEvents + * @memberof google.cloud.retail.v2alpha.UserEventService + * @instance + * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest} request ImportUserEventsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * OnewaySynonymsAction queryTerms. - * @member {Array.} queryTerms - * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction - * @instance - */ - OnewaySynonymsAction.prototype.queryTerms = $util.emptyArray; + /** + * Callback as used by {@link google.cloud.retail.v2alpha.UserEventService#rejoinUserEvents}. + * @memberof google.cloud.retail.v2alpha.UserEventService + * @typedef RejoinUserEventsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * OnewaySynonymsAction synonyms. - * @member {Array.} synonyms - * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction - * @instance - */ - OnewaySynonymsAction.prototype.synonyms = $util.emptyArray; + /** + * Calls RejoinUserEvents. + * @function rejoinUserEvents + * @memberof google.cloud.retail.v2alpha.UserEventService + * @instance + * @param {google.cloud.retail.v2alpha.IRejoinUserEventsRequest} request RejoinUserEventsRequest message or plain object + * @param {google.cloud.retail.v2alpha.UserEventService.RejoinUserEventsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserEventService.prototype.rejoinUserEvents = function rejoinUserEvents(request, callback) { + return this.rpcCall(rejoinUserEvents, $root.google.cloud.retail.v2alpha.RejoinUserEventsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RejoinUserEvents" }); - /** - * OnewaySynonymsAction onewayTerms. - * @member {Array.} onewayTerms - * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction - * @instance - */ - OnewaySynonymsAction.prototype.onewayTerms = $util.emptyArray; + /** + * Calls RejoinUserEvents. + * @function rejoinUserEvents + * @memberof google.cloud.retail.v2alpha.UserEventService + * @instance + * @param {google.cloud.retail.v2alpha.IRejoinUserEventsRequest} request RejoinUserEventsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a new OnewaySynonymsAction instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction - * @static - * @param {google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Rule.OnewaySynonymsAction} OnewaySynonymsAction instance - */ - OnewaySynonymsAction.create = function create(properties) { - return new OnewaySynonymsAction(properties); - }; + return UserEventService; + })(); - /** - * Encodes the specified OnewaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction - * @static - * @param {google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction} message OnewaySynonymsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OnewaySynonymsAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.onewayTerms != null && message.onewayTerms.length) - for (var i = 0; i < message.onewayTerms.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.onewayTerms[i]); - if (message.queryTerms != null && message.queryTerms.length) - for (var i = 0; i < message.queryTerms.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.queryTerms[i]); - if (message.synonyms != null && message.synonyms.length) - for (var i = 0; i < message.synonyms.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.synonyms[i]); - return writer; - }; + v2alpha.WriteUserEventRequest = (function() { - /** - * Encodes the specified OnewaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction - * @static - * @param {google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction} message OnewaySynonymsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OnewaySynonymsAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a WriteUserEventRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IWriteUserEventRequest + * @property {string|null} [parent] WriteUserEventRequest parent + * @property {google.cloud.retail.v2alpha.IUserEvent|null} [userEvent] WriteUserEventRequest userEvent + */ - /** - * Decodes an OnewaySynonymsAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Rule.OnewaySynonymsAction} OnewaySynonymsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OnewaySynonymsAction.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.v2beta.Rule.OnewaySynonymsAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: - if (!(message.queryTerms && message.queryTerms.length)) - message.queryTerms = []; - message.queryTerms.push(reader.string()); - break; - case 4: - if (!(message.synonyms && message.synonyms.length)) - message.synonyms = []; - message.synonyms.push(reader.string()); - break; - case 2: - if (!(message.onewayTerms && message.onewayTerms.length)) - message.onewayTerms = []; - message.onewayTerms.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Constructs a new WriteUserEventRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a WriteUserEventRequest. + * @implements IWriteUserEventRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IWriteUserEventRequest=} [properties] Properties to set + */ + function WriteUserEventRequest(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]]; + } - /** - * Decodes an OnewaySynonymsAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Rule.OnewaySynonymsAction} OnewaySynonymsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OnewaySynonymsAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * WriteUserEventRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @instance + */ + WriteUserEventRequest.prototype.parent = ""; - /** - * Verifies an OnewaySynonymsAction message. - * @function verify - * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OnewaySynonymsAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { - if (!Array.isArray(message.queryTerms)) - return "queryTerms: array expected"; - for (var i = 0; i < message.queryTerms.length; ++i) - if (!$util.isString(message.queryTerms[i])) - return "queryTerms: string[] expected"; - } - if (message.synonyms != null && message.hasOwnProperty("synonyms")) { - if (!Array.isArray(message.synonyms)) - return "synonyms: array expected"; - for (var i = 0; i < message.synonyms.length; ++i) - if (!$util.isString(message.synonyms[i])) - return "synonyms: string[] expected"; - } - if (message.onewayTerms != null && message.hasOwnProperty("onewayTerms")) { - if (!Array.isArray(message.onewayTerms)) - return "onewayTerms: array expected"; - for (var i = 0; i < message.onewayTerms.length; ++i) - if (!$util.isString(message.onewayTerms[i])) - return "onewayTerms: string[] expected"; - } - return null; - }; + /** + * WriteUserEventRequest userEvent. + * @member {google.cloud.retail.v2alpha.IUserEvent|null|undefined} userEvent + * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @instance + */ + WriteUserEventRequest.prototype.userEvent = null; - /** - * Creates an OnewaySynonymsAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Rule.OnewaySynonymsAction} OnewaySynonymsAction - */ - OnewaySynonymsAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) - return object; - var message = new $root.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction(); - if (object.queryTerms) { - if (!Array.isArray(object.queryTerms)) - throw TypeError(".google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.queryTerms: array expected"); - message.queryTerms = []; - for (var i = 0; i < object.queryTerms.length; ++i) - message.queryTerms[i] = String(object.queryTerms[i]); - } - if (object.synonyms) { - if (!Array.isArray(object.synonyms)) - throw TypeError(".google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.synonyms: array expected"); - message.synonyms = []; - for (var i = 0; i < object.synonyms.length; ++i) - message.synonyms[i] = String(object.synonyms[i]); - } - if (object.onewayTerms) { - if (!Array.isArray(object.onewayTerms)) - throw TypeError(".google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.onewayTerms: array expected"); - message.onewayTerms = []; - for (var i = 0; i < object.onewayTerms.length; ++i) - message.onewayTerms[i] = String(object.onewayTerms[i]); - } - return message; - }; + /** + * Creates a new WriteUserEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @static + * @param {google.cloud.retail.v2alpha.IWriteUserEventRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.WriteUserEventRequest} WriteUserEventRequest instance + */ + WriteUserEventRequest.create = function create(properties) { + return new WriteUserEventRequest(properties); + }; - /** - * Creates a plain object from an OnewaySynonymsAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction - * @static - * @param {google.cloud.retail.v2beta.Rule.OnewaySynonymsAction} message OnewaySynonymsAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OnewaySynonymsAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.onewayTerms = []; - object.queryTerms = []; - object.synonyms = []; - } - if (message.onewayTerms && message.onewayTerms.length) { - object.onewayTerms = []; - for (var j = 0; j < message.onewayTerms.length; ++j) - object.onewayTerms[j] = message.onewayTerms[j]; - } - if (message.queryTerms && message.queryTerms.length) { - object.queryTerms = []; - for (var j = 0; j < message.queryTerms.length; ++j) - object.queryTerms[j] = message.queryTerms[j]; - } - if (message.synonyms && message.synonyms.length) { - object.synonyms = []; - for (var j = 0; j < message.synonyms.length; ++j) - object.synonyms[j] = message.synonyms[j]; - } - return object; - }; + /** + * Encodes the specified WriteUserEventRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.WriteUserEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @static + * @param {google.cloud.retail.v2alpha.IWriteUserEventRequest} message WriteUserEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteUserEventRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + 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(); + return writer; + }; - /** - * Converts this OnewaySynonymsAction to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction - * @instance - * @returns {Object.} JSON object - */ - OnewaySynonymsAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified WriteUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.WriteUserEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @static + * @param {google.cloud.retail.v2alpha.IWriteUserEventRequest} message WriteUserEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteUserEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - return OnewaySynonymsAction; - })(); + /** + * Decodes a WriteUserEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @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.WriteUserEventRequest} WriteUserEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteUserEventRequest.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.WriteUserEventRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - Rule.DoNotAssociateAction = (function() { + /** + * Decodes a WriteUserEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.WriteUserEventRequest} WriteUserEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteUserEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Properties of a DoNotAssociateAction. - * @memberof google.cloud.retail.v2beta.Rule - * @interface IDoNotAssociateAction - * @property {Array.|null} [queryTerms] DoNotAssociateAction queryTerms - * @property {Array.|null} [doNotAssociateTerms] DoNotAssociateAction doNotAssociateTerms - * @property {Array.|null} [terms] DoNotAssociateAction terms - */ + /** + * Verifies a WriteUserEventRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WriteUserEventRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.userEvent != null && message.hasOwnProperty("userEvent")) { + var error = $root.google.cloud.retail.v2alpha.UserEvent.verify(message.userEvent); + if (error) + return "userEvent." + error; + } + return null; + }; - /** - * Constructs a new DoNotAssociateAction. - * @memberof google.cloud.retail.v2beta.Rule - * @classdesc Represents a DoNotAssociateAction. - * @implements IDoNotAssociateAction - * @constructor - * @param {google.cloud.retail.v2beta.Rule.IDoNotAssociateAction=} [properties] Properties to set - */ - function DoNotAssociateAction(properties) { - this.queryTerms = []; - this.doNotAssociateTerms = []; - this.terms = []; - 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]]; + /** + * Creates a WriteUserEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.WriteUserEventRequest} WriteUserEventRequest + */ + WriteUserEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.WriteUserEventRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.WriteUserEventRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.userEvent != null) { + if (typeof object.userEvent !== "object") + throw TypeError(".google.cloud.retail.v2alpha.WriteUserEventRequest.userEvent: object expected"); + message.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.fromObject(object.userEvent); } + return message; + }; - /** - * DoNotAssociateAction queryTerms. - * @member {Array.} queryTerms - * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction - * @instance - */ - DoNotAssociateAction.prototype.queryTerms = $util.emptyArray; + /** + * Creates a plain object from a WriteUserEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @static + * @param {google.cloud.retail.v2alpha.WriteUserEventRequest} message WriteUserEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WriteUserEventRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.userEvent = null; + } + 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); + return object; + }; - /** - * DoNotAssociateAction doNotAssociateTerms. - * @member {Array.} doNotAssociateTerms - * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction - * @instance - */ - DoNotAssociateAction.prototype.doNotAssociateTerms = $util.emptyArray; + /** + * Converts this WriteUserEventRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @instance + * @returns {Object.} JSON object + */ + WriteUserEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * DoNotAssociateAction terms. - * @member {Array.} terms - * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction - * @instance - */ - DoNotAssociateAction.prototype.terms = $util.emptyArray; + return WriteUserEventRequest; + })(); - /** - * Creates a new DoNotAssociateAction instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction - * @static - * @param {google.cloud.retail.v2beta.Rule.IDoNotAssociateAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Rule.DoNotAssociateAction} DoNotAssociateAction instance - */ - DoNotAssociateAction.create = function create(properties) { - return new DoNotAssociateAction(properties); - }; + v2alpha.CollectUserEventRequest = (function() { - /** - * Encodes the specified DoNotAssociateAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.DoNotAssociateAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction - * @static - * @param {google.cloud.retail.v2beta.Rule.IDoNotAssociateAction} message DoNotAssociateAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoNotAssociateAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.terms != null && message.terms.length) - for (var i = 0; i < message.terms.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.terms[i]); - if (message.queryTerms != null && message.queryTerms.length) - for (var i = 0; i < message.queryTerms.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.queryTerms[i]); - if (message.doNotAssociateTerms != null && message.doNotAssociateTerms.length) - for (var i = 0; i < message.doNotAssociateTerms.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.doNotAssociateTerms[i]); - return writer; - }; + /** + * Properties of a CollectUserEventRequest. + * @memberof google.cloud.retail.v2alpha + * @interface ICollectUserEventRequest + * @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 + */ - /** - * Encodes the specified DoNotAssociateAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.DoNotAssociateAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction - * @static - * @param {google.cloud.retail.v2beta.Rule.IDoNotAssociateAction} message DoNotAssociateAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoNotAssociateAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Constructs a new CollectUserEventRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a CollectUserEventRequest. + * @implements ICollectUserEventRequest + * @constructor + * @param {google.cloud.retail.v2alpha.ICollectUserEventRequest=} [properties] Properties to set + */ + function CollectUserEventRequest(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]]; + } - /** - * Decodes a DoNotAssociateAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Rule.DoNotAssociateAction} DoNotAssociateAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoNotAssociateAction.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.v2beta.Rule.DoNotAssociateAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - if (!(message.queryTerms && message.queryTerms.length)) - message.queryTerms = []; - message.queryTerms.push(reader.string()); - break; - case 3: - if (!(message.doNotAssociateTerms && message.doNotAssociateTerms.length)) - message.doNotAssociateTerms = []; - message.doNotAssociateTerms.push(reader.string()); - break; - case 1: - if (!(message.terms && message.terms.length)) - message.terms = []; - message.terms.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * CollectUserEventRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * @instance + */ + CollectUserEventRequest.prototype.parent = ""; - /** - * Decodes a DoNotAssociateAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Rule.DoNotAssociateAction} DoNotAssociateAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoNotAssociateAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * CollectUserEventRequest userEvent. + * @member {string} userEvent + * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * @instance + */ + CollectUserEventRequest.prototype.userEvent = ""; - /** - * Verifies a DoNotAssociateAction message. - * @function verify - * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DoNotAssociateAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { - if (!Array.isArray(message.queryTerms)) - return "queryTerms: array expected"; - for (var i = 0; i < message.queryTerms.length; ++i) - if (!$util.isString(message.queryTerms[i])) - return "queryTerms: string[] expected"; - } - if (message.doNotAssociateTerms != null && message.hasOwnProperty("doNotAssociateTerms")) { - if (!Array.isArray(message.doNotAssociateTerms)) - return "doNotAssociateTerms: array expected"; - for (var i = 0; i < message.doNotAssociateTerms.length; ++i) - if (!$util.isString(message.doNotAssociateTerms[i])) - return "doNotAssociateTerms: string[] expected"; - } - if (message.terms != null && message.hasOwnProperty("terms")) { - if (!Array.isArray(message.terms)) - return "terms: array expected"; - for (var i = 0; i < message.terms.length; ++i) - if (!$util.isString(message.terms[i])) - return "terms: string[] expected"; - } - return null; - }; + /** + * CollectUserEventRequest uri. + * @member {string} uri + * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * @instance + */ + CollectUserEventRequest.prototype.uri = ""; - /** - * Creates a DoNotAssociateAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Rule.DoNotAssociateAction} DoNotAssociateAction - */ - DoNotAssociateAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Rule.DoNotAssociateAction) - return object; - var message = new $root.google.cloud.retail.v2beta.Rule.DoNotAssociateAction(); - if (object.queryTerms) { - if (!Array.isArray(object.queryTerms)) - throw TypeError(".google.cloud.retail.v2beta.Rule.DoNotAssociateAction.queryTerms: array expected"); - message.queryTerms = []; - for (var i = 0; i < object.queryTerms.length; ++i) - message.queryTerms[i] = String(object.queryTerms[i]); - } - if (object.doNotAssociateTerms) { - if (!Array.isArray(object.doNotAssociateTerms)) - throw TypeError(".google.cloud.retail.v2beta.Rule.DoNotAssociateAction.doNotAssociateTerms: array expected"); - message.doNotAssociateTerms = []; - for (var i = 0; i < object.doNotAssociateTerms.length; ++i) - message.doNotAssociateTerms[i] = String(object.doNotAssociateTerms[i]); - } - if (object.terms) { - if (!Array.isArray(object.terms)) - throw TypeError(".google.cloud.retail.v2beta.Rule.DoNotAssociateAction.terms: array expected"); - message.terms = []; - for (var i = 0; i < object.terms.length; ++i) - message.terms[i] = String(object.terms[i]); - } - return message; - }; + /** + * CollectUserEventRequest ets. + * @member {number|Long} ets + * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * @instance + */ + CollectUserEventRequest.prototype.ets = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Creates a plain object from a DoNotAssociateAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction - * @static - * @param {google.cloud.retail.v2beta.Rule.DoNotAssociateAction} message DoNotAssociateAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DoNotAssociateAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.terms = []; - object.queryTerms = []; - object.doNotAssociateTerms = []; - } - if (message.terms && message.terms.length) { - object.terms = []; - for (var j = 0; j < message.terms.length; ++j) - object.terms[j] = message.terms[j]; - } - if (message.queryTerms && message.queryTerms.length) { - object.queryTerms = []; - for (var j = 0; j < message.queryTerms.length; ++j) - object.queryTerms[j] = message.queryTerms[j]; - } - if (message.doNotAssociateTerms && message.doNotAssociateTerms.length) { - object.doNotAssociateTerms = []; - for (var j = 0; j < message.doNotAssociateTerms.length; ++j) - object.doNotAssociateTerms[j] = message.doNotAssociateTerms[j]; - } - return object; - }; + /** + * Creates a new CollectUserEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * @static + * @param {google.cloud.retail.v2alpha.ICollectUserEventRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CollectUserEventRequest} CollectUserEventRequest instance + */ + CollectUserEventRequest.create = function create(properties) { + return new CollectUserEventRequest(properties); + }; - /** - * Converts this DoNotAssociateAction to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction - * @instance - * @returns {Object.} JSON object - */ - DoNotAssociateAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified CollectUserEventRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CollectUserEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * @static + * @param {google.cloud.retail.v2alpha.ICollectUserEventRequest} message CollectUserEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CollectUserEventRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.userEvent != null && Object.hasOwnProperty.call(message, "userEvent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userEvent); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + 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); + return writer; + }; - return DoNotAssociateAction; - })(); + /** + * Encodes the specified CollectUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CollectUserEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * @static + * @param {google.cloud.retail.v2alpha.ICollectUserEventRequest} message CollectUserEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CollectUserEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - Rule.ReplacementAction = (function() { + /** + * Decodes a CollectUserEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * @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.CollectUserEventRequest} CollectUserEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CollectUserEventRequest.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.CollectUserEventRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.userEvent = reader.string(); + break; + case 3: + message.uri = reader.string(); + break; + case 4: + message.ets = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a ReplacementAction. - * @memberof google.cloud.retail.v2beta.Rule - * @interface IReplacementAction - * @property {Array.|null} [queryTerms] ReplacementAction queryTerms - * @property {string|null} [replacementTerm] ReplacementAction replacementTerm - * @property {string|null} [term] ReplacementAction term - */ + /** + * Decodes a CollectUserEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.CollectUserEventRequest} CollectUserEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CollectUserEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new ReplacementAction. - * @memberof google.cloud.retail.v2beta.Rule - * @classdesc Represents a ReplacementAction. - * @implements IReplacementAction - * @constructor - * @param {google.cloud.retail.v2beta.Rule.IReplacementAction=} [properties] Properties to set - */ - function ReplacementAction(properties) { - this.queryTerms = []; - 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]]; + /** + * Verifies a CollectUserEventRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CollectUserEventRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.userEvent != null && message.hasOwnProperty("userEvent")) + if (!$util.isString(message.userEvent)) + return "userEvent: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + 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"; + return null; + }; + + /** + * Creates a CollectUserEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.CollectUserEventRequest} CollectUserEventRequest + */ + CollectUserEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CollectUserEventRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.CollectUserEventRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.userEvent != null) + message.userEvent = String(object.userEvent); + if (object.uri != null) + message.uri = String(object.uri); + if (object.ets != null) + if ($util.Long) + (message.ets = $util.Long.fromValue(object.ets)).unsigned = false; + else if (typeof object.ets === "string") + message.ets = parseInt(object.ets, 10); + else if (typeof object.ets === "number") + message.ets = object.ets; + else if (typeof object.ets === "object") + message.ets = new $util.LongBits(object.ets.low >>> 0, object.ets.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a CollectUserEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * @static + * @param {google.cloud.retail.v2alpha.CollectUserEventRequest} message CollectUserEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CollectUserEventRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.userEvent = ""; + object.uri = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.ets = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.ets = options.longs === String ? "0" : 0; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.userEvent != null && message.hasOwnProperty("userEvent")) + object.userEvent = message.userEvent; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.ets != null && message.hasOwnProperty("ets")) + if (typeof message.ets === "number") + 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; + return object; + }; - /** - * ReplacementAction queryTerms. - * @member {Array.} queryTerms - * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction - * @instance - */ - ReplacementAction.prototype.queryTerms = $util.emptyArray; + /** + * Converts this CollectUserEventRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * @instance + * @returns {Object.} JSON object + */ + CollectUserEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * ReplacementAction replacementTerm. - * @member {string} replacementTerm - * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction - * @instance - */ - ReplacementAction.prototype.replacementTerm = ""; + return CollectUserEventRequest; + })(); - /** - * ReplacementAction term. - * @member {string} term - * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction - * @instance - */ - ReplacementAction.prototype.term = ""; + v2alpha.RejoinUserEventsRequest = (function() { - /** - * Creates a new ReplacementAction instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction - * @static - * @param {google.cloud.retail.v2beta.Rule.IReplacementAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Rule.ReplacementAction} ReplacementAction instance - */ - ReplacementAction.create = function create(properties) { - return new ReplacementAction(properties); - }; + /** + * Properties of a RejoinUserEventsRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IRejoinUserEventsRequest + * @property {string|null} [parent] RejoinUserEventsRequest parent + * @property {google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope|null} [userEventRejoinScope] RejoinUserEventsRequest userEventRejoinScope + */ - /** - * Encodes the specified ReplacementAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.ReplacementAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction - * @static - * @param {google.cloud.retail.v2beta.Rule.IReplacementAction} message ReplacementAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplacementAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.term != null && Object.hasOwnProperty.call(message, "term")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.term); - if (message.queryTerms != null && message.queryTerms.length) - for (var i = 0; i < message.queryTerms.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.queryTerms[i]); - if (message.replacementTerm != null && Object.hasOwnProperty.call(message, "replacementTerm")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.replacementTerm); - return writer; - }; + /** + * Constructs a new RejoinUserEventsRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a RejoinUserEventsRequest. + * @implements IRejoinUserEventsRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IRejoinUserEventsRequest=} [properties] Properties to set + */ + function RejoinUserEventsRequest(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]]; + } - /** - * Encodes the specified ReplacementAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.ReplacementAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction - * @static - * @param {google.cloud.retail.v2beta.Rule.IReplacementAction} message ReplacementAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplacementAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReplacementAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Rule.ReplacementAction} ReplacementAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplacementAction.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.v2beta.Rule.ReplacementAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - if (!(message.queryTerms && message.queryTerms.length)) - message.queryTerms = []; - message.queryTerms.push(reader.string()); - break; - case 3: - message.replacementTerm = reader.string(); - break; - case 1: - message.term = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReplacementAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Rule.ReplacementAction} ReplacementAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplacementAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReplacementAction message. - * @function verify - * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReplacementAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { - if (!Array.isArray(message.queryTerms)) - return "queryTerms: array expected"; - for (var i = 0; i < message.queryTerms.length; ++i) - if (!$util.isString(message.queryTerms[i])) - return "queryTerms: string[] expected"; - } - if (message.replacementTerm != null && message.hasOwnProperty("replacementTerm")) - if (!$util.isString(message.replacementTerm)) - return "replacementTerm: string expected"; - if (message.term != null && message.hasOwnProperty("term")) - if (!$util.isString(message.term)) - return "term: string expected"; - return null; - }; - - /** - * Creates a ReplacementAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Rule.ReplacementAction} ReplacementAction - */ - ReplacementAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Rule.ReplacementAction) - return object; - var message = new $root.google.cloud.retail.v2beta.Rule.ReplacementAction(); - if (object.queryTerms) { - if (!Array.isArray(object.queryTerms)) - throw TypeError(".google.cloud.retail.v2beta.Rule.ReplacementAction.queryTerms: array expected"); - message.queryTerms = []; - for (var i = 0; i < object.queryTerms.length; ++i) - message.queryTerms[i] = String(object.queryTerms[i]); - } - if (object.replacementTerm != null) - message.replacementTerm = String(object.replacementTerm); - if (object.term != null) - message.term = String(object.term); - return message; - }; - - /** - * Creates a plain object from a ReplacementAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction - * @static - * @param {google.cloud.retail.v2beta.Rule.ReplacementAction} message ReplacementAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReplacementAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.queryTerms = []; - if (options.defaults) { - object.term = ""; - object.replacementTerm = ""; - } - if (message.term != null && message.hasOwnProperty("term")) - object.term = message.term; - if (message.queryTerms && message.queryTerms.length) { - object.queryTerms = []; - for (var j = 0; j < message.queryTerms.length; ++j) - object.queryTerms[j] = message.queryTerms[j]; - } - if (message.replacementTerm != null && message.hasOwnProperty("replacementTerm")) - object.replacementTerm = message.replacementTerm; - return object; - }; - - /** - * Converts this ReplacementAction to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction - * @instance - * @returns {Object.} JSON object - */ - ReplacementAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ReplacementAction; - })(); - - Rule.IgnoreAction = (function() { - - /** - * Properties of an IgnoreAction. - * @memberof google.cloud.retail.v2beta.Rule - * @interface IIgnoreAction - * @property {Array.|null} [ignoreTerms] IgnoreAction ignoreTerms - */ - - /** - * Constructs a new IgnoreAction. - * @memberof google.cloud.retail.v2beta.Rule - * @classdesc Represents an IgnoreAction. - * @implements IIgnoreAction - * @constructor - * @param {google.cloud.retail.v2beta.Rule.IIgnoreAction=} [properties] Properties to set - */ - function IgnoreAction(properties) { - this.ignoreTerms = []; - 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]]; - } - - /** - * IgnoreAction ignoreTerms. - * @member {Array.} ignoreTerms - * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction - * @instance - */ - IgnoreAction.prototype.ignoreTerms = $util.emptyArray; - - /** - * Creates a new IgnoreAction instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction - * @static - * @param {google.cloud.retail.v2beta.Rule.IIgnoreAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Rule.IgnoreAction} IgnoreAction instance - */ - IgnoreAction.create = function create(properties) { - return new IgnoreAction(properties); - }; - - /** - * Encodes the specified IgnoreAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.IgnoreAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction - * @static - * @param {google.cloud.retail.v2beta.Rule.IIgnoreAction} message IgnoreAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IgnoreAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ignoreTerms != null && message.ignoreTerms.length) - for (var i = 0; i < message.ignoreTerms.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ignoreTerms[i]); - return writer; - }; - - /** - * Encodes the specified IgnoreAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.IgnoreAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction - * @static - * @param {google.cloud.retail.v2beta.Rule.IIgnoreAction} message IgnoreAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IgnoreAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IgnoreAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Rule.IgnoreAction} IgnoreAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IgnoreAction.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.v2beta.Rule.IgnoreAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.ignoreTerms && message.ignoreTerms.length)) - message.ignoreTerms = []; - message.ignoreTerms.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IgnoreAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Rule.IgnoreAction} IgnoreAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IgnoreAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IgnoreAction message. - * @function verify - * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IgnoreAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ignoreTerms != null && message.hasOwnProperty("ignoreTerms")) { - if (!Array.isArray(message.ignoreTerms)) - return "ignoreTerms: array expected"; - for (var i = 0; i < message.ignoreTerms.length; ++i) - if (!$util.isString(message.ignoreTerms[i])) - return "ignoreTerms: string[] expected"; - } - return null; - }; - - /** - * Creates an IgnoreAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Rule.IgnoreAction} IgnoreAction - */ - IgnoreAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Rule.IgnoreAction) - return object; - var message = new $root.google.cloud.retail.v2beta.Rule.IgnoreAction(); - if (object.ignoreTerms) { - if (!Array.isArray(object.ignoreTerms)) - throw TypeError(".google.cloud.retail.v2beta.Rule.IgnoreAction.ignoreTerms: array expected"); - message.ignoreTerms = []; - for (var i = 0; i < object.ignoreTerms.length; ++i) - message.ignoreTerms[i] = String(object.ignoreTerms[i]); - } - return message; - }; - - /** - * Creates a plain object from an IgnoreAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction - * @static - * @param {google.cloud.retail.v2beta.Rule.IgnoreAction} message IgnoreAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IgnoreAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ignoreTerms = []; - if (message.ignoreTerms && message.ignoreTerms.length) { - object.ignoreTerms = []; - for (var j = 0; j < message.ignoreTerms.length; ++j) - object.ignoreTerms[j] = message.ignoreTerms[j]; - } - return object; - }; - - /** - * Converts this IgnoreAction to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction - * @instance - * @returns {Object.} JSON object - */ - IgnoreAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IgnoreAction; - })(); - - return Rule; - })(); - - v2beta.Audience = (function() { - - /** - * Properties of an Audience. - * @memberof google.cloud.retail.v2beta - * @interface IAudience - * @property {Array.|null} [genders] Audience genders - * @property {Array.|null} [ageGroups] Audience ageGroups - */ + /** + * RejoinUserEventsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest + * @instance + */ + RejoinUserEventsRequest.prototype.parent = ""; /** - * Constructs a new Audience. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents an Audience. - * @implements IAudience - * @constructor - * @param {google.cloud.retail.v2beta.IAudience=} [properties] Properties to set - */ - function Audience(properties) { - this.genders = []; - this.ageGroups = []; - 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]]; - } - - /** - * Audience genders. - * @member {Array.} genders - * @memberof google.cloud.retail.v2beta.Audience - * @instance - */ - Audience.prototype.genders = $util.emptyArray; - - /** - * Audience ageGroups. - * @member {Array.} ageGroups - * @memberof google.cloud.retail.v2beta.Audience + * RejoinUserEventsRequest userEventRejoinScope. + * @member {google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope} userEventRejoinScope + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest * @instance */ - Audience.prototype.ageGroups = $util.emptyArray; + RejoinUserEventsRequest.prototype.userEventRejoinScope = 0; /** - * Creates a new Audience instance using the specified properties. + * Creates a new RejoinUserEventsRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.Audience + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest * @static - * @param {google.cloud.retail.v2beta.IAudience=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Audience} Audience instance + * @param {google.cloud.retail.v2alpha.IRejoinUserEventsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.RejoinUserEventsRequest} RejoinUserEventsRequest instance */ - Audience.create = function create(properties) { - return new Audience(properties); + RejoinUserEventsRequest.create = function create(properties) { + return new RejoinUserEventsRequest(properties); }; /** - * Encodes the specified Audience message. Does not implicitly {@link google.cloud.retail.v2beta.Audience.verify|verify} messages. + * Encodes the specified RejoinUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.Audience + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest * @static - * @param {google.cloud.retail.v2beta.IAudience} message Audience message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRejoinUserEventsRequest} message RejoinUserEventsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Audience.encode = function encode(message, writer) { + RejoinUserEventsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.genders != null && message.genders.length) - for (var i = 0; i < message.genders.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.genders[i]); - if (message.ageGroups != null && message.ageGroups.length) - for (var i = 0; i < message.ageGroups.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ageGroups[i]); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.userEventRejoinScope != null && Object.hasOwnProperty.call(message, "userEventRejoinScope")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.userEventRejoinScope); return writer; }; /** - * Encodes the specified Audience message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Audience.verify|verify} messages. + * Encodes the specified RejoinUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Audience + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest * @static - * @param {google.cloud.retail.v2beta.IAudience} message Audience message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRejoinUserEventsRequest} message RejoinUserEventsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Audience.encodeDelimited = function encodeDelimited(message, writer) { + RejoinUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Audience message from the specified reader or buffer. + * Decodes a RejoinUserEventsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.Audience + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Audience} Audience + * @returns {google.cloud.retail.v2alpha.RejoinUserEventsRequest} RejoinUserEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Audience.decode = function decode(reader, length) { + RejoinUserEventsRequest.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.v2beta.Audience(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RejoinUserEventsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.genders && message.genders.length)) - message.genders = []; - message.genders.push(reader.string()); + message.parent = reader.string(); break; case 2: - if (!(message.ageGroups && message.ageGroups.length)) - message.ageGroups = []; - message.ageGroups.push(reader.string()); + message.userEventRejoinScope = reader.int32(); break; default: reader.skipType(tag & 7); @@ -55779,143 +53734,150 @@ }; /** - * Decodes an Audience message from the specified reader or buffer, length delimited. + * Decodes a RejoinUserEventsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Audience + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Audience} Audience + * @returns {google.cloud.retail.v2alpha.RejoinUserEventsRequest} RejoinUserEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Audience.decodeDelimited = function decodeDelimited(reader) { + RejoinUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Audience message. + * Verifies a RejoinUserEventsRequest message. * @function verify - * @memberof google.cloud.retail.v2beta.Audience + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Audience.verify = function verify(message) { + RejoinUserEventsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.genders != null && message.hasOwnProperty("genders")) { - if (!Array.isArray(message.genders)) - return "genders: array expected"; - for (var i = 0; i < message.genders.length; ++i) - if (!$util.isString(message.genders[i])) - return "genders: string[] expected"; - } - if (message.ageGroups != null && message.hasOwnProperty("ageGroups")) { - if (!Array.isArray(message.ageGroups)) - return "ageGroups: array expected"; - for (var i = 0; i < message.ageGroups.length; ++i) - if (!$util.isString(message.ageGroups[i])) - return "ageGroups: string[] expected"; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.userEventRejoinScope != null && message.hasOwnProperty("userEventRejoinScope")) + switch (message.userEventRejoinScope) { + default: + return "userEventRejoinScope: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates an Audience message from a plain object. Also converts values to their respective internal types. + * Creates a RejoinUserEventsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.Audience + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Audience} Audience + * @returns {google.cloud.retail.v2alpha.RejoinUserEventsRequest} RejoinUserEventsRequest */ - Audience.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Audience) + RejoinUserEventsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.RejoinUserEventsRequest) return object; - var message = new $root.google.cloud.retail.v2beta.Audience(); - if (object.genders) { - if (!Array.isArray(object.genders)) - throw TypeError(".google.cloud.retail.v2beta.Audience.genders: array expected"); - message.genders = []; - for (var i = 0; i < object.genders.length; ++i) - message.genders[i] = String(object.genders[i]); - } - if (object.ageGroups) { - if (!Array.isArray(object.ageGroups)) - throw TypeError(".google.cloud.retail.v2beta.Audience.ageGroups: array expected"); - message.ageGroups = []; - for (var i = 0; i < object.ageGroups.length; ++i) - message.ageGroups[i] = String(object.ageGroups[i]); - } - return message; - }; - - /** - * Creates a plain object from an Audience message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.Audience + var message = new $root.google.cloud.retail.v2alpha.RejoinUserEventsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.userEventRejoinScope) { + case "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED": + case 0: + message.userEventRejoinScope = 0; + break; + case "JOINED_EVENTS": + case 1: + message.userEventRejoinScope = 1; + break; + case "UNJOINED_EVENTS": + case 2: + message.userEventRejoinScope = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a RejoinUserEventsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest * @static - * @param {google.cloud.retail.v2beta.Audience} message Audience + * @param {google.cloud.retail.v2alpha.RejoinUserEventsRequest} message RejoinUserEventsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Audience.toObject = function toObject(message, options) { + RejoinUserEventsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.genders = []; - object.ageGroups = []; - } - if (message.genders && message.genders.length) { - object.genders = []; - for (var j = 0; j < message.genders.length; ++j) - object.genders[j] = message.genders[j]; - } - if (message.ageGroups && message.ageGroups.length) { - object.ageGroups = []; - for (var j = 0; j < message.ageGroups.length; ++j) - object.ageGroups[j] = message.ageGroups[j]; + if (options.defaults) { + object.parent = ""; + object.userEventRejoinScope = options.enums === String ? "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED" : 0; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.userEventRejoinScope != null && message.hasOwnProperty("userEventRejoinScope")) + object.userEventRejoinScope = options.enums === String ? $root.google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope[message.userEventRejoinScope] : message.userEventRejoinScope; return object; }; /** - * Converts this Audience to JSON. + * Converts this RejoinUserEventsRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.Audience + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsRequest * @instance * @returns {Object.} JSON object */ - Audience.prototype.toJSON = function toJSON() { + RejoinUserEventsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Audience; + /** + * UserEventRejoinScope enum. + * @name google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope + * @enum {number} + * @property {number} USER_EVENT_REJOIN_SCOPE_UNSPECIFIED=0 USER_EVENT_REJOIN_SCOPE_UNSPECIFIED value + * @property {number} JOINED_EVENTS=1 JOINED_EVENTS value + * @property {number} UNJOINED_EVENTS=2 UNJOINED_EVENTS value + */ + RejoinUserEventsRequest.UserEventRejoinScope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOINED_EVENTS"] = 1; + values[valuesById[2] = "UNJOINED_EVENTS"] = 2; + return values; + })(); + + return RejoinUserEventsRequest; })(); - v2beta.ColorInfo = (function() { + v2alpha.RejoinUserEventsResponse = (function() { /** - * Properties of a ColorInfo. - * @memberof google.cloud.retail.v2beta - * @interface IColorInfo - * @property {Array.|null} [colorFamilies] ColorInfo colorFamilies - * @property {Array.|null} [colors] ColorInfo colors + * Properties of a RejoinUserEventsResponse. + * @memberof google.cloud.retail.v2alpha + * @interface IRejoinUserEventsResponse + * @property {number|Long|null} [rejoinedUserEventsCount] RejoinUserEventsResponse rejoinedUserEventsCount */ /** - * Constructs a new ColorInfo. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a ColorInfo. - * @implements IColorInfo + * Constructs a new RejoinUserEventsResponse. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a RejoinUserEventsResponse. + * @implements IRejoinUserEventsResponse * @constructor - * @param {google.cloud.retail.v2beta.IColorInfo=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IRejoinUserEventsResponse=} [properties] Properties to set */ - function ColorInfo(properties) { - this.colorFamilies = []; - this.colors = []; + function RejoinUserEventsResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -55923,94 +53885,75 @@ } /** - * ColorInfo colorFamilies. - * @member {Array.} colorFamilies - * @memberof google.cloud.retail.v2beta.ColorInfo - * @instance - */ - ColorInfo.prototype.colorFamilies = $util.emptyArray; - - /** - * ColorInfo colors. - * @member {Array.} colors - * @memberof google.cloud.retail.v2beta.ColorInfo + * RejoinUserEventsResponse rejoinedUserEventsCount. + * @member {number|Long} rejoinedUserEventsCount + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse * @instance */ - ColorInfo.prototype.colors = $util.emptyArray; + RejoinUserEventsResponse.prototype.rejoinedUserEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new ColorInfo instance using the specified properties. + * Creates a new RejoinUserEventsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.ColorInfo + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse * @static - * @param {google.cloud.retail.v2beta.IColorInfo=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ColorInfo} ColorInfo instance + * @param {google.cloud.retail.v2alpha.IRejoinUserEventsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.RejoinUserEventsResponse} RejoinUserEventsResponse instance */ - ColorInfo.create = function create(properties) { - return new ColorInfo(properties); + RejoinUserEventsResponse.create = function create(properties) { + return new RejoinUserEventsResponse(properties); }; /** - * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.retail.v2beta.ColorInfo.verify|verify} messages. + * Encodes the specified RejoinUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.ColorInfo + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse * @static - * @param {google.cloud.retail.v2beta.IColorInfo} message ColorInfo message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRejoinUserEventsResponse} message RejoinUserEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ColorInfo.encode = function encode(message, writer) { + RejoinUserEventsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.colorFamilies != null && message.colorFamilies.length) - for (var i = 0; i < message.colorFamilies.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.colorFamilies[i]); - if (message.colors != null && message.colors.length) - for (var i = 0; i < message.colors.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.colors[i]); + if (message.rejoinedUserEventsCount != null && Object.hasOwnProperty.call(message, "rejoinedUserEventsCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.rejoinedUserEventsCount); return writer; }; /** - * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ColorInfo.verify|verify} messages. + * Encodes the specified RejoinUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ColorInfo + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse * @static - * @param {google.cloud.retail.v2beta.IColorInfo} message ColorInfo message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRejoinUserEventsResponse} message RejoinUserEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ColorInfo.encodeDelimited = function encodeDelimited(message, writer) { + RejoinUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ColorInfo message from the specified reader or buffer. + * Decodes a RejoinUserEventsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.ColorInfo + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ColorInfo} ColorInfo + * @returns {google.cloud.retail.v2alpha.RejoinUserEventsResponse} RejoinUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ColorInfo.decode = function decode(reader, length) { + RejoinUserEventsResponse.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.v2beta.ColorInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RejoinUserEventsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.colorFamilies && message.colorFamilies.length)) - message.colorFamilies = []; - message.colorFamilies.push(reader.string()); - break; - case 2: - if (!(message.colors && message.colors.length)) - message.colors = []; - message.colors.push(reader.string()); + message.rejoinedUserEventsCount = reader.int64(); break; default: reader.skipType(tag & 7); @@ -56021,145 +53964,120 @@ }; /** - * Decodes a ColorInfo message from the specified reader or buffer, length delimited. + * Decodes a RejoinUserEventsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ColorInfo + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ColorInfo} ColorInfo + * @returns {google.cloud.retail.v2alpha.RejoinUserEventsResponse} RejoinUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ColorInfo.decodeDelimited = function decodeDelimited(reader) { + RejoinUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ColorInfo message. + * Verifies a RejoinUserEventsResponse message. * @function verify - * @memberof google.cloud.retail.v2beta.ColorInfo + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ColorInfo.verify = function verify(message) { + RejoinUserEventsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.colorFamilies != null && message.hasOwnProperty("colorFamilies")) { - if (!Array.isArray(message.colorFamilies)) - return "colorFamilies: array expected"; - for (var i = 0; i < message.colorFamilies.length; ++i) - if (!$util.isString(message.colorFamilies[i])) - return "colorFamilies: string[] expected"; - } - if (message.colors != null && message.hasOwnProperty("colors")) { - if (!Array.isArray(message.colors)) - return "colors: array expected"; - for (var i = 0; i < message.colors.length; ++i) - if (!$util.isString(message.colors[i])) - return "colors: string[] expected"; - } + if (message.rejoinedUserEventsCount != null && message.hasOwnProperty("rejoinedUserEventsCount")) + if (!$util.isInteger(message.rejoinedUserEventsCount) && !(message.rejoinedUserEventsCount && $util.isInteger(message.rejoinedUserEventsCount.low) && $util.isInteger(message.rejoinedUserEventsCount.high))) + return "rejoinedUserEventsCount: integer|Long expected"; return null; }; /** - * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. + * Creates a RejoinUserEventsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.ColorInfo + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ColorInfo} ColorInfo + * @returns {google.cloud.retail.v2alpha.RejoinUserEventsResponse} RejoinUserEventsResponse */ - ColorInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ColorInfo) + RejoinUserEventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.RejoinUserEventsResponse) return object; - var message = new $root.google.cloud.retail.v2beta.ColorInfo(); - if (object.colorFamilies) { - if (!Array.isArray(object.colorFamilies)) - throw TypeError(".google.cloud.retail.v2beta.ColorInfo.colorFamilies: array expected"); - message.colorFamilies = []; - for (var i = 0; i < object.colorFamilies.length; ++i) - message.colorFamilies[i] = String(object.colorFamilies[i]); - } - if (object.colors) { - if (!Array.isArray(object.colors)) - throw TypeError(".google.cloud.retail.v2beta.ColorInfo.colors: array expected"); - message.colors = []; - for (var i = 0; i < object.colors.length; ++i) - message.colors[i] = String(object.colors[i]); - } + var message = new $root.google.cloud.retail.v2alpha.RejoinUserEventsResponse(); + if (object.rejoinedUserEventsCount != null) + if ($util.Long) + (message.rejoinedUserEventsCount = $util.Long.fromValue(object.rejoinedUserEventsCount)).unsigned = false; + else if (typeof object.rejoinedUserEventsCount === "string") + message.rejoinedUserEventsCount = parseInt(object.rejoinedUserEventsCount, 10); + else if (typeof object.rejoinedUserEventsCount === "number") + message.rejoinedUserEventsCount = object.rejoinedUserEventsCount; + else if (typeof object.rejoinedUserEventsCount === "object") + message.rejoinedUserEventsCount = new $util.LongBits(object.rejoinedUserEventsCount.low >>> 0, object.rejoinedUserEventsCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. + * Creates a plain object from a RejoinUserEventsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.ColorInfo + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse * @static - * @param {google.cloud.retail.v2beta.ColorInfo} message ColorInfo + * @param {google.cloud.retail.v2alpha.RejoinUserEventsResponse} message RejoinUserEventsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ColorInfo.toObject = function toObject(message, options) { + RejoinUserEventsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.colorFamilies = []; - object.colors = []; - } - if (message.colorFamilies && message.colorFamilies.length) { - object.colorFamilies = []; - for (var j = 0; j < message.colorFamilies.length; ++j) - object.colorFamilies[j] = message.colorFamilies[j]; - } - if (message.colors && message.colors.length) { - object.colors = []; - for (var j = 0; j < message.colors.length; ++j) - object.colors[j] = message.colors[j]; - } + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rejoinedUserEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rejoinedUserEventsCount = options.longs === String ? "0" : 0; + if (message.rejoinedUserEventsCount != null && message.hasOwnProperty("rejoinedUserEventsCount")) + if (typeof message.rejoinedUserEventsCount === "number") + object.rejoinedUserEventsCount = options.longs === String ? String(message.rejoinedUserEventsCount) : message.rejoinedUserEventsCount; + else + object.rejoinedUserEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.rejoinedUserEventsCount) : options.longs === Number ? new $util.LongBits(message.rejoinedUserEventsCount.low >>> 0, message.rejoinedUserEventsCount.high >>> 0).toNumber() : message.rejoinedUserEventsCount; return object; }; /** - * Converts this ColorInfo to JSON. + * Converts this RejoinUserEventsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.ColorInfo + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsResponse * @instance * @returns {Object.} JSON object */ - ColorInfo.prototype.toJSON = function toJSON() { + RejoinUserEventsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ColorInfo; + return RejoinUserEventsResponse; })(); - v2beta.CustomAttribute = (function() { + v2alpha.RejoinUserEventsMetadata = (function() { /** - * Properties of a CustomAttribute. - * @memberof google.cloud.retail.v2beta - * @interface ICustomAttribute - * @property {Array.|null} [text] CustomAttribute text - * @property {Array.|null} [numbers] CustomAttribute numbers - * @property {boolean|null} [searchable] CustomAttribute searchable - * @property {boolean|null} [indexable] CustomAttribute indexable + * Properties of a RejoinUserEventsMetadata. + * @memberof google.cloud.retail.v2alpha + * @interface IRejoinUserEventsMetadata */ /** - * Constructs a new CustomAttribute. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a CustomAttribute. - * @implements ICustomAttribute + * Constructs a new RejoinUserEventsMetadata. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a RejoinUserEventsMetadata. + * @implements IRejoinUserEventsMetadata * @constructor - * @param {google.cloud.retail.v2beta.ICustomAttribute=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IRejoinUserEventsMetadata=} [properties] Properties to set */ - function CustomAttribute(properties) { - this.text = []; - this.numbers = []; + function RejoinUserEventsMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -56167,154 +54085,63 @@ } /** - * CustomAttribute text. - * @member {Array.} text - * @memberof google.cloud.retail.v2beta.CustomAttribute - * @instance - */ - CustomAttribute.prototype.text = $util.emptyArray; - - /** - * CustomAttribute numbers. - * @member {Array.} numbers - * @memberof google.cloud.retail.v2beta.CustomAttribute - * @instance - */ - CustomAttribute.prototype.numbers = $util.emptyArray; - - /** - * CustomAttribute searchable. - * @member {boolean|null|undefined} searchable - * @memberof google.cloud.retail.v2beta.CustomAttribute - * @instance - */ - CustomAttribute.prototype.searchable = null; - - /** - * CustomAttribute indexable. - * @member {boolean|null|undefined} indexable - * @memberof google.cloud.retail.v2beta.CustomAttribute - * @instance - */ - CustomAttribute.prototype.indexable = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * CustomAttribute _searchable. - * @member {"searchable"|undefined} _searchable - * @memberof google.cloud.retail.v2beta.CustomAttribute - * @instance - */ - Object.defineProperty(CustomAttribute.prototype, "_searchable", { - get: $util.oneOfGetter($oneOfFields = ["searchable"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * CustomAttribute _indexable. - * @member {"indexable"|undefined} _indexable - * @memberof google.cloud.retail.v2beta.CustomAttribute - * @instance - */ - Object.defineProperty(CustomAttribute.prototype, "_indexable", { - get: $util.oneOfGetter($oneOfFields = ["indexable"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CustomAttribute instance using the specified properties. + * Creates a new RejoinUserEventsMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.CustomAttribute + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata * @static - * @param {google.cloud.retail.v2beta.ICustomAttribute=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.CustomAttribute} CustomAttribute instance + * @param {google.cloud.retail.v2alpha.IRejoinUserEventsMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.RejoinUserEventsMetadata} RejoinUserEventsMetadata instance */ - CustomAttribute.create = function create(properties) { - return new CustomAttribute(properties); + RejoinUserEventsMetadata.create = function create(properties) { + return new RejoinUserEventsMetadata(properties); }; /** - * Encodes the specified CustomAttribute message. Does not implicitly {@link google.cloud.retail.v2beta.CustomAttribute.verify|verify} messages. + * Encodes the specified RejoinUserEventsMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.CustomAttribute + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata * @static - * @param {google.cloud.retail.v2beta.ICustomAttribute} message CustomAttribute message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRejoinUserEventsMetadata} message RejoinUserEventsMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomAttribute.encode = function encode(message, writer) { + RejoinUserEventsMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.text != null && message.text.length) - for (var i = 0; i < message.text.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text[i]); - if (message.numbers != null && message.numbers.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.numbers.length; ++i) - writer.double(message.numbers[i]); - writer.ldelim(); - } - if (message.searchable != null && Object.hasOwnProperty.call(message, "searchable")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.searchable); - if (message.indexable != null && Object.hasOwnProperty.call(message, "indexable")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.indexable); return writer; }; /** - * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CustomAttribute.verify|verify} messages. + * Encodes the specified RejoinUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RejoinUserEventsMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.CustomAttribute + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata * @static - * @param {google.cloud.retail.v2beta.ICustomAttribute} message CustomAttribute message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRejoinUserEventsMetadata} message RejoinUserEventsMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomAttribute.encodeDelimited = function encodeDelimited(message, writer) { + RejoinUserEventsMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomAttribute message from the specified reader or buffer. + * Decodes a RejoinUserEventsMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.CustomAttribute + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.CustomAttribute} CustomAttribute + * @returns {google.cloud.retail.v2alpha.RejoinUserEventsMetadata} RejoinUserEventsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomAttribute.decode = function decode(reader, length) { + RejoinUserEventsMetadata.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.v2beta.CustomAttribute(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RejoinUserEventsMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.text && message.text.length)) - message.text = []; - message.text.push(reader.string()); - break; - case 2: - if (!(message.numbers && message.numbers.length)) - message.numbers = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.numbers.push(reader.double()); - } else - message.numbers.push(reader.double()); - break; - case 3: - message.searchable = reader.bool(); - break; - case 4: - message.indexable = reader.bool(); - break; default: reader.skipType(tag & 7); break; @@ -56324,167 +54151,107 @@ }; /** - * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. + * Decodes a RejoinUserEventsMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.CustomAttribute + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.CustomAttribute} CustomAttribute + * @returns {google.cloud.retail.v2alpha.RejoinUserEventsMetadata} RejoinUserEventsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomAttribute.decodeDelimited = function decodeDelimited(reader) { + RejoinUserEventsMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomAttribute message. + * Verifies a RejoinUserEventsMetadata message. * @function verify - * @memberof google.cloud.retail.v2beta.CustomAttribute + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CustomAttribute.verify = function verify(message) { + RejoinUserEventsMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.text != null && message.hasOwnProperty("text")) { - if (!Array.isArray(message.text)) - return "text: array expected"; - for (var i = 0; i < message.text.length; ++i) - if (!$util.isString(message.text[i])) - return "text: string[] expected"; - } - if (message.numbers != null && message.hasOwnProperty("numbers")) { - if (!Array.isArray(message.numbers)) - return "numbers: array expected"; - for (var i = 0; i < message.numbers.length; ++i) - if (typeof message.numbers[i] !== "number") - return "numbers: number[] expected"; - } - if (message.searchable != null && message.hasOwnProperty("searchable")) { - properties._searchable = 1; - if (typeof message.searchable !== "boolean") - return "searchable: boolean expected"; - } - if (message.indexable != null && message.hasOwnProperty("indexable")) { - properties._indexable = 1; - if (typeof message.indexable !== "boolean") - return "indexable: boolean expected"; - } return null; }; /** - * Creates a CustomAttribute message from a plain object. Also converts values to their respective internal types. + * Creates a RejoinUserEventsMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.CustomAttribute + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.CustomAttribute} CustomAttribute + * @returns {google.cloud.retail.v2alpha.RejoinUserEventsMetadata} RejoinUserEventsMetadata */ - CustomAttribute.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.CustomAttribute) + RejoinUserEventsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.RejoinUserEventsMetadata) return object; - var message = new $root.google.cloud.retail.v2beta.CustomAttribute(); - if (object.text) { - if (!Array.isArray(object.text)) - throw TypeError(".google.cloud.retail.v2beta.CustomAttribute.text: array expected"); - message.text = []; - for (var i = 0; i < object.text.length; ++i) - message.text[i] = String(object.text[i]); - } - if (object.numbers) { - if (!Array.isArray(object.numbers)) - throw TypeError(".google.cloud.retail.v2beta.CustomAttribute.numbers: array expected"); - message.numbers = []; - for (var i = 0; i < object.numbers.length; ++i) - message.numbers[i] = Number(object.numbers[i]); - } - if (object.searchable != null) - message.searchable = Boolean(object.searchable); - if (object.indexable != null) - message.indexable = Boolean(object.indexable); - return message; + return new $root.google.cloud.retail.v2alpha.RejoinUserEventsMetadata(); }; /** - * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. + * Creates a plain object from a RejoinUserEventsMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.CustomAttribute + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata * @static - * @param {google.cloud.retail.v2beta.CustomAttribute} message CustomAttribute + * @param {google.cloud.retail.v2alpha.RejoinUserEventsMetadata} message RejoinUserEventsMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomAttribute.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.text = []; - object.numbers = []; - } - if (message.text && message.text.length) { - object.text = []; - for (var j = 0; j < message.text.length; ++j) - object.text[j] = message.text[j]; - } - if (message.numbers && message.numbers.length) { - object.numbers = []; - for (var j = 0; j < message.numbers.length; ++j) - object.numbers[j] = options.json && !isFinite(message.numbers[j]) ? String(message.numbers[j]) : message.numbers[j]; - } - if (message.searchable != null && message.hasOwnProperty("searchable")) { - object.searchable = message.searchable; - if (options.oneofs) - object._searchable = "searchable"; - } - if (message.indexable != null && message.hasOwnProperty("indexable")) { - object.indexable = message.indexable; - if (options.oneofs) - object._indexable = "indexable"; - } - return object; + RejoinUserEventsMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this CustomAttribute to JSON. + * Converts this RejoinUserEventsMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.CustomAttribute + * @memberof google.cloud.retail.v2alpha.RejoinUserEventsMetadata * @instance * @returns {Object.} JSON object */ - CustomAttribute.prototype.toJSON = function toJSON() { + RejoinUserEventsMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomAttribute; + return RejoinUserEventsMetadata; })(); - v2beta.FulfillmentInfo = (function() { + return v2alpha; + })(); + + retail.v2beta = (function() { + + /** + * Namespace v2beta. + * @memberof google.cloud.retail + * @namespace + */ + var v2beta = {}; + + v2beta.ProductLevelConfig = (function() { /** - * Properties of a FulfillmentInfo. + * Properties of a ProductLevelConfig. * @memberof google.cloud.retail.v2beta - * @interface IFulfillmentInfo - * @property {string|null} [type] FulfillmentInfo type - * @property {Array.|null} [placeIds] FulfillmentInfo placeIds + * @interface IProductLevelConfig + * @property {string|null} [ingestionProductType] ProductLevelConfig ingestionProductType + * @property {string|null} [merchantCenterProductIdField] ProductLevelConfig merchantCenterProductIdField */ /** - * Constructs a new FulfillmentInfo. + * Constructs a new ProductLevelConfig. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a FulfillmentInfo. - * @implements IFulfillmentInfo + * @classdesc Represents a ProductLevelConfig. + * @implements IProductLevelConfig * @constructor - * @param {google.cloud.retail.v2beta.IFulfillmentInfo=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IProductLevelConfig=} [properties] Properties to set */ - function FulfillmentInfo(properties) { - this.placeIds = []; + function ProductLevelConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -56492,91 +54259,88 @@ } /** - * FulfillmentInfo type. - * @member {string} type - * @memberof google.cloud.retail.v2beta.FulfillmentInfo + * ProductLevelConfig ingestionProductType. + * @member {string} ingestionProductType + * @memberof google.cloud.retail.v2beta.ProductLevelConfig * @instance */ - FulfillmentInfo.prototype.type = ""; + ProductLevelConfig.prototype.ingestionProductType = ""; /** - * FulfillmentInfo placeIds. - * @member {Array.} placeIds - * @memberof google.cloud.retail.v2beta.FulfillmentInfo + * ProductLevelConfig merchantCenterProductIdField. + * @member {string} merchantCenterProductIdField + * @memberof google.cloud.retail.v2beta.ProductLevelConfig * @instance */ - FulfillmentInfo.prototype.placeIds = $util.emptyArray; + ProductLevelConfig.prototype.merchantCenterProductIdField = ""; /** - * Creates a new FulfillmentInfo instance using the specified properties. + * Creates a new ProductLevelConfig instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.FulfillmentInfo + * @memberof google.cloud.retail.v2beta.ProductLevelConfig * @static - * @param {google.cloud.retail.v2beta.IFulfillmentInfo=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.FulfillmentInfo} FulfillmentInfo instance + * @param {google.cloud.retail.v2beta.IProductLevelConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ProductLevelConfig} ProductLevelConfig instance */ - FulfillmentInfo.create = function create(properties) { - return new FulfillmentInfo(properties); + ProductLevelConfig.create = function create(properties) { + return new ProductLevelConfig(properties); }; /** - * Encodes the specified FulfillmentInfo message. Does not implicitly {@link google.cloud.retail.v2beta.FulfillmentInfo.verify|verify} messages. + * Encodes the specified ProductLevelConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ProductLevelConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.FulfillmentInfo + * @memberof google.cloud.retail.v2beta.ProductLevelConfig * @static - * @param {google.cloud.retail.v2beta.IFulfillmentInfo} message FulfillmentInfo message or plain object to encode + * @param {google.cloud.retail.v2beta.IProductLevelConfig} message ProductLevelConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FulfillmentInfo.encode = function encode(message, writer) { + ProductLevelConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.placeIds != null && message.placeIds.length) - for (var i = 0; i < message.placeIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.placeIds[i]); + if (message.ingestionProductType != null && Object.hasOwnProperty.call(message, "ingestionProductType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ingestionProductType); + if (message.merchantCenterProductIdField != null && Object.hasOwnProperty.call(message, "merchantCenterProductIdField")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.merchantCenterProductIdField); return writer; }; /** - * Encodes the specified FulfillmentInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.FulfillmentInfo.verify|verify} messages. + * Encodes the specified ProductLevelConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ProductLevelConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.FulfillmentInfo + * @memberof google.cloud.retail.v2beta.ProductLevelConfig * @static - * @param {google.cloud.retail.v2beta.IFulfillmentInfo} message FulfillmentInfo message or plain object to encode + * @param {google.cloud.retail.v2beta.IProductLevelConfig} message ProductLevelConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FulfillmentInfo.encodeDelimited = function encodeDelimited(message, writer) { + ProductLevelConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FulfillmentInfo message from the specified reader or buffer. + * Decodes a ProductLevelConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.FulfillmentInfo + * @memberof google.cloud.retail.v2beta.ProductLevelConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.FulfillmentInfo} FulfillmentInfo + * @returns {google.cloud.retail.v2beta.ProductLevelConfig} ProductLevelConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FulfillmentInfo.decode = function decode(reader, length) { + ProductLevelConfig.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.v2beta.FulfillmentInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.ProductLevelConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type = reader.string(); + message.ingestionProductType = reader.string(); break; case 2: - if (!(message.placeIds && message.placeIds.length)) - message.placeIds = []; - message.placeIds.push(reader.string()); + message.merchantCenterProductIdField = reader.string(); break; default: reader.skipType(tag & 7); @@ -56587,130 +54351,121 @@ }; /** - * Decodes a FulfillmentInfo message from the specified reader or buffer, length delimited. + * Decodes a ProductLevelConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.FulfillmentInfo + * @memberof google.cloud.retail.v2beta.ProductLevelConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.FulfillmentInfo} FulfillmentInfo + * @returns {google.cloud.retail.v2beta.ProductLevelConfig} ProductLevelConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FulfillmentInfo.decodeDelimited = function decodeDelimited(reader) { + ProductLevelConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FulfillmentInfo message. + * Verifies a ProductLevelConfig message. * @function verify - * @memberof google.cloud.retail.v2beta.FulfillmentInfo + * @memberof google.cloud.retail.v2beta.ProductLevelConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FulfillmentInfo.verify = function verify(message) { + ProductLevelConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.placeIds != null && message.hasOwnProperty("placeIds")) { - if (!Array.isArray(message.placeIds)) - return "placeIds: array expected"; - for (var i = 0; i < message.placeIds.length; ++i) - if (!$util.isString(message.placeIds[i])) - return "placeIds: string[] expected"; - } + if (message.ingestionProductType != null && message.hasOwnProperty("ingestionProductType")) + if (!$util.isString(message.ingestionProductType)) + return "ingestionProductType: string expected"; + if (message.merchantCenterProductIdField != null && message.hasOwnProperty("merchantCenterProductIdField")) + if (!$util.isString(message.merchantCenterProductIdField)) + return "merchantCenterProductIdField: string expected"; return null; }; /** - * Creates a FulfillmentInfo message from a plain object. Also converts values to their respective internal types. + * Creates a ProductLevelConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.FulfillmentInfo + * @memberof google.cloud.retail.v2beta.ProductLevelConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.FulfillmentInfo} FulfillmentInfo + * @returns {google.cloud.retail.v2beta.ProductLevelConfig} ProductLevelConfig */ - FulfillmentInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.FulfillmentInfo) + ProductLevelConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ProductLevelConfig) return object; - var message = new $root.google.cloud.retail.v2beta.FulfillmentInfo(); - if (object.type != null) - message.type = String(object.type); - if (object.placeIds) { - if (!Array.isArray(object.placeIds)) - throw TypeError(".google.cloud.retail.v2beta.FulfillmentInfo.placeIds: array expected"); - message.placeIds = []; - for (var i = 0; i < object.placeIds.length; ++i) - message.placeIds[i] = String(object.placeIds[i]); - } + var message = new $root.google.cloud.retail.v2beta.ProductLevelConfig(); + if (object.ingestionProductType != null) + message.ingestionProductType = String(object.ingestionProductType); + if (object.merchantCenterProductIdField != null) + message.merchantCenterProductIdField = String(object.merchantCenterProductIdField); return message; }; /** - * Creates a plain object from a FulfillmentInfo message. Also converts values to other types if specified. + * Creates a plain object from a ProductLevelConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.FulfillmentInfo + * @memberof google.cloud.retail.v2beta.ProductLevelConfig * @static - * @param {google.cloud.retail.v2beta.FulfillmentInfo} message FulfillmentInfo + * @param {google.cloud.retail.v2beta.ProductLevelConfig} message ProductLevelConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FulfillmentInfo.toObject = function toObject(message, options) { + ProductLevelConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.placeIds = []; - if (options.defaults) - object.type = ""; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.placeIds && message.placeIds.length) { - object.placeIds = []; - for (var j = 0; j < message.placeIds.length; ++j) - object.placeIds[j] = message.placeIds[j]; + if (options.defaults) { + object.ingestionProductType = ""; + object.merchantCenterProductIdField = ""; } + if (message.ingestionProductType != null && message.hasOwnProperty("ingestionProductType")) + object.ingestionProductType = message.ingestionProductType; + if (message.merchantCenterProductIdField != null && message.hasOwnProperty("merchantCenterProductIdField")) + object.merchantCenterProductIdField = message.merchantCenterProductIdField; return object; }; /** - * Converts this FulfillmentInfo to JSON. + * Converts this ProductLevelConfig to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.FulfillmentInfo + * @memberof google.cloud.retail.v2beta.ProductLevelConfig * @instance * @returns {Object.} JSON object */ - FulfillmentInfo.prototype.toJSON = function toJSON() { + ProductLevelConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FulfillmentInfo; + return ProductLevelConfig; })(); - v2beta.Image = (function() { + v2beta.CatalogAttribute = (function() { /** - * Properties of an Image. + * Properties of a CatalogAttribute. * @memberof google.cloud.retail.v2beta - * @interface IImage - * @property {string|null} [uri] Image uri - * @property {number|null} [height] Image height - * @property {number|null} [width] Image width + * @interface ICatalogAttribute + * @property {string|null} [key] CatalogAttribute key + * @property {boolean|null} [inUse] CatalogAttribute inUse + * @property {google.cloud.retail.v2beta.CatalogAttribute.AttributeType|null} [type] CatalogAttribute type + * @property {google.cloud.retail.v2beta.CatalogAttribute.IndexableOption|null} [indexableOption] CatalogAttribute indexableOption + * @property {google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption|null} [dynamicFacetableOption] CatalogAttribute dynamicFacetableOption + * @property {google.cloud.retail.v2beta.CatalogAttribute.SearchableOption|null} [searchableOption] CatalogAttribute searchableOption */ /** - * Constructs a new Image. + * Constructs a new CatalogAttribute. * @memberof google.cloud.retail.v2beta - * @classdesc Represents an Image. - * @implements IImage + * @classdesc Represents a CatalogAttribute. + * @implements ICatalogAttribute * @constructor - * @param {google.cloud.retail.v2beta.IImage=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.ICatalogAttribute=} [properties] Properties to set */ - function Image(properties) { + function CatalogAttribute(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -56718,101 +54473,140 @@ } /** - * Image uri. - * @member {string} uri - * @memberof google.cloud.retail.v2beta.Image + * CatalogAttribute key. + * @member {string} key + * @memberof google.cloud.retail.v2beta.CatalogAttribute * @instance */ - Image.prototype.uri = ""; + CatalogAttribute.prototype.key = ""; /** - * Image height. - * @member {number} height - * @memberof google.cloud.retail.v2beta.Image + * CatalogAttribute inUse. + * @member {boolean} inUse + * @memberof google.cloud.retail.v2beta.CatalogAttribute * @instance */ - Image.prototype.height = 0; + CatalogAttribute.prototype.inUse = false; /** - * Image width. - * @member {number} width - * @memberof google.cloud.retail.v2beta.Image + * CatalogAttribute type. + * @member {google.cloud.retail.v2beta.CatalogAttribute.AttributeType} type + * @memberof google.cloud.retail.v2beta.CatalogAttribute * @instance */ - Image.prototype.width = 0; + CatalogAttribute.prototype.type = 0; /** - * Creates a new Image instance using the specified properties. + * CatalogAttribute indexableOption. + * @member {google.cloud.retail.v2beta.CatalogAttribute.IndexableOption} indexableOption + * @memberof google.cloud.retail.v2beta.CatalogAttribute + * @instance + */ + CatalogAttribute.prototype.indexableOption = 0; + + /** + * CatalogAttribute dynamicFacetableOption. + * @member {google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption} dynamicFacetableOption + * @memberof google.cloud.retail.v2beta.CatalogAttribute + * @instance + */ + CatalogAttribute.prototype.dynamicFacetableOption = 0; + + /** + * CatalogAttribute searchableOption. + * @member {google.cloud.retail.v2beta.CatalogAttribute.SearchableOption} searchableOption + * @memberof google.cloud.retail.v2beta.CatalogAttribute + * @instance + */ + CatalogAttribute.prototype.searchableOption = 0; + + /** + * Creates a new CatalogAttribute instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.Image + * @memberof google.cloud.retail.v2beta.CatalogAttribute * @static - * @param {google.cloud.retail.v2beta.IImage=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Image} Image instance + * @param {google.cloud.retail.v2beta.ICatalogAttribute=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.CatalogAttribute} CatalogAttribute instance */ - Image.create = function create(properties) { - return new Image(properties); + CatalogAttribute.create = function create(properties) { + return new CatalogAttribute(properties); }; /** - * Encodes the specified Image message. Does not implicitly {@link google.cloud.retail.v2beta.Image.verify|verify} messages. + * Encodes the specified CatalogAttribute message. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.Image + * @memberof google.cloud.retail.v2beta.CatalogAttribute * @static - * @param {google.cloud.retail.v2beta.IImage} message Image message or plain object to encode + * @param {google.cloud.retail.v2beta.ICatalogAttribute} message CatalogAttribute message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Image.encode = function encode(message, writer) { + CatalogAttribute.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.height); - if (message.width != null && Object.hasOwnProperty.call(message, "width")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.width); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.indexableOption != null && Object.hasOwnProperty.call(message, "indexableOption")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.indexableOption); + if (message.dynamicFacetableOption != null && Object.hasOwnProperty.call(message, "dynamicFacetableOption")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.dynamicFacetableOption); + if (message.searchableOption != null && Object.hasOwnProperty.call(message, "searchableOption")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.searchableOption); + if (message.inUse != null && Object.hasOwnProperty.call(message, "inUse")) + 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); return writer; }; /** - * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Image.verify|verify} messages. + * Encodes the specified CatalogAttribute message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Image + * @memberof google.cloud.retail.v2beta.CatalogAttribute * @static - * @param {google.cloud.retail.v2beta.IImage} message Image message or plain object to encode + * @param {google.cloud.retail.v2beta.ICatalogAttribute} message CatalogAttribute message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Image.encodeDelimited = function encodeDelimited(message, writer) { + CatalogAttribute.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Image message from the specified reader or buffer. + * Decodes a CatalogAttribute message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.Image + * @memberof google.cloud.retail.v2beta.CatalogAttribute * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Image} Image + * @returns {google.cloud.retail.v2beta.CatalogAttribute} CatalogAttribute * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Image.decode = function decode(reader, length) { + CatalogAttribute.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.v2beta.Image(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.CatalogAttribute(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.uri = reader.string(); + message.key = reader.string(); break; - case 2: - message.height = reader.int32(); + case 9: + message.inUse = reader.bool(); break; - case 3: - message.width = reader.int32(); + case 10: + message.type = reader.int32(); + break; + case 5: + message.indexableOption = reader.int32(); + break; + case 6: + message.dynamicFacetableOption = reader.int32(); + break; + case 7: + message.searchableOption = reader.int32(); break; default: reader.skipType(tag & 7); @@ -56823,127 +54617,287 @@ }; /** - * Decodes an Image message from the specified reader or buffer, length delimited. + * Decodes a CatalogAttribute message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Image + * @memberof google.cloud.retail.v2beta.CatalogAttribute * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Image} Image + * @returns {google.cloud.retail.v2beta.CatalogAttribute} CatalogAttribute * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Image.decodeDelimited = function decodeDelimited(reader) { + CatalogAttribute.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Image message. + * Verifies a CatalogAttribute message. * @function verify - * @memberof google.cloud.retail.v2beta.Image + * @memberof google.cloud.retail.v2beta.CatalogAttribute * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Image.verify = function verify(message) { + CatalogAttribute.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height)) - return "height: integer expected"; - if (message.width != null && message.hasOwnProperty("width")) - if (!$util.isInteger(message.width)) - return "width: integer expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.inUse != null && message.hasOwnProperty("inUse")) + if (typeof message.inUse !== "boolean") + return "inUse: boolean expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.indexableOption != null && message.hasOwnProperty("indexableOption")) + switch (message.indexableOption) { + default: + return "indexableOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.dynamicFacetableOption != null && message.hasOwnProperty("dynamicFacetableOption")) + switch (message.dynamicFacetableOption) { + default: + return "dynamicFacetableOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.searchableOption != null && message.hasOwnProperty("searchableOption")) + switch (message.searchableOption) { + default: + return "searchableOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates an Image message from a plain object. Also converts values to their respective internal types. + * Creates a CatalogAttribute message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.Image + * @memberof google.cloud.retail.v2beta.CatalogAttribute * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Image} Image + * @returns {google.cloud.retail.v2beta.CatalogAttribute} CatalogAttribute */ - Image.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Image) + CatalogAttribute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.CatalogAttribute) return object; - var message = new $root.google.cloud.retail.v2beta.Image(); - if (object.uri != null) - message.uri = String(object.uri); - if (object.height != null) - message.height = object.height | 0; - if (object.width != null) - message.width = object.width | 0; + var message = new $root.google.cloud.retail.v2beta.CatalogAttribute(); + if (object.key != null) + message.key = String(object.key); + if (object.inUse != null) + message.inUse = Boolean(object.inUse); + switch (object.type) { + case "UNKNOWN": + case 0: + message.type = 0; + break; + case "TEXTUAL": + case 1: + message.type = 1; + break; + case "NUMERICAL": + case 2: + message.type = 2; + break; + } + switch (object.indexableOption) { + case "INDEXABLE_OPTION_UNSPECIFIED": + case 0: + message.indexableOption = 0; + break; + case "INDEXABLE_ENABLED": + case 1: + message.indexableOption = 1; + break; + case "INDEXABLE_DISABLED": + case 2: + message.indexableOption = 2; + break; + } + switch (object.dynamicFacetableOption) { + case "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED": + case 0: + message.dynamicFacetableOption = 0; + break; + case "DYNAMIC_FACETABLE_ENABLED": + case 1: + message.dynamicFacetableOption = 1; + break; + case "DYNAMIC_FACETABLE_DISABLED": + case 2: + message.dynamicFacetableOption = 2; + break; + } + switch (object.searchableOption) { + case "SEARCHABLE_OPTION_UNSPECIFIED": + case 0: + message.searchableOption = 0; + break; + case "SEARCHABLE_ENABLED": + case 1: + message.searchableOption = 1; + break; + case "SEARCHABLE_DISABLED": + case 2: + message.searchableOption = 2; + break; + } return message; }; /** - * Creates a plain object from an Image message. Also converts values to other types if specified. + * Creates a plain object from a CatalogAttribute message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.Image + * @memberof google.cloud.retail.v2beta.CatalogAttribute * @static - * @param {google.cloud.retail.v2beta.Image} message Image + * @param {google.cloud.retail.v2beta.CatalogAttribute} message CatalogAttribute * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Image.toObject = function toObject(message, options) { + CatalogAttribute.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.uri = ""; - object.height = 0; - object.width = 0; - } - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - if (message.height != null && message.hasOwnProperty("height")) - object.height = message.height; - if (message.width != null && message.hasOwnProperty("width")) - object.width = message.width; + object.key = ""; + object.indexableOption = options.enums === String ? "INDEXABLE_OPTION_UNSPECIFIED" : 0; + object.dynamicFacetableOption = options.enums === String ? "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED" : 0; + object.searchableOption = options.enums === String ? "SEARCHABLE_OPTION_UNSPECIFIED" : 0; + object.inUse = false; + object.type = options.enums === String ? "UNKNOWN" : 0; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.indexableOption != null && message.hasOwnProperty("indexableOption")) + object.indexableOption = options.enums === String ? $root.google.cloud.retail.v2beta.CatalogAttribute.IndexableOption[message.indexableOption] : message.indexableOption; + if (message.dynamicFacetableOption != null && message.hasOwnProperty("dynamicFacetableOption")) + object.dynamicFacetableOption = options.enums === String ? $root.google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption[message.dynamicFacetableOption] : message.dynamicFacetableOption; + if (message.searchableOption != null && message.hasOwnProperty("searchableOption")) + object.searchableOption = options.enums === String ? $root.google.cloud.retail.v2beta.CatalogAttribute.SearchableOption[message.searchableOption] : message.searchableOption; + if (message.inUse != null && message.hasOwnProperty("inUse")) + object.inUse = message.inUse; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.retail.v2beta.CatalogAttribute.AttributeType[message.type] : message.type; return object; }; /** - * Converts this Image to JSON. + * Converts this CatalogAttribute to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.Image + * @memberof google.cloud.retail.v2beta.CatalogAttribute * @instance * @returns {Object.} JSON object */ - Image.prototype.toJSON = function toJSON() { + CatalogAttribute.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Image; + /** + * AttributeType enum. + * @name google.cloud.retail.v2beta.CatalogAttribute.AttributeType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} TEXTUAL=1 TEXTUAL value + * @property {number} NUMERICAL=2 NUMERICAL value + */ + CatalogAttribute.AttributeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "TEXTUAL"] = 1; + values[valuesById[2] = "NUMERICAL"] = 2; + return values; + })(); + + /** + * IndexableOption enum. + * @name google.cloud.retail.v2beta.CatalogAttribute.IndexableOption + * @enum {number} + * @property {number} INDEXABLE_OPTION_UNSPECIFIED=0 INDEXABLE_OPTION_UNSPECIFIED value + * @property {number} INDEXABLE_ENABLED=1 INDEXABLE_ENABLED value + * @property {number} INDEXABLE_DISABLED=2 INDEXABLE_DISABLED value + */ + CatalogAttribute.IndexableOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INDEXABLE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "INDEXABLE_ENABLED"] = 1; + values[valuesById[2] = "INDEXABLE_DISABLED"] = 2; + return values; + })(); + + /** + * DynamicFacetableOption enum. + * @name google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption + * @enum {number} + * @property {number} DYNAMIC_FACETABLE_OPTION_UNSPECIFIED=0 DYNAMIC_FACETABLE_OPTION_UNSPECIFIED value + * @property {number} DYNAMIC_FACETABLE_ENABLED=1 DYNAMIC_FACETABLE_ENABLED value + * @property {number} DYNAMIC_FACETABLE_DISABLED=2 DYNAMIC_FACETABLE_DISABLED value + */ + CatalogAttribute.DynamicFacetableOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "DYNAMIC_FACETABLE_ENABLED"] = 1; + values[valuesById[2] = "DYNAMIC_FACETABLE_DISABLED"] = 2; + return values; + })(); + + /** + * SearchableOption enum. + * @name google.cloud.retail.v2beta.CatalogAttribute.SearchableOption + * @enum {number} + * @property {number} SEARCHABLE_OPTION_UNSPECIFIED=0 SEARCHABLE_OPTION_UNSPECIFIED value + * @property {number} SEARCHABLE_ENABLED=1 SEARCHABLE_ENABLED value + * @property {number} SEARCHABLE_DISABLED=2 SEARCHABLE_DISABLED value + */ + CatalogAttribute.SearchableOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEARCHABLE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "SEARCHABLE_ENABLED"] = 1; + values[valuesById[2] = "SEARCHABLE_DISABLED"] = 2; + return values; + })(); + + return CatalogAttribute; })(); - v2beta.Interval = (function() { + v2beta.AttributesConfig = (function() { /** - * Properties of an Interval. + * Properties of an AttributesConfig. * @memberof google.cloud.retail.v2beta - * @interface IInterval - * @property {number|null} [minimum] Interval minimum - * @property {number|null} [exclusiveMinimum] Interval exclusiveMinimum - * @property {number|null} [maximum] Interval maximum - * @property {number|null} [exclusiveMaximum] Interval exclusiveMaximum + * @interface IAttributesConfig + * @property {string|null} [name] AttributesConfig name + * @property {Object.|null} [catalogAttributes] AttributesConfig catalogAttributes + * @property {google.cloud.retail.v2beta.AttributeConfigLevel|null} [attributeConfigLevel] AttributesConfig attributeConfigLevel */ /** - * Constructs a new Interval. + * Constructs a new AttributesConfig. * @memberof google.cloud.retail.v2beta - * @classdesc Represents an Interval. - * @implements IInterval + * @classdesc Represents an AttributesConfig. + * @implements IAttributesConfig * @constructor - * @param {google.cloud.retail.v2beta.IInterval=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IAttributesConfig=} [properties] Properties to set */ - function Interval(properties) { + function AttributesConfig(properties) { + this.catalogAttributes = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -56951,139 +54905,123 @@ } /** - * Interval minimum. - * @member {number|null|undefined} minimum - * @memberof google.cloud.retail.v2beta.Interval - * @instance - */ - Interval.prototype.minimum = null; - - /** - * Interval exclusiveMinimum. - * @member {number|null|undefined} exclusiveMinimum - * @memberof google.cloud.retail.v2beta.Interval - * @instance - */ - Interval.prototype.exclusiveMinimum = null; - - /** - * Interval maximum. - * @member {number|null|undefined} maximum - * @memberof google.cloud.retail.v2beta.Interval - * @instance - */ - Interval.prototype.maximum = null; - - /** - * Interval exclusiveMaximum. - * @member {number|null|undefined} exclusiveMaximum - * @memberof google.cloud.retail.v2beta.Interval + * AttributesConfig name. + * @member {string} name + * @memberof google.cloud.retail.v2beta.AttributesConfig * @instance */ - Interval.prototype.exclusiveMaximum = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + AttributesConfig.prototype.name = ""; /** - * Interval min. - * @member {"minimum"|"exclusiveMinimum"|undefined} min - * @memberof google.cloud.retail.v2beta.Interval + * AttributesConfig catalogAttributes. + * @member {Object.} catalogAttributes + * @memberof google.cloud.retail.v2beta.AttributesConfig * @instance */ - Object.defineProperty(Interval.prototype, "min", { - get: $util.oneOfGetter($oneOfFields = ["minimum", "exclusiveMinimum"]), - set: $util.oneOfSetter($oneOfFields) - }); + AttributesConfig.prototype.catalogAttributes = $util.emptyObject; /** - * Interval max. - * @member {"maximum"|"exclusiveMaximum"|undefined} max - * @memberof google.cloud.retail.v2beta.Interval + * AttributesConfig attributeConfigLevel. + * @member {google.cloud.retail.v2beta.AttributeConfigLevel} attributeConfigLevel + * @memberof google.cloud.retail.v2beta.AttributesConfig * @instance */ - Object.defineProperty(Interval.prototype, "max", { - get: $util.oneOfGetter($oneOfFields = ["maximum", "exclusiveMaximum"]), - set: $util.oneOfSetter($oneOfFields) - }); + AttributesConfig.prototype.attributeConfigLevel = 0; /** - * Creates a new Interval instance using the specified properties. + * Creates a new AttributesConfig instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.Interval + * @memberof google.cloud.retail.v2beta.AttributesConfig * @static - * @param {google.cloud.retail.v2beta.IInterval=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Interval} Interval instance + * @param {google.cloud.retail.v2beta.IAttributesConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.AttributesConfig} AttributesConfig instance */ - Interval.create = function create(properties) { - return new Interval(properties); + AttributesConfig.create = function create(properties) { + return new AttributesConfig(properties); }; /** - * Encodes the specified Interval message. Does not implicitly {@link google.cloud.retail.v2beta.Interval.verify|verify} messages. + * Encodes the specified AttributesConfig message. Does not implicitly {@link google.cloud.retail.v2beta.AttributesConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.Interval + * @memberof google.cloud.retail.v2beta.AttributesConfig * @static - * @param {google.cloud.retail.v2beta.IInterval} message Interval message or plain object to encode + * @param {google.cloud.retail.v2beta.IAttributesConfig} message AttributesConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Interval.encode = function encode(message, writer) { + AttributesConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.minimum != null && Object.hasOwnProperty.call(message, "minimum")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.minimum); - if (message.exclusiveMinimum != null && Object.hasOwnProperty.call(message, "exclusiveMinimum")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.exclusiveMinimum); - if (message.maximum != null && Object.hasOwnProperty.call(message, "maximum")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.maximum); - if (message.exclusiveMaximum != null && Object.hasOwnProperty.call(message, "exclusiveMaximum")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.exclusiveMaximum); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.catalogAttributes != null && Object.hasOwnProperty.call(message, "catalogAttributes")) + for (var keys = Object.keys(message.catalogAttributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.retail.v2beta.CatalogAttribute.encode(message.catalogAttributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.attributeConfigLevel != null && Object.hasOwnProperty.call(message, "attributeConfigLevel")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.attributeConfigLevel); return writer; }; /** - * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Interval.verify|verify} messages. + * Encodes the specified AttributesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AttributesConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Interval + * @memberof google.cloud.retail.v2beta.AttributesConfig * @static - * @param {google.cloud.retail.v2beta.IInterval} message Interval message or plain object to encode + * @param {google.cloud.retail.v2beta.IAttributesConfig} message AttributesConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Interval.encodeDelimited = function encodeDelimited(message, writer) { + AttributesConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Interval message from the specified reader or buffer. + * Decodes an AttributesConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.Interval + * @memberof google.cloud.retail.v2beta.AttributesConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Interval} Interval + * @returns {google.cloud.retail.v2beta.AttributesConfig} AttributesConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Interval.decode = function decode(reader, length) { + AttributesConfig.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.v2beta.Interval(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.AttributesConfig(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.minimum = reader.double(); + message.name = reader.string(); break; case 2: - message.exclusiveMinimum = reader.double(); + if (message.catalogAttributes === $util.emptyObject) + message.catalogAttributes = {}; + 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.v2beta.CatalogAttribute.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.catalogAttributes[key] = value; break; case 3: - message.maximum = reader.double(); - break; - case 4: - message.exclusiveMaximum = reader.double(); + message.attributeConfigLevel = reader.int32(); break; default: reader.skipType(tag & 7); @@ -57094,157 +55032,172 @@ }; /** - * Decodes an Interval message from the specified reader or buffer, length delimited. + * Decodes an AttributesConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Interval + * @memberof google.cloud.retail.v2beta.AttributesConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Interval} Interval + * @returns {google.cloud.retail.v2beta.AttributesConfig} AttributesConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Interval.decodeDelimited = function decodeDelimited(reader) { + AttributesConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Interval message. + * Verifies an AttributesConfig message. * @function verify - * @memberof google.cloud.retail.v2beta.Interval + * @memberof google.cloud.retail.v2beta.AttributesConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Interval.verify = function verify(message) { + AttributesConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.minimum != null && message.hasOwnProperty("minimum")) { - properties.min = 1; - if (typeof message.minimum !== "number") - return "minimum: number expected"; - } - if (message.exclusiveMinimum != null && message.hasOwnProperty("exclusiveMinimum")) { - if (properties.min === 1) - return "min: multiple values"; - properties.min = 1; - if (typeof message.exclusiveMinimum !== "number") - return "exclusiveMinimum: number expected"; - } - if (message.maximum != null && message.hasOwnProperty("maximum")) { - properties.max = 1; - if (typeof message.maximum !== "number") - return "maximum: number expected"; - } - if (message.exclusiveMaximum != null && message.hasOwnProperty("exclusiveMaximum")) { - if (properties.max === 1) - return "max: multiple values"; - properties.max = 1; - if (typeof message.exclusiveMaximum !== "number") - return "exclusiveMaximum: number expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.catalogAttributes != null && message.hasOwnProperty("catalogAttributes")) { + if (!$util.isObject(message.catalogAttributes)) + return "catalogAttributes: object expected"; + var key = Object.keys(message.catalogAttributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.retail.v2beta.CatalogAttribute.verify(message.catalogAttributes[key[i]]); + if (error) + return "catalogAttributes." + error; + } } + if (message.attributeConfigLevel != null && message.hasOwnProperty("attributeConfigLevel")) + switch (message.attributeConfigLevel) { + default: + return "attributeConfigLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates an Interval message from a plain object. Also converts values to their respective internal types. + * Creates an AttributesConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.Interval + * @memberof google.cloud.retail.v2beta.AttributesConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Interval} Interval + * @returns {google.cloud.retail.v2beta.AttributesConfig} AttributesConfig */ - Interval.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Interval) + AttributesConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.AttributesConfig) return object; - var message = new $root.google.cloud.retail.v2beta.Interval(); - if (object.minimum != null) - message.minimum = Number(object.minimum); - if (object.exclusiveMinimum != null) - message.exclusiveMinimum = Number(object.exclusiveMinimum); - if (object.maximum != null) - message.maximum = Number(object.maximum); - if (object.exclusiveMaximum != null) - message.exclusiveMaximum = Number(object.exclusiveMaximum); + var message = new $root.google.cloud.retail.v2beta.AttributesConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.catalogAttributes) { + if (typeof object.catalogAttributes !== "object") + throw TypeError(".google.cloud.retail.v2beta.AttributesConfig.catalogAttributes: object expected"); + message.catalogAttributes = {}; + for (var keys = Object.keys(object.catalogAttributes), i = 0; i < keys.length; ++i) { + if (typeof object.catalogAttributes[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2beta.AttributesConfig.catalogAttributes: object expected"); + message.catalogAttributes[keys[i]] = $root.google.cloud.retail.v2beta.CatalogAttribute.fromObject(object.catalogAttributes[keys[i]]); + } + } + switch (object.attributeConfigLevel) { + case "ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED": + case 0: + message.attributeConfigLevel = 0; + break; + case "PRODUCT_LEVEL_ATTRIBUTE_CONFIG": + case 1: + message.attributeConfigLevel = 1; + break; + case "CATALOG_LEVEL_ATTRIBUTE_CONFIG": + case 2: + message.attributeConfigLevel = 2; + break; + } return message; }; /** - * Creates a plain object from an Interval message. Also converts values to other types if specified. + * Creates a plain object from an AttributesConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.Interval + * @memberof google.cloud.retail.v2beta.AttributesConfig * @static - * @param {google.cloud.retail.v2beta.Interval} message Interval + * @param {google.cloud.retail.v2beta.AttributesConfig} message AttributesConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Interval.toObject = function toObject(message, options) { + AttributesConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.minimum != null && message.hasOwnProperty("minimum")) { - object.minimum = options.json && !isFinite(message.minimum) ? String(message.minimum) : message.minimum; - if (options.oneofs) - object.min = "minimum"; - } - if (message.exclusiveMinimum != null && message.hasOwnProperty("exclusiveMinimum")) { - object.exclusiveMinimum = options.json && !isFinite(message.exclusiveMinimum) ? String(message.exclusiveMinimum) : message.exclusiveMinimum; - if (options.oneofs) - object.min = "exclusiveMinimum"; - } - if (message.maximum != null && message.hasOwnProperty("maximum")) { - object.maximum = options.json && !isFinite(message.maximum) ? String(message.maximum) : message.maximum; - if (options.oneofs) - object.max = "maximum"; + if (options.objects || options.defaults) + object.catalogAttributes = {}; + if (options.defaults) { + object.name = ""; + object.attributeConfigLevel = options.enums === String ? "ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED" : 0; } - if (message.exclusiveMaximum != null && message.hasOwnProperty("exclusiveMaximum")) { - object.exclusiveMaximum = options.json && !isFinite(message.exclusiveMaximum) ? String(message.exclusiveMaximum) : message.exclusiveMaximum; - if (options.oneofs) - object.max = "exclusiveMaximum"; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.catalogAttributes && (keys2 = Object.keys(message.catalogAttributes)).length) { + object.catalogAttributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.catalogAttributes[keys2[j]] = $root.google.cloud.retail.v2beta.CatalogAttribute.toObject(message.catalogAttributes[keys2[j]], options); } + if (message.attributeConfigLevel != null && message.hasOwnProperty("attributeConfigLevel")) + object.attributeConfigLevel = options.enums === String ? $root.google.cloud.retail.v2beta.AttributeConfigLevel[message.attributeConfigLevel] : message.attributeConfigLevel; return object; }; /** - * Converts this Interval to JSON. + * Converts this AttributesConfig to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.Interval + * @memberof google.cloud.retail.v2beta.AttributesConfig * @instance * @returns {Object.} JSON object */ - Interval.prototype.toJSON = function toJSON() { + AttributesConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Interval; + return AttributesConfig; })(); - v2beta.PriceInfo = (function() { + v2beta.CompletionConfig = (function() { /** - * Properties of a PriceInfo. + * Properties of a CompletionConfig. * @memberof google.cloud.retail.v2beta - * @interface IPriceInfo - * @property {string|null} [currencyCode] PriceInfo currencyCode - * @property {number|null} [price] PriceInfo price - * @property {number|null} [originalPrice] PriceInfo originalPrice - * @property {number|null} [cost] PriceInfo cost - * @property {google.protobuf.ITimestamp|null} [priceEffectiveTime] PriceInfo priceEffectiveTime - * @property {google.protobuf.ITimestamp|null} [priceExpireTime] PriceInfo priceExpireTime - * @property {google.cloud.retail.v2beta.PriceInfo.IPriceRange|null} [priceRange] PriceInfo priceRange - */ - - /** - * Constructs a new PriceInfo. + * @interface ICompletionConfig + * @property {string|null} [name] CompletionConfig name + * @property {string|null} [matchingOrder] CompletionConfig matchingOrder + * @property {number|null} [maxSuggestions] CompletionConfig maxSuggestions + * @property {number|null} [minPrefixLength] CompletionConfig minPrefixLength + * @property {boolean|null} [autoLearning] CompletionConfig autoLearning + * @property {google.cloud.retail.v2beta.ICompletionDataInputConfig|null} [suggestionsInputConfig] CompletionConfig suggestionsInputConfig + * @property {string|null} [lastSuggestionsImportOperation] CompletionConfig lastSuggestionsImportOperation + * @property {google.cloud.retail.v2beta.ICompletionDataInputConfig|null} [denylistInputConfig] CompletionConfig denylistInputConfig + * @property {string|null} [lastDenylistImportOperation] CompletionConfig lastDenylistImportOperation + * @property {google.cloud.retail.v2beta.ICompletionDataInputConfig|null} [allowlistInputConfig] CompletionConfig allowlistInputConfig + * @property {string|null} [lastAllowlistImportOperation] CompletionConfig lastAllowlistImportOperation + */ + + /** + * Constructs a new CompletionConfig. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a PriceInfo. - * @implements IPriceInfo + * @classdesc Represents a CompletionConfig. + * @implements ICompletionConfig * @constructor - * @param {google.cloud.retail.v2beta.IPriceInfo=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.ICompletionConfig=} [properties] Properties to set */ - function PriceInfo(properties) { + function CompletionConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -57252,153 +55205,205 @@ } /** - * PriceInfo currencyCode. - * @member {string} currencyCode - * @memberof google.cloud.retail.v2beta.PriceInfo + * CompletionConfig name. + * @member {string} name + * @memberof google.cloud.retail.v2beta.CompletionConfig * @instance */ - PriceInfo.prototype.currencyCode = ""; + CompletionConfig.prototype.name = ""; /** - * PriceInfo price. - * @member {number} price - * @memberof google.cloud.retail.v2beta.PriceInfo + * CompletionConfig matchingOrder. + * @member {string} matchingOrder + * @memberof google.cloud.retail.v2beta.CompletionConfig * @instance */ - PriceInfo.prototype.price = 0; + CompletionConfig.prototype.matchingOrder = ""; /** - * PriceInfo originalPrice. - * @member {number} originalPrice - * @memberof google.cloud.retail.v2beta.PriceInfo + * CompletionConfig maxSuggestions. + * @member {number} maxSuggestions + * @memberof google.cloud.retail.v2beta.CompletionConfig * @instance */ - PriceInfo.prototype.originalPrice = 0; + CompletionConfig.prototype.maxSuggestions = 0; /** - * PriceInfo cost. - * @member {number} cost - * @memberof google.cloud.retail.v2beta.PriceInfo + * CompletionConfig minPrefixLength. + * @member {number} minPrefixLength + * @memberof google.cloud.retail.v2beta.CompletionConfig * @instance */ - PriceInfo.prototype.cost = 0; + CompletionConfig.prototype.minPrefixLength = 0; /** - * PriceInfo priceEffectiveTime. - * @member {google.protobuf.ITimestamp|null|undefined} priceEffectiveTime - * @memberof google.cloud.retail.v2beta.PriceInfo + * CompletionConfig autoLearning. + * @member {boolean} autoLearning + * @memberof google.cloud.retail.v2beta.CompletionConfig * @instance */ - PriceInfo.prototype.priceEffectiveTime = null; + CompletionConfig.prototype.autoLearning = false; /** - * PriceInfo priceExpireTime. - * @member {google.protobuf.ITimestamp|null|undefined} priceExpireTime - * @memberof google.cloud.retail.v2beta.PriceInfo + * CompletionConfig suggestionsInputConfig. + * @member {google.cloud.retail.v2beta.ICompletionDataInputConfig|null|undefined} suggestionsInputConfig + * @memberof google.cloud.retail.v2beta.CompletionConfig * @instance */ - PriceInfo.prototype.priceExpireTime = null; + CompletionConfig.prototype.suggestionsInputConfig = null; /** - * PriceInfo priceRange. - * @member {google.cloud.retail.v2beta.PriceInfo.IPriceRange|null|undefined} priceRange - * @memberof google.cloud.retail.v2beta.PriceInfo + * CompletionConfig lastSuggestionsImportOperation. + * @member {string} lastSuggestionsImportOperation + * @memberof google.cloud.retail.v2beta.CompletionConfig * @instance */ - PriceInfo.prototype.priceRange = null; + CompletionConfig.prototype.lastSuggestionsImportOperation = ""; /** - * Creates a new PriceInfo instance using the specified properties. + * CompletionConfig denylistInputConfig. + * @member {google.cloud.retail.v2beta.ICompletionDataInputConfig|null|undefined} denylistInputConfig + * @memberof google.cloud.retail.v2beta.CompletionConfig + * @instance + */ + CompletionConfig.prototype.denylistInputConfig = null; + + /** + * CompletionConfig lastDenylistImportOperation. + * @member {string} lastDenylistImportOperation + * @memberof google.cloud.retail.v2beta.CompletionConfig + * @instance + */ + CompletionConfig.prototype.lastDenylistImportOperation = ""; + + /** + * CompletionConfig allowlistInputConfig. + * @member {google.cloud.retail.v2beta.ICompletionDataInputConfig|null|undefined} allowlistInputConfig + * @memberof google.cloud.retail.v2beta.CompletionConfig + * @instance + */ + CompletionConfig.prototype.allowlistInputConfig = null; + + /** + * CompletionConfig lastAllowlistImportOperation. + * @member {string} lastAllowlistImportOperation + * @memberof google.cloud.retail.v2beta.CompletionConfig + * @instance + */ + CompletionConfig.prototype.lastAllowlistImportOperation = ""; + + /** + * Creates a new CompletionConfig instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.PriceInfo + * @memberof google.cloud.retail.v2beta.CompletionConfig * @static - * @param {google.cloud.retail.v2beta.IPriceInfo=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.PriceInfo} PriceInfo instance + * @param {google.cloud.retail.v2beta.ICompletionConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.CompletionConfig} CompletionConfig instance */ - PriceInfo.create = function create(properties) { - return new PriceInfo(properties); + CompletionConfig.create = function create(properties) { + return new CompletionConfig(properties); }; /** - * Encodes the specified PriceInfo message. Does not implicitly {@link google.cloud.retail.v2beta.PriceInfo.verify|verify} messages. + * Encodes the specified CompletionConfig message. Does not implicitly {@link google.cloud.retail.v2beta.CompletionConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.PriceInfo + * @memberof google.cloud.retail.v2beta.CompletionConfig * @static - * @param {google.cloud.retail.v2beta.IPriceInfo} message PriceInfo message or plain object to encode + * @param {google.cloud.retail.v2beta.ICompletionConfig} message CompletionConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PriceInfo.encode = function encode(message, writer) { + CompletionConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCode); - if (message.price != null && Object.hasOwnProperty.call(message, "price")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.price); - if (message.originalPrice != null && Object.hasOwnProperty.call(message, "originalPrice")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.originalPrice); - if (message.cost != null && Object.hasOwnProperty.call(message, "cost")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.cost); - if (message.priceEffectiveTime != null && Object.hasOwnProperty.call(message, "priceEffectiveTime")) - $root.google.protobuf.Timestamp.encode(message.priceEffectiveTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.priceExpireTime != null && Object.hasOwnProperty.call(message, "priceExpireTime")) - $root.google.protobuf.Timestamp.encode(message.priceExpireTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.priceRange != null && Object.hasOwnProperty.call(message, "priceRange")) - $root.google.cloud.retail.v2beta.PriceInfo.PriceRange.encode(message.priceRange, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.matchingOrder != null && Object.hasOwnProperty.call(message, "matchingOrder")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.matchingOrder); + if (message.maxSuggestions != null && Object.hasOwnProperty.call(message, "maxSuggestions")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxSuggestions); + if (message.minPrefixLength != null && Object.hasOwnProperty.call(message, "minPrefixLength")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minPrefixLength); + if (message.suggestionsInputConfig != null && Object.hasOwnProperty.call(message, "suggestionsInputConfig")) + $root.google.cloud.retail.v2beta.CompletionDataInputConfig.encode(message.suggestionsInputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lastSuggestionsImportOperation != null && Object.hasOwnProperty.call(message, "lastSuggestionsImportOperation")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.lastSuggestionsImportOperation); + if (message.denylistInputConfig != null && Object.hasOwnProperty.call(message, "denylistInputConfig")) + $root.google.cloud.retail.v2beta.CompletionDataInputConfig.encode(message.denylistInputConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.lastDenylistImportOperation != null && Object.hasOwnProperty.call(message, "lastDenylistImportOperation")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.lastDenylistImportOperation); + if (message.allowlistInputConfig != null && Object.hasOwnProperty.call(message, "allowlistInputConfig")) + $root.google.cloud.retail.v2beta.CompletionDataInputConfig.encode(message.allowlistInputConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.lastAllowlistImportOperation != null && Object.hasOwnProperty.call(message, "lastAllowlistImportOperation")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.lastAllowlistImportOperation); + if (message.autoLearning != null && Object.hasOwnProperty.call(message, "autoLearning")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.autoLearning); return writer; }; /** - * Encodes the specified PriceInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PriceInfo.verify|verify} messages. + * Encodes the specified CompletionConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompletionConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.PriceInfo + * @memberof google.cloud.retail.v2beta.CompletionConfig * @static - * @param {google.cloud.retail.v2beta.IPriceInfo} message PriceInfo message or plain object to encode + * @param {google.cloud.retail.v2beta.ICompletionConfig} message CompletionConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PriceInfo.encodeDelimited = function encodeDelimited(message, writer) { + CompletionConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PriceInfo message from the specified reader or buffer. + * Decodes a CompletionConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.PriceInfo + * @memberof google.cloud.retail.v2beta.CompletionConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.PriceInfo} PriceInfo + * @returns {google.cloud.retail.v2beta.CompletionConfig} CompletionConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PriceInfo.decode = function decode(reader, length) { + CompletionConfig.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.v2beta.PriceInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.CompletionConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.currencyCode = reader.string(); + message.name = reader.string(); break; case 2: - message.price = reader.float(); + message.matchingOrder = reader.string(); break; case 3: - message.originalPrice = reader.float(); + message.maxSuggestions = reader.int32(); break; case 4: - message.cost = reader.float(); + message.minPrefixLength = reader.int32(); + break; + case 11: + message.autoLearning = reader.bool(); break; case 5: - message.priceEffectiveTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.suggestionsInputConfig = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.decode(reader, reader.uint32()); break; case 6: - message.priceExpireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.lastSuggestionsImportOperation = reader.string(); break; case 7: - message.priceRange = $root.google.cloud.retail.v2beta.PriceInfo.PriceRange.decode(reader, reader.uint32()); + message.denylistInputConfig = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.decode(reader, reader.uint32()); + break; + case 8: + message.lastDenylistImportOperation = reader.string(); + break; + case 9: + message.allowlistInputConfig = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.decode(reader, reader.uint32()); + break; + case 10: + message.lastAllowlistImportOperation = reader.string(); break; default: reader.skipType(tag & 7); @@ -57409,507 +55414,339 @@ }; /** - * Decodes a PriceInfo message from the specified reader or buffer, length delimited. + * Decodes a CompletionConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.PriceInfo + * @memberof google.cloud.retail.v2beta.CompletionConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.PriceInfo} PriceInfo + * @returns {google.cloud.retail.v2beta.CompletionConfig} CompletionConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PriceInfo.decodeDelimited = function decodeDelimited(reader) { + CompletionConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PriceInfo message. + * Verifies a CompletionConfig message. * @function verify - * @memberof google.cloud.retail.v2beta.PriceInfo + * @memberof google.cloud.retail.v2beta.CompletionConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PriceInfo.verify = function verify(message) { + CompletionConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - if (!$util.isString(message.currencyCode)) - return "currencyCode: string expected"; - if (message.price != null && message.hasOwnProperty("price")) - if (typeof message.price !== "number") - return "price: number expected"; - if (message.originalPrice != null && message.hasOwnProperty("originalPrice")) - if (typeof message.originalPrice !== "number") - return "originalPrice: number expected"; - if (message.cost != null && message.hasOwnProperty("cost")) - if (typeof message.cost !== "number") - return "cost: number expected"; - if (message.priceEffectiveTime != null && message.hasOwnProperty("priceEffectiveTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.priceEffectiveTime); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.matchingOrder != null && message.hasOwnProperty("matchingOrder")) + if (!$util.isString(message.matchingOrder)) + return "matchingOrder: string expected"; + if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) + if (!$util.isInteger(message.maxSuggestions)) + return "maxSuggestions: integer expected"; + if (message.minPrefixLength != null && message.hasOwnProperty("minPrefixLength")) + if (!$util.isInteger(message.minPrefixLength)) + return "minPrefixLength: integer expected"; + if (message.autoLearning != null && message.hasOwnProperty("autoLearning")) + if (typeof message.autoLearning !== "boolean") + return "autoLearning: boolean expected"; + if (message.suggestionsInputConfig != null && message.hasOwnProperty("suggestionsInputConfig")) { + var error = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.verify(message.suggestionsInputConfig); if (error) - return "priceEffectiveTime." + error; + return "suggestionsInputConfig." + error; } - if (message.priceExpireTime != null && message.hasOwnProperty("priceExpireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.priceExpireTime); + if (message.lastSuggestionsImportOperation != null && message.hasOwnProperty("lastSuggestionsImportOperation")) + if (!$util.isString(message.lastSuggestionsImportOperation)) + return "lastSuggestionsImportOperation: string expected"; + if (message.denylistInputConfig != null && message.hasOwnProperty("denylistInputConfig")) { + var error = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.verify(message.denylistInputConfig); if (error) - return "priceExpireTime." + error; + return "denylistInputConfig." + error; } - if (message.priceRange != null && message.hasOwnProperty("priceRange")) { - var error = $root.google.cloud.retail.v2beta.PriceInfo.PriceRange.verify(message.priceRange); + if (message.lastDenylistImportOperation != null && message.hasOwnProperty("lastDenylistImportOperation")) + if (!$util.isString(message.lastDenylistImportOperation)) + return "lastDenylistImportOperation: string expected"; + if (message.allowlistInputConfig != null && message.hasOwnProperty("allowlistInputConfig")) { + var error = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.verify(message.allowlistInputConfig); if (error) - return "priceRange." + error; + return "allowlistInputConfig." + error; } + if (message.lastAllowlistImportOperation != null && message.hasOwnProperty("lastAllowlistImportOperation")) + if (!$util.isString(message.lastAllowlistImportOperation)) + return "lastAllowlistImportOperation: string expected"; return null; }; /** - * Creates a PriceInfo message from a plain object. Also converts values to their respective internal types. + * Creates a CompletionConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.PriceInfo + * @memberof google.cloud.retail.v2beta.CompletionConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.PriceInfo} PriceInfo + * @returns {google.cloud.retail.v2beta.CompletionConfig} CompletionConfig */ - PriceInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.PriceInfo) + CompletionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.CompletionConfig) return object; - var message = new $root.google.cloud.retail.v2beta.PriceInfo(); - if (object.currencyCode != null) - message.currencyCode = String(object.currencyCode); - if (object.price != null) - message.price = Number(object.price); - if (object.originalPrice != null) - message.originalPrice = Number(object.originalPrice); - if (object.cost != null) - message.cost = Number(object.cost); - if (object.priceEffectiveTime != null) { - if (typeof object.priceEffectiveTime !== "object") - throw TypeError(".google.cloud.retail.v2beta.PriceInfo.priceEffectiveTime: object expected"); - message.priceEffectiveTime = $root.google.protobuf.Timestamp.fromObject(object.priceEffectiveTime); - } - if (object.priceExpireTime != null) { - if (typeof object.priceExpireTime !== "object") - throw TypeError(".google.cloud.retail.v2beta.PriceInfo.priceExpireTime: object expected"); - message.priceExpireTime = $root.google.protobuf.Timestamp.fromObject(object.priceExpireTime); - } - if (object.priceRange != null) { - if (typeof object.priceRange !== "object") - throw TypeError(".google.cloud.retail.v2beta.PriceInfo.priceRange: object expected"); - message.priceRange = $root.google.cloud.retail.v2beta.PriceInfo.PriceRange.fromObject(object.priceRange); - } + var message = new $root.google.cloud.retail.v2beta.CompletionConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.matchingOrder != null) + message.matchingOrder = String(object.matchingOrder); + if (object.maxSuggestions != null) + message.maxSuggestions = object.maxSuggestions | 0; + if (object.minPrefixLength != null) + message.minPrefixLength = object.minPrefixLength | 0; + if (object.autoLearning != null) + message.autoLearning = Boolean(object.autoLearning); + if (object.suggestionsInputConfig != null) { + if (typeof object.suggestionsInputConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.CompletionConfig.suggestionsInputConfig: object expected"); + message.suggestionsInputConfig = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.fromObject(object.suggestionsInputConfig); + } + if (object.lastSuggestionsImportOperation != null) + message.lastSuggestionsImportOperation = String(object.lastSuggestionsImportOperation); + if (object.denylistInputConfig != null) { + if (typeof object.denylistInputConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.CompletionConfig.denylistInputConfig: object expected"); + message.denylistInputConfig = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.fromObject(object.denylistInputConfig); + } + if (object.lastDenylistImportOperation != null) + message.lastDenylistImportOperation = String(object.lastDenylistImportOperation); + if (object.allowlistInputConfig != null) { + if (typeof object.allowlistInputConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.CompletionConfig.allowlistInputConfig: object expected"); + message.allowlistInputConfig = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.fromObject(object.allowlistInputConfig); + } + if (object.lastAllowlistImportOperation != null) + message.lastAllowlistImportOperation = String(object.lastAllowlistImportOperation); return message; }; /** - * Creates a plain object from a PriceInfo message. Also converts values to other types if specified. + * Creates a plain object from a CompletionConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.PriceInfo + * @memberof google.cloud.retail.v2beta.CompletionConfig * @static - * @param {google.cloud.retail.v2beta.PriceInfo} message PriceInfo + * @param {google.cloud.retail.v2beta.CompletionConfig} message CompletionConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PriceInfo.toObject = function toObject(message, options) { + CompletionConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.currencyCode = ""; - object.price = 0; - object.originalPrice = 0; - object.cost = 0; - object.priceEffectiveTime = null; - object.priceExpireTime = null; - object.priceRange = null; + object.name = ""; + object.matchingOrder = ""; + object.maxSuggestions = 0; + object.minPrefixLength = 0; + object.suggestionsInputConfig = null; + object.lastSuggestionsImportOperation = ""; + object.denylistInputConfig = null; + object.lastDenylistImportOperation = ""; + object.allowlistInputConfig = null; + object.lastAllowlistImportOperation = ""; + object.autoLearning = false; } - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - object.currencyCode = message.currencyCode; - if (message.price != null && message.hasOwnProperty("price")) - object.price = options.json && !isFinite(message.price) ? String(message.price) : message.price; - if (message.originalPrice != null && message.hasOwnProperty("originalPrice")) - object.originalPrice = options.json && !isFinite(message.originalPrice) ? String(message.originalPrice) : message.originalPrice; - if (message.cost != null && message.hasOwnProperty("cost")) - object.cost = options.json && !isFinite(message.cost) ? String(message.cost) : message.cost; - if (message.priceEffectiveTime != null && message.hasOwnProperty("priceEffectiveTime")) - object.priceEffectiveTime = $root.google.protobuf.Timestamp.toObject(message.priceEffectiveTime, options); - if (message.priceExpireTime != null && message.hasOwnProperty("priceExpireTime")) - object.priceExpireTime = $root.google.protobuf.Timestamp.toObject(message.priceExpireTime, options); - if (message.priceRange != null && message.hasOwnProperty("priceRange")) - object.priceRange = $root.google.cloud.retail.v2beta.PriceInfo.PriceRange.toObject(message.priceRange, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.matchingOrder != null && message.hasOwnProperty("matchingOrder")) + object.matchingOrder = message.matchingOrder; + if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) + object.maxSuggestions = message.maxSuggestions; + if (message.minPrefixLength != null && message.hasOwnProperty("minPrefixLength")) + object.minPrefixLength = message.minPrefixLength; + if (message.suggestionsInputConfig != null && message.hasOwnProperty("suggestionsInputConfig")) + object.suggestionsInputConfig = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.toObject(message.suggestionsInputConfig, options); + if (message.lastSuggestionsImportOperation != null && message.hasOwnProperty("lastSuggestionsImportOperation")) + object.lastSuggestionsImportOperation = message.lastSuggestionsImportOperation; + if (message.denylistInputConfig != null && message.hasOwnProperty("denylistInputConfig")) + object.denylistInputConfig = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.toObject(message.denylistInputConfig, options); + if (message.lastDenylistImportOperation != null && message.hasOwnProperty("lastDenylistImportOperation")) + object.lastDenylistImportOperation = message.lastDenylistImportOperation; + if (message.allowlistInputConfig != null && message.hasOwnProperty("allowlistInputConfig")) + object.allowlistInputConfig = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.toObject(message.allowlistInputConfig, options); + if (message.lastAllowlistImportOperation != null && message.hasOwnProperty("lastAllowlistImportOperation")) + object.lastAllowlistImportOperation = message.lastAllowlistImportOperation; + if (message.autoLearning != null && message.hasOwnProperty("autoLearning")) + object.autoLearning = message.autoLearning; return object; }; /** - * Converts this PriceInfo to JSON. + * Converts this CompletionConfig to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.PriceInfo + * @memberof google.cloud.retail.v2beta.CompletionConfig * @instance * @returns {Object.} JSON object */ - PriceInfo.prototype.toJSON = function toJSON() { + CompletionConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - PriceInfo.PriceRange = (function() { + return CompletionConfig; + })(); - /** - * Properties of a PriceRange. - * @memberof google.cloud.retail.v2beta.PriceInfo - * @interface IPriceRange - * @property {google.cloud.retail.v2beta.IInterval|null} [price] PriceRange price - * @property {google.cloud.retail.v2beta.IInterval|null} [originalPrice] PriceRange originalPrice - */ + v2beta.MerchantCenterLink = (function() { - /** - * Constructs a new PriceRange. - * @memberof google.cloud.retail.v2beta.PriceInfo - * @classdesc Represents a PriceRange. - * @implements IPriceRange - * @constructor - * @param {google.cloud.retail.v2beta.PriceInfo.IPriceRange=} [properties] Properties to set - */ - function PriceRange(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]]; - } + /** + * Properties of a MerchantCenterLink. + * @memberof google.cloud.retail.v2beta + * @interface IMerchantCenterLink + * @property {number|Long|null} [merchantCenterAccountId] MerchantCenterLink merchantCenterAccountId + * @property {string|null} [branchId] MerchantCenterLink branchId + * @property {Array.|null} [destinations] MerchantCenterLink destinations + * @property {string|null} [regionCode] MerchantCenterLink regionCode + * @property {string|null} [languageCode] MerchantCenterLink languageCode + */ - /** - * PriceRange price. - * @member {google.cloud.retail.v2beta.IInterval|null|undefined} price - * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange - * @instance - */ - PriceRange.prototype.price = null; + /** + * Constructs a new MerchantCenterLink. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a MerchantCenterLink. + * @implements IMerchantCenterLink + * @constructor + * @param {google.cloud.retail.v2beta.IMerchantCenterLink=} [properties] Properties to set + */ + function MerchantCenterLink(properties) { + this.destinations = []; + 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]]; + } - /** - * PriceRange originalPrice. - * @member {google.cloud.retail.v2beta.IInterval|null|undefined} originalPrice - * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange - * @instance - */ - PriceRange.prototype.originalPrice = null; + /** + * MerchantCenterLink merchantCenterAccountId. + * @member {number|Long} merchantCenterAccountId + * @memberof google.cloud.retail.v2beta.MerchantCenterLink + * @instance + */ + MerchantCenterLink.prototype.merchantCenterAccountId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Creates a new PriceRange instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange - * @static - * @param {google.cloud.retail.v2beta.PriceInfo.IPriceRange=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.PriceInfo.PriceRange} PriceRange instance - */ - PriceRange.create = function create(properties) { - return new PriceRange(properties); - }; + /** + * MerchantCenterLink branchId. + * @member {string} branchId + * @memberof google.cloud.retail.v2beta.MerchantCenterLink + * @instance + */ + MerchantCenterLink.prototype.branchId = ""; - /** - * Encodes the specified PriceRange message. Does not implicitly {@link google.cloud.retail.v2beta.PriceInfo.PriceRange.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange - * @static - * @param {google.cloud.retail.v2beta.PriceInfo.IPriceRange} message PriceRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PriceRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.price != null && Object.hasOwnProperty.call(message, "price")) - $root.google.cloud.retail.v2beta.Interval.encode(message.price, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.originalPrice != null && Object.hasOwnProperty.call(message, "originalPrice")) - $root.google.cloud.retail.v2beta.Interval.encode(message.originalPrice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * MerchantCenterLink destinations. + * @member {Array.} destinations + * @memberof google.cloud.retail.v2beta.MerchantCenterLink + * @instance + */ + MerchantCenterLink.prototype.destinations = $util.emptyArray; - /** - * Encodes the specified PriceRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PriceInfo.PriceRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange - * @static - * @param {google.cloud.retail.v2beta.PriceInfo.IPriceRange} message PriceRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PriceRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * MerchantCenterLink regionCode. + * @member {string} regionCode + * @memberof google.cloud.retail.v2beta.MerchantCenterLink + * @instance + */ + MerchantCenterLink.prototype.regionCode = ""; - /** - * Decodes a PriceRange message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.PriceInfo.PriceRange} PriceRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PriceRange.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.v2beta.PriceInfo.PriceRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.price = $root.google.cloud.retail.v2beta.Interval.decode(reader, reader.uint32()); - break; - case 2: - message.originalPrice = $root.google.cloud.retail.v2beta.Interval.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PriceRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.PriceInfo.PriceRange} PriceRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PriceRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PriceRange message. - * @function verify - * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PriceRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.price != null && message.hasOwnProperty("price")) { - var error = $root.google.cloud.retail.v2beta.Interval.verify(message.price); - if (error) - return "price." + error; - } - if (message.originalPrice != null && message.hasOwnProperty("originalPrice")) { - var error = $root.google.cloud.retail.v2beta.Interval.verify(message.originalPrice); - if (error) - return "originalPrice." + error; - } - return null; - }; - - /** - * Creates a PriceRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.PriceInfo.PriceRange} PriceRange - */ - PriceRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.PriceInfo.PriceRange) - return object; - var message = new $root.google.cloud.retail.v2beta.PriceInfo.PriceRange(); - if (object.price != null) { - if (typeof object.price !== "object") - throw TypeError(".google.cloud.retail.v2beta.PriceInfo.PriceRange.price: object expected"); - message.price = $root.google.cloud.retail.v2beta.Interval.fromObject(object.price); - } - if (object.originalPrice != null) { - if (typeof object.originalPrice !== "object") - throw TypeError(".google.cloud.retail.v2beta.PriceInfo.PriceRange.originalPrice: object expected"); - message.originalPrice = $root.google.cloud.retail.v2beta.Interval.fromObject(object.originalPrice); - } - return message; - }; - - /** - * Creates a plain object from a PriceRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange - * @static - * @param {google.cloud.retail.v2beta.PriceInfo.PriceRange} message PriceRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PriceRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.price = null; - object.originalPrice = null; - } - if (message.price != null && message.hasOwnProperty("price")) - object.price = $root.google.cloud.retail.v2beta.Interval.toObject(message.price, options); - if (message.originalPrice != null && message.hasOwnProperty("originalPrice")) - object.originalPrice = $root.google.cloud.retail.v2beta.Interval.toObject(message.originalPrice, options); - return object; - }; - - /** - * Converts this PriceRange to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange - * @instance - * @returns {Object.} JSON object - */ - PriceRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PriceRange; - })(); - - return PriceInfo; - })(); - - v2beta.Rating = (function() { - - /** - * Properties of a Rating. - * @memberof google.cloud.retail.v2beta - * @interface IRating - * @property {number|null} [ratingCount] Rating ratingCount - * @property {number|null} [averageRating] Rating averageRating - * @property {Array.|null} [ratingHistogram] Rating ratingHistogram - */ - - /** - * Constructs a new Rating. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a Rating. - * @implements IRating - * @constructor - * @param {google.cloud.retail.v2beta.IRating=} [properties] Properties to set - */ - function Rating(properties) { - this.ratingHistogram = []; - 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]]; - } - - /** - * Rating ratingCount. - * @member {number} ratingCount - * @memberof google.cloud.retail.v2beta.Rating - * @instance - */ - Rating.prototype.ratingCount = 0; - - /** - * Rating averageRating. - * @member {number} averageRating - * @memberof google.cloud.retail.v2beta.Rating - * @instance - */ - Rating.prototype.averageRating = 0; - - /** - * Rating ratingHistogram. - * @member {Array.} ratingHistogram - * @memberof google.cloud.retail.v2beta.Rating - * @instance - */ - Rating.prototype.ratingHistogram = $util.emptyArray; + /** + * MerchantCenterLink languageCode. + * @member {string} languageCode + * @memberof google.cloud.retail.v2beta.MerchantCenterLink + * @instance + */ + MerchantCenterLink.prototype.languageCode = ""; /** - * Creates a new Rating instance using the specified properties. + * Creates a new MerchantCenterLink instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.Rating + * @memberof google.cloud.retail.v2beta.MerchantCenterLink * @static - * @param {google.cloud.retail.v2beta.IRating=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Rating} Rating instance + * @param {google.cloud.retail.v2beta.IMerchantCenterLink=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.MerchantCenterLink} MerchantCenterLink instance */ - Rating.create = function create(properties) { - return new Rating(properties); + MerchantCenterLink.create = function create(properties) { + return new MerchantCenterLink(properties); }; /** - * Encodes the specified Rating message. Does not implicitly {@link google.cloud.retail.v2beta.Rating.verify|verify} messages. + * Encodes the specified MerchantCenterLink message. Does not implicitly {@link google.cloud.retail.v2beta.MerchantCenterLink.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.Rating + * @memberof google.cloud.retail.v2beta.MerchantCenterLink * @static - * @param {google.cloud.retail.v2beta.IRating} message Rating message or plain object to encode + * @param {google.cloud.retail.v2beta.IMerchantCenterLink} message MerchantCenterLink message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Rating.encode = function encode(message, writer) { + MerchantCenterLink.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ratingCount != null && Object.hasOwnProperty.call(message, "ratingCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ratingCount); - if (message.averageRating != null && Object.hasOwnProperty.call(message, "averageRating")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.averageRating); - if (message.ratingHistogram != null && message.ratingHistogram.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.ratingHistogram.length; ++i) - writer.int32(message.ratingHistogram[i]); - writer.ldelim(); - } + if (message.merchantCenterAccountId != null && Object.hasOwnProperty.call(message, "merchantCenterAccountId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.merchantCenterAccountId); + if (message.branchId != null && Object.hasOwnProperty.call(message, "branchId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.branchId); + if (message.destinations != null && message.destinations.length) + for (var i = 0; i < message.destinations.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.destinations[i]); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + 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); return writer; }; /** - * Encodes the specified Rating message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rating.verify|verify} messages. + * Encodes the specified MerchantCenterLink message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.MerchantCenterLink.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Rating + * @memberof google.cloud.retail.v2beta.MerchantCenterLink * @static - * @param {google.cloud.retail.v2beta.IRating} message Rating message or plain object to encode + * @param {google.cloud.retail.v2beta.IMerchantCenterLink} message MerchantCenterLink message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Rating.encodeDelimited = function encodeDelimited(message, writer) { + MerchantCenterLink.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Rating message from the specified reader or buffer. + * Decodes a MerchantCenterLink message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.Rating + * @memberof google.cloud.retail.v2beta.MerchantCenterLink * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Rating} Rating + * @returns {google.cloud.retail.v2beta.MerchantCenterLink} MerchantCenterLink * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Rating.decode = function decode(reader, length) { + MerchantCenterLink.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.v2beta.Rating(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.MerchantCenterLink(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.ratingCount = reader.int32(); + message.merchantCenterAccountId = reader.int64(); break; case 2: - message.averageRating = reader.float(); + message.branchId = reader.string(); break; case 3: - if (!(message.ratingHistogram && message.ratingHistogram.length)) - message.ratingHistogram = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.ratingHistogram.push(reader.int32()); - } else - message.ratingHistogram.push(reader.int32()); + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + message.destinations.push(reader.string()); + break; + case 4: + message.regionCode = reader.string(); + break; + case 5: + message.languageCode = reader.string(); break; default: reader.skipType(tag & 7); @@ -57920,140 +55757,168 @@ }; /** - * Decodes a Rating message from the specified reader or buffer, length delimited. + * Decodes a MerchantCenterLink message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Rating + * @memberof google.cloud.retail.v2beta.MerchantCenterLink * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Rating} Rating + * @returns {google.cloud.retail.v2beta.MerchantCenterLink} MerchantCenterLink * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Rating.decodeDelimited = function decodeDelimited(reader) { + MerchantCenterLink.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Rating message. + * Verifies a MerchantCenterLink message. * @function verify - * @memberof google.cloud.retail.v2beta.Rating + * @memberof google.cloud.retail.v2beta.MerchantCenterLink * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Rating.verify = function verify(message) { + MerchantCenterLink.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.ratingCount != null && message.hasOwnProperty("ratingCount")) - if (!$util.isInteger(message.ratingCount)) - return "ratingCount: integer expected"; - if (message.averageRating != null && message.hasOwnProperty("averageRating")) - if (typeof message.averageRating !== "number") - return "averageRating: number expected"; - if (message.ratingHistogram != null && message.hasOwnProperty("ratingHistogram")) { - if (!Array.isArray(message.ratingHistogram)) - return "ratingHistogram: array expected"; - for (var i = 0; i < message.ratingHistogram.length; ++i) - if (!$util.isInteger(message.ratingHistogram[i])) - return "ratingHistogram: integer[] expected"; + if (message.merchantCenterAccountId != null && message.hasOwnProperty("merchantCenterAccountId")) + if (!$util.isInteger(message.merchantCenterAccountId) && !(message.merchantCenterAccountId && $util.isInteger(message.merchantCenterAccountId.low) && $util.isInteger(message.merchantCenterAccountId.high))) + return "merchantCenterAccountId: integer|Long expected"; + if (message.branchId != null && message.hasOwnProperty("branchId")) + if (!$util.isString(message.branchId)) + return "branchId: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + if (!$util.isString(message.destinations[i])) + return "destinations: string[] expected"; } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; return null; }; /** - * Creates a Rating message from a plain object. Also converts values to their respective internal types. + * Creates a MerchantCenterLink message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.Rating + * @memberof google.cloud.retail.v2beta.MerchantCenterLink * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Rating} Rating + * @returns {google.cloud.retail.v2beta.MerchantCenterLink} MerchantCenterLink */ - Rating.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Rating) + MerchantCenterLink.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.MerchantCenterLink) return object; - var message = new $root.google.cloud.retail.v2beta.Rating(); - if (object.ratingCount != null) - message.ratingCount = object.ratingCount | 0; - if (object.averageRating != null) - message.averageRating = Number(object.averageRating); - if (object.ratingHistogram) { - if (!Array.isArray(object.ratingHistogram)) - throw TypeError(".google.cloud.retail.v2beta.Rating.ratingHistogram: array expected"); - message.ratingHistogram = []; - for (var i = 0; i < object.ratingHistogram.length; ++i) - message.ratingHistogram[i] = object.ratingHistogram[i] | 0; + var message = new $root.google.cloud.retail.v2beta.MerchantCenterLink(); + if (object.merchantCenterAccountId != null) + if ($util.Long) + (message.merchantCenterAccountId = $util.Long.fromValue(object.merchantCenterAccountId)).unsigned = false; + else if (typeof object.merchantCenterAccountId === "string") + message.merchantCenterAccountId = parseInt(object.merchantCenterAccountId, 10); + else if (typeof object.merchantCenterAccountId === "number") + message.merchantCenterAccountId = object.merchantCenterAccountId; + else if (typeof object.merchantCenterAccountId === "object") + message.merchantCenterAccountId = new $util.LongBits(object.merchantCenterAccountId.low >>> 0, object.merchantCenterAccountId.high >>> 0).toNumber(); + if (object.branchId != null) + message.branchId = String(object.branchId); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.cloud.retail.v2beta.MerchantCenterLink.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + message.destinations[i] = String(object.destinations[i]); } + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); return message; }; /** - * Creates a plain object from a Rating message. Also converts values to other types if specified. + * Creates a plain object from a MerchantCenterLink message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.Rating + * @memberof google.cloud.retail.v2beta.MerchantCenterLink * @static - * @param {google.cloud.retail.v2beta.Rating} message Rating + * @param {google.cloud.retail.v2beta.MerchantCenterLink} message MerchantCenterLink * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Rating.toObject = function toObject(message, options) { + MerchantCenterLink.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.ratingHistogram = []; + object.destinations = []; if (options.defaults) { - object.ratingCount = 0; - object.averageRating = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.merchantCenterAccountId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.merchantCenterAccountId = options.longs === String ? "0" : 0; + object.branchId = ""; + object.regionCode = ""; + object.languageCode = ""; } - if (message.ratingCount != null && message.hasOwnProperty("ratingCount")) - object.ratingCount = message.ratingCount; - if (message.averageRating != null && message.hasOwnProperty("averageRating")) - object.averageRating = options.json && !isFinite(message.averageRating) ? String(message.averageRating) : message.averageRating; - if (message.ratingHistogram && message.ratingHistogram.length) { - object.ratingHistogram = []; - for (var j = 0; j < message.ratingHistogram.length; ++j) - object.ratingHistogram[j] = message.ratingHistogram[j]; + if (message.merchantCenterAccountId != null && message.hasOwnProperty("merchantCenterAccountId")) + if (typeof message.merchantCenterAccountId === "number") + object.merchantCenterAccountId = options.longs === String ? String(message.merchantCenterAccountId) : message.merchantCenterAccountId; + else + object.merchantCenterAccountId = options.longs === String ? $util.Long.prototype.toString.call(message.merchantCenterAccountId) : options.longs === Number ? new $util.LongBits(message.merchantCenterAccountId.low >>> 0, message.merchantCenterAccountId.high >>> 0).toNumber() : message.merchantCenterAccountId; + if (message.branchId != null && message.hasOwnProperty("branchId")) + object.branchId = message.branchId; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = message.destinations[j]; } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; return object; }; /** - * Converts this Rating to JSON. + * Converts this MerchantCenterLink to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.Rating + * @memberof google.cloud.retail.v2beta.MerchantCenterLink * @instance * @returns {Object.} JSON object */ - Rating.prototype.toJSON = function toJSON() { + MerchantCenterLink.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Rating; + return MerchantCenterLink; })(); - v2beta.UserInfo = (function() { + v2beta.MerchantCenterLinkingConfig = (function() { /** - * Properties of a UserInfo. + * Properties of a MerchantCenterLinkingConfig. * @memberof google.cloud.retail.v2beta - * @interface IUserInfo - * @property {string|null} [userId] UserInfo userId - * @property {string|null} [ipAddress] UserInfo ipAddress - * @property {string|null} [userAgent] UserInfo userAgent - * @property {boolean|null} [directUserRequest] UserInfo directUserRequest + * @interface IMerchantCenterLinkingConfig + * @property {Array.|null} [links] MerchantCenterLinkingConfig links */ /** - * Constructs a new UserInfo. + * Constructs a new MerchantCenterLinkingConfig. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a UserInfo. - * @implements IUserInfo + * @classdesc Represents a MerchantCenterLinkingConfig. + * @implements IMerchantCenterLinkingConfig * @constructor - * @param {google.cloud.retail.v2beta.IUserInfo=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IMerchantCenterLinkingConfig=} [properties] Properties to set */ - function UserInfo(properties) { + function MerchantCenterLinkingConfig(properties) { + this.links = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -58061,114 +55926,78 @@ } /** - * UserInfo userId. - * @member {string} userId - * @memberof google.cloud.retail.v2beta.UserInfo - * @instance - */ - UserInfo.prototype.userId = ""; - - /** - * UserInfo ipAddress. - * @member {string} ipAddress - * @memberof google.cloud.retail.v2beta.UserInfo - * @instance - */ - UserInfo.prototype.ipAddress = ""; - - /** - * UserInfo userAgent. - * @member {string} userAgent - * @memberof google.cloud.retail.v2beta.UserInfo - * @instance - */ - UserInfo.prototype.userAgent = ""; - - /** - * UserInfo directUserRequest. - * @member {boolean} directUserRequest - * @memberof google.cloud.retail.v2beta.UserInfo + * MerchantCenterLinkingConfig links. + * @member {Array.} links + * @memberof google.cloud.retail.v2beta.MerchantCenterLinkingConfig * @instance */ - UserInfo.prototype.directUserRequest = false; + MerchantCenterLinkingConfig.prototype.links = $util.emptyArray; /** - * Creates a new UserInfo instance using the specified properties. + * Creates a new MerchantCenterLinkingConfig instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.UserInfo + * @memberof google.cloud.retail.v2beta.MerchantCenterLinkingConfig * @static - * @param {google.cloud.retail.v2beta.IUserInfo=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.UserInfo} UserInfo instance + * @param {google.cloud.retail.v2beta.IMerchantCenterLinkingConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig instance */ - UserInfo.create = function create(properties) { - return new UserInfo(properties); + MerchantCenterLinkingConfig.create = function create(properties) { + return new MerchantCenterLinkingConfig(properties); }; /** - * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.retail.v2beta.UserInfo.verify|verify} messages. + * Encodes the specified MerchantCenterLinkingConfig message. Does not implicitly {@link google.cloud.retail.v2beta.MerchantCenterLinkingConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.UserInfo + * @memberof google.cloud.retail.v2beta.MerchantCenterLinkingConfig * @static - * @param {google.cloud.retail.v2beta.IUserInfo} message UserInfo message or plain object to encode + * @param {google.cloud.retail.v2beta.IMerchantCenterLinkingConfig} message MerchantCenterLinkingConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserInfo.encode = function encode(message, writer) { + MerchantCenterLinkingConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.userId); - if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAddress); - if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.userAgent); - if (message.directUserRequest != null && Object.hasOwnProperty.call(message, "directUserRequest")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.directUserRequest); + if (message.links != null && message.links.length) + for (var i = 0; i < message.links.length; ++i) + $root.google.cloud.retail.v2beta.MerchantCenterLink.encode(message.links[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserInfo.verify|verify} messages. + * Encodes the specified MerchantCenterLinkingConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.MerchantCenterLinkingConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.UserInfo + * @memberof google.cloud.retail.v2beta.MerchantCenterLinkingConfig * @static - * @param {google.cloud.retail.v2beta.IUserInfo} message UserInfo message or plain object to encode + * @param {google.cloud.retail.v2beta.IMerchantCenterLinkingConfig} message MerchantCenterLinkingConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserInfo.encodeDelimited = function encodeDelimited(message, writer) { + MerchantCenterLinkingConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserInfo message from the specified reader or buffer. + * Decodes a MerchantCenterLinkingConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.UserInfo + * @memberof google.cloud.retail.v2beta.MerchantCenterLinkingConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.UserInfo} UserInfo + * @returns {google.cloud.retail.v2beta.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserInfo.decode = function decode(reader, length) { + MerchantCenterLinkingConfig.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.v2beta.UserInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.MerchantCenterLinkingConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.userId = reader.string(); - break; - case 2: - message.ipAddress = reader.string(); - break; - case 3: - message.userAgent = reader.string(); - break; - case 4: - message.directUserRequest = reader.bool(); + if (!(message.links && message.links.length)) + message.links = []; + message.links.push($root.google.cloud.retail.v2beta.MerchantCenterLink.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -58179,132 +56008,127 @@ }; /** - * Decodes a UserInfo message from the specified reader or buffer, length delimited. + * Decodes a MerchantCenterLinkingConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.UserInfo + * @memberof google.cloud.retail.v2beta.MerchantCenterLinkingConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.UserInfo} UserInfo + * @returns {google.cloud.retail.v2beta.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserInfo.decodeDelimited = function decodeDelimited(reader) { + MerchantCenterLinkingConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserInfo message. + * Verifies a MerchantCenterLinkingConfig message. * @function verify - * @memberof google.cloud.retail.v2beta.UserInfo + * @memberof google.cloud.retail.v2beta.MerchantCenterLinkingConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserInfo.verify = function verify(message) { + MerchantCenterLinkingConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.userId != null && message.hasOwnProperty("userId")) - if (!$util.isString(message.userId)) - return "userId: string expected"; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - if (message.userAgent != null && message.hasOwnProperty("userAgent")) - if (!$util.isString(message.userAgent)) - return "userAgent: string expected"; - if (message.directUserRequest != null && message.hasOwnProperty("directUserRequest")) - if (typeof message.directUserRequest !== "boolean") - return "directUserRequest: boolean expected"; + if (message.links != null && message.hasOwnProperty("links")) { + if (!Array.isArray(message.links)) + return "links: array expected"; + for (var i = 0; i < message.links.length; ++i) { + var error = $root.google.cloud.retail.v2beta.MerchantCenterLink.verify(message.links[i]); + if (error) + return "links." + error; + } + } return null; }; /** - * Creates a UserInfo message from a plain object. Also converts values to their respective internal types. + * Creates a MerchantCenterLinkingConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.UserInfo + * @memberof google.cloud.retail.v2beta.MerchantCenterLinkingConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.UserInfo} UserInfo + * @returns {google.cloud.retail.v2beta.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig */ - UserInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.UserInfo) + MerchantCenterLinkingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.MerchantCenterLinkingConfig) return object; - var message = new $root.google.cloud.retail.v2beta.UserInfo(); - if (object.userId != null) - message.userId = String(object.userId); - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - if (object.userAgent != null) - message.userAgent = String(object.userAgent); - if (object.directUserRequest != null) - message.directUserRequest = Boolean(object.directUserRequest); + var message = new $root.google.cloud.retail.v2beta.MerchantCenterLinkingConfig(); + if (object.links) { + if (!Array.isArray(object.links)) + throw TypeError(".google.cloud.retail.v2beta.MerchantCenterLinkingConfig.links: array expected"); + message.links = []; + for (var i = 0; i < object.links.length; ++i) { + if (typeof object.links[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.MerchantCenterLinkingConfig.links: object expected"); + message.links[i] = $root.google.cloud.retail.v2beta.MerchantCenterLink.fromObject(object.links[i]); + } + } return message; }; /** - * Creates a plain object from a UserInfo message. Also converts values to other types if specified. + * Creates a plain object from a MerchantCenterLinkingConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.UserInfo + * @memberof google.cloud.retail.v2beta.MerchantCenterLinkingConfig * @static - * @param {google.cloud.retail.v2beta.UserInfo} message UserInfo + * @param {google.cloud.retail.v2beta.MerchantCenterLinkingConfig} message MerchantCenterLinkingConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserInfo.toObject = function toObject(message, options) { + MerchantCenterLinkingConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.userId = ""; - object.ipAddress = ""; - object.userAgent = ""; - object.directUserRequest = false; + if (options.arrays || options.defaults) + object.links = []; + if (message.links && message.links.length) { + object.links = []; + for (var j = 0; j < message.links.length; ++j) + object.links[j] = $root.google.cloud.retail.v2beta.MerchantCenterLink.toObject(message.links[j], options); } - if (message.userId != null && message.hasOwnProperty("userId")) - object.userId = message.userId; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - object.ipAddress = message.ipAddress; - if (message.userAgent != null && message.hasOwnProperty("userAgent")) - object.userAgent = message.userAgent; - if (message.directUserRequest != null && message.hasOwnProperty("directUserRequest")) - object.directUserRequest = message.directUserRequest; return object; }; /** - * Converts this UserInfo to JSON. + * Converts this MerchantCenterLinkingConfig to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.UserInfo + * @memberof google.cloud.retail.v2beta.MerchantCenterLinkingConfig * @instance * @returns {Object.} JSON object */ - UserInfo.prototype.toJSON = function toJSON() { + MerchantCenterLinkingConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UserInfo; + return MerchantCenterLinkingConfig; })(); - v2beta.Promotion = (function() { + v2beta.Catalog = (function() { /** - * Properties of a Promotion. + * Properties of a Catalog. * @memberof google.cloud.retail.v2beta - * @interface IPromotion - * @property {string|null} [promotionId] Promotion promotionId + * @interface ICatalog + * @property {string|null} [name] Catalog name + * @property {string|null} [displayName] Catalog displayName + * @property {google.cloud.retail.v2beta.IProductLevelConfig|null} [productLevelConfig] Catalog productLevelConfig + * @property {google.cloud.retail.v2beta.IMerchantCenterLinkingConfig|null} [merchantCenterLinkingConfig] Catalog merchantCenterLinkingConfig */ /** - * Constructs a new Promotion. + * Constructs a new Catalog. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a Promotion. - * @implements IPromotion + * @classdesc Represents a Catalog. + * @implements ICatalog * @constructor - * @param {google.cloud.retail.v2beta.IPromotion=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.ICatalog=} [properties] Properties to set */ - function Promotion(properties) { + function Catalog(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -58312,75 +56136,114 @@ } /** - * Promotion promotionId. - * @member {string} promotionId - * @memberof google.cloud.retail.v2beta.Promotion + * Catalog name. + * @member {string} name + * @memberof google.cloud.retail.v2beta.Catalog * @instance */ - Promotion.prototype.promotionId = ""; + Catalog.prototype.name = ""; /** - * Creates a new Promotion instance using the specified properties. + * Catalog displayName. + * @member {string} displayName + * @memberof google.cloud.retail.v2beta.Catalog + * @instance + */ + Catalog.prototype.displayName = ""; + + /** + * Catalog productLevelConfig. + * @member {google.cloud.retail.v2beta.IProductLevelConfig|null|undefined} productLevelConfig + * @memberof google.cloud.retail.v2beta.Catalog + * @instance + */ + Catalog.prototype.productLevelConfig = null; + + /** + * Catalog merchantCenterLinkingConfig. + * @member {google.cloud.retail.v2beta.IMerchantCenterLinkingConfig|null|undefined} merchantCenterLinkingConfig + * @memberof google.cloud.retail.v2beta.Catalog + * @instance + */ + Catalog.prototype.merchantCenterLinkingConfig = null; + + /** + * Creates a new Catalog instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.Promotion + * @memberof google.cloud.retail.v2beta.Catalog * @static - * @param {google.cloud.retail.v2beta.IPromotion=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Promotion} Promotion instance + * @param {google.cloud.retail.v2beta.ICatalog=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Catalog} Catalog instance */ - Promotion.create = function create(properties) { - return new Promotion(properties); + Catalog.create = function create(properties) { + return new Catalog(properties); }; /** - * Encodes the specified Promotion message. Does not implicitly {@link google.cloud.retail.v2beta.Promotion.verify|verify} messages. + * Encodes the specified Catalog message. Does not implicitly {@link google.cloud.retail.v2beta.Catalog.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.Promotion + * @memberof google.cloud.retail.v2beta.Catalog * @static - * @param {google.cloud.retail.v2beta.IPromotion} message Promotion message or plain object to encode + * @param {google.cloud.retail.v2beta.ICatalog} message Catalog message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Promotion.encode = function encode(message, writer) { + Catalog.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.promotionId != null && Object.hasOwnProperty.call(message, "promotionId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.promotionId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.productLevelConfig != null && Object.hasOwnProperty.call(message, "productLevelConfig")) + $root.google.cloud.retail.v2beta.ProductLevelConfig.encode(message.productLevelConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.merchantCenterLinkingConfig != null && Object.hasOwnProperty.call(message, "merchantCenterLinkingConfig")) + $root.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.encode(message.merchantCenterLinkingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified Promotion message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Promotion.verify|verify} messages. + * Encodes the specified Catalog message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Catalog.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Promotion + * @memberof google.cloud.retail.v2beta.Catalog * @static - * @param {google.cloud.retail.v2beta.IPromotion} message Promotion message or plain object to encode + * @param {google.cloud.retail.v2beta.ICatalog} message Catalog message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Promotion.encodeDelimited = function encodeDelimited(message, writer) { + Catalog.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Promotion message from the specified reader or buffer. + * Decodes a Catalog message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.Promotion + * @memberof google.cloud.retail.v2beta.Catalog * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Promotion} Promotion + * @returns {google.cloud.retail.v2beta.Catalog} Catalog * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Promotion.decode = function decode(reader, length) { + Catalog.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.v2beta.Promotion(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.Catalog(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.promotionId = reader.string(); + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 4: + message.productLevelConfig = $root.google.cloud.retail.v2beta.ProductLevelConfig.decode(reader, reader.uint32()); + break; + case 6: + message.merchantCenterLinkingConfig = $root.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -58391,109 +56254,193 @@ }; /** - * Decodes a Promotion message from the specified reader or buffer, length delimited. + * Decodes a Catalog message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Promotion + * @memberof google.cloud.retail.v2beta.Catalog * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Promotion} Promotion + * @returns {google.cloud.retail.v2beta.Catalog} Catalog * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Promotion.decodeDelimited = function decodeDelimited(reader) { + Catalog.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Promotion message. + * Verifies a Catalog message. * @function verify - * @memberof google.cloud.retail.v2beta.Promotion + * @memberof google.cloud.retail.v2beta.Catalog * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Promotion.verify = function verify(message) { + Catalog.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.promotionId != null && message.hasOwnProperty("promotionId")) - if (!$util.isString(message.promotionId)) - return "promotionId: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.productLevelConfig != null && message.hasOwnProperty("productLevelConfig")) { + var error = $root.google.cloud.retail.v2beta.ProductLevelConfig.verify(message.productLevelConfig); + if (error) + return "productLevelConfig." + error; + } + if (message.merchantCenterLinkingConfig != null && message.hasOwnProperty("merchantCenterLinkingConfig")) { + var error = $root.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.verify(message.merchantCenterLinkingConfig); + if (error) + return "merchantCenterLinkingConfig." + error; + } return null; }; /** - * Creates a Promotion message from a plain object. Also converts values to their respective internal types. + * Creates a Catalog message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.Promotion + * @memberof google.cloud.retail.v2beta.Catalog * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Promotion} Promotion + * @returns {google.cloud.retail.v2beta.Catalog} Catalog */ - Promotion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Promotion) + Catalog.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Catalog) return object; - var message = new $root.google.cloud.retail.v2beta.Promotion(); - if (object.promotionId != null) - message.promotionId = String(object.promotionId); + var message = new $root.google.cloud.retail.v2beta.Catalog(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.productLevelConfig != null) { + if (typeof object.productLevelConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.Catalog.productLevelConfig: object expected"); + message.productLevelConfig = $root.google.cloud.retail.v2beta.ProductLevelConfig.fromObject(object.productLevelConfig); + } + if (object.merchantCenterLinkingConfig != null) { + if (typeof object.merchantCenterLinkingConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.Catalog.merchantCenterLinkingConfig: object expected"); + message.merchantCenterLinkingConfig = $root.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.fromObject(object.merchantCenterLinkingConfig); + } return message; }; /** - * Creates a plain object from a Promotion message. Also converts values to other types if specified. + * Creates a plain object from a Catalog message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.Promotion + * @memberof google.cloud.retail.v2beta.Catalog * @static - * @param {google.cloud.retail.v2beta.Promotion} message Promotion + * @param {google.cloud.retail.v2beta.Catalog} message Catalog * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Promotion.toObject = function toObject(message, options) { + Catalog.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.promotionId = ""; - if (message.promotionId != null && message.hasOwnProperty("promotionId")) - object.promotionId = message.promotionId; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.productLevelConfig = null; + object.merchantCenterLinkingConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.productLevelConfig != null && message.hasOwnProperty("productLevelConfig")) + object.productLevelConfig = $root.google.cloud.retail.v2beta.ProductLevelConfig.toObject(message.productLevelConfig, options); + if (message.merchantCenterLinkingConfig != null && message.hasOwnProperty("merchantCenterLinkingConfig")) + object.merchantCenterLinkingConfig = $root.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.toObject(message.merchantCenterLinkingConfig, options); return object; }; /** - * Converts this Promotion to JSON. + * Converts this Catalog to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.Promotion + * @memberof google.cloud.retail.v2beta.Catalog * @instance * @returns {Object.} JSON object */ - Promotion.prototype.toJSON = function toJSON() { + Catalog.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Promotion; + return Catalog; })(); - v2beta.GcsSource = (function() { + /** + * AttributeConfigLevel enum. + * @name google.cloud.retail.v2beta.AttributeConfigLevel + * @enum {number} + * @property {number} ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED=0 ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED value + * @property {number} PRODUCT_LEVEL_ATTRIBUTE_CONFIG=1 PRODUCT_LEVEL_ATTRIBUTE_CONFIG value + * @property {number} CATALOG_LEVEL_ATTRIBUTE_CONFIG=2 CATALOG_LEVEL_ATTRIBUTE_CONFIG value + */ + v2beta.AttributeConfigLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRODUCT_LEVEL_ATTRIBUTE_CONFIG"] = 1; + values[valuesById[2] = "CATALOG_LEVEL_ATTRIBUTE_CONFIG"] = 2; + return values; + })(); + + /** + * SolutionType enum. + * @name google.cloud.retail.v2beta.SolutionType + * @enum {number} + * @property {number} SOLUTION_TYPE_UNSPECIFIED=0 SOLUTION_TYPE_UNSPECIFIED value + * @property {number} SOLUTION_TYPE_RECOMMENDATION=1 SOLUTION_TYPE_RECOMMENDATION value + * @property {number} SOLUTION_TYPE_SEARCH=2 SOLUTION_TYPE_SEARCH value + */ + v2beta.SolutionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SOLUTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SOLUTION_TYPE_RECOMMENDATION"] = 1; + values[valuesById[2] = "SOLUTION_TYPE_SEARCH"] = 2; + return values; + })(); + + /** + * SearchSolutionUseCase enum. + * @name google.cloud.retail.v2beta.SearchSolutionUseCase + * @enum {number} + * @property {number} SEARCH_SOLUTION_USE_CASE_UNSPECIFIED=0 SEARCH_SOLUTION_USE_CASE_UNSPECIFIED value + * @property {number} SEARCH_SOLUTION_USE_CASE_SEARCH=1 SEARCH_SOLUTION_USE_CASE_SEARCH value + * @property {number} SEARCH_SOLUTION_USE_CASE_BROWSE=2 SEARCH_SOLUTION_USE_CASE_BROWSE value + */ + v2beta.SearchSolutionUseCase = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEARCH_SOLUTION_USE_CASE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SEARCH_SOLUTION_USE_CASE_SEARCH"] = 1; + values[valuesById[2] = "SEARCH_SOLUTION_USE_CASE_BROWSE"] = 2; + return values; + })(); + + v2beta.Condition = (function() { /** - * Properties of a GcsSource. + * Properties of a Condition. * @memberof google.cloud.retail.v2beta - * @interface IGcsSource - * @property {Array.|null} [inputUris] GcsSource inputUris - * @property {string|null} [dataSchema] GcsSource dataSchema + * @interface ICondition + * @property {Array.|null} [queryTerms] Condition queryTerms + * @property {Array.|null} [activeTimeRange] Condition activeTimeRange */ /** - * Constructs a new GcsSource. + * Constructs a new Condition. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a GcsSource. - * @implements IGcsSource + * @classdesc Represents a Condition. + * @implements ICondition * @constructor - * @param {google.cloud.retail.v2beta.IGcsSource=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.ICondition=} [properties] Properties to set */ - function GcsSource(properties) { - this.inputUris = []; + function Condition(properties) { + this.queryTerms = []; + this.activeTimeRange = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -58501,91 +56448,94 @@ } /** - * GcsSource inputUris. - * @member {Array.} inputUris - * @memberof google.cloud.retail.v2beta.GcsSource + * Condition queryTerms. + * @member {Array.} queryTerms + * @memberof google.cloud.retail.v2beta.Condition * @instance */ - GcsSource.prototype.inputUris = $util.emptyArray; + Condition.prototype.queryTerms = $util.emptyArray; /** - * GcsSource dataSchema. - * @member {string} dataSchema - * @memberof google.cloud.retail.v2beta.GcsSource + * Condition activeTimeRange. + * @member {Array.} activeTimeRange + * @memberof google.cloud.retail.v2beta.Condition * @instance */ - GcsSource.prototype.dataSchema = ""; + Condition.prototype.activeTimeRange = $util.emptyArray; /** - * Creates a new GcsSource instance using the specified properties. + * Creates a new Condition instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.GcsSource + * @memberof google.cloud.retail.v2beta.Condition * @static - * @param {google.cloud.retail.v2beta.IGcsSource=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.GcsSource} GcsSource instance + * @param {google.cloud.retail.v2beta.ICondition=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Condition} Condition instance */ - GcsSource.create = function create(properties) { - return new GcsSource(properties); + Condition.create = function create(properties) { + return new Condition(properties); }; /** - * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.retail.v2beta.GcsSource.verify|verify} messages. + * Encodes the specified Condition message. Does not implicitly {@link google.cloud.retail.v2beta.Condition.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.GcsSource + * @memberof google.cloud.retail.v2beta.Condition * @static - * @param {google.cloud.retail.v2beta.IGcsSource} message GcsSource message or plain object to encode + * @param {google.cloud.retail.v2beta.ICondition} message Condition message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsSource.encode = function encode(message, writer) { + Condition.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.inputUris != null && message.inputUris.length) - for (var i = 0; i < message.inputUris.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUris[i]); - if (message.dataSchema != null && Object.hasOwnProperty.call(message, "dataSchema")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataSchema); + if (message.queryTerms != null && message.queryTerms.length) + for (var i = 0; i < message.queryTerms.length; ++i) + $root.google.cloud.retail.v2beta.Condition.QueryTerm.encode(message.queryTerms[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.activeTimeRange != null && message.activeTimeRange.length) + for (var i = 0; i < message.activeTimeRange.length; ++i) + $root.google.cloud.retail.v2beta.Condition.TimeRange.encode(message.activeTimeRange[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GcsSource.verify|verify} messages. + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Condition.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.GcsSource + * @memberof google.cloud.retail.v2beta.Condition * @static - * @param {google.cloud.retail.v2beta.IGcsSource} message GcsSource message or plain object to encode + * @param {google.cloud.retail.v2beta.ICondition} message Condition message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsSource.encodeDelimited = function encodeDelimited(message, writer) { + Condition.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GcsSource message from the specified reader or buffer. + * Decodes a Condition message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.GcsSource + * @memberof google.cloud.retail.v2beta.Condition * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.GcsSource} GcsSource + * @returns {google.cloud.retail.v2beta.Condition} Condition * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsSource.decode = function decode(reader, length) { + Condition.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.v2beta.GcsSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.Condition(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.inputUris && message.inputUris.length)) - message.inputUris = []; - message.inputUris.push(reader.string()); + if (!(message.queryTerms && message.queryTerms.length)) + message.queryTerms = []; + message.queryTerms.push($root.google.cloud.retail.v2beta.Condition.QueryTerm.decode(reader, reader.uint32())); break; - case 2: - message.dataSchema = reader.string(); + case 3: + if (!(message.activeTimeRange && message.activeTimeRange.length)) + message.activeTimeRange = []; + message.activeTimeRange.push($root.google.cloud.retail.v2beta.Condition.TimeRange.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -58596,133 +56546,588 @@ }; /** - * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * Decodes a Condition message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.GcsSource + * @memberof google.cloud.retail.v2beta.Condition * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.GcsSource} GcsSource + * @returns {google.cloud.retail.v2beta.Condition} Condition * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsSource.decodeDelimited = function decodeDelimited(reader) { + Condition.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GcsSource message. + * Verifies a Condition message. * @function verify - * @memberof google.cloud.retail.v2beta.GcsSource + * @memberof google.cloud.retail.v2beta.Condition * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GcsSource.verify = function verify(message) { + Condition.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.inputUris != null && message.hasOwnProperty("inputUris")) { - if (!Array.isArray(message.inputUris)) - return "inputUris: array expected"; - for (var i = 0; i < message.inputUris.length; ++i) - if (!$util.isString(message.inputUris[i])) - return "inputUris: string[] expected"; + if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { + if (!Array.isArray(message.queryTerms)) + return "queryTerms: array expected"; + for (var i = 0; i < message.queryTerms.length; ++i) { + var error = $root.google.cloud.retail.v2beta.Condition.QueryTerm.verify(message.queryTerms[i]); + if (error) + return "queryTerms." + error; + } + } + if (message.activeTimeRange != null && message.hasOwnProperty("activeTimeRange")) { + if (!Array.isArray(message.activeTimeRange)) + return "activeTimeRange: array expected"; + for (var i = 0; i < message.activeTimeRange.length; ++i) { + var error = $root.google.cloud.retail.v2beta.Condition.TimeRange.verify(message.activeTimeRange[i]); + if (error) + return "activeTimeRange." + error; + } } - if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) - if (!$util.isString(message.dataSchema)) - return "dataSchema: string expected"; return null; }; /** - * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * Creates a Condition message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.GcsSource + * @memberof google.cloud.retail.v2beta.Condition * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.GcsSource} GcsSource + * @returns {google.cloud.retail.v2beta.Condition} Condition */ - GcsSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.GcsSource) + Condition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Condition) return object; - var message = new $root.google.cloud.retail.v2beta.GcsSource(); - if (object.inputUris) { - if (!Array.isArray(object.inputUris)) - throw TypeError(".google.cloud.retail.v2beta.GcsSource.inputUris: array expected"); - message.inputUris = []; - for (var i = 0; i < object.inputUris.length; ++i) - message.inputUris[i] = String(object.inputUris[i]); + var message = new $root.google.cloud.retail.v2beta.Condition(); + if (object.queryTerms) { + if (!Array.isArray(object.queryTerms)) + throw TypeError(".google.cloud.retail.v2beta.Condition.queryTerms: array expected"); + message.queryTerms = []; + for (var i = 0; i < object.queryTerms.length; ++i) { + if (typeof object.queryTerms[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.Condition.queryTerms: object expected"); + message.queryTerms[i] = $root.google.cloud.retail.v2beta.Condition.QueryTerm.fromObject(object.queryTerms[i]); + } + } + if (object.activeTimeRange) { + if (!Array.isArray(object.activeTimeRange)) + throw TypeError(".google.cloud.retail.v2beta.Condition.activeTimeRange: array expected"); + message.activeTimeRange = []; + for (var i = 0; i < object.activeTimeRange.length; ++i) { + if (typeof object.activeTimeRange[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.Condition.activeTimeRange: object expected"); + message.activeTimeRange[i] = $root.google.cloud.retail.v2beta.Condition.TimeRange.fromObject(object.activeTimeRange[i]); + } } - if (object.dataSchema != null) - message.dataSchema = String(object.dataSchema); return message; }; /** - * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * Creates a plain object from a Condition message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.GcsSource + * @memberof google.cloud.retail.v2beta.Condition * @static - * @param {google.cloud.retail.v2beta.GcsSource} message GcsSource + * @param {google.cloud.retail.v2beta.Condition} message Condition * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GcsSource.toObject = function toObject(message, options) { + Condition.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.inputUris = []; - if (options.defaults) - object.dataSchema = ""; - if (message.inputUris && message.inputUris.length) { - object.inputUris = []; - for (var j = 0; j < message.inputUris.length; ++j) - object.inputUris[j] = message.inputUris[j]; + if (options.arrays || options.defaults) { + object.queryTerms = []; + object.activeTimeRange = []; + } + if (message.queryTerms && message.queryTerms.length) { + object.queryTerms = []; + for (var j = 0; j < message.queryTerms.length; ++j) + object.queryTerms[j] = $root.google.cloud.retail.v2beta.Condition.QueryTerm.toObject(message.queryTerms[j], options); + } + if (message.activeTimeRange && message.activeTimeRange.length) { + object.activeTimeRange = []; + for (var j = 0; j < message.activeTimeRange.length; ++j) + object.activeTimeRange[j] = $root.google.cloud.retail.v2beta.Condition.TimeRange.toObject(message.activeTimeRange[j], options); } - if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) - object.dataSchema = message.dataSchema; return object; }; /** - * Converts this GcsSource to JSON. + * Converts this Condition to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.GcsSource + * @memberof google.cloud.retail.v2beta.Condition * @instance * @returns {Object.} JSON object */ - GcsSource.prototype.toJSON = function toJSON() { + Condition.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GcsSource; - })(); + Condition.QueryTerm = (function() { - v2beta.BigQuerySource = (function() { + /** + * Properties of a QueryTerm. + * @memberof google.cloud.retail.v2beta.Condition + * @interface IQueryTerm + * @property {string|null} [value] QueryTerm value + * @property {boolean|null} [fullMatch] QueryTerm fullMatch + */ - /** - * Properties of a BigQuerySource. - * @memberof google.cloud.retail.v2beta - * @interface IBigQuerySource - * @property {google.type.IDate|null} [partitionDate] BigQuerySource partitionDate - * @property {string|null} [projectId] BigQuerySource projectId - * @property {string|null} [datasetId] BigQuerySource datasetId - * @property {string|null} [tableId] BigQuerySource tableId - * @property {string|null} [gcsStagingDir] BigQuerySource gcsStagingDir - * @property {string|null} [dataSchema] BigQuerySource dataSchema - */ + /** + * Constructs a new QueryTerm. + * @memberof google.cloud.retail.v2beta.Condition + * @classdesc Represents a QueryTerm. + * @implements IQueryTerm + * @constructor + * @param {google.cloud.retail.v2beta.Condition.IQueryTerm=} [properties] Properties to set + */ + function QueryTerm(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]]; + } - /** - * Constructs a new BigQuerySource. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a BigQuerySource. - * @implements IBigQuerySource - * @constructor - * @param {google.cloud.retail.v2beta.IBigQuerySource=} [properties] Properties to set - */ - function BigQuerySource(properties) { + /** + * QueryTerm value. + * @member {string} value + * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @instance + */ + QueryTerm.prototype.value = ""; + + /** + * QueryTerm fullMatch. + * @member {boolean} fullMatch + * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @instance + */ + QueryTerm.prototype.fullMatch = false; + + /** + * Creates a new QueryTerm instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @static + * @param {google.cloud.retail.v2beta.Condition.IQueryTerm=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Condition.QueryTerm} QueryTerm instance + */ + QueryTerm.create = function create(properties) { + return new QueryTerm(properties); + }; + + /** + * Encodes the specified QueryTerm message. Does not implicitly {@link google.cloud.retail.v2beta.Condition.QueryTerm.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @static + * @param {google.cloud.retail.v2beta.Condition.IQueryTerm} message QueryTerm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryTerm.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.fullMatch != null && Object.hasOwnProperty.call(message, "fullMatch")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullMatch); + return writer; + }; + + /** + * Encodes the specified QueryTerm message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Condition.QueryTerm.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @static + * @param {google.cloud.retail.v2beta.Condition.IQueryTerm} message QueryTerm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryTerm.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryTerm message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Condition.QueryTerm} QueryTerm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryTerm.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.v2beta.Condition.QueryTerm(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.string(); + break; + case 2: + message.fullMatch = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryTerm message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Condition.QueryTerm} QueryTerm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryTerm.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryTerm message. + * @function verify + * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryTerm.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.fullMatch != null && message.hasOwnProperty("fullMatch")) + if (typeof message.fullMatch !== "boolean") + return "fullMatch: boolean expected"; + return null; + }; + + /** + * Creates a QueryTerm message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Condition.QueryTerm} QueryTerm + */ + QueryTerm.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Condition.QueryTerm) + return object; + var message = new $root.google.cloud.retail.v2beta.Condition.QueryTerm(); + if (object.value != null) + message.value = String(object.value); + if (object.fullMatch != null) + message.fullMatch = Boolean(object.fullMatch); + return message; + }; + + /** + * Creates a plain object from a QueryTerm message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @static + * @param {google.cloud.retail.v2beta.Condition.QueryTerm} message QueryTerm + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryTerm.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.fullMatch = false; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.fullMatch != null && message.hasOwnProperty("fullMatch")) + object.fullMatch = message.fullMatch; + return object; + }; + + /** + * Converts this QueryTerm to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Condition.QueryTerm + * @instance + * @returns {Object.} JSON object + */ + QueryTerm.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryTerm; + })(); + + Condition.TimeRange = (function() { + + /** + * Properties of a TimeRange. + * @memberof google.cloud.retail.v2beta.Condition + * @interface ITimeRange + * @property {google.protobuf.ITimestamp|null} [startTime] TimeRange startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeRange endTime + */ + + /** + * Constructs a new TimeRange. + * @memberof google.cloud.retail.v2beta.Condition + * @classdesc Represents a TimeRange. + * @implements ITimeRange + * @constructor + * @param {google.cloud.retail.v2beta.Condition.ITimeRange=} [properties] Properties to set + */ + function TimeRange(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]]; + } + + /** + * TimeRange startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @instance + */ + TimeRange.prototype.startTime = null; + + /** + * TimeRange endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @instance + */ + TimeRange.prototype.endTime = null; + + /** + * Creates a new TimeRange instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @static + * @param {google.cloud.retail.v2beta.Condition.ITimeRange=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Condition.TimeRange} TimeRange instance + */ + TimeRange.create = function create(properties) { + return new TimeRange(properties); + }; + + /** + * Encodes the specified TimeRange message. Does not implicitly {@link google.cloud.retail.v2beta.Condition.TimeRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @static + * @param {google.cloud.retail.v2beta.Condition.ITimeRange} message TimeRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Condition.TimeRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @static + * @param {google.cloud.retail.v2beta.Condition.ITimeRange} message TimeRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Condition.TimeRange} TimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeRange.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.v2beta.Condition.TimeRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Condition.TimeRange} TimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeRange message. + * @function verify + * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a TimeRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Condition.TimeRange} TimeRange + */ + TimeRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Condition.TimeRange) + return object; + var message = new $root.google.cloud.retail.v2beta.Condition.TimeRange(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.Condition.TimeRange.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.Condition.TimeRange.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a TimeRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @static + * @param {google.cloud.retail.v2beta.Condition.TimeRange} message TimeRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this TimeRange to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Condition.TimeRange + * @instance + * @returns {Object.} JSON object + */ + TimeRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TimeRange; + })(); + + return Condition; + })(); + + v2beta.Rule = (function() { + + /** + * Properties of a Rule. + * @memberof google.cloud.retail.v2beta + * @interface IRule + * @property {google.cloud.retail.v2beta.Rule.IBoostAction|null} [boostAction] Rule boostAction + * @property {google.cloud.retail.v2beta.Rule.IRedirectAction|null} [redirectAction] Rule redirectAction + * @property {google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction|null} [onewaySynonymsAction] Rule onewaySynonymsAction + * @property {google.cloud.retail.v2beta.Rule.IDoNotAssociateAction|null} [doNotAssociateAction] Rule doNotAssociateAction + * @property {google.cloud.retail.v2beta.Rule.IReplacementAction|null} [replacementAction] Rule replacementAction + * @property {google.cloud.retail.v2beta.Rule.IIgnoreAction|null} [ignoreAction] Rule ignoreAction + * @property {google.cloud.retail.v2beta.Rule.IFilterAction|null} [filterAction] Rule filterAction + * @property {google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction|null} [twowaySynonymsAction] Rule twowaySynonymsAction + * @property {google.cloud.retail.v2beta.ICondition|null} [condition] Rule condition + */ + + /** + * Constructs a new Rule. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a Rule. + * @implements IRule + * @constructor + * @param {google.cloud.retail.v2beta.IRule=} [properties] Properties to set + */ + function Rule(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -58730,154 +57135,193 @@ } /** - * BigQuerySource partitionDate. - * @member {google.type.IDate|null|undefined} partitionDate - * @memberof google.cloud.retail.v2beta.BigQuerySource + * Rule boostAction. + * @member {google.cloud.retail.v2beta.Rule.IBoostAction|null|undefined} boostAction + * @memberof google.cloud.retail.v2beta.Rule * @instance */ - BigQuerySource.prototype.partitionDate = null; + Rule.prototype.boostAction = null; /** - * BigQuerySource projectId. - * @member {string} projectId - * @memberof google.cloud.retail.v2beta.BigQuerySource + * Rule redirectAction. + * @member {google.cloud.retail.v2beta.Rule.IRedirectAction|null|undefined} redirectAction + * @memberof google.cloud.retail.v2beta.Rule * @instance */ - BigQuerySource.prototype.projectId = ""; + Rule.prototype.redirectAction = null; /** - * BigQuerySource datasetId. - * @member {string} datasetId - * @memberof google.cloud.retail.v2beta.BigQuerySource + * Rule onewaySynonymsAction. + * @member {google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction|null|undefined} onewaySynonymsAction + * @memberof google.cloud.retail.v2beta.Rule * @instance */ - BigQuerySource.prototype.datasetId = ""; + Rule.prototype.onewaySynonymsAction = null; /** - * BigQuerySource tableId. - * @member {string} tableId - * @memberof google.cloud.retail.v2beta.BigQuerySource + * Rule doNotAssociateAction. + * @member {google.cloud.retail.v2beta.Rule.IDoNotAssociateAction|null|undefined} doNotAssociateAction + * @memberof google.cloud.retail.v2beta.Rule * @instance */ - BigQuerySource.prototype.tableId = ""; + Rule.prototype.doNotAssociateAction = null; /** - * BigQuerySource gcsStagingDir. - * @member {string} gcsStagingDir - * @memberof google.cloud.retail.v2beta.BigQuerySource + * Rule replacementAction. + * @member {google.cloud.retail.v2beta.Rule.IReplacementAction|null|undefined} replacementAction + * @memberof google.cloud.retail.v2beta.Rule * @instance */ - BigQuerySource.prototype.gcsStagingDir = ""; + Rule.prototype.replacementAction = null; /** - * BigQuerySource dataSchema. - * @member {string} dataSchema - * @memberof google.cloud.retail.v2beta.BigQuerySource + * Rule ignoreAction. + * @member {google.cloud.retail.v2beta.Rule.IIgnoreAction|null|undefined} ignoreAction + * @memberof google.cloud.retail.v2beta.Rule * @instance */ - BigQuerySource.prototype.dataSchema = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + Rule.prototype.ignoreAction = null; /** - * BigQuerySource partition. - * @member {"partitionDate"|undefined} partition - * @memberof google.cloud.retail.v2beta.BigQuerySource + * Rule filterAction. + * @member {google.cloud.retail.v2beta.Rule.IFilterAction|null|undefined} filterAction + * @memberof google.cloud.retail.v2beta.Rule * @instance */ - Object.defineProperty(BigQuerySource.prototype, "partition", { - get: $util.oneOfGetter($oneOfFields = ["partitionDate"]), - set: $util.oneOfSetter($oneOfFields) - }); + Rule.prototype.filterAction = null; /** - * Creates a new BigQuerySource instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.BigQuerySource - * @static - * @param {google.cloud.retail.v2beta.IBigQuerySource=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.BigQuerySource} BigQuerySource instance + * Rule twowaySynonymsAction. + * @member {google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction|null|undefined} twowaySynonymsAction + * @memberof google.cloud.retail.v2beta.Rule + * @instance */ - BigQuerySource.create = function create(properties) { - return new BigQuerySource(properties); - }; + Rule.prototype.twowaySynonymsAction = null; /** - * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.retail.v2beta.BigQuerySource.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.BigQuerySource + * Rule condition. + * @member {google.cloud.retail.v2beta.ICondition|null|undefined} condition + * @memberof google.cloud.retail.v2beta.Rule + * @instance + */ + Rule.prototype.condition = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Rule action. + * @member {"boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"|undefined} action + * @memberof google.cloud.retail.v2beta.Rule + * @instance + */ + Object.defineProperty(Rule.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["boostAction", "redirectAction", "onewaySynonymsAction", "doNotAssociateAction", "replacementAction", "ignoreAction", "filterAction", "twowaySynonymsAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Rule instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Rule * @static - * @param {google.cloud.retail.v2beta.IBigQuerySource} message BigQuerySource message or plain object to encode + * @param {google.cloud.retail.v2beta.IRule=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Rule} Rule instance + */ + Rule.create = function create(properties) { + return new Rule(properties); + }; + + /** + * Encodes the specified Rule message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Rule + * @static + * @param {google.cloud.retail.v2beta.IRule} message Rule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BigQuerySource.encode = function encode(message, writer) { + Rule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.datasetId); - if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableId); - if (message.gcsStagingDir != null && Object.hasOwnProperty.call(message, "gcsStagingDir")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsStagingDir); - if (message.dataSchema != null && Object.hasOwnProperty.call(message, "dataSchema")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.dataSchema); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.projectId); - if (message.partitionDate != null && Object.hasOwnProperty.call(message, "partitionDate")) - $root.google.type.Date.encode(message.partitionDate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.cloud.retail.v2beta.Condition.encode(message.condition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boostAction != null && Object.hasOwnProperty.call(message, "boostAction")) + $root.google.cloud.retail.v2beta.Rule.BoostAction.encode(message.boostAction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.redirectAction != null && Object.hasOwnProperty.call(message, "redirectAction")) + $root.google.cloud.retail.v2beta.Rule.RedirectAction.encode(message.redirectAction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.onewaySynonymsAction != null && Object.hasOwnProperty.call(message, "onewaySynonymsAction")) + $root.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.encode(message.onewaySynonymsAction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.doNotAssociateAction != null && Object.hasOwnProperty.call(message, "doNotAssociateAction")) + $root.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.encode(message.doNotAssociateAction, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.replacementAction != null && Object.hasOwnProperty.call(message, "replacementAction")) + $root.google.cloud.retail.v2beta.Rule.ReplacementAction.encode(message.replacementAction, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.ignoreAction != null && Object.hasOwnProperty.call(message, "ignoreAction")) + $root.google.cloud.retail.v2beta.Rule.IgnoreAction.encode(message.ignoreAction, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.filterAction != null && Object.hasOwnProperty.call(message, "filterAction")) + $root.google.cloud.retail.v2beta.Rule.FilterAction.encode(message.filterAction, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.twowaySynonymsAction != null && Object.hasOwnProperty.call(message, "twowaySynonymsAction")) + $root.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.encode(message.twowaySynonymsAction, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; /** - * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.BigQuerySource.verify|verify} messages. + * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.BigQuerySource + * @memberof google.cloud.retail.v2beta.Rule * @static - * @param {google.cloud.retail.v2beta.IBigQuerySource} message BigQuerySource message or plain object to encode + * @param {google.cloud.retail.v2beta.IRule} message Rule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BigQuerySource.encodeDelimited = function encodeDelimited(message, writer) { + Rule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BigQuerySource message from the specified reader or buffer. + * Decodes a Rule message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.BigQuerySource + * @memberof google.cloud.retail.v2beta.Rule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.BigQuerySource} BigQuerySource + * @returns {google.cloud.retail.v2beta.Rule} Rule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BigQuerySource.decode = function decode(reader, length) { + Rule.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.v2beta.BigQuerySource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.Rule(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 2: + message.boostAction = $root.google.cloud.retail.v2beta.Rule.BoostAction.decode(reader, reader.uint32()); + break; + case 3: + message.redirectAction = $root.google.cloud.retail.v2beta.Rule.RedirectAction.decode(reader, reader.uint32()); + break; case 6: - message.partitionDate = $root.google.type.Date.decode(reader, reader.uint32()); + message.onewaySynonymsAction = $root.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.decode(reader, reader.uint32()); break; - case 5: - message.projectId = reader.string(); + case 7: + message.doNotAssociateAction = $root.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.decode(reader, reader.uint32()); break; - case 1: - message.datasetId = reader.string(); + case 8: + message.replacementAction = $root.google.cloud.retail.v2beta.Rule.ReplacementAction.decode(reader, reader.uint32()); break; - case 2: - message.tableId = reader.string(); + case 9: + message.ignoreAction = $root.google.cloud.retail.v2beta.Rule.IgnoreAction.decode(reader, reader.uint32()); break; - case 3: - message.gcsStagingDir = reader.string(); + case 10: + message.filterAction = $root.google.cloud.retail.v2beta.Rule.FilterAction.decode(reader, reader.uint32()); break; - case 4: - message.dataSchema = reader.string(); + case 11: + message.twowaySynonymsAction = $root.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.decode(reader, reader.uint32()); + break; + case 1: + message.condition = $root.google.cloud.retail.v2beta.Condition.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -58888,1746 +57332,2168 @@ }; /** - * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. + * Decodes a Rule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.BigQuerySource + * @memberof google.cloud.retail.v2beta.Rule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.BigQuerySource} BigQuerySource + * @returns {google.cloud.retail.v2beta.Rule} Rule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BigQuerySource.decodeDelimited = function decodeDelimited(reader) { + Rule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BigQuerySource message. + * Verifies a Rule message. * @function verify - * @memberof google.cloud.retail.v2beta.BigQuerySource + * @memberof google.cloud.retail.v2beta.Rule * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BigQuerySource.verify = function verify(message) { + Rule.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.partitionDate != null && message.hasOwnProperty("partitionDate")) { - properties.partition = 1; + if (message.boostAction != null && message.hasOwnProperty("boostAction")) { + properties.action = 1; { - var error = $root.google.type.Date.verify(message.partitionDate); + var error = $root.google.cloud.retail.v2beta.Rule.BoostAction.verify(message.boostAction); if (error) - return "partitionDate." + error; + return "boostAction." + error; } } - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.datasetId != null && message.hasOwnProperty("datasetId")) - if (!$util.isString(message.datasetId)) - return "datasetId: string expected"; - if (message.tableId != null && message.hasOwnProperty("tableId")) - if (!$util.isString(message.tableId)) - return "tableId: string expected"; - if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) - if (!$util.isString(message.gcsStagingDir)) - return "gcsStagingDir: string expected"; - if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) - if (!$util.isString(message.dataSchema)) - return "dataSchema: string expected"; + if (message.redirectAction != null && message.hasOwnProperty("redirectAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2beta.Rule.RedirectAction.verify(message.redirectAction); + if (error) + return "redirectAction." + error; + } + } + if (message.onewaySynonymsAction != null && message.hasOwnProperty("onewaySynonymsAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.verify(message.onewaySynonymsAction); + if (error) + return "onewaySynonymsAction." + error; + } + } + if (message.doNotAssociateAction != null && message.hasOwnProperty("doNotAssociateAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.verify(message.doNotAssociateAction); + if (error) + return "doNotAssociateAction." + error; + } + } + if (message.replacementAction != null && message.hasOwnProperty("replacementAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2beta.Rule.ReplacementAction.verify(message.replacementAction); + if (error) + return "replacementAction." + error; + } + } + if (message.ignoreAction != null && message.hasOwnProperty("ignoreAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2beta.Rule.IgnoreAction.verify(message.ignoreAction); + if (error) + return "ignoreAction." + error; + } + } + if (message.filterAction != null && message.hasOwnProperty("filterAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2beta.Rule.FilterAction.verify(message.filterAction); + if (error) + return "filterAction." + error; + } + } + if (message.twowaySynonymsAction != null && message.hasOwnProperty("twowaySynonymsAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.verify(message.twowaySynonymsAction); + if (error) + return "twowaySynonymsAction." + error; + } + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.cloud.retail.v2beta.Condition.verify(message.condition); + if (error) + return "condition." + error; + } return null; }; /** - * Creates a BigQuerySource message from a plain object. Also converts values to their respective internal types. + * Creates a Rule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.BigQuerySource + * @memberof google.cloud.retail.v2beta.Rule * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.BigQuerySource} BigQuerySource + * @returns {google.cloud.retail.v2beta.Rule} Rule */ - BigQuerySource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.BigQuerySource) + Rule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Rule) return object; - var message = new $root.google.cloud.retail.v2beta.BigQuerySource(); - if (object.partitionDate != null) { - if (typeof object.partitionDate !== "object") - throw TypeError(".google.cloud.retail.v2beta.BigQuerySource.partitionDate: object expected"); - message.partitionDate = $root.google.type.Date.fromObject(object.partitionDate); + var message = new $root.google.cloud.retail.v2beta.Rule(); + if (object.boostAction != null) { + if (typeof object.boostAction !== "object") + throw TypeError(".google.cloud.retail.v2beta.Rule.boostAction: object expected"); + message.boostAction = $root.google.cloud.retail.v2beta.Rule.BoostAction.fromObject(object.boostAction); + } + if (object.redirectAction != null) { + if (typeof object.redirectAction !== "object") + throw TypeError(".google.cloud.retail.v2beta.Rule.redirectAction: object expected"); + message.redirectAction = $root.google.cloud.retail.v2beta.Rule.RedirectAction.fromObject(object.redirectAction); + } + if (object.onewaySynonymsAction != null) { + if (typeof object.onewaySynonymsAction !== "object") + throw TypeError(".google.cloud.retail.v2beta.Rule.onewaySynonymsAction: object expected"); + message.onewaySynonymsAction = $root.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.fromObject(object.onewaySynonymsAction); + } + if (object.doNotAssociateAction != null) { + if (typeof object.doNotAssociateAction !== "object") + throw TypeError(".google.cloud.retail.v2beta.Rule.doNotAssociateAction: object expected"); + message.doNotAssociateAction = $root.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.fromObject(object.doNotAssociateAction); + } + if (object.replacementAction != null) { + if (typeof object.replacementAction !== "object") + throw TypeError(".google.cloud.retail.v2beta.Rule.replacementAction: object expected"); + message.replacementAction = $root.google.cloud.retail.v2beta.Rule.ReplacementAction.fromObject(object.replacementAction); + } + if (object.ignoreAction != null) { + if (typeof object.ignoreAction !== "object") + throw TypeError(".google.cloud.retail.v2beta.Rule.ignoreAction: object expected"); + message.ignoreAction = $root.google.cloud.retail.v2beta.Rule.IgnoreAction.fromObject(object.ignoreAction); + } + if (object.filterAction != null) { + if (typeof object.filterAction !== "object") + throw TypeError(".google.cloud.retail.v2beta.Rule.filterAction: object expected"); + message.filterAction = $root.google.cloud.retail.v2beta.Rule.FilterAction.fromObject(object.filterAction); + } + if (object.twowaySynonymsAction != null) { + if (typeof object.twowaySynonymsAction !== "object") + throw TypeError(".google.cloud.retail.v2beta.Rule.twowaySynonymsAction: object expected"); + message.twowaySynonymsAction = $root.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.fromObject(object.twowaySynonymsAction); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.cloud.retail.v2beta.Rule.condition: object expected"); + message.condition = $root.google.cloud.retail.v2beta.Condition.fromObject(object.condition); } - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.datasetId != null) - message.datasetId = String(object.datasetId); - if (object.tableId != null) - message.tableId = String(object.tableId); - if (object.gcsStagingDir != null) - message.gcsStagingDir = String(object.gcsStagingDir); - if (object.dataSchema != null) - message.dataSchema = String(object.dataSchema); return message; }; /** - * Creates a plain object from a BigQuerySource message. Also converts values to other types if specified. + * Creates a plain object from a Rule message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.BigQuerySource + * @memberof google.cloud.retail.v2beta.Rule * @static - * @param {google.cloud.retail.v2beta.BigQuerySource} message BigQuerySource + * @param {google.cloud.retail.v2beta.Rule} message Rule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BigQuerySource.toObject = function toObject(message, options) { + Rule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.datasetId = ""; - object.tableId = ""; - object.gcsStagingDir = ""; - object.dataSchema = ""; - object.projectId = ""; + if (options.defaults) + object.condition = null; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.cloud.retail.v2beta.Condition.toObject(message.condition, options); + if (message.boostAction != null && message.hasOwnProperty("boostAction")) { + object.boostAction = $root.google.cloud.retail.v2beta.Rule.BoostAction.toObject(message.boostAction, options); + if (options.oneofs) + object.action = "boostAction"; } - if (message.datasetId != null && message.hasOwnProperty("datasetId")) - object.datasetId = message.datasetId; - if (message.tableId != null && message.hasOwnProperty("tableId")) - object.tableId = message.tableId; - if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) - object.gcsStagingDir = message.gcsStagingDir; - if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) - object.dataSchema = message.dataSchema; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.partitionDate != null && message.hasOwnProperty("partitionDate")) { - object.partitionDate = $root.google.type.Date.toObject(message.partitionDate, options); + if (message.redirectAction != null && message.hasOwnProperty("redirectAction")) { + object.redirectAction = $root.google.cloud.retail.v2beta.Rule.RedirectAction.toObject(message.redirectAction, options); if (options.oneofs) - object.partition = "partitionDate"; + object.action = "redirectAction"; + } + if (message.onewaySynonymsAction != null && message.hasOwnProperty("onewaySynonymsAction")) { + object.onewaySynonymsAction = $root.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.toObject(message.onewaySynonymsAction, options); + if (options.oneofs) + object.action = "onewaySynonymsAction"; + } + if (message.doNotAssociateAction != null && message.hasOwnProperty("doNotAssociateAction")) { + object.doNotAssociateAction = $root.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.toObject(message.doNotAssociateAction, options); + if (options.oneofs) + object.action = "doNotAssociateAction"; + } + if (message.replacementAction != null && message.hasOwnProperty("replacementAction")) { + object.replacementAction = $root.google.cloud.retail.v2beta.Rule.ReplacementAction.toObject(message.replacementAction, options); + if (options.oneofs) + object.action = "replacementAction"; + } + if (message.ignoreAction != null && message.hasOwnProperty("ignoreAction")) { + object.ignoreAction = $root.google.cloud.retail.v2beta.Rule.IgnoreAction.toObject(message.ignoreAction, options); + if (options.oneofs) + object.action = "ignoreAction"; + } + if (message.filterAction != null && message.hasOwnProperty("filterAction")) { + object.filterAction = $root.google.cloud.retail.v2beta.Rule.FilterAction.toObject(message.filterAction, options); + if (options.oneofs) + object.action = "filterAction"; + } + if (message.twowaySynonymsAction != null && message.hasOwnProperty("twowaySynonymsAction")) { + object.twowaySynonymsAction = $root.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.toObject(message.twowaySynonymsAction, options); + if (options.oneofs) + object.action = "twowaySynonymsAction"; } return object; }; /** - * Converts this BigQuerySource to JSON. + * Converts this Rule to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.BigQuerySource + * @memberof google.cloud.retail.v2beta.Rule * @instance * @returns {Object.} JSON object */ - BigQuerySource.prototype.toJSON = function toJSON() { + Rule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BigQuerySource; - })(); + Rule.BoostAction = (function() { - v2beta.ProductInlineSource = (function() { + /** + * Properties of a BoostAction. + * @memberof google.cloud.retail.v2beta.Rule + * @interface IBoostAction + * @property {number|null} [boost] BoostAction boost + * @property {string|null} [productsFilter] BoostAction productsFilter + */ - /** - * Properties of a ProductInlineSource. - * @memberof google.cloud.retail.v2beta - * @interface IProductInlineSource - * @property {Array.|null} [products] ProductInlineSource products - */ + /** + * Constructs a new BoostAction. + * @memberof google.cloud.retail.v2beta.Rule + * @classdesc Represents a BoostAction. + * @implements IBoostAction + * @constructor + * @param {google.cloud.retail.v2beta.Rule.IBoostAction=} [properties] Properties to set + */ + function BoostAction(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]]; + } - /** - * Constructs a new ProductInlineSource. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a ProductInlineSource. - * @implements IProductInlineSource - * @constructor - * @param {google.cloud.retail.v2beta.IProductInlineSource=} [properties] Properties to set - */ - function ProductInlineSource(properties) { - this.products = []; - 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]]; - } + /** + * BoostAction boost. + * @member {number} boost + * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @instance + */ + BoostAction.prototype.boost = 0; - /** - * ProductInlineSource products. - * @member {Array.} products - * @memberof google.cloud.retail.v2beta.ProductInlineSource - * @instance - */ - ProductInlineSource.prototype.products = $util.emptyArray; + /** + * BoostAction productsFilter. + * @member {string} productsFilter + * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @instance + */ + BoostAction.prototype.productsFilter = ""; - /** - * Creates a new ProductInlineSource instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.ProductInlineSource - * @static - * @param {google.cloud.retail.v2beta.IProductInlineSource=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ProductInlineSource} ProductInlineSource instance - */ - ProductInlineSource.create = function create(properties) { - return new ProductInlineSource(properties); - }; + /** + * Creates a new BoostAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IBoostAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Rule.BoostAction} BoostAction instance + */ + BoostAction.create = function create(properties) { + return new BoostAction(properties); + }; - /** - * Encodes the specified ProductInlineSource message. Does not implicitly {@link google.cloud.retail.v2beta.ProductInlineSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.ProductInlineSource - * @static - * @param {google.cloud.retail.v2beta.IProductInlineSource} message ProductInlineSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProductInlineSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.products != null && message.products.length) - for (var i = 0; i < message.products.length; ++i) - $root.google.cloud.retail.v2beta.Product.encode(message.products[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified BoostAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.BoostAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IBoostAction} message BoostAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.boost); + if (message.productsFilter != null && Object.hasOwnProperty.call(message, "productsFilter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.productsFilter); + return writer; + }; - /** - * Encodes the specified ProductInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ProductInlineSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ProductInlineSource - * @static - * @param {google.cloud.retail.v2beta.IProductInlineSource} message ProductInlineSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProductInlineSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified BoostAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.BoostAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IBoostAction} message BoostAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ProductInlineSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.ProductInlineSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ProductInlineSource} ProductInlineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProductInlineSource.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.v2beta.ProductInlineSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.products && message.products.length)) - message.products = []; - message.products.push($root.google.cloud.retail.v2beta.Product.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a BoostAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Rule.BoostAction} BoostAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostAction.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.v2beta.Rule.BoostAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boost = reader.float(); + break; + case 2: + message.productsFilter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a ProductInlineSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ProductInlineSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ProductInlineSource} ProductInlineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProductInlineSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a BoostAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Rule.BoostAction} BoostAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a ProductInlineSource message. - * @function verify - * @memberof google.cloud.retail.v2beta.ProductInlineSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProductInlineSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.products != null && message.hasOwnProperty("products")) { - if (!Array.isArray(message.products)) - return "products: array expected"; - for (var i = 0; i < message.products.length; ++i) { - var error = $root.google.cloud.retail.v2beta.Product.verify(message.products[i]); - if (error) - return "products." + error; - } - } - return null; - }; + /** + * Verifies a BoostAction message. + * @function verify + * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + if (message.productsFilter != null && message.hasOwnProperty("productsFilter")) + if (!$util.isString(message.productsFilter)) + return "productsFilter: string expected"; + return null; + }; - /** - * Creates a ProductInlineSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.ProductInlineSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ProductInlineSource} ProductInlineSource - */ - ProductInlineSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ProductInlineSource) - return object; - var message = new $root.google.cloud.retail.v2beta.ProductInlineSource(); - if (object.products) { - if (!Array.isArray(object.products)) - throw TypeError(".google.cloud.retail.v2beta.ProductInlineSource.products: array expected"); - message.products = []; - for (var i = 0; i < object.products.length; ++i) { - if (typeof object.products[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.ProductInlineSource.products: object expected"); - message.products[i] = $root.google.cloud.retail.v2beta.Product.fromObject(object.products[i]); - } - } - return message; - }; + /** + * Creates a BoostAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Rule.BoostAction} BoostAction + */ + BoostAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Rule.BoostAction) + return object; + var message = new $root.google.cloud.retail.v2beta.Rule.BoostAction(); + if (object.boost != null) + message.boost = Number(object.boost); + if (object.productsFilter != null) + message.productsFilter = String(object.productsFilter); + return message; + }; - /** - * Creates a plain object from a ProductInlineSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.ProductInlineSource - * @static - * @param {google.cloud.retail.v2beta.ProductInlineSource} message ProductInlineSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProductInlineSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.products = []; - if (message.products && message.products.length) { - object.products = []; - for (var j = 0; j < message.products.length; ++j) - object.products[j] = $root.google.cloud.retail.v2beta.Product.toObject(message.products[j], options); - } - return object; - }; + /** + * Creates a plain object from a BoostAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @static + * @param {google.cloud.retail.v2beta.Rule.BoostAction} message BoostAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.boost = 0; + object.productsFilter = ""; + } + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + if (message.productsFilter != null && message.hasOwnProperty("productsFilter")) + object.productsFilter = message.productsFilter; + return object; + }; - /** - * Converts this ProductInlineSource to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.ProductInlineSource - * @instance - * @returns {Object.} JSON object - */ - ProductInlineSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this BoostAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Rule.BoostAction + * @instance + * @returns {Object.} JSON object + */ + BoostAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ProductInlineSource; - })(); + return BoostAction; + })(); - v2beta.UserEventInlineSource = (function() { + Rule.FilterAction = (function() { - /** - * Properties of a UserEventInlineSource. - * @memberof google.cloud.retail.v2beta - * @interface IUserEventInlineSource - * @property {Array.|null} [userEvents] UserEventInlineSource userEvents - */ + /** + * Properties of a FilterAction. + * @memberof google.cloud.retail.v2beta.Rule + * @interface IFilterAction + * @property {string|null} [filter] FilterAction filter + */ - /** - * Constructs a new UserEventInlineSource. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a UserEventInlineSource. - * @implements IUserEventInlineSource - * @constructor - * @param {google.cloud.retail.v2beta.IUserEventInlineSource=} [properties] Properties to set - */ - function UserEventInlineSource(properties) { - this.userEvents = []; - 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]]; - } + /** + * Constructs a new FilterAction. + * @memberof google.cloud.retail.v2beta.Rule + * @classdesc Represents a FilterAction. + * @implements IFilterAction + * @constructor + * @param {google.cloud.retail.v2beta.Rule.IFilterAction=} [properties] Properties to set + */ + function FilterAction(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]]; + } - /** - * UserEventInlineSource userEvents. - * @member {Array.} userEvents - * @memberof google.cloud.retail.v2beta.UserEventInlineSource - * @instance - */ - UserEventInlineSource.prototype.userEvents = $util.emptyArray; + /** + * FilterAction filter. + * @member {string} filter + * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @instance + */ + FilterAction.prototype.filter = ""; - /** - * Creates a new UserEventInlineSource instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.UserEventInlineSource - * @static - * @param {google.cloud.retail.v2beta.IUserEventInlineSource=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.UserEventInlineSource} UserEventInlineSource instance - */ - UserEventInlineSource.create = function create(properties) { - return new UserEventInlineSource(properties); - }; + /** + * Creates a new FilterAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IFilterAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Rule.FilterAction} FilterAction instance + */ + FilterAction.create = function create(properties) { + return new FilterAction(properties); + }; - /** - * Encodes the specified UserEventInlineSource message. Does not implicitly {@link google.cloud.retail.v2beta.UserEventInlineSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.UserEventInlineSource - * @static - * @param {google.cloud.retail.v2beta.IUserEventInlineSource} message UserEventInlineSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UserEventInlineSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.userEvents != null && message.userEvents.length) - for (var i = 0; i < message.userEvents.length; ++i) - $root.google.cloud.retail.v2beta.UserEvent.encode(message.userEvents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified FilterAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.FilterAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IFilterAction} message FilterAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + return writer; + }; - /** - * Encodes the specified UserEventInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserEventInlineSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.UserEventInlineSource - * @static - * @param {google.cloud.retail.v2beta.IUserEventInlineSource} message UserEventInlineSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UserEventInlineSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified FilterAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.FilterAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IFilterAction} message FilterAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a UserEventInlineSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.UserEventInlineSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.UserEventInlineSource} UserEventInlineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserEventInlineSource.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.v2beta.UserEventInlineSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.userEvents && message.userEvents.length)) - message.userEvents = []; - message.userEvents.push($root.google.cloud.retail.v2beta.UserEvent.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a FilterAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Rule.FilterAction} FilterAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterAction.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.v2beta.Rule.FilterAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; - - /** - * Decodes a UserEventInlineSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.UserEventInlineSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.UserEventInlineSource} UserEventInlineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserEventInlineSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return message; + }; - /** - * Verifies a UserEventInlineSource message. - * @function verify - * @memberof google.cloud.retail.v2beta.UserEventInlineSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UserEventInlineSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.userEvents != null && message.hasOwnProperty("userEvents")) { - if (!Array.isArray(message.userEvents)) - return "userEvents: array expected"; - for (var i = 0; i < message.userEvents.length; ++i) { - var error = $root.google.cloud.retail.v2beta.UserEvent.verify(message.userEvents[i]); - if (error) - return "userEvents." + error; - } - } - return null; - }; + /** + * Decodes a FilterAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Rule.FilterAction} FilterAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a UserEventInlineSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.UserEventInlineSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.UserEventInlineSource} UserEventInlineSource - */ - UserEventInlineSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.UserEventInlineSource) - return object; - var message = new $root.google.cloud.retail.v2beta.UserEventInlineSource(); - if (object.userEvents) { - if (!Array.isArray(object.userEvents)) - throw TypeError(".google.cloud.retail.v2beta.UserEventInlineSource.userEvents: array expected"); - message.userEvents = []; - for (var i = 0; i < object.userEvents.length; ++i) { - if (typeof object.userEvents[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.UserEventInlineSource.userEvents: object expected"); - message.userEvents[i] = $root.google.cloud.retail.v2beta.UserEvent.fromObject(object.userEvents[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a UserEventInlineSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.UserEventInlineSource - * @static - * @param {google.cloud.retail.v2beta.UserEventInlineSource} message UserEventInlineSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UserEventInlineSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.userEvents = []; - if (message.userEvents && message.userEvents.length) { - object.userEvents = []; - for (var j = 0; j < message.userEvents.length; ++j) - object.userEvents[j] = $root.google.cloud.retail.v2beta.UserEvent.toObject(message.userEvents[j], options); - } - return object; - }; + /** + * Verifies a FilterAction message. + * @function verify + * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FilterAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; - /** - * Converts this UserEventInlineSource to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.UserEventInlineSource - * @instance - * @returns {Object.} JSON object - */ - UserEventInlineSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a FilterAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Rule.FilterAction} FilterAction + */ + FilterAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Rule.FilterAction) + return object; + var message = new $root.google.cloud.retail.v2beta.Rule.FilterAction(); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; - return UserEventInlineSource; - })(); + /** + * Creates a plain object from a FilterAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @static + * @param {google.cloud.retail.v2beta.Rule.FilterAction} message FilterAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FilterAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.filter = ""; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; - v2beta.ImportErrorsConfig = (function() { + /** + * Converts this FilterAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Rule.FilterAction + * @instance + * @returns {Object.} JSON object + */ + FilterAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of an ImportErrorsConfig. - * @memberof google.cloud.retail.v2beta - * @interface IImportErrorsConfig - * @property {string|null} [gcsPrefix] ImportErrorsConfig gcsPrefix - */ + return FilterAction; + })(); - /** - * Constructs a new ImportErrorsConfig. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents an ImportErrorsConfig. - * @implements IImportErrorsConfig - * @constructor - * @param {google.cloud.retail.v2beta.IImportErrorsConfig=} [properties] Properties to set - */ - function ImportErrorsConfig(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]]; - } + Rule.RedirectAction = (function() { - /** - * ImportErrorsConfig gcsPrefix. - * @member {string|null|undefined} gcsPrefix - * @memberof google.cloud.retail.v2beta.ImportErrorsConfig - * @instance - */ - ImportErrorsConfig.prototype.gcsPrefix = null; + /** + * Properties of a RedirectAction. + * @memberof google.cloud.retail.v2beta.Rule + * @interface IRedirectAction + * @property {string|null} [redirectUri] RedirectAction redirectUri + */ - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Constructs a new RedirectAction. + * @memberof google.cloud.retail.v2beta.Rule + * @classdesc Represents a RedirectAction. + * @implements IRedirectAction + * @constructor + * @param {google.cloud.retail.v2beta.Rule.IRedirectAction=} [properties] Properties to set + */ + function RedirectAction(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]]; + } - /** - * ImportErrorsConfig destination. - * @member {"gcsPrefix"|undefined} destination - * @memberof google.cloud.retail.v2beta.ImportErrorsConfig - * @instance - */ - Object.defineProperty(ImportErrorsConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsPrefix"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * RedirectAction redirectUri. + * @member {string} redirectUri + * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @instance + */ + RedirectAction.prototype.redirectUri = ""; - /** - * Creates a new ImportErrorsConfig instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.ImportErrorsConfig - * @static - * @param {google.cloud.retail.v2beta.IImportErrorsConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ImportErrorsConfig} ImportErrorsConfig instance - */ - ImportErrorsConfig.create = function create(properties) { - return new ImportErrorsConfig(properties); - }; + /** + * Creates a new RedirectAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IRedirectAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Rule.RedirectAction} RedirectAction instance + */ + RedirectAction.create = function create(properties) { + return new RedirectAction(properties); + }; - /** - * Encodes the specified ImportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ImportErrorsConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.ImportErrorsConfig - * @static - * @param {google.cloud.retail.v2beta.IImportErrorsConfig} message ImportErrorsConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportErrorsConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsPrefix); - return writer; - }; + /** + * Encodes the specified RedirectAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.RedirectAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IRedirectAction} message RedirectAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedirectAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.redirectUri != null && Object.hasOwnProperty.call(message, "redirectUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.redirectUri); + return writer; + }; - /** - * Encodes the specified ImportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportErrorsConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ImportErrorsConfig - * @static - * @param {google.cloud.retail.v2beta.IImportErrorsConfig} message ImportErrorsConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportErrorsConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified RedirectAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.RedirectAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IRedirectAction} message RedirectAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedirectAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an ImportErrorsConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.ImportErrorsConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ImportErrorsConfig} ImportErrorsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportErrorsConfig.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.v2beta.ImportErrorsConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.gcsPrefix = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a RedirectAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Rule.RedirectAction} RedirectAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedirectAction.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.v2beta.Rule.RedirectAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redirectUri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes an ImportErrorsConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ImportErrorsConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ImportErrorsConfig} ImportErrorsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportErrorsConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a RedirectAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Rule.RedirectAction} RedirectAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedirectAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an ImportErrorsConfig message. - * @function verify - * @memberof google.cloud.retail.v2beta.ImportErrorsConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportErrorsConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { - properties.destination = 1; - if (!$util.isString(message.gcsPrefix)) - return "gcsPrefix: string expected"; - } - return null; - }; + /** + * Verifies a RedirectAction message. + * @function verify + * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedirectAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) + if (!$util.isString(message.redirectUri)) + return "redirectUri: string expected"; + return null; + }; - /** - * Creates an ImportErrorsConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.ImportErrorsConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ImportErrorsConfig} ImportErrorsConfig - */ - ImportErrorsConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ImportErrorsConfig) + /** + * Creates a RedirectAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Rule.RedirectAction} RedirectAction + */ + RedirectAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Rule.RedirectAction) + return object; + var message = new $root.google.cloud.retail.v2beta.Rule.RedirectAction(); + if (object.redirectUri != null) + message.redirectUri = String(object.redirectUri); + return message; + }; + + /** + * Creates a plain object from a RedirectAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @static + * @param {google.cloud.retail.v2beta.Rule.RedirectAction} message RedirectAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedirectAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.redirectUri = ""; + if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) + object.redirectUri = message.redirectUri; return object; - var message = new $root.google.cloud.retail.v2beta.ImportErrorsConfig(); - if (object.gcsPrefix != null) - message.gcsPrefix = String(object.gcsPrefix); - return message; - }; + }; - /** - * Creates a plain object from an ImportErrorsConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.ImportErrorsConfig - * @static - * @param {google.cloud.retail.v2beta.ImportErrorsConfig} message ImportErrorsConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportErrorsConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { - object.gcsPrefix = message.gcsPrefix; - if (options.oneofs) - object.destination = "gcsPrefix"; - } - return object; - }; + /** + * Converts this RedirectAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Rule.RedirectAction + * @instance + * @returns {Object.} JSON object + */ + RedirectAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ImportErrorsConfig to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.ImportErrorsConfig - * @instance - * @returns {Object.} JSON object - */ - ImportErrorsConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return RedirectAction; + })(); - return ImportErrorsConfig; - })(); + Rule.TwowaySynonymsAction = (function() { - v2beta.ImportProductsRequest = (function() { + /** + * Properties of a TwowaySynonymsAction. + * @memberof google.cloud.retail.v2beta.Rule + * @interface ITwowaySynonymsAction + * @property {Array.|null} [synonyms] TwowaySynonymsAction synonyms + */ - /** - * Properties of an ImportProductsRequest. - * @memberof google.cloud.retail.v2beta - * @interface IImportProductsRequest - * @property {string|null} [parent] ImportProductsRequest parent - * @property {string|null} [requestId] ImportProductsRequest requestId - * @property {google.cloud.retail.v2beta.IProductInputConfig|null} [inputConfig] ImportProductsRequest inputConfig - * @property {google.cloud.retail.v2beta.IImportErrorsConfig|null} [errorsConfig] ImportProductsRequest errorsConfig - * @property {google.protobuf.IFieldMask|null} [updateMask] ImportProductsRequest updateMask - * @property {google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode|null} [reconciliationMode] ImportProductsRequest reconciliationMode - * @property {string|null} [notificationPubsubTopic] ImportProductsRequest notificationPubsubTopic - */ + /** + * Constructs a new TwowaySynonymsAction. + * @memberof google.cloud.retail.v2beta.Rule + * @classdesc Represents a TwowaySynonymsAction. + * @implements ITwowaySynonymsAction + * @constructor + * @param {google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction=} [properties] Properties to set + */ + function TwowaySynonymsAction(properties) { + this.synonyms = []; + 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]]; + } - /** - * Constructs a new ImportProductsRequest. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents an ImportProductsRequest. - * @implements IImportProductsRequest - * @constructor - * @param {google.cloud.retail.v2beta.IImportProductsRequest=} [properties] Properties to set - */ - function ImportProductsRequest(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]]; - } - - /** - * ImportProductsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2beta.ImportProductsRequest - * @instance - */ - ImportProductsRequest.prototype.parent = ""; - - /** - * ImportProductsRequest requestId. - * @member {string} requestId - * @memberof google.cloud.retail.v2beta.ImportProductsRequest - * @instance - */ - ImportProductsRequest.prototype.requestId = ""; - - /** - * ImportProductsRequest inputConfig. - * @member {google.cloud.retail.v2beta.IProductInputConfig|null|undefined} inputConfig - * @memberof google.cloud.retail.v2beta.ImportProductsRequest - * @instance - */ - ImportProductsRequest.prototype.inputConfig = null; - - /** - * ImportProductsRequest errorsConfig. - * @member {google.cloud.retail.v2beta.IImportErrorsConfig|null|undefined} errorsConfig - * @memberof google.cloud.retail.v2beta.ImportProductsRequest - * @instance - */ - ImportProductsRequest.prototype.errorsConfig = null; - - /** - * ImportProductsRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.retail.v2beta.ImportProductsRequest - * @instance - */ - ImportProductsRequest.prototype.updateMask = null; + /** + * TwowaySynonymsAction synonyms. + * @member {Array.} synonyms + * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction + * @instance + */ + TwowaySynonymsAction.prototype.synonyms = $util.emptyArray; - /** - * ImportProductsRequest reconciliationMode. - * @member {google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode} reconciliationMode - * @memberof google.cloud.retail.v2beta.ImportProductsRequest - * @instance - */ - ImportProductsRequest.prototype.reconciliationMode = 0; + /** + * Creates a new TwowaySynonymsAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction + * @static + * @param {google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Rule.TwowaySynonymsAction} TwowaySynonymsAction instance + */ + TwowaySynonymsAction.create = function create(properties) { + return new TwowaySynonymsAction(properties); + }; - /** - * ImportProductsRequest notificationPubsubTopic. - * @member {string} notificationPubsubTopic - * @memberof google.cloud.retail.v2beta.ImportProductsRequest - * @instance - */ - ImportProductsRequest.prototype.notificationPubsubTopic = ""; + /** + * Encodes the specified TwowaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction + * @static + * @param {google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction} message TwowaySynonymsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TwowaySynonymsAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.synonyms != null && message.synonyms.length) + for (var i = 0; i < message.synonyms.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.synonyms[i]); + return writer; + }; - /** - * Creates a new ImportProductsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.ImportProductsRequest - * @static - * @param {google.cloud.retail.v2beta.IImportProductsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ImportProductsRequest} ImportProductsRequest instance - */ - ImportProductsRequest.create = function create(properties) { - return new ImportProductsRequest(properties); - }; + /** + * Encodes the specified TwowaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction + * @static + * @param {google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction} message TwowaySynonymsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TwowaySynonymsAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified ImportProductsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ImportProductsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.ImportProductsRequest - * @static - * @param {google.cloud.retail.v2beta.IImportProductsRequest} message ImportProductsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportProductsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) - $root.google.cloud.retail.v2beta.ProductInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) - $root.google.cloud.retail.v2beta.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reconciliationMode != null && Object.hasOwnProperty.call(message, "reconciliationMode")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.reconciliationMode); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.requestId); - if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.notificationPubsubTopic); - return writer; - }; + /** + * Decodes a TwowaySynonymsAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Rule.TwowaySynonymsAction} TwowaySynonymsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TwowaySynonymsAction.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.v2beta.Rule.TwowaySynonymsAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.synonyms && message.synonyms.length)) + message.synonyms = []; + message.synonyms.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified ImportProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportProductsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ImportProductsRequest - * @static - * @param {google.cloud.retail.v2beta.IImportProductsRequest} message ImportProductsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a TwowaySynonymsAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Rule.TwowaySynonymsAction} TwowaySynonymsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TwowaySynonymsAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes an ImportProductsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.ImportProductsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ImportProductsRequest} ImportProductsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportProductsRequest.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.v2beta.ImportProductsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 6: - message.requestId = reader.string(); - break; - case 2: - message.inputConfig = $root.google.cloud.retail.v2beta.ProductInputConfig.decode(reader, reader.uint32()); - break; - case 3: - message.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.decode(reader, reader.uint32()); - break; - case 4: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 5: - message.reconciliationMode = reader.int32(); - break; - case 7: - message.notificationPubsubTopic = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Verifies a TwowaySynonymsAction message. + * @function verify + * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TwowaySynonymsAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.synonyms != null && message.hasOwnProperty("synonyms")) { + if (!Array.isArray(message.synonyms)) + return "synonyms: array expected"; + for (var i = 0; i < message.synonyms.length; ++i) + if (!$util.isString(message.synonyms[i])) + return "synonyms: string[] expected"; } - } - return message; - }; - - /** - * Decodes an ImportProductsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ImportProductsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ImportProductsRequest} ImportProductsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportProductsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return null; + }; - /** - * Verifies an ImportProductsRequest message. - * @function verify - * @memberof google.cloud.retail.v2beta.ImportProductsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportProductsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { - var error = $root.google.cloud.retail.v2beta.ProductInputConfig.verify(message.inputConfig); - if (error) - return "inputConfig." + error; - } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { - var error = $root.google.cloud.retail.v2beta.ImportErrorsConfig.verify(message.errorsConfig); - if (error) - return "errorsConfig." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) - switch (message.reconciliationMode) { - default: - return "reconciliationMode: enum value expected"; - case 0: - case 1: - case 2: - break; + /** + * Creates a TwowaySynonymsAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Rule.TwowaySynonymsAction} TwowaySynonymsAction + */ + TwowaySynonymsAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) + return object; + var message = new $root.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction(); + if (object.synonyms) { + if (!Array.isArray(object.synonyms)) + throw TypeError(".google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.synonyms: array expected"); + message.synonyms = []; + for (var i = 0; i < object.synonyms.length; ++i) + message.synonyms[i] = String(object.synonyms[i]); } - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - if (!$util.isString(message.notificationPubsubTopic)) - return "notificationPubsubTopic: string expected"; - return null; - }; + return message; + }; - /** - * Creates an ImportProductsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.ImportProductsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ImportProductsRequest} ImportProductsRequest - */ - ImportProductsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ImportProductsRequest) + /** + * Creates a plain object from a TwowaySynonymsAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction + * @static + * @param {google.cloud.retail.v2beta.Rule.TwowaySynonymsAction} message TwowaySynonymsAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TwowaySynonymsAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.synonyms = []; + if (message.synonyms && message.synonyms.length) { + object.synonyms = []; + for (var j = 0; j < message.synonyms.length; ++j) + object.synonyms[j] = message.synonyms[j]; + } return object; - var message = new $root.google.cloud.retail.v2beta.ImportProductsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.inputConfig != null) { - if (typeof object.inputConfig !== "object") - throw TypeError(".google.cloud.retail.v2beta.ImportProductsRequest.inputConfig: object expected"); - message.inputConfig = $root.google.cloud.retail.v2beta.ProductInputConfig.fromObject(object.inputConfig); - } - if (object.errorsConfig != null) { - if (typeof object.errorsConfig !== "object") - throw TypeError(".google.cloud.retail.v2beta.ImportProductsRequest.errorsConfig: object expected"); - message.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.fromObject(object.errorsConfig); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.retail.v2beta.ImportProductsRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - switch (object.reconciliationMode) { - case "RECONCILIATION_MODE_UNSPECIFIED": - case 0: - message.reconciliationMode = 0; - break; - case "INCREMENTAL": - case 1: - message.reconciliationMode = 1; - break; - case "FULL": - case 2: - message.reconciliationMode = 2; - break; - } - if (object.notificationPubsubTopic != null) - message.notificationPubsubTopic = String(object.notificationPubsubTopic); - return message; - }; - - /** - * Creates a plain object from an ImportProductsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.ImportProductsRequest - * @static - * @param {google.cloud.retail.v2beta.ImportProductsRequest} message ImportProductsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportProductsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.inputConfig = null; - object.errorsConfig = null; - object.updateMask = null; - object.reconciliationMode = options.enums === String ? "RECONCILIATION_MODE_UNSPECIFIED" : 0; - object.requestId = ""; - object.notificationPubsubTopic = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) - object.inputConfig = $root.google.cloud.retail.v2beta.ProductInputConfig.toObject(message.inputConfig, options); - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) - object.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.toObject(message.errorsConfig, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) - object.reconciliationMode = options.enums === String ? $root.google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode[message.reconciliationMode] : message.reconciliationMode; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - object.notificationPubsubTopic = message.notificationPubsubTopic; - return object; - }; + }; - /** - * Converts this ImportProductsRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.ImportProductsRequest - * @instance - * @returns {Object.} JSON object - */ - ImportProductsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this TwowaySynonymsAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Rule.TwowaySynonymsAction + * @instance + * @returns {Object.} JSON object + */ + TwowaySynonymsAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * ReconciliationMode enum. - * @name google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode - * @enum {number} - * @property {number} RECONCILIATION_MODE_UNSPECIFIED=0 RECONCILIATION_MODE_UNSPECIFIED value - * @property {number} INCREMENTAL=1 INCREMENTAL value - * @property {number} FULL=2 FULL value - */ - ImportProductsRequest.ReconciliationMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RECONCILIATION_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INCREMENTAL"] = 1; - values[valuesById[2] = "FULL"] = 2; - return values; + return TwowaySynonymsAction; })(); - return ImportProductsRequest; - })(); - - v2beta.ImportUserEventsRequest = (function() { + Rule.OnewaySynonymsAction = (function() { - /** - * Properties of an ImportUserEventsRequest. - * @memberof google.cloud.retail.v2beta - * @interface IImportUserEventsRequest - * @property {string|null} [parent] ImportUserEventsRequest parent - * @property {google.cloud.retail.v2beta.IUserEventInputConfig|null} [inputConfig] ImportUserEventsRequest inputConfig - * @property {google.cloud.retail.v2beta.IImportErrorsConfig|null} [errorsConfig] ImportUserEventsRequest errorsConfig - */ + /** + * Properties of an OnewaySynonymsAction. + * @memberof google.cloud.retail.v2beta.Rule + * @interface IOnewaySynonymsAction + * @property {Array.|null} [queryTerms] OnewaySynonymsAction queryTerms + * @property {Array.|null} [synonyms] OnewaySynonymsAction synonyms + * @property {Array.|null} [onewayTerms] OnewaySynonymsAction onewayTerms + */ - /** - * Constructs a new ImportUserEventsRequest. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents an ImportUserEventsRequest. - * @implements IImportUserEventsRequest - * @constructor - * @param {google.cloud.retail.v2beta.IImportUserEventsRequest=} [properties] Properties to set - */ - function ImportUserEventsRequest(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]]; - } + /** + * Constructs a new OnewaySynonymsAction. + * @memberof google.cloud.retail.v2beta.Rule + * @classdesc Represents an OnewaySynonymsAction. + * @implements IOnewaySynonymsAction + * @constructor + * @param {google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction=} [properties] Properties to set + */ + function OnewaySynonymsAction(properties) { + this.queryTerms = []; + this.synonyms = []; + this.onewayTerms = []; + 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]]; + } - /** - * ImportUserEventsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest - * @instance - */ - ImportUserEventsRequest.prototype.parent = ""; + /** + * OnewaySynonymsAction queryTerms. + * @member {Array.} queryTerms + * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction + * @instance + */ + OnewaySynonymsAction.prototype.queryTerms = $util.emptyArray; - /** - * ImportUserEventsRequest inputConfig. - * @member {google.cloud.retail.v2beta.IUserEventInputConfig|null|undefined} inputConfig - * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest - * @instance - */ - ImportUserEventsRequest.prototype.inputConfig = null; + /** + * OnewaySynonymsAction synonyms. + * @member {Array.} synonyms + * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction + * @instance + */ + OnewaySynonymsAction.prototype.synonyms = $util.emptyArray; - /** - * ImportUserEventsRequest errorsConfig. - * @member {google.cloud.retail.v2beta.IImportErrorsConfig|null|undefined} errorsConfig - * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest - * @instance - */ - ImportUserEventsRequest.prototype.errorsConfig = null; + /** + * OnewaySynonymsAction onewayTerms. + * @member {Array.} onewayTerms + * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction + * @instance + */ + OnewaySynonymsAction.prototype.onewayTerms = $util.emptyArray; - /** - * Creates a new ImportUserEventsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest - * @static - * @param {google.cloud.retail.v2beta.IImportUserEventsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ImportUserEventsRequest} ImportUserEventsRequest instance - */ - ImportUserEventsRequest.create = function create(properties) { - return new ImportUserEventsRequest(properties); - }; + /** + * Creates a new OnewaySynonymsAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Rule.OnewaySynonymsAction} OnewaySynonymsAction instance + */ + OnewaySynonymsAction.create = function create(properties) { + return new OnewaySynonymsAction(properties); + }; - /** - * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ImportUserEventsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest - * @static - * @param {google.cloud.retail.v2beta.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportUserEventsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) - $root.google.cloud.retail.v2beta.UserEventInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) - $root.google.cloud.retail.v2beta.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified OnewaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction} message OnewaySynonymsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnewaySynonymsAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.onewayTerms != null && message.onewayTerms.length) + for (var i = 0; i < message.onewayTerms.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.onewayTerms[i]); + if (message.queryTerms != null && message.queryTerms.length) + for (var i = 0; i < message.queryTerms.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.queryTerms[i]); + if (message.synonyms != null && message.synonyms.length) + for (var i = 0; i < message.synonyms.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.synonyms[i]); + return writer; + }; - /** - * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportUserEventsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest - * @static - * @param {google.cloud.retail.v2beta.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified OnewaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IOnewaySynonymsAction} message OnewaySynonymsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnewaySynonymsAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an ImportUserEventsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ImportUserEventsRequest} ImportUserEventsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportUserEventsRequest.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.v2beta.ImportUserEventsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.inputConfig = $root.google.cloud.retail.v2beta.UserEventInputConfig.decode(reader, reader.uint32()); - break; - case 3: - message.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes an OnewaySynonymsAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Rule.OnewaySynonymsAction} OnewaySynonymsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnewaySynonymsAction.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.v2beta.Rule.OnewaySynonymsAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + if (!(message.queryTerms && message.queryTerms.length)) + message.queryTerms = []; + message.queryTerms.push(reader.string()); + break; + case 4: + if (!(message.synonyms && message.synonyms.length)) + message.synonyms = []; + message.synonyms.push(reader.string()); + break; + case 2: + if (!(message.onewayTerms && message.onewayTerms.length)) + message.onewayTerms = []; + message.onewayTerms.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ImportUserEventsRequest} ImportUserEventsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an OnewaySynonymsAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Rule.OnewaySynonymsAction} OnewaySynonymsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnewaySynonymsAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an ImportUserEventsRequest message. - * @function verify - * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportUserEventsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { - var error = $root.google.cloud.retail.v2beta.UserEventInputConfig.verify(message.inputConfig); - if (error) - return "inputConfig." + error; - } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { - var error = $root.google.cloud.retail.v2beta.ImportErrorsConfig.verify(message.errorsConfig); - if (error) - return "errorsConfig." + error; - } - return null; - }; + /** + * Verifies an OnewaySynonymsAction message. + * @function verify + * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OnewaySynonymsAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { + if (!Array.isArray(message.queryTerms)) + return "queryTerms: array expected"; + for (var i = 0; i < message.queryTerms.length; ++i) + if (!$util.isString(message.queryTerms[i])) + return "queryTerms: string[] expected"; + } + if (message.synonyms != null && message.hasOwnProperty("synonyms")) { + if (!Array.isArray(message.synonyms)) + return "synonyms: array expected"; + for (var i = 0; i < message.synonyms.length; ++i) + if (!$util.isString(message.synonyms[i])) + return "synonyms: string[] expected"; + } + if (message.onewayTerms != null && message.hasOwnProperty("onewayTerms")) { + if (!Array.isArray(message.onewayTerms)) + return "onewayTerms: array expected"; + for (var i = 0; i < message.onewayTerms.length; ++i) + if (!$util.isString(message.onewayTerms[i])) + return "onewayTerms: string[] expected"; + } + return null; + }; - /** - * Creates an ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ImportUserEventsRequest} ImportUserEventsRequest - */ - ImportUserEventsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ImportUserEventsRequest) + /** + * Creates an OnewaySynonymsAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Rule.OnewaySynonymsAction} OnewaySynonymsAction + */ + OnewaySynonymsAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) + return object; + var message = new $root.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction(); + if (object.queryTerms) { + if (!Array.isArray(object.queryTerms)) + throw TypeError(".google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.queryTerms: array expected"); + message.queryTerms = []; + for (var i = 0; i < object.queryTerms.length; ++i) + message.queryTerms[i] = String(object.queryTerms[i]); + } + if (object.synonyms) { + if (!Array.isArray(object.synonyms)) + throw TypeError(".google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.synonyms: array expected"); + message.synonyms = []; + for (var i = 0; i < object.synonyms.length; ++i) + message.synonyms[i] = String(object.synonyms[i]); + } + if (object.onewayTerms) { + if (!Array.isArray(object.onewayTerms)) + throw TypeError(".google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.onewayTerms: array expected"); + message.onewayTerms = []; + for (var i = 0; i < object.onewayTerms.length; ++i) + message.onewayTerms[i] = String(object.onewayTerms[i]); + } + return message; + }; + + /** + * Creates a plain object from an OnewaySynonymsAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction + * @static + * @param {google.cloud.retail.v2beta.Rule.OnewaySynonymsAction} message OnewaySynonymsAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OnewaySynonymsAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.onewayTerms = []; + object.queryTerms = []; + object.synonyms = []; + } + if (message.onewayTerms && message.onewayTerms.length) { + object.onewayTerms = []; + for (var j = 0; j < message.onewayTerms.length; ++j) + object.onewayTerms[j] = message.onewayTerms[j]; + } + if (message.queryTerms && message.queryTerms.length) { + object.queryTerms = []; + for (var j = 0; j < message.queryTerms.length; ++j) + object.queryTerms[j] = message.queryTerms[j]; + } + if (message.synonyms && message.synonyms.length) { + object.synonyms = []; + for (var j = 0; j < message.synonyms.length; ++j) + object.synonyms[j] = message.synonyms[j]; + } return object; - var message = new $root.google.cloud.retail.v2beta.ImportUserEventsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.inputConfig != null) { - if (typeof object.inputConfig !== "object") - throw TypeError(".google.cloud.retail.v2beta.ImportUserEventsRequest.inputConfig: object expected"); - message.inputConfig = $root.google.cloud.retail.v2beta.UserEventInputConfig.fromObject(object.inputConfig); - } - if (object.errorsConfig != null) { - if (typeof object.errorsConfig !== "object") - throw TypeError(".google.cloud.retail.v2beta.ImportUserEventsRequest.errorsConfig: object expected"); - message.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.fromObject(object.errorsConfig); - } - return message; - }; + }; - /** - * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest - * @static - * @param {google.cloud.retail.v2beta.ImportUserEventsRequest} message ImportUserEventsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportUserEventsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.inputConfig = null; - object.errorsConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) - object.inputConfig = $root.google.cloud.retail.v2beta.UserEventInputConfig.toObject(message.inputConfig, options); - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) - object.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.toObject(message.errorsConfig, options); - return object; - }; + /** + * Converts this OnewaySynonymsAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Rule.OnewaySynonymsAction + * @instance + * @returns {Object.} JSON object + */ + OnewaySynonymsAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ImportUserEventsRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest - * @instance - * @returns {Object.} JSON object - */ - ImportUserEventsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return OnewaySynonymsAction; + })(); - return ImportUserEventsRequest; - })(); + Rule.DoNotAssociateAction = (function() { - v2beta.ImportCompletionDataRequest = (function() { + /** + * Properties of a DoNotAssociateAction. + * @memberof google.cloud.retail.v2beta.Rule + * @interface IDoNotAssociateAction + * @property {Array.|null} [queryTerms] DoNotAssociateAction queryTerms + * @property {Array.|null} [doNotAssociateTerms] DoNotAssociateAction doNotAssociateTerms + * @property {Array.|null} [terms] DoNotAssociateAction terms + */ - /** - * Properties of an ImportCompletionDataRequest. - * @memberof google.cloud.retail.v2beta - * @interface IImportCompletionDataRequest - * @property {string|null} [parent] ImportCompletionDataRequest parent - * @property {google.cloud.retail.v2beta.ICompletionDataInputConfig|null} [inputConfig] ImportCompletionDataRequest inputConfig - * @property {string|null} [notificationPubsubTopic] ImportCompletionDataRequest notificationPubsubTopic - */ + /** + * Constructs a new DoNotAssociateAction. + * @memberof google.cloud.retail.v2beta.Rule + * @classdesc Represents a DoNotAssociateAction. + * @implements IDoNotAssociateAction + * @constructor + * @param {google.cloud.retail.v2beta.Rule.IDoNotAssociateAction=} [properties] Properties to set + */ + function DoNotAssociateAction(properties) { + this.queryTerms = []; + this.doNotAssociateTerms = []; + this.terms = []; + 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]]; + } - /** - * Constructs a new ImportCompletionDataRequest. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents an ImportCompletionDataRequest. - * @implements IImportCompletionDataRequest - * @constructor - * @param {google.cloud.retail.v2beta.IImportCompletionDataRequest=} [properties] Properties to set - */ - function ImportCompletionDataRequest(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]]; - } - - /** - * ImportCompletionDataRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest - * @instance - */ - ImportCompletionDataRequest.prototype.parent = ""; + /** + * DoNotAssociateAction queryTerms. + * @member {Array.} queryTerms + * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction + * @instance + */ + DoNotAssociateAction.prototype.queryTerms = $util.emptyArray; - /** - * ImportCompletionDataRequest inputConfig. - * @member {google.cloud.retail.v2beta.ICompletionDataInputConfig|null|undefined} inputConfig - * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest - * @instance - */ - ImportCompletionDataRequest.prototype.inputConfig = null; + /** + * DoNotAssociateAction doNotAssociateTerms. + * @member {Array.} doNotAssociateTerms + * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction + * @instance + */ + DoNotAssociateAction.prototype.doNotAssociateTerms = $util.emptyArray; - /** - * ImportCompletionDataRequest notificationPubsubTopic. - * @member {string} notificationPubsubTopic - * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest - * @instance - */ - ImportCompletionDataRequest.prototype.notificationPubsubTopic = ""; + /** + * DoNotAssociateAction terms. + * @member {Array.} terms + * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction + * @instance + */ + DoNotAssociateAction.prototype.terms = $util.emptyArray; - /** - * Creates a new ImportCompletionDataRequest instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest - * @static - * @param {google.cloud.retail.v2beta.IImportCompletionDataRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ImportCompletionDataRequest} ImportCompletionDataRequest instance - */ - ImportCompletionDataRequest.create = function create(properties) { - return new ImportCompletionDataRequest(properties); - }; + /** + * Creates a new DoNotAssociateAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IDoNotAssociateAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Rule.DoNotAssociateAction} DoNotAssociateAction instance + */ + DoNotAssociateAction.create = function create(properties) { + return new DoNotAssociateAction(properties); + }; - /** - * Encodes the specified ImportCompletionDataRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ImportCompletionDataRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest - * @static - * @param {google.cloud.retail.v2beta.IImportCompletionDataRequest} message ImportCompletionDataRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportCompletionDataRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) - $root.google.cloud.retail.v2beta.CompletionDataInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.notificationPubsubTopic); - return writer; - }; + /** + * Encodes the specified DoNotAssociateAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.DoNotAssociateAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IDoNotAssociateAction} message DoNotAssociateAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoNotAssociateAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.terms != null && message.terms.length) + for (var i = 0; i < message.terms.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.terms[i]); + if (message.queryTerms != null && message.queryTerms.length) + for (var i = 0; i < message.queryTerms.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.queryTerms[i]); + if (message.doNotAssociateTerms != null && message.doNotAssociateTerms.length) + for (var i = 0; i < message.doNotAssociateTerms.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.doNotAssociateTerms[i]); + return writer; + }; - /** - * Encodes the specified ImportCompletionDataRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportCompletionDataRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest - * @static - * @param {google.cloud.retail.v2beta.IImportCompletionDataRequest} message ImportCompletionDataRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportCompletionDataRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified DoNotAssociateAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.DoNotAssociateAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IDoNotAssociateAction} message DoNotAssociateAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoNotAssociateAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an ImportCompletionDataRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ImportCompletionDataRequest} ImportCompletionDataRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportCompletionDataRequest.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.v2beta.ImportCompletionDataRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.inputConfig = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.decode(reader, reader.uint32()); - break; - case 3: - message.notificationPubsubTopic = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a DoNotAssociateAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Rule.DoNotAssociateAction} DoNotAssociateAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoNotAssociateAction.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.v2beta.Rule.DoNotAssociateAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.queryTerms && message.queryTerms.length)) + message.queryTerms = []; + message.queryTerms.push(reader.string()); + break; + case 3: + if (!(message.doNotAssociateTerms && message.doNotAssociateTerms.length)) + message.doNotAssociateTerms = []; + message.doNotAssociateTerms.push(reader.string()); + break; + case 1: + if (!(message.terms && message.terms.length)) + message.terms = []; + message.terms.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes an ImportCompletionDataRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ImportCompletionDataRequest} ImportCompletionDataRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportCompletionDataRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a DoNotAssociateAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Rule.DoNotAssociateAction} DoNotAssociateAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoNotAssociateAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an ImportCompletionDataRequest message. - * @function verify - * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportCompletionDataRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { - var error = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.verify(message.inputConfig); - if (error) - return "inputConfig." + error; - } - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - if (!$util.isString(message.notificationPubsubTopic)) - return "notificationPubsubTopic: string expected"; - return null; - }; + /** + * Verifies a DoNotAssociateAction message. + * @function verify + * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoNotAssociateAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { + if (!Array.isArray(message.queryTerms)) + return "queryTerms: array expected"; + for (var i = 0; i < message.queryTerms.length; ++i) + if (!$util.isString(message.queryTerms[i])) + return "queryTerms: string[] expected"; + } + if (message.doNotAssociateTerms != null && message.hasOwnProperty("doNotAssociateTerms")) { + if (!Array.isArray(message.doNotAssociateTerms)) + return "doNotAssociateTerms: array expected"; + for (var i = 0; i < message.doNotAssociateTerms.length; ++i) + if (!$util.isString(message.doNotAssociateTerms[i])) + return "doNotAssociateTerms: string[] expected"; + } + if (message.terms != null && message.hasOwnProperty("terms")) { + if (!Array.isArray(message.terms)) + return "terms: array expected"; + for (var i = 0; i < message.terms.length; ++i) + if (!$util.isString(message.terms[i])) + return "terms: string[] expected"; + } + return null; + }; - /** - * Creates an ImportCompletionDataRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ImportCompletionDataRequest} ImportCompletionDataRequest - */ - ImportCompletionDataRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ImportCompletionDataRequest) + /** + * Creates a DoNotAssociateAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Rule.DoNotAssociateAction} DoNotAssociateAction + */ + DoNotAssociateAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Rule.DoNotAssociateAction) + return object; + var message = new $root.google.cloud.retail.v2beta.Rule.DoNotAssociateAction(); + if (object.queryTerms) { + if (!Array.isArray(object.queryTerms)) + throw TypeError(".google.cloud.retail.v2beta.Rule.DoNotAssociateAction.queryTerms: array expected"); + message.queryTerms = []; + for (var i = 0; i < object.queryTerms.length; ++i) + message.queryTerms[i] = String(object.queryTerms[i]); + } + if (object.doNotAssociateTerms) { + if (!Array.isArray(object.doNotAssociateTerms)) + throw TypeError(".google.cloud.retail.v2beta.Rule.DoNotAssociateAction.doNotAssociateTerms: array expected"); + message.doNotAssociateTerms = []; + for (var i = 0; i < object.doNotAssociateTerms.length; ++i) + message.doNotAssociateTerms[i] = String(object.doNotAssociateTerms[i]); + } + if (object.terms) { + if (!Array.isArray(object.terms)) + throw TypeError(".google.cloud.retail.v2beta.Rule.DoNotAssociateAction.terms: array expected"); + message.terms = []; + for (var i = 0; i < object.terms.length; ++i) + message.terms[i] = String(object.terms[i]); + } + return message; + }; + + /** + * Creates a plain object from a DoNotAssociateAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction + * @static + * @param {google.cloud.retail.v2beta.Rule.DoNotAssociateAction} message DoNotAssociateAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoNotAssociateAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.terms = []; + object.queryTerms = []; + object.doNotAssociateTerms = []; + } + if (message.terms && message.terms.length) { + object.terms = []; + for (var j = 0; j < message.terms.length; ++j) + object.terms[j] = message.terms[j]; + } + if (message.queryTerms && message.queryTerms.length) { + object.queryTerms = []; + for (var j = 0; j < message.queryTerms.length; ++j) + object.queryTerms[j] = message.queryTerms[j]; + } + if (message.doNotAssociateTerms && message.doNotAssociateTerms.length) { + object.doNotAssociateTerms = []; + for (var j = 0; j < message.doNotAssociateTerms.length; ++j) + object.doNotAssociateTerms[j] = message.doNotAssociateTerms[j]; + } return object; - var message = new $root.google.cloud.retail.v2beta.ImportCompletionDataRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.inputConfig != null) { - if (typeof object.inputConfig !== "object") - throw TypeError(".google.cloud.retail.v2beta.ImportCompletionDataRequest.inputConfig: object expected"); - message.inputConfig = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.fromObject(object.inputConfig); - } - if (object.notificationPubsubTopic != null) - message.notificationPubsubTopic = String(object.notificationPubsubTopic); - return message; - }; + }; - /** - * Creates a plain object from an ImportCompletionDataRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest - * @static - * @param {google.cloud.retail.v2beta.ImportCompletionDataRequest} message ImportCompletionDataRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportCompletionDataRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.inputConfig = null; - object.notificationPubsubTopic = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) - object.inputConfig = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.toObject(message.inputConfig, options); - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - object.notificationPubsubTopic = message.notificationPubsubTopic; - return object; - }; + /** + * Converts this DoNotAssociateAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Rule.DoNotAssociateAction + * @instance + * @returns {Object.} JSON object + */ + DoNotAssociateAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ImportCompletionDataRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest - * @instance - * @returns {Object.} JSON object - */ - ImportCompletionDataRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return DoNotAssociateAction; + })(); - return ImportCompletionDataRequest; - })(); + Rule.ReplacementAction = (function() { - v2beta.ProductInputConfig = (function() { + /** + * Properties of a ReplacementAction. + * @memberof google.cloud.retail.v2beta.Rule + * @interface IReplacementAction + * @property {Array.|null} [queryTerms] ReplacementAction queryTerms + * @property {string|null} [replacementTerm] ReplacementAction replacementTerm + * @property {string|null} [term] ReplacementAction term + */ - /** - * Properties of a ProductInputConfig. - * @memberof google.cloud.retail.v2beta - * @interface IProductInputConfig - * @property {google.cloud.retail.v2beta.IProductInlineSource|null} [productInlineSource] ProductInputConfig productInlineSource - * @property {google.cloud.retail.v2beta.IGcsSource|null} [gcsSource] ProductInputConfig gcsSource - * @property {google.cloud.retail.v2beta.IBigQuerySource|null} [bigQuerySource] ProductInputConfig bigQuerySource - */ + /** + * Constructs a new ReplacementAction. + * @memberof google.cloud.retail.v2beta.Rule + * @classdesc Represents a ReplacementAction. + * @implements IReplacementAction + * @constructor + * @param {google.cloud.retail.v2beta.Rule.IReplacementAction=} [properties] Properties to set + */ + function ReplacementAction(properties) { + this.queryTerms = []; + 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]]; + } - /** - * Constructs a new ProductInputConfig. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a ProductInputConfig. - * @implements IProductInputConfig - * @constructor - * @param {google.cloud.retail.v2beta.IProductInputConfig=} [properties] Properties to set - */ - function ProductInputConfig(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]]; - } + /** + * ReplacementAction queryTerms. + * @member {Array.} queryTerms + * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction + * @instance + */ + ReplacementAction.prototype.queryTerms = $util.emptyArray; - /** - * ProductInputConfig productInlineSource. - * @member {google.cloud.retail.v2beta.IProductInlineSource|null|undefined} productInlineSource - * @memberof google.cloud.retail.v2beta.ProductInputConfig - * @instance - */ - ProductInputConfig.prototype.productInlineSource = null; + /** + * ReplacementAction replacementTerm. + * @member {string} replacementTerm + * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction + * @instance + */ + ReplacementAction.prototype.replacementTerm = ""; - /** - * ProductInputConfig gcsSource. - * @member {google.cloud.retail.v2beta.IGcsSource|null|undefined} gcsSource - * @memberof google.cloud.retail.v2beta.ProductInputConfig - * @instance + /** + * ReplacementAction term. + * @member {string} term + * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction + * @instance + */ + ReplacementAction.prototype.term = ""; + + /** + * Creates a new ReplacementAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IReplacementAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Rule.ReplacementAction} ReplacementAction instance + */ + ReplacementAction.create = function create(properties) { + return new ReplacementAction(properties); + }; + + /** + * Encodes the specified ReplacementAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.ReplacementAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IReplacementAction} message ReplacementAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplacementAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.term != null && Object.hasOwnProperty.call(message, "term")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.term); + if (message.queryTerms != null && message.queryTerms.length) + for (var i = 0; i < message.queryTerms.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.queryTerms[i]); + if (message.replacementTerm != null && Object.hasOwnProperty.call(message, "replacementTerm")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.replacementTerm); + return writer; + }; + + /** + * Encodes the specified ReplacementAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.ReplacementAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IReplacementAction} message ReplacementAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplacementAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplacementAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Rule.ReplacementAction} ReplacementAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplacementAction.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.v2beta.Rule.ReplacementAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.queryTerms && message.queryTerms.length)) + message.queryTerms = []; + message.queryTerms.push(reader.string()); + break; + case 3: + message.replacementTerm = reader.string(); + break; + case 1: + message.term = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplacementAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Rule.ReplacementAction} ReplacementAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplacementAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplacementAction message. + * @function verify + * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplacementAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { + if (!Array.isArray(message.queryTerms)) + return "queryTerms: array expected"; + for (var i = 0; i < message.queryTerms.length; ++i) + if (!$util.isString(message.queryTerms[i])) + return "queryTerms: string[] expected"; + } + if (message.replacementTerm != null && message.hasOwnProperty("replacementTerm")) + if (!$util.isString(message.replacementTerm)) + return "replacementTerm: string expected"; + if (message.term != null && message.hasOwnProperty("term")) + if (!$util.isString(message.term)) + return "term: string expected"; + return null; + }; + + /** + * Creates a ReplacementAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Rule.ReplacementAction} ReplacementAction + */ + ReplacementAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Rule.ReplacementAction) + return object; + var message = new $root.google.cloud.retail.v2beta.Rule.ReplacementAction(); + if (object.queryTerms) { + if (!Array.isArray(object.queryTerms)) + throw TypeError(".google.cloud.retail.v2beta.Rule.ReplacementAction.queryTerms: array expected"); + message.queryTerms = []; + for (var i = 0; i < object.queryTerms.length; ++i) + message.queryTerms[i] = String(object.queryTerms[i]); + } + if (object.replacementTerm != null) + message.replacementTerm = String(object.replacementTerm); + if (object.term != null) + message.term = String(object.term); + return message; + }; + + /** + * Creates a plain object from a ReplacementAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction + * @static + * @param {google.cloud.retail.v2beta.Rule.ReplacementAction} message ReplacementAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplacementAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.queryTerms = []; + if (options.defaults) { + object.term = ""; + object.replacementTerm = ""; + } + if (message.term != null && message.hasOwnProperty("term")) + object.term = message.term; + if (message.queryTerms && message.queryTerms.length) { + object.queryTerms = []; + for (var j = 0; j < message.queryTerms.length; ++j) + object.queryTerms[j] = message.queryTerms[j]; + } + if (message.replacementTerm != null && message.hasOwnProperty("replacementTerm")) + object.replacementTerm = message.replacementTerm; + return object; + }; + + /** + * Converts this ReplacementAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Rule.ReplacementAction + * @instance + * @returns {Object.} JSON object + */ + ReplacementAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReplacementAction; + })(); + + Rule.IgnoreAction = (function() { + + /** + * Properties of an IgnoreAction. + * @memberof google.cloud.retail.v2beta.Rule + * @interface IIgnoreAction + * @property {Array.|null} [ignoreTerms] IgnoreAction ignoreTerms + */ + + /** + * Constructs a new IgnoreAction. + * @memberof google.cloud.retail.v2beta.Rule + * @classdesc Represents an IgnoreAction. + * @implements IIgnoreAction + * @constructor + * @param {google.cloud.retail.v2beta.Rule.IIgnoreAction=} [properties] Properties to set + */ + function IgnoreAction(properties) { + this.ignoreTerms = []; + 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]]; + } + + /** + * IgnoreAction ignoreTerms. + * @member {Array.} ignoreTerms + * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction + * @instance + */ + IgnoreAction.prototype.ignoreTerms = $util.emptyArray; + + /** + * Creates a new IgnoreAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IIgnoreAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Rule.IgnoreAction} IgnoreAction instance + */ + IgnoreAction.create = function create(properties) { + return new IgnoreAction(properties); + }; + + /** + * Encodes the specified IgnoreAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.IgnoreAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IIgnoreAction} message IgnoreAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IgnoreAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ignoreTerms != null && message.ignoreTerms.length) + for (var i = 0; i < message.ignoreTerms.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ignoreTerms[i]); + return writer; + }; + + /** + * Encodes the specified IgnoreAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.IgnoreAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IIgnoreAction} message IgnoreAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IgnoreAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IgnoreAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Rule.IgnoreAction} IgnoreAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IgnoreAction.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.v2beta.Rule.IgnoreAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ignoreTerms && message.ignoreTerms.length)) + message.ignoreTerms = []; + message.ignoreTerms.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IgnoreAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Rule.IgnoreAction} IgnoreAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IgnoreAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IgnoreAction message. + * @function verify + * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IgnoreAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ignoreTerms != null && message.hasOwnProperty("ignoreTerms")) { + if (!Array.isArray(message.ignoreTerms)) + return "ignoreTerms: array expected"; + for (var i = 0; i < message.ignoreTerms.length; ++i) + if (!$util.isString(message.ignoreTerms[i])) + return "ignoreTerms: string[] expected"; + } + return null; + }; + + /** + * Creates an IgnoreAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Rule.IgnoreAction} IgnoreAction + */ + IgnoreAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Rule.IgnoreAction) + return object; + var message = new $root.google.cloud.retail.v2beta.Rule.IgnoreAction(); + if (object.ignoreTerms) { + if (!Array.isArray(object.ignoreTerms)) + throw TypeError(".google.cloud.retail.v2beta.Rule.IgnoreAction.ignoreTerms: array expected"); + message.ignoreTerms = []; + for (var i = 0; i < object.ignoreTerms.length; ++i) + message.ignoreTerms[i] = String(object.ignoreTerms[i]); + } + return message; + }; + + /** + * Creates a plain object from an IgnoreAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IgnoreAction} message IgnoreAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IgnoreAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ignoreTerms = []; + if (message.ignoreTerms && message.ignoreTerms.length) { + object.ignoreTerms = []; + for (var j = 0; j < message.ignoreTerms.length; ++j) + object.ignoreTerms[j] = message.ignoreTerms[j]; + } + return object; + }; + + /** + * Converts this IgnoreAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Rule.IgnoreAction + * @instance + * @returns {Object.} JSON object + */ + IgnoreAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IgnoreAction; + })(); + + return Rule; + })(); + + v2beta.Audience = (function() { + + /** + * Properties of an Audience. + * @memberof google.cloud.retail.v2beta + * @interface IAudience + * @property {Array.|null} [genders] Audience genders + * @property {Array.|null} [ageGroups] Audience ageGroups */ - ProductInputConfig.prototype.gcsSource = null; /** - * ProductInputConfig bigQuerySource. - * @member {google.cloud.retail.v2beta.IBigQuerySource|null|undefined} bigQuerySource - * @memberof google.cloud.retail.v2beta.ProductInputConfig - * @instance + * Constructs a new Audience. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents an Audience. + * @implements IAudience + * @constructor + * @param {google.cloud.retail.v2beta.IAudience=} [properties] Properties to set */ - ProductInputConfig.prototype.bigQuerySource = null; + function Audience(properties) { + this.genders = []; + this.ageGroups = []; + 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]]; + } - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Audience genders. + * @member {Array.} genders + * @memberof google.cloud.retail.v2beta.Audience + * @instance + */ + Audience.prototype.genders = $util.emptyArray; /** - * ProductInputConfig source. - * @member {"productInlineSource"|"gcsSource"|"bigQuerySource"|undefined} source - * @memberof google.cloud.retail.v2beta.ProductInputConfig + * Audience ageGroups. + * @member {Array.} ageGroups + * @memberof google.cloud.retail.v2beta.Audience * @instance */ - Object.defineProperty(ProductInputConfig.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["productInlineSource", "gcsSource", "bigQuerySource"]), - set: $util.oneOfSetter($oneOfFields) - }); + Audience.prototype.ageGroups = $util.emptyArray; /** - * Creates a new ProductInputConfig instance using the specified properties. + * Creates a new Audience instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @memberof google.cloud.retail.v2beta.Audience * @static - * @param {google.cloud.retail.v2beta.IProductInputConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ProductInputConfig} ProductInputConfig instance + * @param {google.cloud.retail.v2beta.IAudience=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Audience} Audience instance */ - ProductInputConfig.create = function create(properties) { - return new ProductInputConfig(properties); + Audience.create = function create(properties) { + return new Audience(properties); }; /** - * Encodes the specified ProductInputConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ProductInputConfig.verify|verify} messages. + * Encodes the specified Audience message. Does not implicitly {@link google.cloud.retail.v2beta.Audience.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @memberof google.cloud.retail.v2beta.Audience * @static - * @param {google.cloud.retail.v2beta.IProductInputConfig} message ProductInputConfig message or plain object to encode + * @param {google.cloud.retail.v2beta.IAudience} message Audience message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductInputConfig.encode = function encode(message, writer) { + Audience.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.productInlineSource != null && Object.hasOwnProperty.call(message, "productInlineSource")) - $root.google.cloud.retail.v2beta.ProductInlineSource.encode(message.productInlineSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) - $root.google.cloud.retail.v2beta.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) - $root.google.cloud.retail.v2beta.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.genders != null && message.genders.length) + for (var i = 0; i < message.genders.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.genders[i]); + if (message.ageGroups != null && message.ageGroups.length) + for (var i = 0; i < message.ageGroups.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ageGroups[i]); return writer; }; /** - * Encodes the specified ProductInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ProductInputConfig.verify|verify} messages. + * Encodes the specified Audience message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Audience.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @memberof google.cloud.retail.v2beta.Audience * @static - * @param {google.cloud.retail.v2beta.IProductInputConfig} message ProductInputConfig message or plain object to encode + * @param {google.cloud.retail.v2beta.IAudience} message Audience message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + Audience.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ProductInputConfig message from the specified reader or buffer. + * Decodes an Audience message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @memberof google.cloud.retail.v2beta.Audience * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ProductInputConfig} ProductInputConfig + * @returns {google.cloud.retail.v2beta.Audience} Audience * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductInputConfig.decode = function decode(reader, length) { + Audience.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.v2beta.ProductInputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.Audience(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.productInlineSource = $root.google.cloud.retail.v2beta.ProductInlineSource.decode(reader, reader.uint32()); - break; - case 2: - message.gcsSource = $root.google.cloud.retail.v2beta.GcsSource.decode(reader, reader.uint32()); + if (!(message.genders && message.genders.length)) + message.genders = []; + message.genders.push(reader.string()); break; - case 3: - message.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.decode(reader, reader.uint32()); + case 2: + if (!(message.ageGroups && message.ageGroups.length)) + message.ageGroups = []; + message.ageGroups.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -60638,159 +59504,143 @@ }; /** - * Decodes a ProductInputConfig message from the specified reader or buffer, length delimited. + * Decodes an Audience message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @memberof google.cloud.retail.v2beta.Audience * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ProductInputConfig} ProductInputConfig + * @returns {google.cloud.retail.v2beta.Audience} Audience * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductInputConfig.decodeDelimited = function decodeDelimited(reader) { + Audience.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ProductInputConfig message. + * Verifies an Audience message. * @function verify - * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @memberof google.cloud.retail.v2beta.Audience * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ProductInputConfig.verify = function verify(message) { + Audience.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.productInlineSource != null && message.hasOwnProperty("productInlineSource")) { - properties.source = 1; - { - var error = $root.google.cloud.retail.v2beta.ProductInlineSource.verify(message.productInlineSource); - if (error) - return "productInlineSource." + error; - } - } - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.retail.v2beta.GcsSource.verify(message.gcsSource); - if (error) - return "gcsSource." + error; - } + if (message.genders != null && message.hasOwnProperty("genders")) { + if (!Array.isArray(message.genders)) + return "genders: array expected"; + for (var i = 0; i < message.genders.length; ++i) + if (!$util.isString(message.genders[i])) + return "genders: string[] expected"; } - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.retail.v2beta.BigQuerySource.verify(message.bigQuerySource); - if (error) - return "bigQuerySource." + error; - } + if (message.ageGroups != null && message.hasOwnProperty("ageGroups")) { + if (!Array.isArray(message.ageGroups)) + return "ageGroups: array expected"; + for (var i = 0; i < message.ageGroups.length; ++i) + if (!$util.isString(message.ageGroups[i])) + return "ageGroups: string[] expected"; } return null; }; /** - * Creates a ProductInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates an Audience message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @memberof google.cloud.retail.v2beta.Audience * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ProductInputConfig} ProductInputConfig + * @returns {google.cloud.retail.v2beta.Audience} Audience */ - ProductInputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ProductInputConfig) + Audience.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Audience) return object; - var message = new $root.google.cloud.retail.v2beta.ProductInputConfig(); - if (object.productInlineSource != null) { - if (typeof object.productInlineSource !== "object") - throw TypeError(".google.cloud.retail.v2beta.ProductInputConfig.productInlineSource: object expected"); - message.productInlineSource = $root.google.cloud.retail.v2beta.ProductInlineSource.fromObject(object.productInlineSource); - } - if (object.gcsSource != null) { - if (typeof object.gcsSource !== "object") - throw TypeError(".google.cloud.retail.v2beta.ProductInputConfig.gcsSource: object expected"); - message.gcsSource = $root.google.cloud.retail.v2beta.GcsSource.fromObject(object.gcsSource); + var message = new $root.google.cloud.retail.v2beta.Audience(); + if (object.genders) { + if (!Array.isArray(object.genders)) + throw TypeError(".google.cloud.retail.v2beta.Audience.genders: array expected"); + message.genders = []; + for (var i = 0; i < object.genders.length; ++i) + message.genders[i] = String(object.genders[i]); } - if (object.bigQuerySource != null) { - if (typeof object.bigQuerySource !== "object") - throw TypeError(".google.cloud.retail.v2beta.ProductInputConfig.bigQuerySource: object expected"); - message.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.fromObject(object.bigQuerySource); + if (object.ageGroups) { + if (!Array.isArray(object.ageGroups)) + throw TypeError(".google.cloud.retail.v2beta.Audience.ageGroups: array expected"); + message.ageGroups = []; + for (var i = 0; i < object.ageGroups.length; ++i) + message.ageGroups[i] = String(object.ageGroups[i]); } return message; }; /** - * Creates a plain object from a ProductInputConfig message. Also converts values to other types if specified. + * Creates a plain object from an Audience message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @memberof google.cloud.retail.v2beta.Audience * @static - * @param {google.cloud.retail.v2beta.ProductInputConfig} message ProductInputConfig + * @param {google.cloud.retail.v2beta.Audience} message Audience * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ProductInputConfig.toObject = function toObject(message, options) { + Audience.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.productInlineSource != null && message.hasOwnProperty("productInlineSource")) { - object.productInlineSource = $root.google.cloud.retail.v2beta.ProductInlineSource.toObject(message.productInlineSource, options); - if (options.oneofs) - object.source = "productInlineSource"; + if (options.arrays || options.defaults) { + object.genders = []; + object.ageGroups = []; } - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - object.gcsSource = $root.google.cloud.retail.v2beta.GcsSource.toObject(message.gcsSource, options); - if (options.oneofs) - object.source = "gcsSource"; + if (message.genders && message.genders.length) { + object.genders = []; + for (var j = 0; j < message.genders.length; ++j) + object.genders[j] = message.genders[j]; } - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - object.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.toObject(message.bigQuerySource, options); - if (options.oneofs) - object.source = "bigQuerySource"; + if (message.ageGroups && message.ageGroups.length) { + object.ageGroups = []; + for (var j = 0; j < message.ageGroups.length; ++j) + object.ageGroups[j] = message.ageGroups[j]; } return object; }; /** - * Converts this ProductInputConfig to JSON. + * Converts this Audience to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @memberof google.cloud.retail.v2beta.Audience * @instance * @returns {Object.} JSON object */ - ProductInputConfig.prototype.toJSON = function toJSON() { + Audience.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ProductInputConfig; + return Audience; })(); - v2beta.UserEventInputConfig = (function() { + v2beta.ColorInfo = (function() { /** - * Properties of a UserEventInputConfig. + * Properties of a ColorInfo. * @memberof google.cloud.retail.v2beta - * @interface IUserEventInputConfig - * @property {google.cloud.retail.v2beta.IUserEventInlineSource|null} [userEventInlineSource] UserEventInputConfig userEventInlineSource - * @property {google.cloud.retail.v2beta.IGcsSource|null} [gcsSource] UserEventInputConfig gcsSource - * @property {google.cloud.retail.v2beta.IBigQuerySource|null} [bigQuerySource] UserEventInputConfig bigQuerySource + * @interface IColorInfo + * @property {Array.|null} [colorFamilies] ColorInfo colorFamilies + * @property {Array.|null} [colors] ColorInfo colors */ /** - * Constructs a new UserEventInputConfig. + * Constructs a new ColorInfo. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a UserEventInputConfig. - * @implements IUserEventInputConfig + * @classdesc Represents a ColorInfo. + * @implements IColorInfo * @constructor - * @param {google.cloud.retail.v2beta.IUserEventInputConfig=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IColorInfo=} [properties] Properties to set */ - function UserEventInputConfig(properties) { + function ColorInfo(properties) { + this.colorFamilies = []; + this.colors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -60798,115 +59648,94 @@ } /** - * UserEventInputConfig userEventInlineSource. - * @member {google.cloud.retail.v2beta.IUserEventInlineSource|null|undefined} userEventInlineSource - * @memberof google.cloud.retail.v2beta.UserEventInputConfig - * @instance - */ - UserEventInputConfig.prototype.userEventInlineSource = null; - - /** - * UserEventInputConfig gcsSource. - * @member {google.cloud.retail.v2beta.IGcsSource|null|undefined} gcsSource - * @memberof google.cloud.retail.v2beta.UserEventInputConfig - * @instance - */ - UserEventInputConfig.prototype.gcsSource = null; - - /** - * UserEventInputConfig bigQuerySource. - * @member {google.cloud.retail.v2beta.IBigQuerySource|null|undefined} bigQuerySource - * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * ColorInfo colorFamilies. + * @member {Array.} colorFamilies + * @memberof google.cloud.retail.v2beta.ColorInfo * @instance */ - UserEventInputConfig.prototype.bigQuerySource = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ColorInfo.prototype.colorFamilies = $util.emptyArray; /** - * UserEventInputConfig source. - * @member {"userEventInlineSource"|"gcsSource"|"bigQuerySource"|undefined} source - * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * ColorInfo colors. + * @member {Array.} colors + * @memberof google.cloud.retail.v2beta.ColorInfo * @instance */ - Object.defineProperty(UserEventInputConfig.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["userEventInlineSource", "gcsSource", "bigQuerySource"]), - set: $util.oneOfSetter($oneOfFields) - }); + ColorInfo.prototype.colors = $util.emptyArray; /** - * Creates a new UserEventInputConfig instance using the specified properties. + * Creates a new ColorInfo instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @memberof google.cloud.retail.v2beta.ColorInfo * @static - * @param {google.cloud.retail.v2beta.IUserEventInputConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.UserEventInputConfig} UserEventInputConfig instance + * @param {google.cloud.retail.v2beta.IColorInfo=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ColorInfo} ColorInfo instance */ - UserEventInputConfig.create = function create(properties) { - return new UserEventInputConfig(properties); + ColorInfo.create = function create(properties) { + return new ColorInfo(properties); }; /** - * Encodes the specified UserEventInputConfig message. Does not implicitly {@link google.cloud.retail.v2beta.UserEventInputConfig.verify|verify} messages. + * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.retail.v2beta.ColorInfo.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @memberof google.cloud.retail.v2beta.ColorInfo * @static - * @param {google.cloud.retail.v2beta.IUserEventInputConfig} message UserEventInputConfig message or plain object to encode + * @param {google.cloud.retail.v2beta.IColorInfo} message ColorInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEventInputConfig.encode = function encode(message, writer) { + ColorInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.userEventInlineSource != null && Object.hasOwnProperty.call(message, "userEventInlineSource")) - $root.google.cloud.retail.v2beta.UserEventInlineSource.encode(message.userEventInlineSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) - $root.google.cloud.retail.v2beta.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) - $root.google.cloud.retail.v2beta.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.colorFamilies != null && message.colorFamilies.length) + for (var i = 0; i < message.colorFamilies.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.colorFamilies[i]); + if (message.colors != null && message.colors.length) + for (var i = 0; i < message.colors.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.colors[i]); return writer; }; /** - * Encodes the specified UserEventInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserEventInputConfig.verify|verify} messages. + * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ColorInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @memberof google.cloud.retail.v2beta.ColorInfo * @static - * @param {google.cloud.retail.v2beta.IUserEventInputConfig} message UserEventInputConfig message or plain object to encode + * @param {google.cloud.retail.v2beta.IColorInfo} message ColorInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEventInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + ColorInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserEventInputConfig message from the specified reader or buffer. + * Decodes a ColorInfo message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @memberof google.cloud.retail.v2beta.ColorInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.UserEventInputConfig} UserEventInputConfig + * @returns {google.cloud.retail.v2beta.ColorInfo} ColorInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEventInputConfig.decode = function decode(reader, length) { + ColorInfo.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.v2beta.UserEventInputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.ColorInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.userEventInlineSource = $root.google.cloud.retail.v2beta.UserEventInlineSource.decode(reader, reader.uint32()); + if (!(message.colorFamilies && message.colorFamilies.length)) + message.colorFamilies = []; + message.colorFamilies.push(reader.string()); break; case 2: - message.gcsSource = $root.google.cloud.retail.v2beta.GcsSource.decode(reader, reader.uint32()); - break; - case 3: - message.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.decode(reader, reader.uint32()); + if (!(message.colors && message.colors.length)) + message.colors = []; + message.colors.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -60917,157 +59746,145 @@ }; /** - * Decodes a UserEventInputConfig message from the specified reader or buffer, length delimited. + * Decodes a ColorInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @memberof google.cloud.retail.v2beta.ColorInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.UserEventInputConfig} UserEventInputConfig + * @returns {google.cloud.retail.v2beta.ColorInfo} ColorInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEventInputConfig.decodeDelimited = function decodeDelimited(reader) { + ColorInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserEventInputConfig message. + * Verifies a ColorInfo message. * @function verify - * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @memberof google.cloud.retail.v2beta.ColorInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserEventInputConfig.verify = function verify(message) { + ColorInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.userEventInlineSource != null && message.hasOwnProperty("userEventInlineSource")) { - properties.source = 1; - { - var error = $root.google.cloud.retail.v2beta.UserEventInlineSource.verify(message.userEventInlineSource); - if (error) - return "userEventInlineSource." + error; - } - } - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.retail.v2beta.GcsSource.verify(message.gcsSource); - if (error) - return "gcsSource." + error; - } + if (message.colorFamilies != null && message.hasOwnProperty("colorFamilies")) { + if (!Array.isArray(message.colorFamilies)) + return "colorFamilies: array expected"; + for (var i = 0; i < message.colorFamilies.length; ++i) + if (!$util.isString(message.colorFamilies[i])) + return "colorFamilies: string[] expected"; } - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.retail.v2beta.BigQuerySource.verify(message.bigQuerySource); - if (error) - return "bigQuerySource." + error; - } + if (message.colors != null && message.hasOwnProperty("colors")) { + if (!Array.isArray(message.colors)) + return "colors: array expected"; + for (var i = 0; i < message.colors.length; ++i) + if (!$util.isString(message.colors[i])) + return "colors: string[] expected"; } return null; }; /** - * Creates a UserEventInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @memberof google.cloud.retail.v2beta.ColorInfo * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.UserEventInputConfig} UserEventInputConfig + * @returns {google.cloud.retail.v2beta.ColorInfo} ColorInfo */ - UserEventInputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.UserEventInputConfig) + ColorInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ColorInfo) return object; - var message = new $root.google.cloud.retail.v2beta.UserEventInputConfig(); - if (object.userEventInlineSource != null) { - if (typeof object.userEventInlineSource !== "object") - throw TypeError(".google.cloud.retail.v2beta.UserEventInputConfig.userEventInlineSource: object expected"); - message.userEventInlineSource = $root.google.cloud.retail.v2beta.UserEventInlineSource.fromObject(object.userEventInlineSource); - } - if (object.gcsSource != null) { - if (typeof object.gcsSource !== "object") - throw TypeError(".google.cloud.retail.v2beta.UserEventInputConfig.gcsSource: object expected"); - message.gcsSource = $root.google.cloud.retail.v2beta.GcsSource.fromObject(object.gcsSource); + var message = new $root.google.cloud.retail.v2beta.ColorInfo(); + if (object.colorFamilies) { + if (!Array.isArray(object.colorFamilies)) + throw TypeError(".google.cloud.retail.v2beta.ColorInfo.colorFamilies: array expected"); + message.colorFamilies = []; + for (var i = 0; i < object.colorFamilies.length; ++i) + message.colorFamilies[i] = String(object.colorFamilies[i]); } - if (object.bigQuerySource != null) { - if (typeof object.bigQuerySource !== "object") - throw TypeError(".google.cloud.retail.v2beta.UserEventInputConfig.bigQuerySource: object expected"); - message.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.fromObject(object.bigQuerySource); + if (object.colors) { + if (!Array.isArray(object.colors)) + throw TypeError(".google.cloud.retail.v2beta.ColorInfo.colors: array expected"); + message.colors = []; + for (var i = 0; i < object.colors.length; ++i) + message.colors[i] = String(object.colors[i]); } return message; }; /** - * Creates a plain object from a UserEventInputConfig message. Also converts values to other types if specified. + * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @memberof google.cloud.retail.v2beta.ColorInfo * @static - * @param {google.cloud.retail.v2beta.UserEventInputConfig} message UserEventInputConfig + * @param {google.cloud.retail.v2beta.ColorInfo} message ColorInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserEventInputConfig.toObject = function toObject(message, options) { + ColorInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.userEventInlineSource != null && message.hasOwnProperty("userEventInlineSource")) { - object.userEventInlineSource = $root.google.cloud.retail.v2beta.UserEventInlineSource.toObject(message.userEventInlineSource, options); - if (options.oneofs) - object.source = "userEventInlineSource"; + if (options.arrays || options.defaults) { + object.colorFamilies = []; + object.colors = []; } - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - object.gcsSource = $root.google.cloud.retail.v2beta.GcsSource.toObject(message.gcsSource, options); - if (options.oneofs) - object.source = "gcsSource"; + if (message.colorFamilies && message.colorFamilies.length) { + object.colorFamilies = []; + for (var j = 0; j < message.colorFamilies.length; ++j) + object.colorFamilies[j] = message.colorFamilies[j]; } - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - object.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.toObject(message.bigQuerySource, options); - if (options.oneofs) - object.source = "bigQuerySource"; + if (message.colors && message.colors.length) { + object.colors = []; + for (var j = 0; j < message.colors.length; ++j) + object.colors[j] = message.colors[j]; } return object; }; /** - * Converts this UserEventInputConfig to JSON. + * Converts this ColorInfo to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @memberof google.cloud.retail.v2beta.ColorInfo * @instance * @returns {Object.} JSON object */ - UserEventInputConfig.prototype.toJSON = function toJSON() { + ColorInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UserEventInputConfig; + return ColorInfo; })(); - v2beta.CompletionDataInputConfig = (function() { + v2beta.CustomAttribute = (function() { /** - * Properties of a CompletionDataInputConfig. + * Properties of a CustomAttribute. * @memberof google.cloud.retail.v2beta - * @interface ICompletionDataInputConfig - * @property {google.cloud.retail.v2beta.IBigQuerySource|null} [bigQuerySource] CompletionDataInputConfig bigQuerySource + * @interface ICustomAttribute + * @property {Array.|null} [text] CustomAttribute text + * @property {Array.|null} [numbers] CustomAttribute numbers + * @property {boolean|null} [searchable] CustomAttribute searchable + * @property {boolean|null} [indexable] CustomAttribute indexable */ /** - * Constructs a new CompletionDataInputConfig. + * Constructs a new CustomAttribute. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a CompletionDataInputConfig. - * @implements ICompletionDataInputConfig + * @classdesc Represents a CustomAttribute. + * @implements ICustomAttribute * @constructor - * @param {google.cloud.retail.v2beta.ICompletionDataInputConfig=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.ICustomAttribute=} [properties] Properties to set */ - function CompletionDataInputConfig(properties) { + function CustomAttribute(properties) { + this.text = []; + this.numbers = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -61075,89 +59892,153 @@ } /** - * CompletionDataInputConfig bigQuerySource. - * @member {google.cloud.retail.v2beta.IBigQuerySource|null|undefined} bigQuerySource - * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * CustomAttribute text. + * @member {Array.} text + * @memberof google.cloud.retail.v2beta.CustomAttribute * @instance */ - CompletionDataInputConfig.prototype.bigQuerySource = null; + CustomAttribute.prototype.text = $util.emptyArray; + + /** + * CustomAttribute numbers. + * @member {Array.} numbers + * @memberof google.cloud.retail.v2beta.CustomAttribute + * @instance + */ + CustomAttribute.prototype.numbers = $util.emptyArray; + + /** + * CustomAttribute searchable. + * @member {boolean|null|undefined} searchable + * @memberof google.cloud.retail.v2beta.CustomAttribute + * @instance + */ + CustomAttribute.prototype.searchable = null; + + /** + * CustomAttribute indexable. + * @member {boolean|null|undefined} indexable + * @memberof google.cloud.retail.v2beta.CustomAttribute + * @instance + */ + CustomAttribute.prototype.indexable = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * CompletionDataInputConfig source. - * @member {"bigQuerySource"|undefined} source - * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * CustomAttribute _searchable. + * @member {"searchable"|undefined} _searchable + * @memberof google.cloud.retail.v2beta.CustomAttribute * @instance */ - Object.defineProperty(CompletionDataInputConfig.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["bigQuerySource"]), + Object.defineProperty(CustomAttribute.prototype, "_searchable", { + get: $util.oneOfGetter($oneOfFields = ["searchable"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new CompletionDataInputConfig instance using the specified properties. + * CustomAttribute _indexable. + * @member {"indexable"|undefined} _indexable + * @memberof google.cloud.retail.v2beta.CustomAttribute + * @instance + */ + Object.defineProperty(CustomAttribute.prototype, "_indexable", { + get: $util.oneOfGetter($oneOfFields = ["indexable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomAttribute instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @memberof google.cloud.retail.v2beta.CustomAttribute * @static - * @param {google.cloud.retail.v2beta.ICompletionDataInputConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.CompletionDataInputConfig} CompletionDataInputConfig instance + * @param {google.cloud.retail.v2beta.ICustomAttribute=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.CustomAttribute} CustomAttribute instance */ - CompletionDataInputConfig.create = function create(properties) { - return new CompletionDataInputConfig(properties); + CustomAttribute.create = function create(properties) { + return new CustomAttribute(properties); }; /** - * Encodes the specified CompletionDataInputConfig message. Does not implicitly {@link google.cloud.retail.v2beta.CompletionDataInputConfig.verify|verify} messages. + * Encodes the specified CustomAttribute message. Does not implicitly {@link google.cloud.retail.v2beta.CustomAttribute.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @memberof google.cloud.retail.v2beta.CustomAttribute * @static - * @param {google.cloud.retail.v2beta.ICompletionDataInputConfig} message CompletionDataInputConfig message or plain object to encode + * @param {google.cloud.retail.v2beta.ICustomAttribute} message CustomAttribute message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompletionDataInputConfig.encode = function encode(message, writer) { + CustomAttribute.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) - $root.google.cloud.retail.v2beta.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.text != null && message.text.length) + for (var i = 0; i < message.text.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text[i]); + if (message.numbers != null && message.numbers.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.numbers.length; ++i) + writer.double(message.numbers[i]); + writer.ldelim(); + } + if (message.searchable != null && Object.hasOwnProperty.call(message, "searchable")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.searchable); + if (message.indexable != null && Object.hasOwnProperty.call(message, "indexable")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.indexable); return writer; }; /** - * Encodes the specified CompletionDataInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompletionDataInputConfig.verify|verify} messages. + * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CustomAttribute.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @memberof google.cloud.retail.v2beta.CustomAttribute * @static - * @param {google.cloud.retail.v2beta.ICompletionDataInputConfig} message CompletionDataInputConfig message or plain object to encode + * @param {google.cloud.retail.v2beta.ICustomAttribute} message CustomAttribute message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompletionDataInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + CustomAttribute.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CompletionDataInputConfig message from the specified reader or buffer. + * Decodes a CustomAttribute message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @memberof google.cloud.retail.v2beta.CustomAttribute * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.CompletionDataInputConfig} CompletionDataInputConfig + * @returns {google.cloud.retail.v2beta.CustomAttribute} CustomAttribute * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompletionDataInputConfig.decode = function decode(reader, length) { + CustomAttribute.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.v2beta.CompletionDataInputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.CustomAttribute(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.decode(reader, reader.uint32()); + if (!(message.text && message.text.length)) + message.text = []; + message.text.push(reader.string()); + break; + case 2: + if (!(message.numbers && message.numbers.length)) + message.numbers = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.numbers.push(reader.double()); + } else + message.numbers.push(reader.double()); + break; + case 3: + message.searchable = reader.bool(); + break; + case 4: + message.indexable = reader.bool(); break; default: reader.skipType(tag & 7); @@ -61168,122 +60049,167 @@ }; /** - * Decodes a CompletionDataInputConfig message from the specified reader or buffer, length delimited. + * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @memberof google.cloud.retail.v2beta.CustomAttribute * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.CompletionDataInputConfig} CompletionDataInputConfig + * @returns {google.cloud.retail.v2beta.CustomAttribute} CustomAttribute * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompletionDataInputConfig.decodeDelimited = function decodeDelimited(reader) { + CustomAttribute.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CompletionDataInputConfig message. + * Verifies a CustomAttribute message. * @function verify - * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @memberof google.cloud.retail.v2beta.CustomAttribute * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CompletionDataInputConfig.verify = function verify(message) { + CustomAttribute.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - properties.source = 1; - { - var error = $root.google.cloud.retail.v2beta.BigQuerySource.verify(message.bigQuerySource); - if (error) - return "bigQuerySource." + error; - } + if (message.text != null && message.hasOwnProperty("text")) { + if (!Array.isArray(message.text)) + return "text: array expected"; + for (var i = 0; i < message.text.length; ++i) + if (!$util.isString(message.text[i])) + return "text: string[] expected"; + } + if (message.numbers != null && message.hasOwnProperty("numbers")) { + if (!Array.isArray(message.numbers)) + return "numbers: array expected"; + for (var i = 0; i < message.numbers.length; ++i) + if (typeof message.numbers[i] !== "number") + return "numbers: number[] expected"; + } + if (message.searchable != null && message.hasOwnProperty("searchable")) { + properties._searchable = 1; + if (typeof message.searchable !== "boolean") + return "searchable: boolean expected"; + } + if (message.indexable != null && message.hasOwnProperty("indexable")) { + properties._indexable = 1; + if (typeof message.indexable !== "boolean") + return "indexable: boolean expected"; } return null; }; /** - * Creates a CompletionDataInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a CustomAttribute message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @memberof google.cloud.retail.v2beta.CustomAttribute * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.CompletionDataInputConfig} CompletionDataInputConfig + * @returns {google.cloud.retail.v2beta.CustomAttribute} CustomAttribute */ - CompletionDataInputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.CompletionDataInputConfig) + CustomAttribute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.CustomAttribute) return object; - var message = new $root.google.cloud.retail.v2beta.CompletionDataInputConfig(); - if (object.bigQuerySource != null) { - if (typeof object.bigQuerySource !== "object") - throw TypeError(".google.cloud.retail.v2beta.CompletionDataInputConfig.bigQuerySource: object expected"); - message.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.fromObject(object.bigQuerySource); + var message = new $root.google.cloud.retail.v2beta.CustomAttribute(); + if (object.text) { + if (!Array.isArray(object.text)) + throw TypeError(".google.cloud.retail.v2beta.CustomAttribute.text: array expected"); + message.text = []; + for (var i = 0; i < object.text.length; ++i) + message.text[i] = String(object.text[i]); + } + if (object.numbers) { + if (!Array.isArray(object.numbers)) + throw TypeError(".google.cloud.retail.v2beta.CustomAttribute.numbers: array expected"); + message.numbers = []; + for (var i = 0; i < object.numbers.length; ++i) + message.numbers[i] = Number(object.numbers[i]); } + if (object.searchable != null) + message.searchable = Boolean(object.searchable); + if (object.indexable != null) + message.indexable = Boolean(object.indexable); return message; }; /** - * Creates a plain object from a CompletionDataInputConfig message. Also converts values to other types if specified. + * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @memberof google.cloud.retail.v2beta.CustomAttribute * @static - * @param {google.cloud.retail.v2beta.CompletionDataInputConfig} message CompletionDataInputConfig + * @param {google.cloud.retail.v2beta.CustomAttribute} message CustomAttribute * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CompletionDataInputConfig.toObject = function toObject(message, options) { + CustomAttribute.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - object.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.toObject(message.bigQuerySource, options); + if (options.arrays || options.defaults) { + object.text = []; + object.numbers = []; + } + if (message.text && message.text.length) { + object.text = []; + for (var j = 0; j < message.text.length; ++j) + object.text[j] = message.text[j]; + } + if (message.numbers && message.numbers.length) { + object.numbers = []; + for (var j = 0; j < message.numbers.length; ++j) + object.numbers[j] = options.json && !isFinite(message.numbers[j]) ? String(message.numbers[j]) : message.numbers[j]; + } + if (message.searchable != null && message.hasOwnProperty("searchable")) { + object.searchable = message.searchable; if (options.oneofs) - object.source = "bigQuerySource"; + object._searchable = "searchable"; + } + if (message.indexable != null && message.hasOwnProperty("indexable")) { + object.indexable = message.indexable; + if (options.oneofs) + object._indexable = "indexable"; } return object; }; /** - * Converts this CompletionDataInputConfig to JSON. + * Converts this CustomAttribute to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @memberof google.cloud.retail.v2beta.CustomAttribute * @instance * @returns {Object.} JSON object */ - CompletionDataInputConfig.prototype.toJSON = function toJSON() { + CustomAttribute.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CompletionDataInputConfig; + return CustomAttribute; })(); - v2beta.ImportMetadata = (function() { + v2beta.FulfillmentInfo = (function() { /** - * Properties of an ImportMetadata. + * Properties of a FulfillmentInfo. * @memberof google.cloud.retail.v2beta - * @interface IImportMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] ImportMetadata createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ImportMetadata updateTime - * @property {number|Long|null} [successCount] ImportMetadata successCount - * @property {number|Long|null} [failureCount] ImportMetadata failureCount - * @property {string|null} [requestId] ImportMetadata requestId - * @property {string|null} [notificationPubsubTopic] ImportMetadata notificationPubsubTopic + * @interface IFulfillmentInfo + * @property {string|null} [type] FulfillmentInfo type + * @property {Array.|null} [placeIds] FulfillmentInfo placeIds */ /** - * Constructs a new ImportMetadata. + * Constructs a new FulfillmentInfo. * @memberof google.cloud.retail.v2beta - * @classdesc Represents an ImportMetadata. - * @implements IImportMetadata + * @classdesc Represents a FulfillmentInfo. + * @implements IFulfillmentInfo * @constructor - * @param {google.cloud.retail.v2beta.IImportMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IFulfillmentInfo=} [properties] Properties to set */ - function ImportMetadata(properties) { + function FulfillmentInfo(properties) { + this.placeIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -61291,140 +60217,91 @@ } /** - * ImportMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.retail.v2beta.ImportMetadata - * @instance - */ - ImportMetadata.prototype.createTime = null; - - /** - * ImportMetadata updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.retail.v2beta.ImportMetadata - * @instance - */ - ImportMetadata.prototype.updateTime = null; - - /** - * ImportMetadata successCount. - * @member {number|Long} successCount - * @memberof google.cloud.retail.v2beta.ImportMetadata - * @instance - */ - ImportMetadata.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ImportMetadata failureCount. - * @member {number|Long} failureCount - * @memberof google.cloud.retail.v2beta.ImportMetadata - * @instance - */ - ImportMetadata.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ImportMetadata requestId. - * @member {string} requestId - * @memberof google.cloud.retail.v2beta.ImportMetadata + * FulfillmentInfo type. + * @member {string} type + * @memberof google.cloud.retail.v2beta.FulfillmentInfo * @instance */ - ImportMetadata.prototype.requestId = ""; + FulfillmentInfo.prototype.type = ""; /** - * ImportMetadata notificationPubsubTopic. - * @member {string} notificationPubsubTopic - * @memberof google.cloud.retail.v2beta.ImportMetadata + * FulfillmentInfo placeIds. + * @member {Array.} placeIds + * @memberof google.cloud.retail.v2beta.FulfillmentInfo * @instance */ - ImportMetadata.prototype.notificationPubsubTopic = ""; + FulfillmentInfo.prototype.placeIds = $util.emptyArray; /** - * Creates a new ImportMetadata instance using the specified properties. + * Creates a new FulfillmentInfo instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.ImportMetadata + * @memberof google.cloud.retail.v2beta.FulfillmentInfo * @static - * @param {google.cloud.retail.v2beta.IImportMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ImportMetadata} ImportMetadata instance + * @param {google.cloud.retail.v2beta.IFulfillmentInfo=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.FulfillmentInfo} FulfillmentInfo instance */ - ImportMetadata.create = function create(properties) { - return new ImportMetadata(properties); + FulfillmentInfo.create = function create(properties) { + return new FulfillmentInfo(properties); }; /** - * Encodes the specified ImportMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.ImportMetadata.verify|verify} messages. + * Encodes the specified FulfillmentInfo message. Does not implicitly {@link google.cloud.retail.v2beta.FulfillmentInfo.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.ImportMetadata + * @memberof google.cloud.retail.v2beta.FulfillmentInfo * @static - * @param {google.cloud.retail.v2beta.IImportMetadata} message ImportMetadata message or plain object to encode + * @param {google.cloud.retail.v2beta.IFulfillmentInfo} message FulfillmentInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportMetadata.encode = function encode(message, writer) { + FulfillmentInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.successCount); - if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failureCount); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - 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.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.placeIds != null && message.placeIds.length) + for (var i = 0; i < message.placeIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.placeIds[i]); return writer; }; /** - * Encodes the specified ImportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportMetadata.verify|verify} messages. + * Encodes the specified FulfillmentInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.FulfillmentInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ImportMetadata + * @memberof google.cloud.retail.v2beta.FulfillmentInfo * @static - * @param {google.cloud.retail.v2beta.IImportMetadata} message ImportMetadata message or plain object to encode + * @param {google.cloud.retail.v2beta.IFulfillmentInfo} message FulfillmentInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportMetadata.encodeDelimited = function encodeDelimited(message, writer) { + FulfillmentInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportMetadata message from the specified reader or buffer. + * Decodes a FulfillmentInfo message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.ImportMetadata + * @memberof google.cloud.retail.v2beta.FulfillmentInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ImportMetadata} ImportMetadata + * @returns {google.cloud.retail.v2beta.FulfillmentInfo} FulfillmentInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportMetadata.decode = function decode(reader, length) { + FulfillmentInfo.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.v2beta.ImportMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.FulfillmentInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.type = reader.string(); break; case 2: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.successCount = reader.int64(); - break; - case 4: - message.failureCount = reader.int64(); - break; - case 5: - message.requestId = reader.string(); - break; - case 6: - message.notificationPubsubTopic = reader.string(); + if (!(message.placeIds && message.placeIds.length)) + message.placeIds = []; + message.placeIds.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -61435,188 +60312,130 @@ }; /** - * Decodes an ImportMetadata message from the specified reader or buffer, length delimited. + * Decodes a FulfillmentInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ImportMetadata + * @memberof google.cloud.retail.v2beta.FulfillmentInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ImportMetadata} ImportMetadata + * @returns {google.cloud.retail.v2beta.FulfillmentInfo} FulfillmentInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportMetadata.decodeDelimited = function decodeDelimited(reader) { + FulfillmentInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportMetadata message. + * Verifies a FulfillmentInfo message. * @function verify - * @memberof google.cloud.retail.v2beta.ImportMetadata + * @memberof google.cloud.retail.v2beta.FulfillmentInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportMetadata.verify = function verify(message) { + FulfillmentInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.placeIds != null && message.hasOwnProperty("placeIds")) { + if (!Array.isArray(message.placeIds)) + return "placeIds: array expected"; + for (var i = 0; i < message.placeIds.length; ++i) + if (!$util.isString(message.placeIds[i])) + return "placeIds: string[] expected"; } - if (message.successCount != null && message.hasOwnProperty("successCount")) - if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) - return "successCount: integer|Long expected"; - if (message.failureCount != null && message.hasOwnProperty("failureCount")) - if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) - return "failureCount: integer|Long expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - if (!$util.isString(message.notificationPubsubTopic)) - return "notificationPubsubTopic: string expected"; return null; }; /** - * Creates an ImportMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a FulfillmentInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.ImportMetadata + * @memberof google.cloud.retail.v2beta.FulfillmentInfo * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ImportMetadata} ImportMetadata + * @returns {google.cloud.retail.v2beta.FulfillmentInfo} FulfillmentInfo */ - ImportMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ImportMetadata) + FulfillmentInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.FulfillmentInfo) return object; - var message = new $root.google.cloud.retail.v2beta.ImportMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.retail.v2beta.ImportMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.retail.v2beta.ImportMetadata.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + var message = new $root.google.cloud.retail.v2beta.FulfillmentInfo(); + if (object.type != null) + message.type = String(object.type); + if (object.placeIds) { + if (!Array.isArray(object.placeIds)) + throw TypeError(".google.cloud.retail.v2beta.FulfillmentInfo.placeIds: array expected"); + message.placeIds = []; + for (var i = 0; i < object.placeIds.length; ++i) + message.placeIds[i] = String(object.placeIds[i]); } - if (object.successCount != null) - if ($util.Long) - (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; - else if (typeof object.successCount === "string") - message.successCount = parseInt(object.successCount, 10); - else if (typeof object.successCount === "number") - message.successCount = object.successCount; - else if (typeof object.successCount === "object") - message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); - if (object.failureCount != null) - if ($util.Long) - (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; - else if (typeof object.failureCount === "string") - message.failureCount = parseInt(object.failureCount, 10); - else if (typeof object.failureCount === "number") - message.failureCount = object.failureCount; - else if (typeof object.failureCount === "object") - message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.notificationPubsubTopic != null) - message.notificationPubsubTopic = String(object.notificationPubsubTopic); return message; }; /** - * Creates a plain object from an ImportMetadata message. Also converts values to other types if specified. + * Creates a plain object from a FulfillmentInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.ImportMetadata + * @memberof google.cloud.retail.v2beta.FulfillmentInfo * @static - * @param {google.cloud.retail.v2beta.ImportMetadata} message ImportMetadata + * @param {google.cloud.retail.v2beta.FulfillmentInfo} message FulfillmentInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportMetadata.toObject = function toObject(message, options) { + FulfillmentInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.createTime = null; - object.updateTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.successCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.failureCount = options.longs === String ? "0" : 0; - object.requestId = ""; - object.notificationPubsubTopic = ""; + if (options.arrays || options.defaults) + object.placeIds = []; + if (options.defaults) + object.type = ""; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.placeIds && message.placeIds.length) { + object.placeIds = []; + for (var j = 0; j < message.placeIds.length; ++j) + object.placeIds[j] = message.placeIds[j]; } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.successCount != null && message.hasOwnProperty("successCount")) - if (typeof message.successCount === "number") - object.successCount = options.longs === String ? String(message.successCount) : message.successCount; - else - object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; - if (message.failureCount != null && message.hasOwnProperty("failureCount")) - if (typeof message.failureCount === "number") - object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; - else - object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - object.notificationPubsubTopic = message.notificationPubsubTopic; return object; }; /** - * Converts this ImportMetadata to JSON. + * Converts this FulfillmentInfo to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.ImportMetadata + * @memberof google.cloud.retail.v2beta.FulfillmentInfo * @instance * @returns {Object.} JSON object */ - ImportMetadata.prototype.toJSON = function toJSON() { + FulfillmentInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ImportMetadata; + return FulfillmentInfo; })(); - v2beta.ImportProductsResponse = (function() { + v2beta.Image = (function() { /** - * Properties of an ImportProductsResponse. + * Properties of an Image. * @memberof google.cloud.retail.v2beta - * @interface IImportProductsResponse - * @property {Array.|null} [errorSamples] ImportProductsResponse errorSamples - * @property {google.cloud.retail.v2beta.IImportErrorsConfig|null} [errorsConfig] ImportProductsResponse errorsConfig + * @interface IImage + * @property {string|null} [uri] Image uri + * @property {number|null} [height] Image height + * @property {number|null} [width] Image width */ /** - * Constructs a new ImportProductsResponse. + * Constructs a new Image. * @memberof google.cloud.retail.v2beta - * @classdesc Represents an ImportProductsResponse. - * @implements IImportProductsResponse + * @classdesc Represents an Image. + * @implements IImage * @constructor - * @param {google.cloud.retail.v2beta.IImportProductsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IImage=} [properties] Properties to set */ - function ImportProductsResponse(properties) { - this.errorSamples = []; + function Image(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -61624,91 +60443,101 @@ } /** - * ImportProductsResponse errorSamples. - * @member {Array.} errorSamples - * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * Image uri. + * @member {string} uri + * @memberof google.cloud.retail.v2beta.Image * @instance */ - ImportProductsResponse.prototype.errorSamples = $util.emptyArray; + Image.prototype.uri = ""; /** - * ImportProductsResponse errorsConfig. - * @member {google.cloud.retail.v2beta.IImportErrorsConfig|null|undefined} errorsConfig - * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * Image height. + * @member {number} height + * @memberof google.cloud.retail.v2beta.Image * @instance */ - ImportProductsResponse.prototype.errorsConfig = null; + Image.prototype.height = 0; /** - * Creates a new ImportProductsResponse instance using the specified properties. + * Image width. + * @member {number} width + * @memberof google.cloud.retail.v2beta.Image + * @instance + */ + Image.prototype.width = 0; + + /** + * Creates a new Image instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @memberof google.cloud.retail.v2beta.Image * @static - * @param {google.cloud.retail.v2beta.IImportProductsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ImportProductsResponse} ImportProductsResponse instance + * @param {google.cloud.retail.v2beta.IImage=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Image} Image instance */ - ImportProductsResponse.create = function create(properties) { - return new ImportProductsResponse(properties); + Image.create = function create(properties) { + return new Image(properties); }; /** - * Encodes the specified ImportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ImportProductsResponse.verify|verify} messages. + * Encodes the specified Image message. Does not implicitly {@link google.cloud.retail.v2beta.Image.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @memberof google.cloud.retail.v2beta.Image * @static - * @param {google.cloud.retail.v2beta.IImportProductsResponse} message ImportProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IImage} message Image message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportProductsResponse.encode = function encode(message, writer) { + Image.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorSamples != null && message.errorSamples.length) - for (var i = 0; i < message.errorSamples.length; ++i) - $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) - $root.google.cloud.retail.v2beta.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.height); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.width); return writer; }; /** - * Encodes the specified ImportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportProductsResponse.verify|verify} messages. + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Image.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @memberof google.cloud.retail.v2beta.Image * @static - * @param {google.cloud.retail.v2beta.IImportProductsResponse} message ImportProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IImage} message Image message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { + Image.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportProductsResponse message from the specified reader or buffer. + * Decodes an Image message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @memberof google.cloud.retail.v2beta.Image * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ImportProductsResponse} ImportProductsResponse + * @returns {google.cloud.retail.v2beta.Image} Image * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportProductsResponse.decode = function decode(reader, length) { + Image.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.v2beta.ImportProductsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.Image(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.errorSamples && message.errorSamples.length)) - message.errorSamples = []; - message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + message.uri = reader.string(); break; case 2: - message.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.decode(reader, reader.uint32()); + message.height = reader.int32(); + break; + case 3: + message.width = reader.int32(); break; default: reader.skipType(tag & 7); @@ -61719,141 +60548,127 @@ }; /** - * Decodes an ImportProductsResponse message from the specified reader or buffer, length delimited. + * Decodes an Image message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @memberof google.cloud.retail.v2beta.Image * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ImportProductsResponse} ImportProductsResponse + * @returns {google.cloud.retail.v2beta.Image} Image * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportProductsResponse.decodeDelimited = function decodeDelimited(reader) { + Image.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportProductsResponse message. + * Verifies an Image message. * @function verify - * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @memberof google.cloud.retail.v2beta.Image * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportProductsResponse.verify = function verify(message) { + Image.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { - if (!Array.isArray(message.errorSamples)) - return "errorSamples: array expected"; - for (var i = 0; i < message.errorSamples.length; ++i) { - var error = $root.google.rpc.Status.verify(message.errorSamples[i]); - if (error) - return "errorSamples." + error; - } - } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { - var error = $root.google.cloud.retail.v2beta.ImportErrorsConfig.verify(message.errorsConfig); - if (error) - return "errorsConfig." + error; - } + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; return null; }; /** - * Creates an ImportProductsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an Image message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @memberof google.cloud.retail.v2beta.Image * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ImportProductsResponse} ImportProductsResponse + * @returns {google.cloud.retail.v2beta.Image} Image */ - ImportProductsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ImportProductsResponse) + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Image) return object; - var message = new $root.google.cloud.retail.v2beta.ImportProductsResponse(); - if (object.errorSamples) { - if (!Array.isArray(object.errorSamples)) - throw TypeError(".google.cloud.retail.v2beta.ImportProductsResponse.errorSamples: array expected"); - message.errorSamples = []; - for (var i = 0; i < object.errorSamples.length; ++i) { - if (typeof object.errorSamples[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.ImportProductsResponse.errorSamples: object expected"); - message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); - } - } - if (object.errorsConfig != null) { - if (typeof object.errorsConfig !== "object") - throw TypeError(".google.cloud.retail.v2beta.ImportProductsResponse.errorsConfig: object expected"); - message.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.fromObject(object.errorsConfig); - } + var message = new $root.google.cloud.retail.v2beta.Image(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.height != null) + message.height = object.height | 0; + if (object.width != null) + message.width = object.width | 0; return message; }; /** - * Creates a plain object from an ImportProductsResponse message. Also converts values to other types if specified. + * Creates a plain object from an Image message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @memberof google.cloud.retail.v2beta.Image * @static - * @param {google.cloud.retail.v2beta.ImportProductsResponse} message ImportProductsResponse + * @param {google.cloud.retail.v2beta.Image} message Image * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportProductsResponse.toObject = function toObject(message, options) { + Image.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.errorSamples = []; - if (options.defaults) - object.errorsConfig = null; - if (message.errorSamples && message.errorSamples.length) { - object.errorSamples = []; - for (var j = 0; j < message.errorSamples.length; ++j) - object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + if (options.defaults) { + object.uri = ""; + object.height = 0; + object.width = 0; } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) - object.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.toObject(message.errorsConfig, options); + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; return object; }; /** - * Converts this ImportProductsResponse to JSON. + * Converts this Image to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @memberof google.cloud.retail.v2beta.Image * @instance * @returns {Object.} JSON object */ - ImportProductsResponse.prototype.toJSON = function toJSON() { + Image.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ImportProductsResponse; + return Image; })(); - v2beta.ImportUserEventsResponse = (function() { + v2beta.Interval = (function() { /** - * Properties of an ImportUserEventsResponse. + * Properties of an Interval. * @memberof google.cloud.retail.v2beta - * @interface IImportUserEventsResponse - * @property {Array.|null} [errorSamples] ImportUserEventsResponse errorSamples - * @property {google.cloud.retail.v2beta.IImportErrorsConfig|null} [errorsConfig] ImportUserEventsResponse errorsConfig - * @property {google.cloud.retail.v2beta.IUserEventImportSummary|null} [importSummary] ImportUserEventsResponse importSummary + * @interface IInterval + * @property {number|null} [minimum] Interval minimum + * @property {number|null} [exclusiveMinimum] Interval exclusiveMinimum + * @property {number|null} [maximum] Interval maximum + * @property {number|null} [exclusiveMaximum] Interval exclusiveMaximum */ /** - * Constructs a new ImportUserEventsResponse. + * Constructs a new Interval. * @memberof google.cloud.retail.v2beta - * @classdesc Represents an ImportUserEventsResponse. - * @implements IImportUserEventsResponse + * @classdesc Represents an Interval. + * @implements IInterval * @constructor - * @param {google.cloud.retail.v2beta.IImportUserEventsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IInterval=} [properties] Properties to set */ - function ImportUserEventsResponse(properties) { - this.errorSamples = []; + function Interval(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -61861,104 +60676,139 @@ } /** - * ImportUserEventsResponse errorSamples. - * @member {Array.} errorSamples - * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * Interval minimum. + * @member {number|null|undefined} minimum + * @memberof google.cloud.retail.v2beta.Interval * @instance */ - ImportUserEventsResponse.prototype.errorSamples = $util.emptyArray; + Interval.prototype.minimum = null; /** - * ImportUserEventsResponse errorsConfig. - * @member {google.cloud.retail.v2beta.IImportErrorsConfig|null|undefined} errorsConfig - * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * Interval exclusiveMinimum. + * @member {number|null|undefined} exclusiveMinimum + * @memberof google.cloud.retail.v2beta.Interval * @instance */ - ImportUserEventsResponse.prototype.errorsConfig = null; + Interval.prototype.exclusiveMinimum = null; /** - * ImportUserEventsResponse importSummary. - * @member {google.cloud.retail.v2beta.IUserEventImportSummary|null|undefined} importSummary - * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * Interval maximum. + * @member {number|null|undefined} maximum + * @memberof google.cloud.retail.v2beta.Interval * @instance */ - ImportUserEventsResponse.prototype.importSummary = null; + Interval.prototype.maximum = null; /** - * Creates a new ImportUserEventsResponse instance using the specified properties. + * Interval exclusiveMaximum. + * @member {number|null|undefined} exclusiveMaximum + * @memberof google.cloud.retail.v2beta.Interval + * @instance + */ + Interval.prototype.exclusiveMaximum = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Interval min. + * @member {"minimum"|"exclusiveMinimum"|undefined} min + * @memberof google.cloud.retail.v2beta.Interval + * @instance + */ + Object.defineProperty(Interval.prototype, "min", { + get: $util.oneOfGetter($oneOfFields = ["minimum", "exclusiveMinimum"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interval max. + * @member {"maximum"|"exclusiveMaximum"|undefined} max + * @memberof google.cloud.retail.v2beta.Interval + * @instance + */ + Object.defineProperty(Interval.prototype, "max", { + get: $util.oneOfGetter($oneOfFields = ["maximum", "exclusiveMaximum"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Interval instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @memberof google.cloud.retail.v2beta.Interval * @static - * @param {google.cloud.retail.v2beta.IImportUserEventsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ImportUserEventsResponse} ImportUserEventsResponse instance + * @param {google.cloud.retail.v2beta.IInterval=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Interval} Interval instance */ - ImportUserEventsResponse.create = function create(properties) { - return new ImportUserEventsResponse(properties); + Interval.create = function create(properties) { + return new Interval(properties); }; /** - * Encodes the specified ImportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ImportUserEventsResponse.verify|verify} messages. + * Encodes the specified Interval message. Does not implicitly {@link google.cloud.retail.v2beta.Interval.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @memberof google.cloud.retail.v2beta.Interval * @static - * @param {google.cloud.retail.v2beta.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IInterval} message Interval message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportUserEventsResponse.encode = function encode(message, writer) { + Interval.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorSamples != null && message.errorSamples.length) - for (var i = 0; i < message.errorSamples.length; ++i) - $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) - $root.google.cloud.retail.v2beta.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.importSummary != null && Object.hasOwnProperty.call(message, "importSummary")) - $root.google.cloud.retail.v2beta.UserEventImportSummary.encode(message.importSummary, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.minimum != null && Object.hasOwnProperty.call(message, "minimum")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.minimum); + if (message.exclusiveMinimum != null && Object.hasOwnProperty.call(message, "exclusiveMinimum")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.exclusiveMinimum); + if (message.maximum != null && Object.hasOwnProperty.call(message, "maximum")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.maximum); + if (message.exclusiveMaximum != null && Object.hasOwnProperty.call(message, "exclusiveMaximum")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.exclusiveMaximum); return writer; }; /** - * Encodes the specified ImportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportUserEventsResponse.verify|verify} messages. + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Interval.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @memberof google.cloud.retail.v2beta.Interval * @static - * @param {google.cloud.retail.v2beta.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IInterval} message Interval message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + Interval.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportUserEventsResponse message from the specified reader or buffer. + * Decodes an Interval message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @memberof google.cloud.retail.v2beta.Interval * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ImportUserEventsResponse} ImportUserEventsResponse + * @returns {google.cloud.retail.v2beta.Interval} Interval * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportUserEventsResponse.decode = function decode(reader, length) { + Interval.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.v2beta.ImportUserEventsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.Interval(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.errorSamples && message.errorSamples.length)) - message.errorSamples = []; - message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + message.minimum = reader.double(); break; case 2: - message.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.decode(reader, reader.uint32()); + message.exclusiveMinimum = reader.double(); break; case 3: - message.importSummary = $root.google.cloud.retail.v2beta.UserEventImportSummary.decode(reader, reader.uint32()); + message.maximum = reader.double(); + break; + case 4: + message.exclusiveMaximum = reader.double(); break; default: reader.skipType(tag & 7); @@ -61969,153 +60819,157 @@ }; /** - * Decodes an ImportUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes an Interval message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @memberof google.cloud.retail.v2beta.Interval * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ImportUserEventsResponse} ImportUserEventsResponse + * @returns {google.cloud.retail.v2beta.Interval} Interval * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { + Interval.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportUserEventsResponse message. + * Verifies an Interval message. * @function verify - * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @memberof google.cloud.retail.v2beta.Interval * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportUserEventsResponse.verify = function verify(message) { + Interval.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { - if (!Array.isArray(message.errorSamples)) - return "errorSamples: array expected"; - for (var i = 0; i < message.errorSamples.length; ++i) { - var error = $root.google.rpc.Status.verify(message.errorSamples[i]); - if (error) - return "errorSamples." + error; - } + var properties = {}; + if (message.minimum != null && message.hasOwnProperty("minimum")) { + properties.min = 1; + if (typeof message.minimum !== "number") + return "minimum: number expected"; } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { - var error = $root.google.cloud.retail.v2beta.ImportErrorsConfig.verify(message.errorsConfig); - if (error) - return "errorsConfig." + error; + if (message.exclusiveMinimum != null && message.hasOwnProperty("exclusiveMinimum")) { + if (properties.min === 1) + return "min: multiple values"; + properties.min = 1; + if (typeof message.exclusiveMinimum !== "number") + return "exclusiveMinimum: number expected"; } - if (message.importSummary != null && message.hasOwnProperty("importSummary")) { - var error = $root.google.cloud.retail.v2beta.UserEventImportSummary.verify(message.importSummary); - if (error) - return "importSummary." + error; + if (message.maximum != null && message.hasOwnProperty("maximum")) { + properties.max = 1; + if (typeof message.maximum !== "number") + return "maximum: number expected"; + } + if (message.exclusiveMaximum != null && message.hasOwnProperty("exclusiveMaximum")) { + if (properties.max === 1) + return "max: multiple values"; + properties.max = 1; + if (typeof message.exclusiveMaximum !== "number") + return "exclusiveMaximum: number expected"; } return null; }; /** - * Creates an ImportUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an Interval message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @memberof google.cloud.retail.v2beta.Interval * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ImportUserEventsResponse} ImportUserEventsResponse + * @returns {google.cloud.retail.v2beta.Interval} Interval */ - ImportUserEventsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ImportUserEventsResponse) + Interval.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Interval) return object; - var message = new $root.google.cloud.retail.v2beta.ImportUserEventsResponse(); - if (object.errorSamples) { - if (!Array.isArray(object.errorSamples)) - throw TypeError(".google.cloud.retail.v2beta.ImportUserEventsResponse.errorSamples: array expected"); - message.errorSamples = []; - for (var i = 0; i < object.errorSamples.length; ++i) { - if (typeof object.errorSamples[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.ImportUserEventsResponse.errorSamples: object expected"); - message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); - } - } - if (object.errorsConfig != null) { - if (typeof object.errorsConfig !== "object") - throw TypeError(".google.cloud.retail.v2beta.ImportUserEventsResponse.errorsConfig: object expected"); - message.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.fromObject(object.errorsConfig); - } - if (object.importSummary != null) { - if (typeof object.importSummary !== "object") - throw TypeError(".google.cloud.retail.v2beta.ImportUserEventsResponse.importSummary: object expected"); - message.importSummary = $root.google.cloud.retail.v2beta.UserEventImportSummary.fromObject(object.importSummary); - } + var message = new $root.google.cloud.retail.v2beta.Interval(); + if (object.minimum != null) + message.minimum = Number(object.minimum); + if (object.exclusiveMinimum != null) + message.exclusiveMinimum = Number(object.exclusiveMinimum); + if (object.maximum != null) + message.maximum = Number(object.maximum); + if (object.exclusiveMaximum != null) + message.exclusiveMaximum = Number(object.exclusiveMaximum); return message; }; /** - * Creates a plain object from an ImportUserEventsResponse message. Also converts values to other types if specified. + * Creates a plain object from an Interval message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @memberof google.cloud.retail.v2beta.Interval * @static - * @param {google.cloud.retail.v2beta.ImportUserEventsResponse} message ImportUserEventsResponse + * @param {google.cloud.retail.v2beta.Interval} message Interval * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportUserEventsResponse.toObject = function toObject(message, options) { + Interval.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.errorSamples = []; - if (options.defaults) { - object.errorsConfig = null; - object.importSummary = null; + if (message.minimum != null && message.hasOwnProperty("minimum")) { + object.minimum = options.json && !isFinite(message.minimum) ? String(message.minimum) : message.minimum; + if (options.oneofs) + object.min = "minimum"; } - if (message.errorSamples && message.errorSamples.length) { - object.errorSamples = []; - for (var j = 0; j < message.errorSamples.length; ++j) - object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + if (message.exclusiveMinimum != null && message.hasOwnProperty("exclusiveMinimum")) { + object.exclusiveMinimum = options.json && !isFinite(message.exclusiveMinimum) ? String(message.exclusiveMinimum) : message.exclusiveMinimum; + if (options.oneofs) + object.min = "exclusiveMinimum"; + } + if (message.maximum != null && message.hasOwnProperty("maximum")) { + object.maximum = options.json && !isFinite(message.maximum) ? String(message.maximum) : message.maximum; + if (options.oneofs) + object.max = "maximum"; + } + if (message.exclusiveMaximum != null && message.hasOwnProperty("exclusiveMaximum")) { + object.exclusiveMaximum = options.json && !isFinite(message.exclusiveMaximum) ? String(message.exclusiveMaximum) : message.exclusiveMaximum; + if (options.oneofs) + object.max = "exclusiveMaximum"; } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) - object.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.toObject(message.errorsConfig, options); - if (message.importSummary != null && message.hasOwnProperty("importSummary")) - object.importSummary = $root.google.cloud.retail.v2beta.UserEventImportSummary.toObject(message.importSummary, options); return object; }; /** - * Converts this ImportUserEventsResponse to JSON. + * Converts this Interval to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @memberof google.cloud.retail.v2beta.Interval * @instance * @returns {Object.} JSON object */ - ImportUserEventsResponse.prototype.toJSON = function toJSON() { + Interval.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ImportUserEventsResponse; + return Interval; })(); - v2beta.UserEventImportSummary = (function() { + v2beta.PriceInfo = (function() { /** - * Properties of a UserEventImportSummary. + * Properties of a PriceInfo. * @memberof google.cloud.retail.v2beta - * @interface IUserEventImportSummary - * @property {number|Long|null} [joinedEventsCount] UserEventImportSummary joinedEventsCount - * @property {number|Long|null} [unjoinedEventsCount] UserEventImportSummary unjoinedEventsCount + * @interface IPriceInfo + * @property {string|null} [currencyCode] PriceInfo currencyCode + * @property {number|null} [price] PriceInfo price + * @property {number|null} [originalPrice] PriceInfo originalPrice + * @property {number|null} [cost] PriceInfo cost + * @property {google.protobuf.ITimestamp|null} [priceEffectiveTime] PriceInfo priceEffectiveTime + * @property {google.protobuf.ITimestamp|null} [priceExpireTime] PriceInfo priceExpireTime + * @property {google.cloud.retail.v2beta.PriceInfo.IPriceRange|null} [priceRange] PriceInfo priceRange */ /** - * Constructs a new UserEventImportSummary. + * Constructs a new PriceInfo. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a UserEventImportSummary. - * @implements IUserEventImportSummary + * @classdesc Represents a PriceInfo. + * @implements IPriceInfo * @constructor - * @param {google.cloud.retail.v2beta.IUserEventImportSummary=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IPriceInfo=} [properties] Properties to set */ - function UserEventImportSummary(properties) { + function PriceInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -62123,316 +60977,153 @@ } /** - * UserEventImportSummary joinedEventsCount. - * @member {number|Long} joinedEventsCount - * @memberof google.cloud.retail.v2beta.UserEventImportSummary + * PriceInfo currencyCode. + * @member {string} currencyCode + * @memberof google.cloud.retail.v2beta.PriceInfo * @instance */ - UserEventImportSummary.prototype.joinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PriceInfo.prototype.currencyCode = ""; /** - * UserEventImportSummary unjoinedEventsCount. - * @member {number|Long} unjoinedEventsCount - * @memberof google.cloud.retail.v2beta.UserEventImportSummary + * PriceInfo price. + * @member {number} price + * @memberof google.cloud.retail.v2beta.PriceInfo * @instance */ - UserEventImportSummary.prototype.unjoinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PriceInfo.prototype.price = 0; /** - * Creates a new UserEventImportSummary instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.UserEventImportSummary - * @static - * @param {google.cloud.retail.v2beta.IUserEventImportSummary=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.UserEventImportSummary} UserEventImportSummary instance + * PriceInfo originalPrice. + * @member {number} originalPrice + * @memberof google.cloud.retail.v2beta.PriceInfo + * @instance */ - UserEventImportSummary.create = function create(properties) { - return new UserEventImportSummary(properties); - }; + PriceInfo.prototype.originalPrice = 0; /** - * Encodes the specified UserEventImportSummary message. Does not implicitly {@link google.cloud.retail.v2beta.UserEventImportSummary.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.UserEventImportSummary - * @static - * @param {google.cloud.retail.v2beta.IUserEventImportSummary} message UserEventImportSummary message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * PriceInfo cost. + * @member {number} cost + * @memberof google.cloud.retail.v2beta.PriceInfo + * @instance */ - UserEventImportSummary.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.joinedEventsCount != null && Object.hasOwnProperty.call(message, "joinedEventsCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.joinedEventsCount); - if (message.unjoinedEventsCount != null && Object.hasOwnProperty.call(message, "unjoinedEventsCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.unjoinedEventsCount); - return writer; - }; + PriceInfo.prototype.cost = 0; /** - * Encodes the specified UserEventImportSummary message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserEventImportSummary.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.UserEventImportSummary - * @static - * @param {google.cloud.retail.v2beta.IUserEventImportSummary} message UserEventImportSummary message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UserEventImportSummary.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UserEventImportSummary message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.UserEventImportSummary - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.UserEventImportSummary} UserEventImportSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserEventImportSummary.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.v2beta.UserEventImportSummary(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.joinedEventsCount = reader.int64(); - break; - case 2: - message.unjoinedEventsCount = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UserEventImportSummary message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.UserEventImportSummary - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.UserEventImportSummary} UserEventImportSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserEventImportSummary.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UserEventImportSummary message. - * @function verify - * @memberof google.cloud.retail.v2beta.UserEventImportSummary - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UserEventImportSummary.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) - if (!$util.isInteger(message.joinedEventsCount) && !(message.joinedEventsCount && $util.isInteger(message.joinedEventsCount.low) && $util.isInteger(message.joinedEventsCount.high))) - return "joinedEventsCount: integer|Long expected"; - if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) - if (!$util.isInteger(message.unjoinedEventsCount) && !(message.unjoinedEventsCount && $util.isInteger(message.unjoinedEventsCount.low) && $util.isInteger(message.unjoinedEventsCount.high))) - return "unjoinedEventsCount: integer|Long expected"; - return null; - }; - - /** - * Creates a UserEventImportSummary message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.UserEventImportSummary - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.UserEventImportSummary} UserEventImportSummary - */ - UserEventImportSummary.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.UserEventImportSummary) - return object; - var message = new $root.google.cloud.retail.v2beta.UserEventImportSummary(); - if (object.joinedEventsCount != null) - if ($util.Long) - (message.joinedEventsCount = $util.Long.fromValue(object.joinedEventsCount)).unsigned = false; - else if (typeof object.joinedEventsCount === "string") - message.joinedEventsCount = parseInt(object.joinedEventsCount, 10); - else if (typeof object.joinedEventsCount === "number") - message.joinedEventsCount = object.joinedEventsCount; - else if (typeof object.joinedEventsCount === "object") - message.joinedEventsCount = new $util.LongBits(object.joinedEventsCount.low >>> 0, object.joinedEventsCount.high >>> 0).toNumber(); - if (object.unjoinedEventsCount != null) - if ($util.Long) - (message.unjoinedEventsCount = $util.Long.fromValue(object.unjoinedEventsCount)).unsigned = false; - else if (typeof object.unjoinedEventsCount === "string") - message.unjoinedEventsCount = parseInt(object.unjoinedEventsCount, 10); - else if (typeof object.unjoinedEventsCount === "number") - message.unjoinedEventsCount = object.unjoinedEventsCount; - else if (typeof object.unjoinedEventsCount === "object") - message.unjoinedEventsCount = new $util.LongBits(object.unjoinedEventsCount.low >>> 0, object.unjoinedEventsCount.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a UserEventImportSummary message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.UserEventImportSummary - * @static - * @param {google.cloud.retail.v2beta.UserEventImportSummary} message UserEventImportSummary - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UserEventImportSummary.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.joinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.joinedEventsCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.unjoinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.unjoinedEventsCount = options.longs === String ? "0" : 0; - } - if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) - if (typeof message.joinedEventsCount === "number") - object.joinedEventsCount = options.longs === String ? String(message.joinedEventsCount) : message.joinedEventsCount; - else - object.joinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.joinedEventsCount) : options.longs === Number ? new $util.LongBits(message.joinedEventsCount.low >>> 0, message.joinedEventsCount.high >>> 0).toNumber() : message.joinedEventsCount; - if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) - if (typeof message.unjoinedEventsCount === "number") - object.unjoinedEventsCount = options.longs === String ? String(message.unjoinedEventsCount) : message.unjoinedEventsCount; - else - object.unjoinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.unjoinedEventsCount) : options.longs === Number ? new $util.LongBits(message.unjoinedEventsCount.low >>> 0, message.unjoinedEventsCount.high >>> 0).toNumber() : message.unjoinedEventsCount; - return object; - }; - - /** - * Converts this UserEventImportSummary to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.UserEventImportSummary + * PriceInfo priceEffectiveTime. + * @member {google.protobuf.ITimestamp|null|undefined} priceEffectiveTime + * @memberof google.cloud.retail.v2beta.PriceInfo * @instance - * @returns {Object.} JSON object - */ - UserEventImportSummary.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UserEventImportSummary; - })(); - - v2beta.ImportCompletionDataResponse = (function() { - - /** - * Properties of an ImportCompletionDataResponse. - * @memberof google.cloud.retail.v2beta - * @interface IImportCompletionDataResponse - * @property {Array.|null} [errorSamples] ImportCompletionDataResponse errorSamples */ + PriceInfo.prototype.priceEffectiveTime = null; /** - * Constructs a new ImportCompletionDataResponse. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents an ImportCompletionDataResponse. - * @implements IImportCompletionDataResponse - * @constructor - * @param {google.cloud.retail.v2beta.IImportCompletionDataResponse=} [properties] Properties to set + * PriceInfo priceExpireTime. + * @member {google.protobuf.ITimestamp|null|undefined} priceExpireTime + * @memberof google.cloud.retail.v2beta.PriceInfo + * @instance */ - function ImportCompletionDataResponse(properties) { - this.errorSamples = []; - 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]]; - } + PriceInfo.prototype.priceExpireTime = null; /** - * ImportCompletionDataResponse errorSamples. - * @member {Array.} errorSamples - * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * PriceInfo priceRange. + * @member {google.cloud.retail.v2beta.PriceInfo.IPriceRange|null|undefined} priceRange + * @memberof google.cloud.retail.v2beta.PriceInfo * @instance */ - ImportCompletionDataResponse.prototype.errorSamples = $util.emptyArray; + PriceInfo.prototype.priceRange = null; /** - * Creates a new ImportCompletionDataResponse instance using the specified properties. + * Creates a new PriceInfo instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2beta.PriceInfo * @static - * @param {google.cloud.retail.v2beta.IImportCompletionDataResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ImportCompletionDataResponse} ImportCompletionDataResponse instance + * @param {google.cloud.retail.v2beta.IPriceInfo=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.PriceInfo} PriceInfo instance */ - ImportCompletionDataResponse.create = function create(properties) { - return new ImportCompletionDataResponse(properties); + PriceInfo.create = function create(properties) { + return new PriceInfo(properties); }; /** - * Encodes the specified ImportCompletionDataResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ImportCompletionDataResponse.verify|verify} messages. + * Encodes the specified PriceInfo message. Does not implicitly {@link google.cloud.retail.v2beta.PriceInfo.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2beta.PriceInfo * @static - * @param {google.cloud.retail.v2beta.IImportCompletionDataResponse} message ImportCompletionDataResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IPriceInfo} message PriceInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportCompletionDataResponse.encode = function encode(message, writer) { + PriceInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorSamples != null && message.errorSamples.length) - for (var i = 0; i < message.errorSamples.length; ++i) - $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCode); + if (message.price != null && Object.hasOwnProperty.call(message, "price")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.price); + if (message.originalPrice != null && Object.hasOwnProperty.call(message, "originalPrice")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.originalPrice); + if (message.cost != null && Object.hasOwnProperty.call(message, "cost")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.cost); + if (message.priceEffectiveTime != null && Object.hasOwnProperty.call(message, "priceEffectiveTime")) + $root.google.protobuf.Timestamp.encode(message.priceEffectiveTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.priceExpireTime != null && Object.hasOwnProperty.call(message, "priceExpireTime")) + $root.google.protobuf.Timestamp.encode(message.priceExpireTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.priceRange != null && Object.hasOwnProperty.call(message, "priceRange")) + $root.google.cloud.retail.v2beta.PriceInfo.PriceRange.encode(message.priceRange, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; /** - * Encodes the specified ImportCompletionDataResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportCompletionDataResponse.verify|verify} messages. + * Encodes the specified PriceInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PriceInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2beta.PriceInfo * @static - * @param {google.cloud.retail.v2beta.IImportCompletionDataResponse} message ImportCompletionDataResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IPriceInfo} message PriceInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportCompletionDataResponse.encodeDelimited = function encodeDelimited(message, writer) { + PriceInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportCompletionDataResponse message from the specified reader or buffer. + * Decodes a PriceInfo message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2beta.PriceInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ImportCompletionDataResponse} ImportCompletionDataResponse + * @returns {google.cloud.retail.v2beta.PriceInfo} PriceInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportCompletionDataResponse.decode = function decode(reader, length) { + PriceInfo.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.v2beta.ImportCompletionDataResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.PriceInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.errorSamples && message.errorSamples.length)) - message.errorSamples = []; - message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + message.currencyCode = reader.string(); + break; + case 2: + message.price = reader.float(); + break; + case 3: + message.originalPrice = reader.float(); + break; + case 4: + message.cost = reader.float(); + break; + case 5: + message.priceEffectiveTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.priceExpireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.priceRange = $root.google.cloud.retail.v2beta.PriceInfo.PriceRange.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -62443,638 +61134,1022 @@ }; /** - * Decodes an ImportCompletionDataResponse message from the specified reader or buffer, length delimited. + * Decodes a PriceInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2beta.PriceInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ImportCompletionDataResponse} ImportCompletionDataResponse + * @returns {google.cloud.retail.v2beta.PriceInfo} PriceInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportCompletionDataResponse.decodeDelimited = function decodeDelimited(reader) { + PriceInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportCompletionDataResponse message. + * Verifies a PriceInfo message. * @function verify - * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2beta.PriceInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportCompletionDataResponse.verify = function verify(message) { + PriceInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { - if (!Array.isArray(message.errorSamples)) - return "errorSamples: array expected"; - for (var i = 0; i < message.errorSamples.length; ++i) { - var error = $root.google.rpc.Status.verify(message.errorSamples[i]); - if (error) - return "errorSamples." + error; - } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + if (message.price != null && message.hasOwnProperty("price")) + if (typeof message.price !== "number") + return "price: number expected"; + if (message.originalPrice != null && message.hasOwnProperty("originalPrice")) + if (typeof message.originalPrice !== "number") + return "originalPrice: number expected"; + if (message.cost != null && message.hasOwnProperty("cost")) + if (typeof message.cost !== "number") + return "cost: number expected"; + if (message.priceEffectiveTime != null && message.hasOwnProperty("priceEffectiveTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.priceEffectiveTime); + if (error) + return "priceEffectiveTime." + error; + } + if (message.priceExpireTime != null && message.hasOwnProperty("priceExpireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.priceExpireTime); + if (error) + return "priceExpireTime." + error; + } + if (message.priceRange != null && message.hasOwnProperty("priceRange")) { + var error = $root.google.cloud.retail.v2beta.PriceInfo.PriceRange.verify(message.priceRange); + if (error) + return "priceRange." + error; } return null; }; /** - * Creates an ImportCompletionDataResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PriceInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2beta.PriceInfo * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ImportCompletionDataResponse} ImportCompletionDataResponse + * @returns {google.cloud.retail.v2beta.PriceInfo} PriceInfo */ - ImportCompletionDataResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ImportCompletionDataResponse) + PriceInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.PriceInfo) return object; - var message = new $root.google.cloud.retail.v2beta.ImportCompletionDataResponse(); - if (object.errorSamples) { - if (!Array.isArray(object.errorSamples)) - throw TypeError(".google.cloud.retail.v2beta.ImportCompletionDataResponse.errorSamples: array expected"); - message.errorSamples = []; - for (var i = 0; i < object.errorSamples.length; ++i) { - if (typeof object.errorSamples[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.ImportCompletionDataResponse.errorSamples: object expected"); - message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); - } + var message = new $root.google.cloud.retail.v2beta.PriceInfo(); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.price != null) + message.price = Number(object.price); + if (object.originalPrice != null) + message.originalPrice = Number(object.originalPrice); + if (object.cost != null) + message.cost = Number(object.cost); + if (object.priceEffectiveTime != null) { + if (typeof object.priceEffectiveTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.PriceInfo.priceEffectiveTime: object expected"); + message.priceEffectiveTime = $root.google.protobuf.Timestamp.fromObject(object.priceEffectiveTime); + } + if (object.priceExpireTime != null) { + if (typeof object.priceExpireTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.PriceInfo.priceExpireTime: object expected"); + message.priceExpireTime = $root.google.protobuf.Timestamp.fromObject(object.priceExpireTime); + } + if (object.priceRange != null) { + if (typeof object.priceRange !== "object") + throw TypeError(".google.cloud.retail.v2beta.PriceInfo.priceRange: object expected"); + message.priceRange = $root.google.cloud.retail.v2beta.PriceInfo.PriceRange.fromObject(object.priceRange); } return message; }; /** - * Creates a plain object from an ImportCompletionDataResponse message. Also converts values to other types if specified. + * Creates a plain object from a PriceInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2beta.PriceInfo * @static - * @param {google.cloud.retail.v2beta.ImportCompletionDataResponse} message ImportCompletionDataResponse + * @param {google.cloud.retail.v2beta.PriceInfo} message PriceInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportCompletionDataResponse.toObject = function toObject(message, options) { + PriceInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.errorSamples = []; - if (message.errorSamples && message.errorSamples.length) { - object.errorSamples = []; - for (var j = 0; j < message.errorSamples.length; ++j) - object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + if (options.defaults) { + object.currencyCode = ""; + object.price = 0; + object.originalPrice = 0; + object.cost = 0; + object.priceEffectiveTime = null; + object.priceExpireTime = null; + object.priceRange = null; } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + if (message.price != null && message.hasOwnProperty("price")) + object.price = options.json && !isFinite(message.price) ? String(message.price) : message.price; + if (message.originalPrice != null && message.hasOwnProperty("originalPrice")) + object.originalPrice = options.json && !isFinite(message.originalPrice) ? String(message.originalPrice) : message.originalPrice; + if (message.cost != null && message.hasOwnProperty("cost")) + object.cost = options.json && !isFinite(message.cost) ? String(message.cost) : message.cost; + if (message.priceEffectiveTime != null && message.hasOwnProperty("priceEffectiveTime")) + object.priceEffectiveTime = $root.google.protobuf.Timestamp.toObject(message.priceEffectiveTime, options); + if (message.priceExpireTime != null && message.hasOwnProperty("priceExpireTime")) + object.priceExpireTime = $root.google.protobuf.Timestamp.toObject(message.priceExpireTime, options); + if (message.priceRange != null && message.hasOwnProperty("priceRange")) + object.priceRange = $root.google.cloud.retail.v2beta.PriceInfo.PriceRange.toObject(message.priceRange, options); return object; }; /** - * Converts this ImportCompletionDataResponse to JSON. + * Converts this PriceInfo to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2beta.PriceInfo * @instance * @returns {Object.} JSON object */ - ImportCompletionDataResponse.prototype.toJSON = function toJSON() { + PriceInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ImportCompletionDataResponse; - })(); - - v2beta.Product = (function() { + PriceInfo.PriceRange = (function() { - /** - * Properties of a Product. - * @memberof google.cloud.retail.v2beta - * @interface IProduct - * @property {google.protobuf.ITimestamp|null} [expireTime] Product expireTime - * @property {google.protobuf.IDuration|null} [ttl] Product ttl - * @property {string|null} [name] Product name - * @property {string|null} [id] Product id - * @property {google.cloud.retail.v2beta.Product.Type|null} [type] Product type - * @property {string|null} [primaryProductId] Product primaryProductId - * @property {Array.|null} [collectionMemberIds] Product collectionMemberIds - * @property {string|null} [gtin] Product gtin - * @property {Array.|null} [categories] Product categories - * @property {string|null} [title] Product title - * @property {Array.|null} [brands] Product brands - * @property {string|null} [description] Product description - * @property {string|null} [languageCode] Product languageCode - * @property {Object.|null} [attributes] Product attributes - * @property {Array.|null} [tags] Product tags - * @property {google.cloud.retail.v2beta.IPriceInfo|null} [priceInfo] Product priceInfo - * @property {google.cloud.retail.v2beta.IRating|null} [rating] Product rating - * @property {google.protobuf.ITimestamp|null} [availableTime] Product availableTime - * @property {google.cloud.retail.v2beta.Product.Availability|null} [availability] Product availability - * @property {google.protobuf.IInt32Value|null} [availableQuantity] Product availableQuantity - * @property {Array.|null} [fulfillmentInfo] Product fulfillmentInfo - * @property {string|null} [uri] Product uri - * @property {Array.|null} [images] Product images - * @property {google.cloud.retail.v2beta.IAudience|null} [audience] Product audience - * @property {google.cloud.retail.v2beta.IColorInfo|null} [colorInfo] Product colorInfo - * @property {Array.|null} [sizes] Product sizes - * @property {Array.|null} [materials] Product materials - * @property {Array.|null} [patterns] Product patterns - * @property {Array.|null} [conditions] Product conditions - * @property {Array.|null} [promotions] Product promotions - * @property {google.protobuf.ITimestamp|null} [publishTime] Product publishTime - * @property {google.protobuf.IFieldMask|null} [retrievableFields] Product retrievableFields - * @property {Array.|null} [variants] Product variants - */ + /** + * Properties of a PriceRange. + * @memberof google.cloud.retail.v2beta.PriceInfo + * @interface IPriceRange + * @property {google.cloud.retail.v2beta.IInterval|null} [price] PriceRange price + * @property {google.cloud.retail.v2beta.IInterval|null} [originalPrice] PriceRange originalPrice + */ - /** - * Constructs a new Product. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a Product. - * @implements IProduct - * @constructor - * @param {google.cloud.retail.v2beta.IProduct=} [properties] Properties to set - */ - function Product(properties) { - this.collectionMemberIds = []; - this.categories = []; - this.brands = []; - this.attributes = {}; - this.tags = []; - this.fulfillmentInfo = []; - this.images = []; - this.sizes = []; - this.materials = []; - this.patterns = []; - this.conditions = []; - this.promotions = []; - this.variants = []; - 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]]; - } + /** + * Constructs a new PriceRange. + * @memberof google.cloud.retail.v2beta.PriceInfo + * @classdesc Represents a PriceRange. + * @implements IPriceRange + * @constructor + * @param {google.cloud.retail.v2beta.PriceInfo.IPriceRange=} [properties] Properties to set + */ + function PriceRange(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]]; + } - /** - * Product expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.retail.v2beta.Product - * @instance - */ - Product.prototype.expireTime = null; + /** + * PriceRange price. + * @member {google.cloud.retail.v2beta.IInterval|null|undefined} price + * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange + * @instance + */ + PriceRange.prototype.price = null; - /** - * Product ttl. - * @member {google.protobuf.IDuration|null|undefined} ttl - * @memberof google.cloud.retail.v2beta.Product - * @instance + /** + * PriceRange originalPrice. + * @member {google.cloud.retail.v2beta.IInterval|null|undefined} originalPrice + * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange + * @instance + */ + PriceRange.prototype.originalPrice = null; + + /** + * Creates a new PriceRange instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange + * @static + * @param {google.cloud.retail.v2beta.PriceInfo.IPriceRange=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.PriceInfo.PriceRange} PriceRange instance + */ + PriceRange.create = function create(properties) { + return new PriceRange(properties); + }; + + /** + * Encodes the specified PriceRange message. Does not implicitly {@link google.cloud.retail.v2beta.PriceInfo.PriceRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange + * @static + * @param {google.cloud.retail.v2beta.PriceInfo.IPriceRange} message PriceRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.price != null && Object.hasOwnProperty.call(message, "price")) + $root.google.cloud.retail.v2beta.Interval.encode(message.price, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.originalPrice != null && Object.hasOwnProperty.call(message, "originalPrice")) + $root.google.cloud.retail.v2beta.Interval.encode(message.originalPrice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PriceRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PriceInfo.PriceRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange + * @static + * @param {google.cloud.retail.v2beta.PriceInfo.IPriceRange} message PriceRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PriceRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.PriceInfo.PriceRange} PriceRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceRange.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.v2beta.PriceInfo.PriceRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = $root.google.cloud.retail.v2beta.Interval.decode(reader, reader.uint32()); + break; + case 2: + message.originalPrice = $root.google.cloud.retail.v2beta.Interval.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PriceRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.PriceInfo.PriceRange} PriceRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PriceRange message. + * @function verify + * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PriceRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.price != null && message.hasOwnProperty("price")) { + var error = $root.google.cloud.retail.v2beta.Interval.verify(message.price); + if (error) + return "price." + error; + } + if (message.originalPrice != null && message.hasOwnProperty("originalPrice")) { + var error = $root.google.cloud.retail.v2beta.Interval.verify(message.originalPrice); + if (error) + return "originalPrice." + error; + } + return null; + }; + + /** + * Creates a PriceRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.PriceInfo.PriceRange} PriceRange + */ + PriceRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.PriceInfo.PriceRange) + return object; + var message = new $root.google.cloud.retail.v2beta.PriceInfo.PriceRange(); + if (object.price != null) { + if (typeof object.price !== "object") + throw TypeError(".google.cloud.retail.v2beta.PriceInfo.PriceRange.price: object expected"); + message.price = $root.google.cloud.retail.v2beta.Interval.fromObject(object.price); + } + if (object.originalPrice != null) { + if (typeof object.originalPrice !== "object") + throw TypeError(".google.cloud.retail.v2beta.PriceInfo.PriceRange.originalPrice: object expected"); + message.originalPrice = $root.google.cloud.retail.v2beta.Interval.fromObject(object.originalPrice); + } + return message; + }; + + /** + * Creates a plain object from a PriceRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange + * @static + * @param {google.cloud.retail.v2beta.PriceInfo.PriceRange} message PriceRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PriceRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.price = null; + object.originalPrice = null; + } + if (message.price != null && message.hasOwnProperty("price")) + object.price = $root.google.cloud.retail.v2beta.Interval.toObject(message.price, options); + if (message.originalPrice != null && message.hasOwnProperty("originalPrice")) + object.originalPrice = $root.google.cloud.retail.v2beta.Interval.toObject(message.originalPrice, options); + return object; + }; + + /** + * Converts this PriceRange to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.PriceInfo.PriceRange + * @instance + * @returns {Object.} JSON object + */ + PriceRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PriceRange; + })(); + + return PriceInfo; + })(); + + v2beta.Rating = (function() { + + /** + * Properties of a Rating. + * @memberof google.cloud.retail.v2beta + * @interface IRating + * @property {number|null} [ratingCount] Rating ratingCount + * @property {number|null} [averageRating] Rating averageRating + * @property {Array.|null} [ratingHistogram] Rating ratingHistogram */ - Product.prototype.ttl = null; /** - * Product name. - * @member {string} name - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Constructs a new Rating. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a Rating. + * @implements IRating + * @constructor + * @param {google.cloud.retail.v2beta.IRating=} [properties] Properties to set */ - Product.prototype.name = ""; + function Rating(properties) { + this.ratingHistogram = []; + 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]]; + } /** - * Product id. - * @member {string} id - * @memberof google.cloud.retail.v2beta.Product + * Rating ratingCount. + * @member {number} ratingCount + * @memberof google.cloud.retail.v2beta.Rating * @instance */ - Product.prototype.id = ""; + Rating.prototype.ratingCount = 0; /** - * Product type. - * @member {google.cloud.retail.v2beta.Product.Type} type - * @memberof google.cloud.retail.v2beta.Product + * Rating averageRating. + * @member {number} averageRating + * @memberof google.cloud.retail.v2beta.Rating * @instance */ - Product.prototype.type = 0; + Rating.prototype.averageRating = 0; /** - * Product primaryProductId. - * @member {string} primaryProductId - * @memberof google.cloud.retail.v2beta.Product + * Rating ratingHistogram. + * @member {Array.} ratingHistogram + * @memberof google.cloud.retail.v2beta.Rating * @instance */ - Product.prototype.primaryProductId = ""; + Rating.prototype.ratingHistogram = $util.emptyArray; /** - * Product collectionMemberIds. - * @member {Array.} collectionMemberIds - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Creates a new Rating instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Rating + * @static + * @param {google.cloud.retail.v2beta.IRating=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Rating} Rating instance */ - Product.prototype.collectionMemberIds = $util.emptyArray; + Rating.create = function create(properties) { + return new Rating(properties); + }; /** - * Product gtin. - * @member {string} gtin - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Encodes the specified Rating message. Does not implicitly {@link google.cloud.retail.v2beta.Rating.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Rating + * @static + * @param {google.cloud.retail.v2beta.IRating} message Rating message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Product.prototype.gtin = ""; + Rating.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ratingCount != null && Object.hasOwnProperty.call(message, "ratingCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ratingCount); + if (message.averageRating != null && Object.hasOwnProperty.call(message, "averageRating")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.averageRating); + if (message.ratingHistogram != null && message.ratingHistogram.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.ratingHistogram.length; ++i) + writer.int32(message.ratingHistogram[i]); + writer.ldelim(); + } + return writer; + }; /** - * Product categories. - * @member {Array.} categories - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Encodes the specified Rating message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rating.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Rating + * @static + * @param {google.cloud.retail.v2beta.IRating} message Rating message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Product.prototype.categories = $util.emptyArray; + Rating.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Product title. - * @member {string} title - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Decodes a Rating message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Rating + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Rating} Rating + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.prototype.title = ""; + Rating.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.v2beta.Rating(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ratingCount = reader.int32(); + break; + case 2: + message.averageRating = reader.float(); + break; + case 3: + if (!(message.ratingHistogram && message.ratingHistogram.length)) + message.ratingHistogram = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.ratingHistogram.push(reader.int32()); + } else + message.ratingHistogram.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Product brands. - * @member {Array.} brands - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Decodes a Rating message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Rating + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Rating} Rating + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.prototype.brands = $util.emptyArray; + Rating.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Product description. - * @member {string} description - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Verifies a Rating message. + * @function verify + * @memberof google.cloud.retail.v2beta.Rating + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Product.prototype.description = ""; + Rating.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ratingCount != null && message.hasOwnProperty("ratingCount")) + if (!$util.isInteger(message.ratingCount)) + return "ratingCount: integer expected"; + if (message.averageRating != null && message.hasOwnProperty("averageRating")) + if (typeof message.averageRating !== "number") + return "averageRating: number expected"; + if (message.ratingHistogram != null && message.hasOwnProperty("ratingHistogram")) { + if (!Array.isArray(message.ratingHistogram)) + return "ratingHistogram: array expected"; + for (var i = 0; i < message.ratingHistogram.length; ++i) + if (!$util.isInteger(message.ratingHistogram[i])) + return "ratingHistogram: integer[] expected"; + } + return null; + }; /** - * Product languageCode. - * @member {string} languageCode - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Creates a Rating message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Rating + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Rating} Rating */ - Product.prototype.languageCode = ""; + Rating.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Rating) + return object; + var message = new $root.google.cloud.retail.v2beta.Rating(); + if (object.ratingCount != null) + message.ratingCount = object.ratingCount | 0; + if (object.averageRating != null) + message.averageRating = Number(object.averageRating); + if (object.ratingHistogram) { + if (!Array.isArray(object.ratingHistogram)) + throw TypeError(".google.cloud.retail.v2beta.Rating.ratingHistogram: array expected"); + message.ratingHistogram = []; + for (var i = 0; i < object.ratingHistogram.length; ++i) + message.ratingHistogram[i] = object.ratingHistogram[i] | 0; + } + return message; + }; /** - * Product attributes. - * @member {Object.} attributes - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Creates a plain object from a Rating message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Rating + * @static + * @param {google.cloud.retail.v2beta.Rating} message Rating + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Product.prototype.attributes = $util.emptyObject; + Rating.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ratingHistogram = []; + if (options.defaults) { + object.ratingCount = 0; + object.averageRating = 0; + } + if (message.ratingCount != null && message.hasOwnProperty("ratingCount")) + object.ratingCount = message.ratingCount; + if (message.averageRating != null && message.hasOwnProperty("averageRating")) + object.averageRating = options.json && !isFinite(message.averageRating) ? String(message.averageRating) : message.averageRating; + if (message.ratingHistogram && message.ratingHistogram.length) { + object.ratingHistogram = []; + for (var j = 0; j < message.ratingHistogram.length; ++j) + object.ratingHistogram[j] = message.ratingHistogram[j]; + } + return object; + }; /** - * Product tags. - * @member {Array.} tags - * @memberof google.cloud.retail.v2beta.Product + * Converts this Rating to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Rating * @instance + * @returns {Object.} JSON object */ - Product.prototype.tags = $util.emptyArray; + Rating.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Rating; + })(); + + v2beta.UserInfo = (function() { /** - * Product priceInfo. - * @member {google.cloud.retail.v2beta.IPriceInfo|null|undefined} priceInfo - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Properties of a UserInfo. + * @memberof google.cloud.retail.v2beta + * @interface IUserInfo + * @property {string|null} [userId] UserInfo userId + * @property {string|null} [ipAddress] UserInfo ipAddress + * @property {string|null} [userAgent] UserInfo userAgent + * @property {boolean|null} [directUserRequest] UserInfo directUserRequest */ - Product.prototype.priceInfo = null; /** - * Product rating. - * @member {google.cloud.retail.v2beta.IRating|null|undefined} rating - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Constructs a new UserInfo. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a UserInfo. + * @implements IUserInfo + * @constructor + * @param {google.cloud.retail.v2beta.IUserInfo=} [properties] Properties to set */ - Product.prototype.rating = null; + function UserInfo(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]]; + } /** - * Product availableTime. - * @member {google.protobuf.ITimestamp|null|undefined} availableTime - * @memberof google.cloud.retail.v2beta.Product + * UserInfo userId. + * @member {string} userId + * @memberof google.cloud.retail.v2beta.UserInfo * @instance */ - Product.prototype.availableTime = null; + UserInfo.prototype.userId = ""; /** - * Product availability. - * @member {google.cloud.retail.v2beta.Product.Availability} availability - * @memberof google.cloud.retail.v2beta.Product + * UserInfo ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.retail.v2beta.UserInfo * @instance */ - Product.prototype.availability = 0; + UserInfo.prototype.ipAddress = ""; /** - * Product availableQuantity. - * @member {google.protobuf.IInt32Value|null|undefined} availableQuantity - * @memberof google.cloud.retail.v2beta.Product + * UserInfo userAgent. + * @member {string} userAgent + * @memberof google.cloud.retail.v2beta.UserInfo * @instance */ - Product.prototype.availableQuantity = null; + UserInfo.prototype.userAgent = ""; /** - * Product fulfillmentInfo. - * @member {Array.} fulfillmentInfo - * @memberof google.cloud.retail.v2beta.Product + * UserInfo directUserRequest. + * @member {boolean} directUserRequest + * @memberof google.cloud.retail.v2beta.UserInfo * @instance */ - Product.prototype.fulfillmentInfo = $util.emptyArray; + UserInfo.prototype.directUserRequest = false; /** - * Product uri. - * @member {string} uri - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Creates a new UserInfo instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.UserInfo + * @static + * @param {google.cloud.retail.v2beta.IUserInfo=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.UserInfo} UserInfo instance */ - Product.prototype.uri = ""; + UserInfo.create = function create(properties) { + return new UserInfo(properties); + }; /** - * Product images. - * @member {Array.} images - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.retail.v2beta.UserInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.UserInfo + * @static + * @param {google.cloud.retail.v2beta.IUserInfo} message UserInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Product.prototype.images = $util.emptyArray; + UserInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userId); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAddress); + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.userAgent); + if (message.directUserRequest != null && Object.hasOwnProperty.call(message, "directUserRequest")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.directUserRequest); + return writer; + }; /** - * Product audience. - * @member {google.cloud.retail.v2beta.IAudience|null|undefined} audience - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.UserInfo + * @static + * @param {google.cloud.retail.v2beta.IUserInfo} message UserInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Product.prototype.audience = null; + UserInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Product colorInfo. - * @member {google.cloud.retail.v2beta.IColorInfo|null|undefined} colorInfo - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Decodes a UserInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.UserInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.UserInfo} UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.prototype.colorInfo = null; + UserInfo.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.v2beta.UserInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userId = reader.string(); + break; + case 2: + message.ipAddress = reader.string(); + break; + case 3: + message.userAgent = reader.string(); + break; + case 4: + message.directUserRequest = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Product sizes. - * @member {Array.} sizes - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Decodes a UserInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.UserInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.UserInfo} UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.prototype.sizes = $util.emptyArray; + UserInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Product materials. - * @member {Array.} materials - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Verifies a UserInfo message. + * @function verify + * @memberof google.cloud.retail.v2beta.UserInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Product.prototype.materials = $util.emptyArray; + UserInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isString(message.userId)) + return "userId: string expected"; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + if (!$util.isString(message.userAgent)) + return "userAgent: string expected"; + if (message.directUserRequest != null && message.hasOwnProperty("directUserRequest")) + if (typeof message.directUserRequest !== "boolean") + return "directUserRequest: boolean expected"; + return null; + }; /** - * Product patterns. - * @member {Array.} patterns - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Creates a UserInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.UserInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.UserInfo} UserInfo */ - Product.prototype.patterns = $util.emptyArray; + UserInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.UserInfo) + return object; + var message = new $root.google.cloud.retail.v2beta.UserInfo(); + if (object.userId != null) + message.userId = String(object.userId); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.userAgent != null) + message.userAgent = String(object.userAgent); + if (object.directUserRequest != null) + message.directUserRequest = Boolean(object.directUserRequest); + return message; + }; /** - * Product conditions. - * @member {Array.} conditions - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Creates a plain object from a UserInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.UserInfo + * @static + * @param {google.cloud.retail.v2beta.UserInfo} message UserInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Product.prototype.conditions = $util.emptyArray; + UserInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.userId = ""; + object.ipAddress = ""; + object.userAgent = ""; + object.directUserRequest = false; + } + if (message.userId != null && message.hasOwnProperty("userId")) + object.userId = message.userId; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + object.userAgent = message.userAgent; + if (message.directUserRequest != null && message.hasOwnProperty("directUserRequest")) + object.directUserRequest = message.directUserRequest; + return object; + }; /** - * Product promotions. - * @member {Array.} promotions - * @memberof google.cloud.retail.v2beta.Product + * Converts this UserInfo to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.UserInfo * @instance + * @returns {Object.} JSON object */ - Product.prototype.promotions = $util.emptyArray; + UserInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UserInfo; + })(); + + v2beta.LocalInventory = (function() { /** - * Product publishTime. - * @member {google.protobuf.ITimestamp|null|undefined} publishTime - * @memberof google.cloud.retail.v2beta.Product - * @instance + * Properties of a LocalInventory. + * @memberof google.cloud.retail.v2beta + * @interface ILocalInventory + * @property {string|null} [placeId] LocalInventory placeId + * @property {google.cloud.retail.v2beta.IPriceInfo|null} [priceInfo] LocalInventory priceInfo + * @property {Object.|null} [attributes] LocalInventory attributes + * @property {Array.|null} [fulfillmentTypes] LocalInventory fulfillmentTypes */ - Product.prototype.publishTime = null; /** - * Product retrievableFields. - * @member {google.protobuf.IFieldMask|null|undefined} retrievableFields - * @memberof google.cloud.retail.v2beta.Product + * Constructs a new LocalInventory. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a LocalInventory. + * @implements ILocalInventory + * @constructor + * @param {google.cloud.retail.v2beta.ILocalInventory=} [properties] Properties to set + */ + function LocalInventory(properties) { + this.attributes = {}; + this.fulfillmentTypes = []; + 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]]; + } + + /** + * LocalInventory placeId. + * @member {string} placeId + * @memberof google.cloud.retail.v2beta.LocalInventory * @instance */ - Product.prototype.retrievableFields = null; + LocalInventory.prototype.placeId = ""; /** - * Product variants. - * @member {Array.} variants - * @memberof google.cloud.retail.v2beta.Product + * LocalInventory priceInfo. + * @member {google.cloud.retail.v2beta.IPriceInfo|null|undefined} priceInfo + * @memberof google.cloud.retail.v2beta.LocalInventory * @instance */ - Product.prototype.variants = $util.emptyArray; + LocalInventory.prototype.priceInfo = null; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * LocalInventory attributes. + * @member {Object.} attributes + * @memberof google.cloud.retail.v2beta.LocalInventory + * @instance + */ + LocalInventory.prototype.attributes = $util.emptyObject; /** - * Product expiration. - * @member {"expireTime"|"ttl"|undefined} expiration - * @memberof google.cloud.retail.v2beta.Product + * LocalInventory fulfillmentTypes. + * @member {Array.} fulfillmentTypes + * @memberof google.cloud.retail.v2beta.LocalInventory * @instance */ - Object.defineProperty(Product.prototype, "expiration", { - get: $util.oneOfGetter($oneOfFields = ["expireTime", "ttl"]), - set: $util.oneOfSetter($oneOfFields) - }); + LocalInventory.prototype.fulfillmentTypes = $util.emptyArray; /** - * Creates a new Product instance using the specified properties. + * Creates a new LocalInventory instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.Product + * @memberof google.cloud.retail.v2beta.LocalInventory * @static - * @param {google.cloud.retail.v2beta.IProduct=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.Product} Product instance + * @param {google.cloud.retail.v2beta.ILocalInventory=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.LocalInventory} LocalInventory instance */ - Product.create = function create(properties) { - return new Product(properties); + LocalInventory.create = function create(properties) { + return new LocalInventory(properties); }; /** - * Encodes the specified Product message. Does not implicitly {@link google.cloud.retail.v2beta.Product.verify|verify} messages. + * Encodes the specified LocalInventory message. Does not implicitly {@link google.cloud.retail.v2beta.LocalInventory.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.Product + * @memberof google.cloud.retail.v2beta.LocalInventory * @static - * @param {google.cloud.retail.v2beta.IProduct} message Product message or plain object to encode + * @param {google.cloud.retail.v2beta.ILocalInventory} message LocalInventory message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Product.encode = function encode(message, writer) { + LocalInventory.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); - if (message.primaryProductId != null && Object.hasOwnProperty.call(message, "primaryProductId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.primaryProductId); - if (message.collectionMemberIds != null && message.collectionMemberIds.length) - for (var i = 0; i < message.collectionMemberIds.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.collectionMemberIds[i]); - if (message.gtin != null && Object.hasOwnProperty.call(message, "gtin")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.gtin); - if (message.categories != null && message.categories.length) - for (var i = 0; i < message.categories.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.categories[i]); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.title); - if (message.brands != null && message.brands.length) - for (var i = 0; i < message.brands.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.brands[i]); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.description); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.languageCode); + if (message.placeId != null && Object.hasOwnProperty.call(message, "placeId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.placeId); + if (message.priceInfo != null && Object.hasOwnProperty.call(message, "priceInfo")) + $root.google.cloud.retail.v2beta.PriceInfo.encode(message.priceInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.cloud.retail.v2beta.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.tags[i]); - if (message.priceInfo != null && Object.hasOwnProperty.call(message, "priceInfo")) - $root.google.cloud.retail.v2beta.PriceInfo.encode(message.priceInfo, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.rating != null && Object.hasOwnProperty.call(message, "rating")) - $root.google.cloud.retail.v2beta.Rating.encode(message.rating, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) - $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.availableTime != null && Object.hasOwnProperty.call(message, "availableTime")) - $root.google.protobuf.Timestamp.encode(message.availableTime, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.availability != null && Object.hasOwnProperty.call(message, "availability")) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.availability); - if (message.availableQuantity != null && Object.hasOwnProperty.call(message, "availableQuantity")) - $root.google.protobuf.Int32Value.encode(message.availableQuantity, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.fulfillmentInfo != null && message.fulfillmentInfo.length) - for (var i = 0; i < message.fulfillmentInfo.length; ++i) - $root.google.cloud.retail.v2beta.FulfillmentInfo.encode(message.fulfillmentInfo[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 22, wireType 2 =*/178).string(message.uri); - if (message.images != null && message.images.length) - for (var i = 0; i < message.images.length; ++i) - $root.google.cloud.retail.v2beta.Image.encode(message.images[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.audience != null && Object.hasOwnProperty.call(message, "audience")) - $root.google.cloud.retail.v2beta.Audience.encode(message.audience, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.colorInfo != null && Object.hasOwnProperty.call(message, "colorInfo")) - $root.google.cloud.retail.v2beta.ColorInfo.encode(message.colorInfo, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.sizes != null && message.sizes.length) - for (var i = 0; i < message.sizes.length; ++i) - writer.uint32(/* id 26, wireType 2 =*/210).string(message.sizes[i]); - if (message.materials != null && message.materials.length) - for (var i = 0; i < message.materials.length; ++i) - writer.uint32(/* id 27, wireType 2 =*/218).string(message.materials[i]); - if (message.patterns != null && message.patterns.length) - for (var i = 0; i < message.patterns.length; ++i) - writer.uint32(/* id 28, wireType 2 =*/226).string(message.patterns[i]); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - writer.uint32(/* id 29, wireType 2 =*/234).string(message.conditions[i]); - if (message.retrievableFields != null && Object.hasOwnProperty.call(message, "retrievableFields")) - $root.google.protobuf.FieldMask.encode(message.retrievableFields, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); - if (message.variants != null && message.variants.length) - for (var i = 0; i < message.variants.length; ++i) - $root.google.cloud.retail.v2beta.Product.encode(message.variants[i], writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.publishTime != null && Object.hasOwnProperty.call(message, "publishTime")) - $root.google.protobuf.Timestamp.encode(message.publishTime, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); - if (message.promotions != null && message.promotions.length) - for (var i = 0; i < message.promotions.length; ++i) - $root.google.cloud.retail.v2beta.Promotion.encode(message.promotions[i], writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.fulfillmentTypes != null && message.fulfillmentTypes.length) + for (var i = 0; i < message.fulfillmentTypes.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.fulfillmentTypes[i]); return writer; }; /** - * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Product.verify|verify} messages. + * Encodes the specified LocalInventory message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.LocalInventory.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.Product + * @memberof google.cloud.retail.v2beta.LocalInventory * @static - * @param {google.cloud.retail.v2beta.IProduct} message Product message or plain object to encode + * @param {google.cloud.retail.v2beta.ILocalInventory} message LocalInventory message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Product.encodeDelimited = function encodeDelimited(message, writer) { + LocalInventory.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Product message from the specified reader or buffer. + * Decodes a LocalInventory message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.Product + * @memberof google.cloud.retail.v2beta.LocalInventory * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.Product} Product + * @returns {google.cloud.retail.v2beta.LocalInventory} LocalInventory * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.decode = function decode(reader, length) { + LocalInventory.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.v2beta.Product(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.LocalInventory(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 16: - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 17: - message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; case 1: - message.name = reader.string(); + message.placeId = reader.string(); break; case 2: - message.id = reader.string(); + message.priceInfo = $root.google.cloud.retail.v2beta.PriceInfo.decode(reader, reader.uint32()); break; case 3: - message.type = reader.int32(); - break; - case 4: - message.primaryProductId = reader.string(); - break; - case 5: - if (!(message.collectionMemberIds && message.collectionMemberIds.length)) - message.collectionMemberIds = []; - message.collectionMemberIds.push(reader.string()); - break; - case 6: - message.gtin = reader.string(); - break; - case 7: - if (!(message.categories && message.categories.length)) - message.categories = []; - message.categories.push(reader.string()); - break; - case 8: - message.title = reader.string(); - break; - case 9: - if (!(message.brands && message.brands.length)) - message.brands = []; - message.brands.push(reader.string()); - break; - case 10: - message.description = reader.string(); - break; - case 11: - message.languageCode = reader.string(); - break; - case 12: if (message.attributes === $util.emptyObject) message.attributes = {}; var end2 = reader.uint32() + reader.pos; @@ -63096,80 +62171,10 @@ } message.attributes[key] = value; break; - case 13: - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(reader.string()); - break; - case 14: - message.priceInfo = $root.google.cloud.retail.v2beta.PriceInfo.decode(reader, reader.uint32()); - break; - case 15: - message.rating = $root.google.cloud.retail.v2beta.Rating.decode(reader, reader.uint32()); - break; - case 18: - message.availableTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 19: - message.availability = reader.int32(); - break; - case 20: - message.availableQuantity = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); - break; - case 21: - if (!(message.fulfillmentInfo && message.fulfillmentInfo.length)) - message.fulfillmentInfo = []; - message.fulfillmentInfo.push($root.google.cloud.retail.v2beta.FulfillmentInfo.decode(reader, reader.uint32())); - break; - case 22: - message.uri = reader.string(); - break; - case 23: - if (!(message.images && message.images.length)) - message.images = []; - message.images.push($root.google.cloud.retail.v2beta.Image.decode(reader, reader.uint32())); - break; - case 24: - message.audience = $root.google.cloud.retail.v2beta.Audience.decode(reader, reader.uint32()); - break; - case 25: - message.colorInfo = $root.google.cloud.retail.v2beta.ColorInfo.decode(reader, reader.uint32()); - break; - case 26: - if (!(message.sizes && message.sizes.length)) - message.sizes = []; - message.sizes.push(reader.string()); - break; - case 27: - if (!(message.materials && message.materials.length)) - message.materials = []; - message.materials.push(reader.string()); - break; - case 28: - if (!(message.patterns && message.patterns.length)) - message.patterns = []; - message.patterns.push(reader.string()); - break; - case 29: - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push(reader.string()); - break; - case 34: - if (!(message.promotions && message.promotions.length)) - message.promotions = []; - message.promotions.push($root.google.cloud.retail.v2beta.Promotion.decode(reader, reader.uint32())); - break; - case 33: - message.publishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 30: - message.retrievableFields = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 31: - if (!(message.variants && message.variants.length)) - message.variants = []; - message.variants.push($root.google.cloud.retail.v2beta.Product.decode(reader, reader.uint32())); + case 4: + if (!(message.fulfillmentTypes && message.fulfillmentTypes.length)) + message.fulfillmentTypes = []; + message.fulfillmentTypes.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -63180,103 +62185,40 @@ }; /** - * Decodes a Product message from the specified reader or buffer, length delimited. + * Decodes a LocalInventory message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.Product + * @memberof google.cloud.retail.v2beta.LocalInventory * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.Product} Product + * @returns {google.cloud.retail.v2beta.LocalInventory} LocalInventory * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.decodeDelimited = function decodeDelimited(reader) { + LocalInventory.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Product message. + * Verifies a LocalInventory message. * @function verify - * @memberof google.cloud.retail.v2beta.Product + * @memberof google.cloud.retail.v2beta.LocalInventory * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Product.verify = function verify(message) { + LocalInventory.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - properties.expiration = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - } - if (message.ttl != null && message.hasOwnProperty("ttl")) { - if (properties.expiration === 1) - return "expiration: multiple values"; - properties.expiration = 1; - { - var error = $root.google.protobuf.Duration.verify(message.ttl); - if (error) - return "ttl." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.primaryProductId != null && message.hasOwnProperty("primaryProductId")) - if (!$util.isString(message.primaryProductId)) - return "primaryProductId: string expected"; - if (message.collectionMemberIds != null && message.hasOwnProperty("collectionMemberIds")) { - if (!Array.isArray(message.collectionMemberIds)) - return "collectionMemberIds: array expected"; - for (var i = 0; i < message.collectionMemberIds.length; ++i) - if (!$util.isString(message.collectionMemberIds[i])) - return "collectionMemberIds: string[] expected"; - } - if (message.gtin != null && message.hasOwnProperty("gtin")) - if (!$util.isString(message.gtin)) - return "gtin: string expected"; - if (message.categories != null && message.hasOwnProperty("categories")) { - if (!Array.isArray(message.categories)) - return "categories: array expected"; - for (var i = 0; i < message.categories.length; ++i) - if (!$util.isString(message.categories[i])) - return "categories: string[] expected"; - } - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.brands != null && message.hasOwnProperty("brands")) { - if (!Array.isArray(message.brands)) - return "brands: array expected"; - for (var i = 0; i < message.brands.length; ++i) - if (!$util.isString(message.brands[i])) - return "brands: string[] expected"; + if (message.placeId != null && message.hasOwnProperty("placeId")) + if (!$util.isString(message.placeId)) + return "placeId: string expected"; + if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) { + var error = $root.google.cloud.retail.v2beta.PriceInfo.verify(message.priceInfo); + if (error) + return "priceInfo." + error; } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; if (message.attributes != null && message.hasOwnProperty("attributes")) { if (!$util.isObject(message.attributes)) return "attributes: object expected"; @@ -63287,618 +62229,14529 @@ return "attributes." + error; } } - if (message.tags != null && message.hasOwnProperty("tags")) { - if (!Array.isArray(message.tags)) - return "tags: array expected"; - for (var i = 0; i < message.tags.length; ++i) - if (!$util.isString(message.tags[i])) - return "tags: string[] expected"; - } - if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) { - var error = $root.google.cloud.retail.v2beta.PriceInfo.verify(message.priceInfo); - if (error) - return "priceInfo." + error; - } - if (message.rating != null && message.hasOwnProperty("rating")) { - var error = $root.google.cloud.retail.v2beta.Rating.verify(message.rating); - if (error) - return "rating." + error; - } - if (message.availableTime != null && message.hasOwnProperty("availableTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.availableTime); - if (error) - return "availableTime." + error; - } - if (message.availability != null && message.hasOwnProperty("availability")) - switch (message.availability) { - default: - return "availability: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.availableQuantity != null && message.hasOwnProperty("availableQuantity")) { - var error = $root.google.protobuf.Int32Value.verify(message.availableQuantity); - if (error) - return "availableQuantity." + error; - } - if (message.fulfillmentInfo != null && message.hasOwnProperty("fulfillmentInfo")) { - if (!Array.isArray(message.fulfillmentInfo)) - return "fulfillmentInfo: array expected"; - for (var i = 0; i < message.fulfillmentInfo.length; ++i) { - var error = $root.google.cloud.retail.v2beta.FulfillmentInfo.verify(message.fulfillmentInfo[i]); - if (error) - return "fulfillmentInfo." + error; - } - } - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - if (message.images != null && message.hasOwnProperty("images")) { - if (!Array.isArray(message.images)) - return "images: array expected"; - for (var i = 0; i < message.images.length; ++i) { - var error = $root.google.cloud.retail.v2beta.Image.verify(message.images[i]); - if (error) - return "images." + error; - } - } - if (message.audience != null && message.hasOwnProperty("audience")) { - var error = $root.google.cloud.retail.v2beta.Audience.verify(message.audience); - if (error) - return "audience." + error; - } - if (message.colorInfo != null && message.hasOwnProperty("colorInfo")) { - var error = $root.google.cloud.retail.v2beta.ColorInfo.verify(message.colorInfo); - if (error) - return "colorInfo." + error; - } - if (message.sizes != null && message.hasOwnProperty("sizes")) { - if (!Array.isArray(message.sizes)) - return "sizes: array expected"; - for (var i = 0; i < message.sizes.length; ++i) - if (!$util.isString(message.sizes[i])) - return "sizes: string[] expected"; - } - if (message.materials != null && message.hasOwnProperty("materials")) { - if (!Array.isArray(message.materials)) - return "materials: array expected"; - for (var i = 0; i < message.materials.length; ++i) - if (!$util.isString(message.materials[i])) - return "materials: string[] expected"; - } - if (message.patterns != null && message.hasOwnProperty("patterns")) { - if (!Array.isArray(message.patterns)) - return "patterns: array expected"; - for (var i = 0; i < message.patterns.length; ++i) - if (!$util.isString(message.patterns[i])) - return "patterns: string[] expected"; - } - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) - if (!$util.isString(message.conditions[i])) - return "conditions: string[] expected"; - } - if (message.promotions != null && message.hasOwnProperty("promotions")) { - if (!Array.isArray(message.promotions)) - return "promotions: array expected"; - for (var i = 0; i < message.promotions.length; ++i) { - var error = $root.google.cloud.retail.v2beta.Promotion.verify(message.promotions[i]); - if (error) - return "promotions." + error; - } - } - if (message.publishTime != null && message.hasOwnProperty("publishTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.publishTime); - if (error) - return "publishTime." + error; - } - if (message.retrievableFields != null && message.hasOwnProperty("retrievableFields")) { - var error = $root.google.protobuf.FieldMask.verify(message.retrievableFields); - if (error) - return "retrievableFields." + error; - } - if (message.variants != null && message.hasOwnProperty("variants")) { - if (!Array.isArray(message.variants)) - return "variants: array expected"; - for (var i = 0; i < message.variants.length; ++i) { - var error = $root.google.cloud.retail.v2beta.Product.verify(message.variants[i]); - if (error) - return "variants." + error; - } + if (message.fulfillmentTypes != null && message.hasOwnProperty("fulfillmentTypes")) { + if (!Array.isArray(message.fulfillmentTypes)) + return "fulfillmentTypes: array expected"; + for (var i = 0; i < message.fulfillmentTypes.length; ++i) + if (!$util.isString(message.fulfillmentTypes[i])) + return "fulfillmentTypes: string[] expected"; } return null; }; /** - * Creates a Product message from a plain object. Also converts values to their respective internal types. + * Creates a LocalInventory message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.Product + * @memberof google.cloud.retail.v2beta.LocalInventory * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.Product} Product + * @returns {google.cloud.retail.v2beta.LocalInventory} LocalInventory */ - Product.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.Product) + LocalInventory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.LocalInventory) return object; - var message = new $root.google.cloud.retail.v2beta.Product(); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.retail.v2beta.Product.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.ttl != null) { - if (typeof object.ttl !== "object") - throw TypeError(".google.cloud.retail.v2beta.Product.ttl: object expected"); - message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); - } - if (object.name != null) - message.name = String(object.name); - if (object.id != null) - message.id = String(object.id); - switch (object.type) { - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "PRIMARY": - case 1: - message.type = 1; - break; - case "VARIANT": - case 2: - message.type = 2; - break; - case "COLLECTION": - case 3: - message.type = 3; - break; - } - if (object.primaryProductId != null) - message.primaryProductId = String(object.primaryProductId); - if (object.collectionMemberIds) { - if (!Array.isArray(object.collectionMemberIds)) - throw TypeError(".google.cloud.retail.v2beta.Product.collectionMemberIds: array expected"); - message.collectionMemberIds = []; - for (var i = 0; i < object.collectionMemberIds.length; ++i) - message.collectionMemberIds[i] = String(object.collectionMemberIds[i]); - } - if (object.gtin != null) - message.gtin = String(object.gtin); - if (object.categories) { - if (!Array.isArray(object.categories)) - throw TypeError(".google.cloud.retail.v2beta.Product.categories: array expected"); - message.categories = []; - for (var i = 0; i < object.categories.length; ++i) - message.categories[i] = String(object.categories[i]); - } - if (object.title != null) - message.title = String(object.title); - if (object.brands) { - if (!Array.isArray(object.brands)) - throw TypeError(".google.cloud.retail.v2beta.Product.brands: array expected"); - message.brands = []; - for (var i = 0; i < object.brands.length; ++i) - message.brands[i] = String(object.brands[i]); + var message = new $root.google.cloud.retail.v2beta.LocalInventory(); + if (object.placeId != null) + message.placeId = String(object.placeId); + if (object.priceInfo != null) { + if (typeof object.priceInfo !== "object") + throw TypeError(".google.cloud.retail.v2beta.LocalInventory.priceInfo: object expected"); + message.priceInfo = $root.google.cloud.retail.v2beta.PriceInfo.fromObject(object.priceInfo); } - if (object.description != null) - message.description = String(object.description); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); if (object.attributes) { if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.retail.v2beta.Product.attributes: object expected"); + throw TypeError(".google.cloud.retail.v2beta.LocalInventory.attributes: object expected"); message.attributes = {}; for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2beta.Product.attributes: object expected"); + throw TypeError(".google.cloud.retail.v2beta.LocalInventory.attributes: object expected"); message.attributes[keys[i]] = $root.google.cloud.retail.v2beta.CustomAttribute.fromObject(object.attributes[keys[i]]); } } - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.cloud.retail.v2beta.Product.tags: array expected"); - message.tags = []; - for (var i = 0; i < object.tags.length; ++i) - message.tags[i] = String(object.tags[i]); - } - if (object.priceInfo != null) { - if (typeof object.priceInfo !== "object") - throw TypeError(".google.cloud.retail.v2beta.Product.priceInfo: object expected"); - message.priceInfo = $root.google.cloud.retail.v2beta.PriceInfo.fromObject(object.priceInfo); - } - if (object.rating != null) { - if (typeof object.rating !== "object") - throw TypeError(".google.cloud.retail.v2beta.Product.rating: object expected"); - message.rating = $root.google.cloud.retail.v2beta.Rating.fromObject(object.rating); - } - if (object.availableTime != null) { - if (typeof object.availableTime !== "object") - throw TypeError(".google.cloud.retail.v2beta.Product.availableTime: object expected"); - message.availableTime = $root.google.protobuf.Timestamp.fromObject(object.availableTime); - } - switch (object.availability) { - case "AVAILABILITY_UNSPECIFIED": - case 0: - message.availability = 0; - break; - case "IN_STOCK": - case 1: - message.availability = 1; - break; - case "OUT_OF_STOCK": - case 2: - message.availability = 2; - break; - case "PREORDER": - case 3: - message.availability = 3; - break; - case "BACKORDER": - case 4: - message.availability = 4; - break; - } - if (object.availableQuantity != null) { - if (typeof object.availableQuantity !== "object") - throw TypeError(".google.cloud.retail.v2beta.Product.availableQuantity: object expected"); - message.availableQuantity = $root.google.protobuf.Int32Value.fromObject(object.availableQuantity); - } - if (object.fulfillmentInfo) { - if (!Array.isArray(object.fulfillmentInfo)) - throw TypeError(".google.cloud.retail.v2beta.Product.fulfillmentInfo: array expected"); - message.fulfillmentInfo = []; - for (var i = 0; i < object.fulfillmentInfo.length; ++i) { - if (typeof object.fulfillmentInfo[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.Product.fulfillmentInfo: object expected"); - message.fulfillmentInfo[i] = $root.google.cloud.retail.v2beta.FulfillmentInfo.fromObject(object.fulfillmentInfo[i]); - } - } - if (object.uri != null) - message.uri = String(object.uri); - if (object.images) { - if (!Array.isArray(object.images)) - throw TypeError(".google.cloud.retail.v2beta.Product.images: array expected"); - message.images = []; - for (var i = 0; i < object.images.length; ++i) { - if (typeof object.images[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.Product.images: object expected"); - message.images[i] = $root.google.cloud.retail.v2beta.Image.fromObject(object.images[i]); - } - } - if (object.audience != null) { - if (typeof object.audience !== "object") - throw TypeError(".google.cloud.retail.v2beta.Product.audience: object expected"); - message.audience = $root.google.cloud.retail.v2beta.Audience.fromObject(object.audience); - } - if (object.colorInfo != null) { - if (typeof object.colorInfo !== "object") - throw TypeError(".google.cloud.retail.v2beta.Product.colorInfo: object expected"); - message.colorInfo = $root.google.cloud.retail.v2beta.ColorInfo.fromObject(object.colorInfo); - } - if (object.sizes) { - if (!Array.isArray(object.sizes)) - throw TypeError(".google.cloud.retail.v2beta.Product.sizes: array expected"); - message.sizes = []; - for (var i = 0; i < object.sizes.length; ++i) - message.sizes[i] = String(object.sizes[i]); - } - if (object.materials) { - if (!Array.isArray(object.materials)) - throw TypeError(".google.cloud.retail.v2beta.Product.materials: array expected"); - message.materials = []; - for (var i = 0; i < object.materials.length; ++i) - message.materials[i] = String(object.materials[i]); - } - if (object.patterns) { - if (!Array.isArray(object.patterns)) - throw TypeError(".google.cloud.retail.v2beta.Product.patterns: array expected"); - message.patterns = []; - for (var i = 0; i < object.patterns.length; ++i) - message.patterns[i] = String(object.patterns[i]); - } - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.cloud.retail.v2beta.Product.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) - message.conditions[i] = String(object.conditions[i]); - } - if (object.promotions) { - if (!Array.isArray(object.promotions)) - throw TypeError(".google.cloud.retail.v2beta.Product.promotions: array expected"); - message.promotions = []; - for (var i = 0; i < object.promotions.length; ++i) { - if (typeof object.promotions[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.Product.promotions: object expected"); - message.promotions[i] = $root.google.cloud.retail.v2beta.Promotion.fromObject(object.promotions[i]); - } - } - if (object.publishTime != null) { - if (typeof object.publishTime !== "object") - throw TypeError(".google.cloud.retail.v2beta.Product.publishTime: object expected"); - message.publishTime = $root.google.protobuf.Timestamp.fromObject(object.publishTime); - } - if (object.retrievableFields != null) { - if (typeof object.retrievableFields !== "object") - throw TypeError(".google.cloud.retail.v2beta.Product.retrievableFields: object expected"); - message.retrievableFields = $root.google.protobuf.FieldMask.fromObject(object.retrievableFields); - } - if (object.variants) { - if (!Array.isArray(object.variants)) - throw TypeError(".google.cloud.retail.v2beta.Product.variants: array expected"); - message.variants = []; - for (var i = 0; i < object.variants.length; ++i) { - if (typeof object.variants[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.Product.variants: object expected"); - message.variants[i] = $root.google.cloud.retail.v2beta.Product.fromObject(object.variants[i]); - } + if (object.fulfillmentTypes) { + if (!Array.isArray(object.fulfillmentTypes)) + throw TypeError(".google.cloud.retail.v2beta.LocalInventory.fulfillmentTypes: array expected"); + message.fulfillmentTypes = []; + for (var i = 0; i < object.fulfillmentTypes.length; ++i) + message.fulfillmentTypes[i] = String(object.fulfillmentTypes[i]); } return message; }; /** - * Creates a plain object from a Product message. Also converts values to other types if specified. + * Creates a plain object from a LocalInventory message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.Product + * @memberof google.cloud.retail.v2beta.LocalInventory * @static - * @param {google.cloud.retail.v2beta.Product} message Product + * @param {google.cloud.retail.v2beta.LocalInventory} message LocalInventory * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Product.toObject = function toObject(message, options) { + LocalInventory.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.collectionMemberIds = []; - object.categories = []; - object.brands = []; - object.tags = []; - object.fulfillmentInfo = []; - object.images = []; - object.sizes = []; - object.materials = []; - object.patterns = []; - object.conditions = []; - object.variants = []; - object.promotions = []; - } + if (options.arrays || options.defaults) + object.fulfillmentTypes = []; if (options.objects || options.defaults) object.attributes = {}; if (options.defaults) { - object.name = ""; - object.id = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.primaryProductId = ""; - object.gtin = ""; - object.title = ""; - object.description = ""; - object.languageCode = ""; + object.placeId = ""; object.priceInfo = null; - object.rating = null; - object.availableTime = null; - object.availability = options.enums === String ? "AVAILABILITY_UNSPECIFIED" : 0; - object.availableQuantity = null; - object.uri = ""; - object.audience = null; - object.colorInfo = null; - object.retrievableFields = null; - object.publishTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.retail.v2beta.Product.Type[message.type] : message.type; - if (message.primaryProductId != null && message.hasOwnProperty("primaryProductId")) - object.primaryProductId = message.primaryProductId; - if (message.collectionMemberIds && message.collectionMemberIds.length) { - object.collectionMemberIds = []; - for (var j = 0; j < message.collectionMemberIds.length; ++j) - object.collectionMemberIds[j] = message.collectionMemberIds[j]; - } - if (message.gtin != null && message.hasOwnProperty("gtin")) - object.gtin = message.gtin; - if (message.categories && message.categories.length) { - object.categories = []; - for (var j = 0; j < message.categories.length; ++j) - object.categories[j] = message.categories[j]; } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.brands && message.brands.length) { - object.brands = []; - for (var j = 0; j < message.brands.length; ++j) - object.brands[j] = message.brands[j]; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; + if (message.placeId != null && message.hasOwnProperty("placeId")) + object.placeId = message.placeId; + if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) + object.priceInfo = $root.google.cloud.retail.v2beta.PriceInfo.toObject(message.priceInfo, options); var keys2; if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { object.attributes = {}; for (var j = 0; j < keys2.length; ++j) object.attributes[keys2[j]] = $root.google.cloud.retail.v2beta.CustomAttribute.toObject(message.attributes[keys2[j]], options); } - if (message.tags && message.tags.length) { - object.tags = []; - for (var j = 0; j < message.tags.length; ++j) - object.tags[j] = message.tags[j]; - } - if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) - object.priceInfo = $root.google.cloud.retail.v2beta.PriceInfo.toObject(message.priceInfo, options); - if (message.rating != null && message.hasOwnProperty("rating")) - object.rating = $root.google.cloud.retail.v2beta.Rating.toObject(message.rating, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (options.oneofs) - object.expiration = "expireTime"; + if (message.fulfillmentTypes && message.fulfillmentTypes.length) { + object.fulfillmentTypes = []; + for (var j = 0; j < message.fulfillmentTypes.length; ++j) + object.fulfillmentTypes[j] = message.fulfillmentTypes[j]; } - if (message.ttl != null && message.hasOwnProperty("ttl")) { - object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); - if (options.oneofs) - object.expiration = "ttl"; - } - if (message.availableTime != null && message.hasOwnProperty("availableTime")) - object.availableTime = $root.google.protobuf.Timestamp.toObject(message.availableTime, options); - if (message.availability != null && message.hasOwnProperty("availability")) - object.availability = options.enums === String ? $root.google.cloud.retail.v2beta.Product.Availability[message.availability] : message.availability; - if (message.availableQuantity != null && message.hasOwnProperty("availableQuantity")) - object.availableQuantity = $root.google.protobuf.Int32Value.toObject(message.availableQuantity, options); - if (message.fulfillmentInfo && message.fulfillmentInfo.length) { - object.fulfillmentInfo = []; - for (var j = 0; j < message.fulfillmentInfo.length; ++j) - object.fulfillmentInfo[j] = $root.google.cloud.retail.v2beta.FulfillmentInfo.toObject(message.fulfillmentInfo[j], options); - } - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - if (message.images && message.images.length) { - object.images = []; - for (var j = 0; j < message.images.length; ++j) - object.images[j] = $root.google.cloud.retail.v2beta.Image.toObject(message.images[j], options); - } - if (message.audience != null && message.hasOwnProperty("audience")) - object.audience = $root.google.cloud.retail.v2beta.Audience.toObject(message.audience, options); - if (message.colorInfo != null && message.hasOwnProperty("colorInfo")) - object.colorInfo = $root.google.cloud.retail.v2beta.ColorInfo.toObject(message.colorInfo, options); - if (message.sizes && message.sizes.length) { - object.sizes = []; - for (var j = 0; j < message.sizes.length; ++j) - object.sizes[j] = message.sizes[j]; - } - if (message.materials && message.materials.length) { - object.materials = []; - for (var j = 0; j < message.materials.length; ++j) - object.materials[j] = message.materials[j]; - } - if (message.patterns && message.patterns.length) { - object.patterns = []; - for (var j = 0; j < message.patterns.length; ++j) - object.patterns[j] = message.patterns[j]; + return object; + }; + + /** + * Converts this LocalInventory to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.LocalInventory + * @instance + * @returns {Object.} JSON object + */ + LocalInventory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LocalInventory; + })(); + + v2beta.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.cloud.retail.v2beta + * @interface IGcsSource + * @property {Array.|null} [inputUris] GcsSource inputUris + * @property {string|null} [dataSchema] GcsSource dataSchema + */ + + /** + * Constructs a new GcsSource. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.cloud.retail.v2beta.IGcsSource=} [properties] Properties to set + */ + function GcsSource(properties) { + this.inputUris = []; + 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]]; + } + + /** + * GcsSource inputUris. + * @member {Array.} inputUris + * @memberof google.cloud.retail.v2beta.GcsSource + * @instance + */ + GcsSource.prototype.inputUris = $util.emptyArray; + + /** + * GcsSource dataSchema. + * @member {string} dataSchema + * @memberof google.cloud.retail.v2beta.GcsSource + * @instance + */ + GcsSource.prototype.dataSchema = ""; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.GcsSource + * @static + * @param {google.cloud.retail.v2beta.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.retail.v2beta.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.GcsSource + * @static + * @param {google.cloud.retail.v2beta.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUris != null && message.inputUris.length) + for (var i = 0; i < message.inputUris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUris[i]); + if (message.dataSchema != null && Object.hasOwnProperty.call(message, "dataSchema")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataSchema); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.GcsSource + * @static + * @param {google.cloud.retail.v2beta.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.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.v2beta.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.inputUris && message.inputUris.length)) + message.inputUris = []; + message.inputUris.push(reader.string()); + break; + case 2: + message.dataSchema = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = message.conditions[j]; + return message; + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsSource message. + * @function verify + * @memberof google.cloud.retail.v2beta.GcsSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUris != null && message.hasOwnProperty("inputUris")) { + if (!Array.isArray(message.inputUris)) + return "inputUris: array expected"; + for (var i = 0; i < message.inputUris.length; ++i) + if (!$util.isString(message.inputUris[i])) + return "inputUris: string[] expected"; } - if (message.retrievableFields != null && message.hasOwnProperty("retrievableFields")) - object.retrievableFields = $root.google.protobuf.FieldMask.toObject(message.retrievableFields, options); - if (message.variants && message.variants.length) { - object.variants = []; - for (var j = 0; j < message.variants.length; ++j) - object.variants[j] = $root.google.cloud.retail.v2beta.Product.toObject(message.variants[j], options); + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + if (!$util.isString(message.dataSchema)) + return "dataSchema: string expected"; + return null; + }; + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.GcsSource) + return object; + var message = new $root.google.cloud.retail.v2beta.GcsSource(); + if (object.inputUris) { + if (!Array.isArray(object.inputUris)) + throw TypeError(".google.cloud.retail.v2beta.GcsSource.inputUris: array expected"); + message.inputUris = []; + for (var i = 0; i < object.inputUris.length; ++i) + message.inputUris[i] = String(object.inputUris[i]); } - if (message.publishTime != null && message.hasOwnProperty("publishTime")) - object.publishTime = $root.google.protobuf.Timestamp.toObject(message.publishTime, options); - if (message.promotions && message.promotions.length) { - object.promotions = []; - for (var j = 0; j < message.promotions.length; ++j) - object.promotions[j] = $root.google.cloud.retail.v2beta.Promotion.toObject(message.promotions[j], options); + if (object.dataSchema != null) + message.dataSchema = String(object.dataSchema); + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.GcsSource + * @static + * @param {google.cloud.retail.v2beta.GcsSource} message GcsSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inputUris = []; + if (options.defaults) + object.dataSchema = ""; + if (message.inputUris && message.inputUris.length) { + object.inputUris = []; + for (var j = 0; j < message.inputUris.length; ++j) + object.inputUris[j] = message.inputUris[j]; } + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + object.dataSchema = message.dataSchema; return object; }; - /** - * Converts this Product to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.Product - * @instance - * @returns {Object.} JSON object - */ - Product.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.GcsSource + * @instance + * @returns {Object.} JSON object + */ + GcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsSource; + })(); + + v2beta.BigQuerySource = (function() { + + /** + * Properties of a BigQuerySource. + * @memberof google.cloud.retail.v2beta + * @interface IBigQuerySource + * @property {google.type.IDate|null} [partitionDate] BigQuerySource partitionDate + * @property {string|null} [projectId] BigQuerySource projectId + * @property {string|null} [datasetId] BigQuerySource datasetId + * @property {string|null} [tableId] BigQuerySource tableId + * @property {string|null} [gcsStagingDir] BigQuerySource gcsStagingDir + * @property {string|null} [dataSchema] BigQuerySource dataSchema + */ + + /** + * Constructs a new BigQuerySource. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a BigQuerySource. + * @implements IBigQuerySource + * @constructor + * @param {google.cloud.retail.v2beta.IBigQuerySource=} [properties] Properties to set + */ + function BigQuerySource(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]]; + } + + /** + * BigQuerySource partitionDate. + * @member {google.type.IDate|null|undefined} partitionDate + * @memberof google.cloud.retail.v2beta.BigQuerySource + * @instance + */ + BigQuerySource.prototype.partitionDate = null; + + /** + * BigQuerySource projectId. + * @member {string} projectId + * @memberof google.cloud.retail.v2beta.BigQuerySource + * @instance + */ + BigQuerySource.prototype.projectId = ""; + + /** + * BigQuerySource datasetId. + * @member {string} datasetId + * @memberof google.cloud.retail.v2beta.BigQuerySource + * @instance + */ + BigQuerySource.prototype.datasetId = ""; + + /** + * BigQuerySource tableId. + * @member {string} tableId + * @memberof google.cloud.retail.v2beta.BigQuerySource + * @instance + */ + BigQuerySource.prototype.tableId = ""; + + /** + * BigQuerySource gcsStagingDir. + * @member {string} gcsStagingDir + * @memberof google.cloud.retail.v2beta.BigQuerySource + * @instance + */ + BigQuerySource.prototype.gcsStagingDir = ""; + + /** + * BigQuerySource dataSchema. + * @member {string} dataSchema + * @memberof google.cloud.retail.v2beta.BigQuerySource + * @instance + */ + BigQuerySource.prototype.dataSchema = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BigQuerySource partition. + * @member {"partitionDate"|undefined} partition + * @memberof google.cloud.retail.v2beta.BigQuerySource + * @instance + */ + Object.defineProperty(BigQuerySource.prototype, "partition", { + get: $util.oneOfGetter($oneOfFields = ["partitionDate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BigQuerySource instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.BigQuerySource + * @static + * @param {google.cloud.retail.v2beta.IBigQuerySource=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.BigQuerySource} BigQuerySource instance + */ + BigQuerySource.create = function create(properties) { + return new BigQuerySource(properties); + }; + + /** + * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.retail.v2beta.BigQuerySource.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.BigQuerySource + * @static + * @param {google.cloud.retail.v2beta.IBigQuerySource} message BigQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQuerySource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableId); + if (message.gcsStagingDir != null && Object.hasOwnProperty.call(message, "gcsStagingDir")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsStagingDir); + if (message.dataSchema != null && Object.hasOwnProperty.call(message, "dataSchema")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.dataSchema); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.projectId); + if (message.partitionDate != null && Object.hasOwnProperty.call(message, "partitionDate")) + $root.google.type.Date.encode(message.partitionDate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.BigQuerySource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.BigQuerySource + * @static + * @param {google.cloud.retail.v2beta.IBigQuerySource} message BigQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQuerySource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQuerySource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.BigQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.BigQuerySource} BigQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQuerySource.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.v2beta.BigQuerySource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 6: + message.partitionDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + case 5: + message.projectId = reader.string(); + break; + case 1: + message.datasetId = reader.string(); + break; + case 2: + message.tableId = reader.string(); + break; + case 3: + message.gcsStagingDir = reader.string(); + break; + case 4: + message.dataSchema = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.BigQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.BigQuerySource} BigQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQuerySource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQuerySource message. + * @function verify + * @memberof google.cloud.retail.v2beta.BigQuerySource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQuerySource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.partitionDate != null && message.hasOwnProperty("partitionDate")) { + properties.partition = 1; + { + var error = $root.google.type.Date.verify(message.partitionDate); + if (error) + return "partitionDate." + error; + } + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && message.hasOwnProperty("tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) + if (!$util.isString(message.gcsStagingDir)) + return "gcsStagingDir: string expected"; + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + if (!$util.isString(message.dataSchema)) + return "dataSchema: string expected"; + return null; + }; + + /** + * Creates a BigQuerySource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.BigQuerySource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.BigQuerySource} BigQuerySource + */ + BigQuerySource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.BigQuerySource) + return object; + var message = new $root.google.cloud.retail.v2beta.BigQuerySource(); + if (object.partitionDate != null) { + if (typeof object.partitionDate !== "object") + throw TypeError(".google.cloud.retail.v2beta.BigQuerySource.partitionDate: object expected"); + message.partitionDate = $root.google.type.Date.fromObject(object.partitionDate); + } + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.gcsStagingDir != null) + message.gcsStagingDir = String(object.gcsStagingDir); + if (object.dataSchema != null) + message.dataSchema = String(object.dataSchema); + return message; + }; + + /** + * Creates a plain object from a BigQuerySource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.BigQuerySource + * @static + * @param {google.cloud.retail.v2beta.BigQuerySource} message BigQuerySource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQuerySource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.datasetId = ""; + object.tableId = ""; + object.gcsStagingDir = ""; + object.dataSchema = ""; + object.projectId = ""; + } + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && message.hasOwnProperty("tableId")) + object.tableId = message.tableId; + if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) + object.gcsStagingDir = message.gcsStagingDir; + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + object.dataSchema = message.dataSchema; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.partitionDate != null && message.hasOwnProperty("partitionDate")) { + object.partitionDate = $root.google.type.Date.toObject(message.partitionDate, options); + if (options.oneofs) + object.partition = "partitionDate"; + } + return object; + }; + + /** + * Converts this BigQuerySource to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.BigQuerySource + * @instance + * @returns {Object.} JSON object + */ + BigQuerySource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BigQuerySource; + })(); + + v2beta.ProductInlineSource = (function() { + + /** + * Properties of a ProductInlineSource. + * @memberof google.cloud.retail.v2beta + * @interface IProductInlineSource + * @property {Array.|null} [products] ProductInlineSource products + */ + + /** + * Constructs a new ProductInlineSource. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a ProductInlineSource. + * @implements IProductInlineSource + * @constructor + * @param {google.cloud.retail.v2beta.IProductInlineSource=} [properties] Properties to set + */ + function ProductInlineSource(properties) { + this.products = []; + 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]]; + } + + /** + * ProductInlineSource products. + * @member {Array.} products + * @memberof google.cloud.retail.v2beta.ProductInlineSource + * @instance + */ + ProductInlineSource.prototype.products = $util.emptyArray; + + /** + * Creates a new ProductInlineSource instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.ProductInlineSource + * @static + * @param {google.cloud.retail.v2beta.IProductInlineSource=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ProductInlineSource} ProductInlineSource instance + */ + ProductInlineSource.create = function create(properties) { + return new ProductInlineSource(properties); + }; + + /** + * Encodes the specified ProductInlineSource message. Does not implicitly {@link google.cloud.retail.v2beta.ProductInlineSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ProductInlineSource + * @static + * @param {google.cloud.retail.v2beta.IProductInlineSource} message ProductInlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductInlineSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.products != null && message.products.length) + for (var i = 0; i < message.products.length; ++i) + $root.google.cloud.retail.v2beta.Product.encode(message.products[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProductInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ProductInlineSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ProductInlineSource + * @static + * @param {google.cloud.retail.v2beta.IProductInlineSource} message ProductInlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductInlineSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProductInlineSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ProductInlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ProductInlineSource} ProductInlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductInlineSource.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.v2beta.ProductInlineSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.products && message.products.length)) + message.products = []; + message.products.push($root.google.cloud.retail.v2beta.Product.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductInlineSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ProductInlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ProductInlineSource} ProductInlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductInlineSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductInlineSource message. + * @function verify + * @memberof google.cloud.retail.v2beta.ProductInlineSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductInlineSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.products != null && message.hasOwnProperty("products")) { + if (!Array.isArray(message.products)) + return "products: array expected"; + for (var i = 0; i < message.products.length; ++i) { + var error = $root.google.cloud.retail.v2beta.Product.verify(message.products[i]); + if (error) + return "products." + error; + } + } + return null; + }; + + /** + * Creates a ProductInlineSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ProductInlineSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ProductInlineSource} ProductInlineSource + */ + ProductInlineSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ProductInlineSource) + return object; + var message = new $root.google.cloud.retail.v2beta.ProductInlineSource(); + if (object.products) { + if (!Array.isArray(object.products)) + throw TypeError(".google.cloud.retail.v2beta.ProductInlineSource.products: array expected"); + message.products = []; + for (var i = 0; i < object.products.length; ++i) { + if (typeof object.products[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.ProductInlineSource.products: object expected"); + message.products[i] = $root.google.cloud.retail.v2beta.Product.fromObject(object.products[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ProductInlineSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ProductInlineSource + * @static + * @param {google.cloud.retail.v2beta.ProductInlineSource} message ProductInlineSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductInlineSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.products = []; + if (message.products && message.products.length) { + object.products = []; + for (var j = 0; j < message.products.length; ++j) + object.products[j] = $root.google.cloud.retail.v2beta.Product.toObject(message.products[j], options); + } + return object; + }; + + /** + * Converts this ProductInlineSource to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ProductInlineSource + * @instance + * @returns {Object.} JSON object + */ + ProductInlineSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProductInlineSource; + })(); + + v2beta.UserEventInlineSource = (function() { + + /** + * Properties of a UserEventInlineSource. + * @memberof google.cloud.retail.v2beta + * @interface IUserEventInlineSource + * @property {Array.|null} [userEvents] UserEventInlineSource userEvents + */ + + /** + * Constructs a new UserEventInlineSource. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a UserEventInlineSource. + * @implements IUserEventInlineSource + * @constructor + * @param {google.cloud.retail.v2beta.IUserEventInlineSource=} [properties] Properties to set + */ + function UserEventInlineSource(properties) { + this.userEvents = []; + 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]]; + } + + /** + * UserEventInlineSource userEvents. + * @member {Array.} userEvents + * @memberof google.cloud.retail.v2beta.UserEventInlineSource + * @instance + */ + UserEventInlineSource.prototype.userEvents = $util.emptyArray; + + /** + * Creates a new UserEventInlineSource instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.UserEventInlineSource + * @static + * @param {google.cloud.retail.v2beta.IUserEventInlineSource=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.UserEventInlineSource} UserEventInlineSource instance + */ + UserEventInlineSource.create = function create(properties) { + return new UserEventInlineSource(properties); + }; + + /** + * Encodes the specified UserEventInlineSource message. Does not implicitly {@link google.cloud.retail.v2beta.UserEventInlineSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.UserEventInlineSource + * @static + * @param {google.cloud.retail.v2beta.IUserEventInlineSource} message UserEventInlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserEventInlineSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userEvents != null && message.userEvents.length) + for (var i = 0; i < message.userEvents.length; ++i) + $root.google.cloud.retail.v2beta.UserEvent.encode(message.userEvents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserEventInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserEventInlineSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.UserEventInlineSource + * @static + * @param {google.cloud.retail.v2beta.IUserEventInlineSource} message UserEventInlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserEventInlineSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserEventInlineSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.UserEventInlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.UserEventInlineSource} UserEventInlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserEventInlineSource.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.v2beta.UserEventInlineSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.userEvents && message.userEvents.length)) + message.userEvents = []; + message.userEvents.push($root.google.cloud.retail.v2beta.UserEvent.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserEventInlineSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.UserEventInlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.UserEventInlineSource} UserEventInlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserEventInlineSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserEventInlineSource message. + * @function verify + * @memberof google.cloud.retail.v2beta.UserEventInlineSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserEventInlineSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userEvents != null && message.hasOwnProperty("userEvents")) { + if (!Array.isArray(message.userEvents)) + return "userEvents: array expected"; + for (var i = 0; i < message.userEvents.length; ++i) { + var error = $root.google.cloud.retail.v2beta.UserEvent.verify(message.userEvents[i]); + if (error) + return "userEvents." + error; + } + } + return null; + }; + + /** + * Creates a UserEventInlineSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.UserEventInlineSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.UserEventInlineSource} UserEventInlineSource + */ + UserEventInlineSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.UserEventInlineSource) + return object; + var message = new $root.google.cloud.retail.v2beta.UserEventInlineSource(); + if (object.userEvents) { + if (!Array.isArray(object.userEvents)) + throw TypeError(".google.cloud.retail.v2beta.UserEventInlineSource.userEvents: array expected"); + message.userEvents = []; + for (var i = 0; i < object.userEvents.length; ++i) { + if (typeof object.userEvents[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.UserEventInlineSource.userEvents: object expected"); + message.userEvents[i] = $root.google.cloud.retail.v2beta.UserEvent.fromObject(object.userEvents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a UserEventInlineSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.UserEventInlineSource + * @static + * @param {google.cloud.retail.v2beta.UserEventInlineSource} message UserEventInlineSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserEventInlineSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.userEvents = []; + if (message.userEvents && message.userEvents.length) { + object.userEvents = []; + for (var j = 0; j < message.userEvents.length; ++j) + object.userEvents[j] = $root.google.cloud.retail.v2beta.UserEvent.toObject(message.userEvents[j], options); + } + return object; + }; + + /** + * Converts this UserEventInlineSource to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.UserEventInlineSource + * @instance + * @returns {Object.} JSON object + */ + UserEventInlineSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UserEventInlineSource; + })(); + + v2beta.ImportErrorsConfig = (function() { + + /** + * Properties of an ImportErrorsConfig. + * @memberof google.cloud.retail.v2beta + * @interface IImportErrorsConfig + * @property {string|null} [gcsPrefix] ImportErrorsConfig gcsPrefix + */ + + /** + * Constructs a new ImportErrorsConfig. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents an ImportErrorsConfig. + * @implements IImportErrorsConfig + * @constructor + * @param {google.cloud.retail.v2beta.IImportErrorsConfig=} [properties] Properties to set + */ + function ImportErrorsConfig(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]]; + } + + /** + * ImportErrorsConfig gcsPrefix. + * @member {string|null|undefined} gcsPrefix + * @memberof google.cloud.retail.v2beta.ImportErrorsConfig + * @instance + */ + ImportErrorsConfig.prototype.gcsPrefix = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportErrorsConfig destination. + * @member {"gcsPrefix"|undefined} destination + * @memberof google.cloud.retail.v2beta.ImportErrorsConfig + * @instance + */ + Object.defineProperty(ImportErrorsConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsPrefix"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportErrorsConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.ImportErrorsConfig + * @static + * @param {google.cloud.retail.v2beta.IImportErrorsConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ImportErrorsConfig} ImportErrorsConfig instance + */ + ImportErrorsConfig.create = function create(properties) { + return new ImportErrorsConfig(properties); + }; + + /** + * Encodes the specified ImportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ImportErrorsConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ImportErrorsConfig + * @static + * @param {google.cloud.retail.v2beta.IImportErrorsConfig} message ImportErrorsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportErrorsConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsPrefix); + return writer; + }; + + /** + * Encodes the specified ImportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportErrorsConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ImportErrorsConfig + * @static + * @param {google.cloud.retail.v2beta.IImportErrorsConfig} message ImportErrorsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportErrorsConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportErrorsConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ImportErrorsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ImportErrorsConfig} ImportErrorsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportErrorsConfig.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.v2beta.ImportErrorsConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsPrefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportErrorsConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ImportErrorsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ImportErrorsConfig} ImportErrorsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportErrorsConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportErrorsConfig message. + * @function verify + * @memberof google.cloud.retail.v2beta.ImportErrorsConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportErrorsConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + properties.destination = 1; + if (!$util.isString(message.gcsPrefix)) + return "gcsPrefix: string expected"; + } + return null; + }; + + /** + * Creates an ImportErrorsConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ImportErrorsConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ImportErrorsConfig} ImportErrorsConfig + */ + ImportErrorsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ImportErrorsConfig) + return object; + var message = new $root.google.cloud.retail.v2beta.ImportErrorsConfig(); + if (object.gcsPrefix != null) + message.gcsPrefix = String(object.gcsPrefix); + return message; + }; + + /** + * Creates a plain object from an ImportErrorsConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ImportErrorsConfig + * @static + * @param {google.cloud.retail.v2beta.ImportErrorsConfig} message ImportErrorsConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportErrorsConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + object.gcsPrefix = message.gcsPrefix; + if (options.oneofs) + object.destination = "gcsPrefix"; + } + return object; + }; + + /** + * Converts this ImportErrorsConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ImportErrorsConfig + * @instance + * @returns {Object.} JSON object + */ + ImportErrorsConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportErrorsConfig; + })(); + + v2beta.ImportProductsRequest = (function() { + + /** + * Properties of an ImportProductsRequest. + * @memberof google.cloud.retail.v2beta + * @interface IImportProductsRequest + * @property {string|null} [parent] ImportProductsRequest parent + * @property {string|null} [requestId] ImportProductsRequest requestId + * @property {google.cloud.retail.v2beta.IProductInputConfig|null} [inputConfig] ImportProductsRequest inputConfig + * @property {google.cloud.retail.v2beta.IImportErrorsConfig|null} [errorsConfig] ImportProductsRequest errorsConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] ImportProductsRequest updateMask + * @property {google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode|null} [reconciliationMode] ImportProductsRequest reconciliationMode + * @property {string|null} [notificationPubsubTopic] ImportProductsRequest notificationPubsubTopic + */ + + /** + * Constructs a new ImportProductsRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents an ImportProductsRequest. + * @implements IImportProductsRequest + * @constructor + * @param {google.cloud.retail.v2beta.IImportProductsRequest=} [properties] Properties to set + */ + function ImportProductsRequest(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]]; + } + + /** + * ImportProductsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2beta.ImportProductsRequest + * @instance + */ + ImportProductsRequest.prototype.parent = ""; + + /** + * ImportProductsRequest requestId. + * @member {string} requestId + * @memberof google.cloud.retail.v2beta.ImportProductsRequest + * @instance + */ + ImportProductsRequest.prototype.requestId = ""; + + /** + * ImportProductsRequest inputConfig. + * @member {google.cloud.retail.v2beta.IProductInputConfig|null|undefined} inputConfig + * @memberof google.cloud.retail.v2beta.ImportProductsRequest + * @instance + */ + ImportProductsRequest.prototype.inputConfig = null; + + /** + * ImportProductsRequest errorsConfig. + * @member {google.cloud.retail.v2beta.IImportErrorsConfig|null|undefined} errorsConfig + * @memberof google.cloud.retail.v2beta.ImportProductsRequest + * @instance + */ + ImportProductsRequest.prototype.errorsConfig = null; + + /** + * ImportProductsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2beta.ImportProductsRequest + * @instance + */ + ImportProductsRequest.prototype.updateMask = null; + + /** + * ImportProductsRequest reconciliationMode. + * @member {google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode} reconciliationMode + * @memberof google.cloud.retail.v2beta.ImportProductsRequest + * @instance + */ + ImportProductsRequest.prototype.reconciliationMode = 0; + + /** + * ImportProductsRequest notificationPubsubTopic. + * @member {string} notificationPubsubTopic + * @memberof google.cloud.retail.v2beta.ImportProductsRequest + * @instance + */ + ImportProductsRequest.prototype.notificationPubsubTopic = ""; + + /** + * Creates a new ImportProductsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.ImportProductsRequest + * @static + * @param {google.cloud.retail.v2beta.IImportProductsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ImportProductsRequest} ImportProductsRequest instance + */ + ImportProductsRequest.create = function create(properties) { + return new ImportProductsRequest(properties); + }; + + /** + * Encodes the specified ImportProductsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ImportProductsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ImportProductsRequest + * @static + * @param {google.cloud.retail.v2beta.IImportProductsRequest} message ImportProductsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.retail.v2beta.ProductInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) + $root.google.cloud.retail.v2beta.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reconciliationMode != null && Object.hasOwnProperty.call(message, "reconciliationMode")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.reconciliationMode); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.requestId); + if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.notificationPubsubTopic); + return writer; + }; + + /** + * Encodes the specified ImportProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportProductsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ImportProductsRequest + * @static + * @param {google.cloud.retail.v2beta.IImportProductsRequest} message ImportProductsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportProductsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ImportProductsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ImportProductsRequest} ImportProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductsRequest.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.v2beta.ImportProductsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 6: + message.requestId = reader.string(); + break; + case 2: + message.inputConfig = $root.google.cloud.retail.v2beta.ProductInputConfig.decode(reader, reader.uint32()); + break; + case 3: + message.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.decode(reader, reader.uint32()); + break; + case 4: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 5: + message.reconciliationMode = reader.int32(); + break; + case 7: + message.notificationPubsubTopic = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportProductsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ImportProductsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ImportProductsRequest} ImportProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportProductsRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.ImportProductsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportProductsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.retail.v2beta.ProductInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { + var error = $root.google.cloud.retail.v2beta.ImportErrorsConfig.verify(message.errorsConfig); + if (error) + return "errorsConfig." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) + switch (message.reconciliationMode) { + default: + return "reconciliationMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + if (!$util.isString(message.notificationPubsubTopic)) + return "notificationPubsubTopic: string expected"; + return null; + }; + + /** + * Creates an ImportProductsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ImportProductsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ImportProductsRequest} ImportProductsRequest + */ + ImportProductsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ImportProductsRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.ImportProductsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.ImportProductsRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.retail.v2beta.ProductInputConfig.fromObject(object.inputConfig); + } + if (object.errorsConfig != null) { + if (typeof object.errorsConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.ImportProductsRequest.errorsConfig: object expected"); + message.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.fromObject(object.errorsConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2beta.ImportProductsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + switch (object.reconciliationMode) { + case "RECONCILIATION_MODE_UNSPECIFIED": + case 0: + message.reconciliationMode = 0; + break; + case "INCREMENTAL": + case 1: + message.reconciliationMode = 1; + break; + case "FULL": + case 2: + message.reconciliationMode = 2; + break; + } + if (object.notificationPubsubTopic != null) + message.notificationPubsubTopic = String(object.notificationPubsubTopic); + return message; + }; + + /** + * Creates a plain object from an ImportProductsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ImportProductsRequest + * @static + * @param {google.cloud.retail.v2beta.ImportProductsRequest} message ImportProductsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportProductsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.inputConfig = null; + object.errorsConfig = null; + object.updateMask = null; + object.reconciliationMode = options.enums === String ? "RECONCILIATION_MODE_UNSPECIFIED" : 0; + object.requestId = ""; + object.notificationPubsubTopic = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.retail.v2beta.ProductInputConfig.toObject(message.inputConfig, options); + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) + object.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.toObject(message.errorsConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) + object.reconciliationMode = options.enums === String ? $root.google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode[message.reconciliationMode] : message.reconciliationMode; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + object.notificationPubsubTopic = message.notificationPubsubTopic; + return object; + }; + + /** + * Converts this ImportProductsRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ImportProductsRequest + * @instance + * @returns {Object.} JSON object + */ + ImportProductsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ReconciliationMode enum. + * @name google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode + * @enum {number} + * @property {number} RECONCILIATION_MODE_UNSPECIFIED=0 RECONCILIATION_MODE_UNSPECIFIED value + * @property {number} INCREMENTAL=1 INCREMENTAL value + * @property {number} FULL=2 FULL value + */ + ImportProductsRequest.ReconciliationMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RECONCILIATION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCREMENTAL"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + return ImportProductsRequest; + })(); + + v2beta.ImportUserEventsRequest = (function() { + + /** + * Properties of an ImportUserEventsRequest. + * @memberof google.cloud.retail.v2beta + * @interface IImportUserEventsRequest + * @property {string|null} [parent] ImportUserEventsRequest parent + * @property {google.cloud.retail.v2beta.IUserEventInputConfig|null} [inputConfig] ImportUserEventsRequest inputConfig + * @property {google.cloud.retail.v2beta.IImportErrorsConfig|null} [errorsConfig] ImportUserEventsRequest errorsConfig + */ + + /** + * Constructs a new ImportUserEventsRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents an ImportUserEventsRequest. + * @implements IImportUserEventsRequest + * @constructor + * @param {google.cloud.retail.v2beta.IImportUserEventsRequest=} [properties] Properties to set + */ + function ImportUserEventsRequest(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]]; + } + + /** + * ImportUserEventsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest + * @instance + */ + ImportUserEventsRequest.prototype.parent = ""; + + /** + * ImportUserEventsRequest inputConfig. + * @member {google.cloud.retail.v2beta.IUserEventInputConfig|null|undefined} inputConfig + * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest + * @instance + */ + ImportUserEventsRequest.prototype.inputConfig = null; + + /** + * ImportUserEventsRequest errorsConfig. + * @member {google.cloud.retail.v2beta.IImportErrorsConfig|null|undefined} errorsConfig + * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest + * @instance + */ + ImportUserEventsRequest.prototype.errorsConfig = null; + + /** + * Creates a new ImportUserEventsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest + * @static + * @param {google.cloud.retail.v2beta.IImportUserEventsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ImportUserEventsRequest} ImportUserEventsRequest instance + */ + ImportUserEventsRequest.create = function create(properties) { + return new ImportUserEventsRequest(properties); + }; + + /** + * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ImportUserEventsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest + * @static + * @param {google.cloud.retail.v2beta.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportUserEventsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.retail.v2beta.UserEventInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) + $root.google.cloud.retail.v2beta.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportUserEventsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest + * @static + * @param {google.cloud.retail.v2beta.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportUserEventsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ImportUserEventsRequest} ImportUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportUserEventsRequest.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.v2beta.ImportUserEventsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.inputConfig = $root.google.cloud.retail.v2beta.UserEventInputConfig.decode(reader, reader.uint32()); + break; + case 3: + message.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ImportUserEventsRequest} ImportUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportUserEventsRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportUserEventsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.retail.v2beta.UserEventInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { + var error = $root.google.cloud.retail.v2beta.ImportErrorsConfig.verify(message.errorsConfig); + if (error) + return "errorsConfig." + error; + } + return null; + }; + + /** + * Creates an ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ImportUserEventsRequest} ImportUserEventsRequest + */ + ImportUserEventsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ImportUserEventsRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.ImportUserEventsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.ImportUserEventsRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.retail.v2beta.UserEventInputConfig.fromObject(object.inputConfig); + } + if (object.errorsConfig != null) { + if (typeof object.errorsConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.ImportUserEventsRequest.errorsConfig: object expected"); + message.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.fromObject(object.errorsConfig); + } + return message; + }; + + /** + * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest + * @static + * @param {google.cloud.retail.v2beta.ImportUserEventsRequest} message ImportUserEventsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportUserEventsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.inputConfig = null; + object.errorsConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.retail.v2beta.UserEventInputConfig.toObject(message.inputConfig, options); + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) + object.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.toObject(message.errorsConfig, options); + return object; + }; + + /** + * Converts this ImportUserEventsRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ImportUserEventsRequest + * @instance + * @returns {Object.} JSON object + */ + ImportUserEventsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportUserEventsRequest; + })(); + + v2beta.ImportCompletionDataRequest = (function() { + + /** + * Properties of an ImportCompletionDataRequest. + * @memberof google.cloud.retail.v2beta + * @interface IImportCompletionDataRequest + * @property {string|null} [parent] ImportCompletionDataRequest parent + * @property {google.cloud.retail.v2beta.ICompletionDataInputConfig|null} [inputConfig] ImportCompletionDataRequest inputConfig + * @property {string|null} [notificationPubsubTopic] ImportCompletionDataRequest notificationPubsubTopic + */ + + /** + * Constructs a new ImportCompletionDataRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents an ImportCompletionDataRequest. + * @implements IImportCompletionDataRequest + * @constructor + * @param {google.cloud.retail.v2beta.IImportCompletionDataRequest=} [properties] Properties to set + */ + function ImportCompletionDataRequest(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]]; + } + + /** + * ImportCompletionDataRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest + * @instance + */ + ImportCompletionDataRequest.prototype.parent = ""; + + /** + * ImportCompletionDataRequest inputConfig. + * @member {google.cloud.retail.v2beta.ICompletionDataInputConfig|null|undefined} inputConfig + * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest + * @instance + */ + ImportCompletionDataRequest.prototype.inputConfig = null; + + /** + * ImportCompletionDataRequest notificationPubsubTopic. + * @member {string} notificationPubsubTopic + * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest + * @instance + */ + ImportCompletionDataRequest.prototype.notificationPubsubTopic = ""; + + /** + * Creates a new ImportCompletionDataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest + * @static + * @param {google.cloud.retail.v2beta.IImportCompletionDataRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ImportCompletionDataRequest} ImportCompletionDataRequest instance + */ + ImportCompletionDataRequest.create = function create(properties) { + return new ImportCompletionDataRequest(properties); + }; + + /** + * Encodes the specified ImportCompletionDataRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ImportCompletionDataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest + * @static + * @param {google.cloud.retail.v2beta.IImportCompletionDataRequest} message ImportCompletionDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportCompletionDataRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.retail.v2beta.CompletionDataInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.notificationPubsubTopic); + return writer; + }; + + /** + * Encodes the specified ImportCompletionDataRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportCompletionDataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest + * @static + * @param {google.cloud.retail.v2beta.IImportCompletionDataRequest} message ImportCompletionDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportCompletionDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportCompletionDataRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ImportCompletionDataRequest} ImportCompletionDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportCompletionDataRequest.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.v2beta.ImportCompletionDataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.inputConfig = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.decode(reader, reader.uint32()); + break; + case 3: + message.notificationPubsubTopic = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportCompletionDataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ImportCompletionDataRequest} ImportCompletionDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportCompletionDataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportCompletionDataRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportCompletionDataRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + if (!$util.isString(message.notificationPubsubTopic)) + return "notificationPubsubTopic: string expected"; + return null; + }; + + /** + * Creates an ImportCompletionDataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ImportCompletionDataRequest} ImportCompletionDataRequest + */ + ImportCompletionDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ImportCompletionDataRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.ImportCompletionDataRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.ImportCompletionDataRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.fromObject(object.inputConfig); + } + if (object.notificationPubsubTopic != null) + message.notificationPubsubTopic = String(object.notificationPubsubTopic); + return message; + }; + + /** + * Creates a plain object from an ImportCompletionDataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest + * @static + * @param {google.cloud.retail.v2beta.ImportCompletionDataRequest} message ImportCompletionDataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportCompletionDataRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.inputConfig = null; + object.notificationPubsubTopic = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.retail.v2beta.CompletionDataInputConfig.toObject(message.inputConfig, options); + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + object.notificationPubsubTopic = message.notificationPubsubTopic; + return object; + }; + + /** + * Converts this ImportCompletionDataRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ImportCompletionDataRequest + * @instance + * @returns {Object.} JSON object + */ + ImportCompletionDataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportCompletionDataRequest; + })(); + + v2beta.ProductInputConfig = (function() { + + /** + * Properties of a ProductInputConfig. + * @memberof google.cloud.retail.v2beta + * @interface IProductInputConfig + * @property {google.cloud.retail.v2beta.IProductInlineSource|null} [productInlineSource] ProductInputConfig productInlineSource + * @property {google.cloud.retail.v2beta.IGcsSource|null} [gcsSource] ProductInputConfig gcsSource + * @property {google.cloud.retail.v2beta.IBigQuerySource|null} [bigQuerySource] ProductInputConfig bigQuerySource + */ + + /** + * Constructs a new ProductInputConfig. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a ProductInputConfig. + * @implements IProductInputConfig + * @constructor + * @param {google.cloud.retail.v2beta.IProductInputConfig=} [properties] Properties to set + */ + function ProductInputConfig(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]]; + } + + /** + * ProductInputConfig productInlineSource. + * @member {google.cloud.retail.v2beta.IProductInlineSource|null|undefined} productInlineSource + * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @instance + */ + ProductInputConfig.prototype.productInlineSource = null; + + /** + * ProductInputConfig gcsSource. + * @member {google.cloud.retail.v2beta.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @instance + */ + ProductInputConfig.prototype.gcsSource = null; + + /** + * ProductInputConfig bigQuerySource. + * @member {google.cloud.retail.v2beta.IBigQuerySource|null|undefined} bigQuerySource + * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @instance + */ + ProductInputConfig.prototype.bigQuerySource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProductInputConfig source. + * @member {"productInlineSource"|"gcsSource"|"bigQuerySource"|undefined} source + * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @instance + */ + Object.defineProperty(ProductInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["productInlineSource", "gcsSource", "bigQuerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ProductInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @static + * @param {google.cloud.retail.v2beta.IProductInputConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ProductInputConfig} ProductInputConfig instance + */ + ProductInputConfig.create = function create(properties) { + return new ProductInputConfig(properties); + }; + + /** + * Encodes the specified ProductInputConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ProductInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @static + * @param {google.cloud.retail.v2beta.IProductInputConfig} message ProductInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.productInlineSource != null && Object.hasOwnProperty.call(message, "productInlineSource")) + $root.google.cloud.retail.v2beta.ProductInlineSource.encode(message.productInlineSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.retail.v2beta.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) + $root.google.cloud.retail.v2beta.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProductInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ProductInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @static + * @param {google.cloud.retail.v2beta.IProductInputConfig} message ProductInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProductInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ProductInputConfig} ProductInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductInputConfig.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.v2beta.ProductInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.productInlineSource = $root.google.cloud.retail.v2beta.ProductInlineSource.decode(reader, reader.uint32()); + break; + case 2: + message.gcsSource = $root.google.cloud.retail.v2beta.GcsSource.decode(reader, reader.uint32()); + break; + case 3: + message.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ProductInputConfig} ProductInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductInputConfig message. + * @function verify + * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.productInlineSource != null && message.hasOwnProperty("productInlineSource")) { + properties.source = 1; + { + var error = $root.google.cloud.retail.v2beta.ProductInlineSource.verify(message.productInlineSource); + if (error) + return "productInlineSource." + error; + } + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.retail.v2beta.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.retail.v2beta.BigQuerySource.verify(message.bigQuerySource); + if (error) + return "bigQuerySource." + error; + } + } + return null; + }; + + /** + * Creates a ProductInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ProductInputConfig} ProductInputConfig + */ + ProductInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ProductInputConfig) + return object; + var message = new $root.google.cloud.retail.v2beta.ProductInputConfig(); + if (object.productInlineSource != null) { + if (typeof object.productInlineSource !== "object") + throw TypeError(".google.cloud.retail.v2beta.ProductInputConfig.productInlineSource: object expected"); + message.productInlineSource = $root.google.cloud.retail.v2beta.ProductInlineSource.fromObject(object.productInlineSource); + } + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.retail.v2beta.ProductInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.retail.v2beta.GcsSource.fromObject(object.gcsSource); + } + if (object.bigQuerySource != null) { + if (typeof object.bigQuerySource !== "object") + throw TypeError(".google.cloud.retail.v2beta.ProductInputConfig.bigQuerySource: object expected"); + message.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.fromObject(object.bigQuerySource); + } + return message; + }; + + /** + * Creates a plain object from a ProductInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @static + * @param {google.cloud.retail.v2beta.ProductInputConfig} message ProductInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.productInlineSource != null && message.hasOwnProperty("productInlineSource")) { + object.productInlineSource = $root.google.cloud.retail.v2beta.ProductInlineSource.toObject(message.productInlineSource, options); + if (options.oneofs) + object.source = "productInlineSource"; + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.retail.v2beta.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { + object.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.toObject(message.bigQuerySource, options); + if (options.oneofs) + object.source = "bigQuerySource"; + } + return object; + }; + + /** + * Converts this ProductInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ProductInputConfig + * @instance + * @returns {Object.} JSON object + */ + ProductInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProductInputConfig; + })(); + + v2beta.UserEventInputConfig = (function() { + + /** + * Properties of a UserEventInputConfig. + * @memberof google.cloud.retail.v2beta + * @interface IUserEventInputConfig + * @property {google.cloud.retail.v2beta.IUserEventInlineSource|null} [userEventInlineSource] UserEventInputConfig userEventInlineSource + * @property {google.cloud.retail.v2beta.IGcsSource|null} [gcsSource] UserEventInputConfig gcsSource + * @property {google.cloud.retail.v2beta.IBigQuerySource|null} [bigQuerySource] UserEventInputConfig bigQuerySource + */ + + /** + * Constructs a new UserEventInputConfig. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a UserEventInputConfig. + * @implements IUserEventInputConfig + * @constructor + * @param {google.cloud.retail.v2beta.IUserEventInputConfig=} [properties] Properties to set + */ + function UserEventInputConfig(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]]; + } + + /** + * UserEventInputConfig userEventInlineSource. + * @member {google.cloud.retail.v2beta.IUserEventInlineSource|null|undefined} userEventInlineSource + * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @instance + */ + UserEventInputConfig.prototype.userEventInlineSource = null; + + /** + * UserEventInputConfig gcsSource. + * @member {google.cloud.retail.v2beta.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @instance + */ + UserEventInputConfig.prototype.gcsSource = null; + + /** + * UserEventInputConfig bigQuerySource. + * @member {google.cloud.retail.v2beta.IBigQuerySource|null|undefined} bigQuerySource + * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @instance + */ + UserEventInputConfig.prototype.bigQuerySource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UserEventInputConfig source. + * @member {"userEventInlineSource"|"gcsSource"|"bigQuerySource"|undefined} source + * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @instance + */ + Object.defineProperty(UserEventInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["userEventInlineSource", "gcsSource", "bigQuerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UserEventInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @static + * @param {google.cloud.retail.v2beta.IUserEventInputConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.UserEventInputConfig} UserEventInputConfig instance + */ + UserEventInputConfig.create = function create(properties) { + return new UserEventInputConfig(properties); + }; + + /** + * Encodes the specified UserEventInputConfig message. Does not implicitly {@link google.cloud.retail.v2beta.UserEventInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @static + * @param {google.cloud.retail.v2beta.IUserEventInputConfig} message UserEventInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserEventInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userEventInlineSource != null && Object.hasOwnProperty.call(message, "userEventInlineSource")) + $root.google.cloud.retail.v2beta.UserEventInlineSource.encode(message.userEventInlineSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.retail.v2beta.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) + $root.google.cloud.retail.v2beta.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserEventInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserEventInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @static + * @param {google.cloud.retail.v2beta.IUserEventInputConfig} message UserEventInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserEventInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserEventInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.UserEventInputConfig} UserEventInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserEventInputConfig.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.v2beta.UserEventInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userEventInlineSource = $root.google.cloud.retail.v2beta.UserEventInlineSource.decode(reader, reader.uint32()); + break; + case 2: + message.gcsSource = $root.google.cloud.retail.v2beta.GcsSource.decode(reader, reader.uint32()); + break; + case 3: + message.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserEventInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.UserEventInputConfig} UserEventInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserEventInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserEventInputConfig message. + * @function verify + * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserEventInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.userEventInlineSource != null && message.hasOwnProperty("userEventInlineSource")) { + properties.source = 1; + { + var error = $root.google.cloud.retail.v2beta.UserEventInlineSource.verify(message.userEventInlineSource); + if (error) + return "userEventInlineSource." + error; + } + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.retail.v2beta.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.retail.v2beta.BigQuerySource.verify(message.bigQuerySource); + if (error) + return "bigQuerySource." + error; + } + } + return null; + }; + + /** + * Creates a UserEventInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.UserEventInputConfig} UserEventInputConfig + */ + UserEventInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.UserEventInputConfig) + return object; + var message = new $root.google.cloud.retail.v2beta.UserEventInputConfig(); + if (object.userEventInlineSource != null) { + if (typeof object.userEventInlineSource !== "object") + throw TypeError(".google.cloud.retail.v2beta.UserEventInputConfig.userEventInlineSource: object expected"); + message.userEventInlineSource = $root.google.cloud.retail.v2beta.UserEventInlineSource.fromObject(object.userEventInlineSource); + } + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.retail.v2beta.UserEventInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.retail.v2beta.GcsSource.fromObject(object.gcsSource); + } + if (object.bigQuerySource != null) { + if (typeof object.bigQuerySource !== "object") + throw TypeError(".google.cloud.retail.v2beta.UserEventInputConfig.bigQuerySource: object expected"); + message.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.fromObject(object.bigQuerySource); + } + return message; + }; + + /** + * Creates a plain object from a UserEventInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @static + * @param {google.cloud.retail.v2beta.UserEventInputConfig} message UserEventInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserEventInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.userEventInlineSource != null && message.hasOwnProperty("userEventInlineSource")) { + object.userEventInlineSource = $root.google.cloud.retail.v2beta.UserEventInlineSource.toObject(message.userEventInlineSource, options); + if (options.oneofs) + object.source = "userEventInlineSource"; + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.retail.v2beta.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { + object.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.toObject(message.bigQuerySource, options); + if (options.oneofs) + object.source = "bigQuerySource"; + } + return object; + }; + + /** + * Converts this UserEventInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.UserEventInputConfig + * @instance + * @returns {Object.} JSON object + */ + UserEventInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UserEventInputConfig; + })(); + + v2beta.CompletionDataInputConfig = (function() { + + /** + * Properties of a CompletionDataInputConfig. + * @memberof google.cloud.retail.v2beta + * @interface ICompletionDataInputConfig + * @property {google.cloud.retail.v2beta.IBigQuerySource|null} [bigQuerySource] CompletionDataInputConfig bigQuerySource + */ + + /** + * Constructs a new CompletionDataInputConfig. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a CompletionDataInputConfig. + * @implements ICompletionDataInputConfig + * @constructor + * @param {google.cloud.retail.v2beta.ICompletionDataInputConfig=} [properties] Properties to set + */ + function CompletionDataInputConfig(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]]; + } + + /** + * CompletionDataInputConfig bigQuerySource. + * @member {google.cloud.retail.v2beta.IBigQuerySource|null|undefined} bigQuerySource + * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @instance + */ + CompletionDataInputConfig.prototype.bigQuerySource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CompletionDataInputConfig source. + * @member {"bigQuerySource"|undefined} source + * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @instance + */ + Object.defineProperty(CompletionDataInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["bigQuerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CompletionDataInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @static + * @param {google.cloud.retail.v2beta.ICompletionDataInputConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.CompletionDataInputConfig} CompletionDataInputConfig instance + */ + CompletionDataInputConfig.create = function create(properties) { + return new CompletionDataInputConfig(properties); + }; + + /** + * Encodes the specified CompletionDataInputConfig message. Does not implicitly {@link google.cloud.retail.v2beta.CompletionDataInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @static + * @param {google.cloud.retail.v2beta.ICompletionDataInputConfig} message CompletionDataInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompletionDataInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) + $root.google.cloud.retail.v2beta.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompletionDataInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompletionDataInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @static + * @param {google.cloud.retail.v2beta.ICompletionDataInputConfig} message CompletionDataInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompletionDataInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompletionDataInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.CompletionDataInputConfig} CompletionDataInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompletionDataInputConfig.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.v2beta.CompletionDataInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompletionDataInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.CompletionDataInputConfig} CompletionDataInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompletionDataInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompletionDataInputConfig message. + * @function verify + * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompletionDataInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { + properties.source = 1; + { + var error = $root.google.cloud.retail.v2beta.BigQuerySource.verify(message.bigQuerySource); + if (error) + return "bigQuerySource." + error; + } + } + return null; + }; + + /** + * Creates a CompletionDataInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.CompletionDataInputConfig} CompletionDataInputConfig + */ + CompletionDataInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.CompletionDataInputConfig) + return object; + var message = new $root.google.cloud.retail.v2beta.CompletionDataInputConfig(); + if (object.bigQuerySource != null) { + if (typeof object.bigQuerySource !== "object") + throw TypeError(".google.cloud.retail.v2beta.CompletionDataInputConfig.bigQuerySource: object expected"); + message.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.fromObject(object.bigQuerySource); + } + return message; + }; + + /** + * Creates a plain object from a CompletionDataInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @static + * @param {google.cloud.retail.v2beta.CompletionDataInputConfig} message CompletionDataInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompletionDataInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { + object.bigQuerySource = $root.google.cloud.retail.v2beta.BigQuerySource.toObject(message.bigQuerySource, options); + if (options.oneofs) + object.source = "bigQuerySource"; + } + return object; + }; + + /** + * Converts this CompletionDataInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.CompletionDataInputConfig + * @instance + * @returns {Object.} JSON object + */ + CompletionDataInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CompletionDataInputConfig; + })(); + + v2beta.ImportMetadata = (function() { + + /** + * Properties of an ImportMetadata. + * @memberof google.cloud.retail.v2beta + * @interface IImportMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] ImportMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ImportMetadata updateTime + * @property {number|Long|null} [successCount] ImportMetadata successCount + * @property {number|Long|null} [failureCount] ImportMetadata failureCount + * @property {string|null} [requestId] ImportMetadata requestId + * @property {string|null} [notificationPubsubTopic] ImportMetadata notificationPubsubTopic + */ + + /** + * Constructs a new ImportMetadata. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents an ImportMetadata. + * @implements IImportMetadata + * @constructor + * @param {google.cloud.retail.v2beta.IImportMetadata=} [properties] Properties to set + */ + function ImportMetadata(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]]; + } + + /** + * ImportMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.retail.v2beta.ImportMetadata + * @instance + */ + ImportMetadata.prototype.createTime = null; + + /** + * ImportMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.retail.v2beta.ImportMetadata + * @instance + */ + ImportMetadata.prototype.updateTime = null; + + /** + * ImportMetadata successCount. + * @member {number|Long} successCount + * @memberof google.cloud.retail.v2beta.ImportMetadata + * @instance + */ + ImportMetadata.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImportMetadata failureCount. + * @member {number|Long} failureCount + * @memberof google.cloud.retail.v2beta.ImportMetadata + * @instance + */ + ImportMetadata.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImportMetadata requestId. + * @member {string} requestId + * @memberof google.cloud.retail.v2beta.ImportMetadata + * @instance + */ + ImportMetadata.prototype.requestId = ""; + + /** + * ImportMetadata notificationPubsubTopic. + * @member {string} notificationPubsubTopic + * @memberof google.cloud.retail.v2beta.ImportMetadata + * @instance + */ + ImportMetadata.prototype.notificationPubsubTopic = ""; + + /** + * Creates a new ImportMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.ImportMetadata + * @static + * @param {google.cloud.retail.v2beta.IImportMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ImportMetadata} ImportMetadata instance + */ + ImportMetadata.create = function create(properties) { + return new ImportMetadata(properties); + }; + + /** + * Encodes the specified ImportMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.ImportMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ImportMetadata + * @static + * @param {google.cloud.retail.v2beta.IImportMetadata} message ImportMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.successCount); + if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failureCount); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + 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); + return writer; + }; + + /** + * Encodes the specified ImportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ImportMetadata + * @static + * @param {google.cloud.retail.v2beta.IImportMetadata} message ImportMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ImportMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ImportMetadata} ImportMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportMetadata.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.v2beta.ImportMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.successCount = reader.int64(); + break; + case 4: + message.failureCount = reader.int64(); + break; + case 5: + message.requestId = reader.string(); + break; + case 6: + message.notificationPubsubTopic = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ImportMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ImportMetadata} ImportMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportMetadata message. + * @function verify + * @memberof google.cloud.retail.v2beta.ImportMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) + return "successCount: integer|Long expected"; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) + return "failureCount: integer|Long expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + if (!$util.isString(message.notificationPubsubTopic)) + return "notificationPubsubTopic: string expected"; + return null; + }; + + /** + * Creates an ImportMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ImportMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ImportMetadata} ImportMetadata + */ + ImportMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ImportMetadata) + return object; + var message = new $root.google.cloud.retail.v2beta.ImportMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.ImportMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.ImportMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.successCount != null) + if ($util.Long) + (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; + else if (typeof object.successCount === "string") + message.successCount = parseInt(object.successCount, 10); + else if (typeof object.successCount === "number") + message.successCount = object.successCount; + else if (typeof object.successCount === "object") + message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); + if (object.failureCount != null) + if ($util.Long) + (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; + else if (typeof object.failureCount === "string") + message.failureCount = parseInt(object.failureCount, 10); + else if (typeof object.failureCount === "number") + message.failureCount = object.failureCount; + else if (typeof object.failureCount === "object") + message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.notificationPubsubTopic != null) + message.notificationPubsubTopic = String(object.notificationPubsubTopic); + return message; + }; + + /** + * Creates a plain object from an ImportMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ImportMetadata + * @static + * @param {google.cloud.retail.v2beta.ImportMetadata} message ImportMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.successCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failureCount = options.longs === String ? "0" : 0; + object.requestId = ""; + object.notificationPubsubTopic = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (typeof message.successCount === "number") + object.successCount = options.longs === String ? String(message.successCount) : message.successCount; + else + object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (typeof message.failureCount === "number") + object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; + else + object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + object.notificationPubsubTopic = message.notificationPubsubTopic; + return object; + }; + + /** + * Converts this ImportMetadata to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ImportMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportMetadata; + })(); + + v2beta.ImportProductsResponse = (function() { + + /** + * Properties of an ImportProductsResponse. + * @memberof google.cloud.retail.v2beta + * @interface IImportProductsResponse + * @property {Array.|null} [errorSamples] ImportProductsResponse errorSamples + * @property {google.cloud.retail.v2beta.IImportErrorsConfig|null} [errorsConfig] ImportProductsResponse errorsConfig + */ + + /** + * Constructs a new ImportProductsResponse. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents an ImportProductsResponse. + * @implements IImportProductsResponse + * @constructor + * @param {google.cloud.retail.v2beta.IImportProductsResponse=} [properties] Properties to set + */ + function ImportProductsResponse(properties) { + this.errorSamples = []; + 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]]; + } + + /** + * ImportProductsResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @instance + */ + ImportProductsResponse.prototype.errorSamples = $util.emptyArray; + + /** + * ImportProductsResponse errorsConfig. + * @member {google.cloud.retail.v2beta.IImportErrorsConfig|null|undefined} errorsConfig + * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @instance + */ + ImportProductsResponse.prototype.errorsConfig = null; + + /** + * Creates a new ImportProductsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @static + * @param {google.cloud.retail.v2beta.IImportProductsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ImportProductsResponse} ImportProductsResponse instance + */ + ImportProductsResponse.create = function create(properties) { + return new ImportProductsResponse(properties); + }; + + /** + * Encodes the specified ImportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ImportProductsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @static + * @param {google.cloud.retail.v2beta.IImportProductsResponse} message ImportProductsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) + $root.google.cloud.retail.v2beta.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportProductsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @static + * @param {google.cloud.retail.v2beta.IImportProductsResponse} message ImportProductsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportProductsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ImportProductsResponse} ImportProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductsResponse.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.v2beta.ImportProductsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + case 2: + message.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportProductsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ImportProductsResponse} ImportProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportProductsResponse message. + * @function verify + * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportProductsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } + } + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { + var error = $root.google.cloud.retail.v2beta.ImportErrorsConfig.verify(message.errorsConfig); + if (error) + return "errorsConfig." + error; + } + return null; + }; + + /** + * Creates an ImportProductsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ImportProductsResponse} ImportProductsResponse + */ + ImportProductsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ImportProductsResponse) + return object; + var message = new $root.google.cloud.retail.v2beta.ImportProductsResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.retail.v2beta.ImportProductsResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.ImportProductsResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } + } + if (object.errorsConfig != null) { + if (typeof object.errorsConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.ImportProductsResponse.errorsConfig: object expected"); + message.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.fromObject(object.errorsConfig); + } + return message; + }; + + /** + * Creates a plain object from an ImportProductsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @static + * @param {google.cloud.retail.v2beta.ImportProductsResponse} message ImportProductsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportProductsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errorSamples = []; + if (options.defaults) + object.errorsConfig = null; + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + } + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) + object.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.toObject(message.errorsConfig, options); + return object; + }; + + /** + * Converts this ImportProductsResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ImportProductsResponse + * @instance + * @returns {Object.} JSON object + */ + ImportProductsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportProductsResponse; + })(); + + v2beta.ImportUserEventsResponse = (function() { + + /** + * Properties of an ImportUserEventsResponse. + * @memberof google.cloud.retail.v2beta + * @interface IImportUserEventsResponse + * @property {Array.|null} [errorSamples] ImportUserEventsResponse errorSamples + * @property {google.cloud.retail.v2beta.IImportErrorsConfig|null} [errorsConfig] ImportUserEventsResponse errorsConfig + * @property {google.cloud.retail.v2beta.IUserEventImportSummary|null} [importSummary] ImportUserEventsResponse importSummary + */ + + /** + * Constructs a new ImportUserEventsResponse. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents an ImportUserEventsResponse. + * @implements IImportUserEventsResponse + * @constructor + * @param {google.cloud.retail.v2beta.IImportUserEventsResponse=} [properties] Properties to set + */ + function ImportUserEventsResponse(properties) { + this.errorSamples = []; + 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]]; + } + + /** + * ImportUserEventsResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @instance + */ + ImportUserEventsResponse.prototype.errorSamples = $util.emptyArray; + + /** + * ImportUserEventsResponse errorsConfig. + * @member {google.cloud.retail.v2beta.IImportErrorsConfig|null|undefined} errorsConfig + * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @instance + */ + ImportUserEventsResponse.prototype.errorsConfig = null; + + /** + * ImportUserEventsResponse importSummary. + * @member {google.cloud.retail.v2beta.IUserEventImportSummary|null|undefined} importSummary + * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @instance + */ + ImportUserEventsResponse.prototype.importSummary = null; + + /** + * Creates a new ImportUserEventsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @static + * @param {google.cloud.retail.v2beta.IImportUserEventsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ImportUserEventsResponse} ImportUserEventsResponse instance + */ + ImportUserEventsResponse.create = function create(properties) { + return new ImportUserEventsResponse(properties); + }; + + /** + * Encodes the specified ImportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ImportUserEventsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @static + * @param {google.cloud.retail.v2beta.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportUserEventsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) + $root.google.cloud.retail.v2beta.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.importSummary != null && Object.hasOwnProperty.call(message, "importSummary")) + $root.google.cloud.retail.v2beta.UserEventImportSummary.encode(message.importSummary, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportUserEventsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @static + * @param {google.cloud.retail.v2beta.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportUserEventsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ImportUserEventsResponse} ImportUserEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportUserEventsResponse.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.v2beta.ImportUserEventsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + case 2: + message.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.decode(reader, reader.uint32()); + break; + case 3: + message.importSummary = $root.google.cloud.retail.v2beta.UserEventImportSummary.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportUserEventsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ImportUserEventsResponse} ImportUserEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportUserEventsResponse message. + * @function verify + * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportUserEventsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } + } + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { + var error = $root.google.cloud.retail.v2beta.ImportErrorsConfig.verify(message.errorsConfig); + if (error) + return "errorsConfig." + error; + } + if (message.importSummary != null && message.hasOwnProperty("importSummary")) { + var error = $root.google.cloud.retail.v2beta.UserEventImportSummary.verify(message.importSummary); + if (error) + return "importSummary." + error; + } + return null; + }; + + /** + * Creates an ImportUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ImportUserEventsResponse} ImportUserEventsResponse + */ + ImportUserEventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ImportUserEventsResponse) + return object; + var message = new $root.google.cloud.retail.v2beta.ImportUserEventsResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.retail.v2beta.ImportUserEventsResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.ImportUserEventsResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } + } + if (object.errorsConfig != null) { + if (typeof object.errorsConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.ImportUserEventsResponse.errorsConfig: object expected"); + message.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.fromObject(object.errorsConfig); + } + if (object.importSummary != null) { + if (typeof object.importSummary !== "object") + throw TypeError(".google.cloud.retail.v2beta.ImportUserEventsResponse.importSummary: object expected"); + message.importSummary = $root.google.cloud.retail.v2beta.UserEventImportSummary.fromObject(object.importSummary); + } + return message; + }; + + /** + * Creates a plain object from an ImportUserEventsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @static + * @param {google.cloud.retail.v2beta.ImportUserEventsResponse} message ImportUserEventsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportUserEventsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errorSamples = []; + if (options.defaults) { + object.errorsConfig = null; + object.importSummary = null; + } + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + } + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) + object.errorsConfig = $root.google.cloud.retail.v2beta.ImportErrorsConfig.toObject(message.errorsConfig, options); + if (message.importSummary != null && message.hasOwnProperty("importSummary")) + object.importSummary = $root.google.cloud.retail.v2beta.UserEventImportSummary.toObject(message.importSummary, options); + return object; + }; + + /** + * Converts this ImportUserEventsResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ImportUserEventsResponse + * @instance + * @returns {Object.} JSON object + */ + ImportUserEventsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportUserEventsResponse; + })(); + + v2beta.UserEventImportSummary = (function() { + + /** + * Properties of a UserEventImportSummary. + * @memberof google.cloud.retail.v2beta + * @interface IUserEventImportSummary + * @property {number|Long|null} [joinedEventsCount] UserEventImportSummary joinedEventsCount + * @property {number|Long|null} [unjoinedEventsCount] UserEventImportSummary unjoinedEventsCount + */ + + /** + * Constructs a new UserEventImportSummary. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a UserEventImportSummary. + * @implements IUserEventImportSummary + * @constructor + * @param {google.cloud.retail.v2beta.IUserEventImportSummary=} [properties] Properties to set + */ + function UserEventImportSummary(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]]; + } + + /** + * UserEventImportSummary joinedEventsCount. + * @member {number|Long} joinedEventsCount + * @memberof google.cloud.retail.v2beta.UserEventImportSummary + * @instance + */ + UserEventImportSummary.prototype.joinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UserEventImportSummary unjoinedEventsCount. + * @member {number|Long} unjoinedEventsCount + * @memberof google.cloud.retail.v2beta.UserEventImportSummary + * @instance + */ + UserEventImportSummary.prototype.unjoinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new UserEventImportSummary instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.UserEventImportSummary + * @static + * @param {google.cloud.retail.v2beta.IUserEventImportSummary=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.UserEventImportSummary} UserEventImportSummary instance + */ + UserEventImportSummary.create = function create(properties) { + return new UserEventImportSummary(properties); + }; + + /** + * Encodes the specified UserEventImportSummary message. Does not implicitly {@link google.cloud.retail.v2beta.UserEventImportSummary.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.UserEventImportSummary + * @static + * @param {google.cloud.retail.v2beta.IUserEventImportSummary} message UserEventImportSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserEventImportSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.joinedEventsCount != null && Object.hasOwnProperty.call(message, "joinedEventsCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.joinedEventsCount); + if (message.unjoinedEventsCount != null && Object.hasOwnProperty.call(message, "unjoinedEventsCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.unjoinedEventsCount); + return writer; + }; + + /** + * Encodes the specified UserEventImportSummary message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserEventImportSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.UserEventImportSummary + * @static + * @param {google.cloud.retail.v2beta.IUserEventImportSummary} message UserEventImportSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserEventImportSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserEventImportSummary message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.UserEventImportSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.UserEventImportSummary} UserEventImportSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserEventImportSummary.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.v2beta.UserEventImportSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.joinedEventsCount = reader.int64(); + break; + case 2: + message.unjoinedEventsCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserEventImportSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.UserEventImportSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.UserEventImportSummary} UserEventImportSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserEventImportSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserEventImportSummary message. + * @function verify + * @memberof google.cloud.retail.v2beta.UserEventImportSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserEventImportSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) + if (!$util.isInteger(message.joinedEventsCount) && !(message.joinedEventsCount && $util.isInteger(message.joinedEventsCount.low) && $util.isInteger(message.joinedEventsCount.high))) + return "joinedEventsCount: integer|Long expected"; + if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) + if (!$util.isInteger(message.unjoinedEventsCount) && !(message.unjoinedEventsCount && $util.isInteger(message.unjoinedEventsCount.low) && $util.isInteger(message.unjoinedEventsCount.high))) + return "unjoinedEventsCount: integer|Long expected"; + return null; + }; + + /** + * Creates a UserEventImportSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.UserEventImportSummary + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.UserEventImportSummary} UserEventImportSummary + */ + UserEventImportSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.UserEventImportSummary) + return object; + var message = new $root.google.cloud.retail.v2beta.UserEventImportSummary(); + if (object.joinedEventsCount != null) + if ($util.Long) + (message.joinedEventsCount = $util.Long.fromValue(object.joinedEventsCount)).unsigned = false; + else if (typeof object.joinedEventsCount === "string") + message.joinedEventsCount = parseInt(object.joinedEventsCount, 10); + else if (typeof object.joinedEventsCount === "number") + message.joinedEventsCount = object.joinedEventsCount; + else if (typeof object.joinedEventsCount === "object") + message.joinedEventsCount = new $util.LongBits(object.joinedEventsCount.low >>> 0, object.joinedEventsCount.high >>> 0).toNumber(); + if (object.unjoinedEventsCount != null) + if ($util.Long) + (message.unjoinedEventsCount = $util.Long.fromValue(object.unjoinedEventsCount)).unsigned = false; + else if (typeof object.unjoinedEventsCount === "string") + message.unjoinedEventsCount = parseInt(object.unjoinedEventsCount, 10); + else if (typeof object.unjoinedEventsCount === "number") + message.unjoinedEventsCount = object.unjoinedEventsCount; + else if (typeof object.unjoinedEventsCount === "object") + message.unjoinedEventsCount = new $util.LongBits(object.unjoinedEventsCount.low >>> 0, object.unjoinedEventsCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a UserEventImportSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.UserEventImportSummary + * @static + * @param {google.cloud.retail.v2beta.UserEventImportSummary} message UserEventImportSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserEventImportSummary.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.joinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.joinedEventsCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.unjoinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.unjoinedEventsCount = options.longs === String ? "0" : 0; + } + if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) + if (typeof message.joinedEventsCount === "number") + object.joinedEventsCount = options.longs === String ? String(message.joinedEventsCount) : message.joinedEventsCount; + else + object.joinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.joinedEventsCount) : options.longs === Number ? new $util.LongBits(message.joinedEventsCount.low >>> 0, message.joinedEventsCount.high >>> 0).toNumber() : message.joinedEventsCount; + if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) + if (typeof message.unjoinedEventsCount === "number") + object.unjoinedEventsCount = options.longs === String ? String(message.unjoinedEventsCount) : message.unjoinedEventsCount; + else + object.unjoinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.unjoinedEventsCount) : options.longs === Number ? new $util.LongBits(message.unjoinedEventsCount.low >>> 0, message.unjoinedEventsCount.high >>> 0).toNumber() : message.unjoinedEventsCount; + return object; + }; + + /** + * Converts this UserEventImportSummary to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.UserEventImportSummary + * @instance + * @returns {Object.} JSON object + */ + UserEventImportSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UserEventImportSummary; + })(); + + v2beta.ImportCompletionDataResponse = (function() { + + /** + * Properties of an ImportCompletionDataResponse. + * @memberof google.cloud.retail.v2beta + * @interface IImportCompletionDataResponse + * @property {Array.|null} [errorSamples] ImportCompletionDataResponse errorSamples + */ + + /** + * Constructs a new ImportCompletionDataResponse. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents an ImportCompletionDataResponse. + * @implements IImportCompletionDataResponse + * @constructor + * @param {google.cloud.retail.v2beta.IImportCompletionDataResponse=} [properties] Properties to set + */ + function ImportCompletionDataResponse(properties) { + this.errorSamples = []; + 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]]; + } + + /** + * ImportCompletionDataResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @instance + */ + ImportCompletionDataResponse.prototype.errorSamples = $util.emptyArray; + + /** + * Creates a new ImportCompletionDataResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @static + * @param {google.cloud.retail.v2beta.IImportCompletionDataResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ImportCompletionDataResponse} ImportCompletionDataResponse instance + */ + ImportCompletionDataResponse.create = function create(properties) { + return new ImportCompletionDataResponse(properties); + }; + + /** + * Encodes the specified ImportCompletionDataResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ImportCompletionDataResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @static + * @param {google.cloud.retail.v2beta.IImportCompletionDataResponse} message ImportCompletionDataResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportCompletionDataResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportCompletionDataResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ImportCompletionDataResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @static + * @param {google.cloud.retail.v2beta.IImportCompletionDataResponse} message ImportCompletionDataResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportCompletionDataResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportCompletionDataResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ImportCompletionDataResponse} ImportCompletionDataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportCompletionDataResponse.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.v2beta.ImportCompletionDataResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportCompletionDataResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ImportCompletionDataResponse} ImportCompletionDataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportCompletionDataResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportCompletionDataResponse message. + * @function verify + * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportCompletionDataResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } + } + return null; + }; + + /** + * Creates an ImportCompletionDataResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ImportCompletionDataResponse} ImportCompletionDataResponse + */ + ImportCompletionDataResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ImportCompletionDataResponse) + return object; + var message = new $root.google.cloud.retail.v2beta.ImportCompletionDataResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.retail.v2beta.ImportCompletionDataResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.ImportCompletionDataResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ImportCompletionDataResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @static + * @param {google.cloud.retail.v2beta.ImportCompletionDataResponse} message ImportCompletionDataResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportCompletionDataResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errorSamples = []; + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + } + return object; + }; + + /** + * Converts this ImportCompletionDataResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ImportCompletionDataResponse + * @instance + * @returns {Object.} JSON object + */ + ImportCompletionDataResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportCompletionDataResponse; + })(); + + v2beta.Product = (function() { + + /** + * Properties of a Product. + * @memberof google.cloud.retail.v2beta + * @interface IProduct + * @property {google.protobuf.ITimestamp|null} [expireTime] Product expireTime + * @property {google.protobuf.IDuration|null} [ttl] Product ttl + * @property {string|null} [name] Product name + * @property {string|null} [id] Product id + * @property {google.cloud.retail.v2beta.Product.Type|null} [type] Product type + * @property {string|null} [primaryProductId] Product primaryProductId + * @property {Array.|null} [collectionMemberIds] Product collectionMemberIds + * @property {string|null} [gtin] Product gtin + * @property {Array.|null} [categories] Product categories + * @property {string|null} [title] Product title + * @property {Array.|null} [brands] Product brands + * @property {string|null} [description] Product description + * @property {string|null} [languageCode] Product languageCode + * @property {Object.|null} [attributes] Product attributes + * @property {Array.|null} [tags] Product tags + * @property {google.cloud.retail.v2beta.IPriceInfo|null} [priceInfo] Product priceInfo + * @property {google.cloud.retail.v2beta.IRating|null} [rating] Product rating + * @property {google.protobuf.ITimestamp|null} [availableTime] Product availableTime + * @property {google.cloud.retail.v2beta.Product.Availability|null} [availability] Product availability + * @property {google.protobuf.IInt32Value|null} [availableQuantity] Product availableQuantity + * @property {Array.|null} [fulfillmentInfo] Product fulfillmentInfo + * @property {string|null} [uri] Product uri + * @property {Array.|null} [images] Product images + * @property {google.cloud.retail.v2beta.IAudience|null} [audience] Product audience + * @property {google.cloud.retail.v2beta.IColorInfo|null} [colorInfo] Product colorInfo + * @property {Array.|null} [sizes] Product sizes + * @property {Array.|null} [materials] Product materials + * @property {Array.|null} [patterns] Product patterns + * @property {Array.|null} [conditions] Product conditions + * @property {Array.|null} [promotions] Product promotions + * @property {google.protobuf.ITimestamp|null} [publishTime] Product publishTime + * @property {google.protobuf.IFieldMask|null} [retrievableFields] Product retrievableFields + * @property {Array.|null} [variants] Product variants + */ + + /** + * Constructs a new Product. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a Product. + * @implements IProduct + * @constructor + * @param {google.cloud.retail.v2beta.IProduct=} [properties] Properties to set + */ + function Product(properties) { + this.collectionMemberIds = []; + this.categories = []; + this.brands = []; + this.attributes = {}; + this.tags = []; + this.fulfillmentInfo = []; + this.images = []; + this.sizes = []; + this.materials = []; + this.patterns = []; + this.conditions = []; + this.promotions = []; + this.variants = []; + 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]]; + } + + /** + * Product expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.expireTime = null; + + /** + * Product ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.ttl = null; + + /** + * Product name. + * @member {string} name + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.name = ""; + + /** + * Product id. + * @member {string} id + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.id = ""; + + /** + * Product type. + * @member {google.cloud.retail.v2beta.Product.Type} type + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.type = 0; + + /** + * Product primaryProductId. + * @member {string} primaryProductId + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.primaryProductId = ""; + + /** + * Product collectionMemberIds. + * @member {Array.} collectionMemberIds + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.collectionMemberIds = $util.emptyArray; + + /** + * Product gtin. + * @member {string} gtin + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.gtin = ""; + + /** + * Product categories. + * @member {Array.} categories + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.categories = $util.emptyArray; + + /** + * Product title. + * @member {string} title + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.title = ""; + + /** + * Product brands. + * @member {Array.} brands + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.brands = $util.emptyArray; + + /** + * Product description. + * @member {string} description + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.description = ""; + + /** + * Product languageCode. + * @member {string} languageCode + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.languageCode = ""; + + /** + * Product attributes. + * @member {Object.} attributes + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.attributes = $util.emptyObject; + + /** + * Product tags. + * @member {Array.} tags + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.tags = $util.emptyArray; + + /** + * Product priceInfo. + * @member {google.cloud.retail.v2beta.IPriceInfo|null|undefined} priceInfo + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.priceInfo = null; + + /** + * Product rating. + * @member {google.cloud.retail.v2beta.IRating|null|undefined} rating + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.rating = null; + + /** + * Product availableTime. + * @member {google.protobuf.ITimestamp|null|undefined} availableTime + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.availableTime = null; + + /** + * Product availability. + * @member {google.cloud.retail.v2beta.Product.Availability} availability + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.availability = 0; + + /** + * Product availableQuantity. + * @member {google.protobuf.IInt32Value|null|undefined} availableQuantity + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.availableQuantity = null; + + /** + * Product fulfillmentInfo. + * @member {Array.} fulfillmentInfo + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.fulfillmentInfo = $util.emptyArray; + + /** + * Product uri. + * @member {string} uri + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.uri = ""; + + /** + * Product images. + * @member {Array.} images + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.images = $util.emptyArray; + + /** + * Product audience. + * @member {google.cloud.retail.v2beta.IAudience|null|undefined} audience + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.audience = null; + + /** + * Product colorInfo. + * @member {google.cloud.retail.v2beta.IColorInfo|null|undefined} colorInfo + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.colorInfo = null; + + /** + * Product sizes. + * @member {Array.} sizes + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.sizes = $util.emptyArray; + + /** + * Product materials. + * @member {Array.} materials + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.materials = $util.emptyArray; + + /** + * Product patterns. + * @member {Array.} patterns + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.patterns = $util.emptyArray; + + /** + * Product conditions. + * @member {Array.} conditions + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.conditions = $util.emptyArray; + + /** + * Product promotions. + * @member {Array.} promotions + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.promotions = $util.emptyArray; + + /** + * Product publishTime. + * @member {google.protobuf.ITimestamp|null|undefined} publishTime + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.publishTime = null; + + /** + * Product retrievableFields. + * @member {google.protobuf.IFieldMask|null|undefined} retrievableFields + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.retrievableFields = null; + + /** + * Product variants. + * @member {Array.} variants + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Product.prototype.variants = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Product expiration. + * @member {"expireTime"|"ttl"|undefined} expiration + * @memberof google.cloud.retail.v2beta.Product + * @instance + */ + Object.defineProperty(Product.prototype, "expiration", { + get: $util.oneOfGetter($oneOfFields = ["expireTime", "ttl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Product instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Product + * @static + * @param {google.cloud.retail.v2beta.IProduct=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Product} Product instance + */ + Product.create = function create(properties) { + return new Product(properties); + }; + + /** + * Encodes the specified Product message. Does not implicitly {@link google.cloud.retail.v2beta.Product.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Product + * @static + * @param {google.cloud.retail.v2beta.IProduct} message Product message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Product.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.primaryProductId != null && Object.hasOwnProperty.call(message, "primaryProductId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.primaryProductId); + if (message.collectionMemberIds != null && message.collectionMemberIds.length) + for (var i = 0; i < message.collectionMemberIds.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.collectionMemberIds[i]); + if (message.gtin != null && Object.hasOwnProperty.call(message, "gtin")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.gtin); + if (message.categories != null && message.categories.length) + for (var i = 0; i < message.categories.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.categories[i]); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.title); + if (message.brands != null && message.brands.length) + for (var i = 0; i < message.brands.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.brands[i]); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.description); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.languageCode); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.retail.v2beta.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.tags[i]); + if (message.priceInfo != null && Object.hasOwnProperty.call(message, "priceInfo")) + $root.google.cloud.retail.v2beta.PriceInfo.encode(message.priceInfo, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.rating != null && Object.hasOwnProperty.call(message, "rating")) + $root.google.cloud.retail.v2beta.Rating.encode(message.rating, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.availableTime != null && Object.hasOwnProperty.call(message, "availableTime")) + $root.google.protobuf.Timestamp.encode(message.availableTime, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.availability != null && Object.hasOwnProperty.call(message, "availability")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.availability); + if (message.availableQuantity != null && Object.hasOwnProperty.call(message, "availableQuantity")) + $root.google.protobuf.Int32Value.encode(message.availableQuantity, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.fulfillmentInfo != null && message.fulfillmentInfo.length) + for (var i = 0; i < message.fulfillmentInfo.length; ++i) + $root.google.cloud.retail.v2beta.FulfillmentInfo.encode(message.fulfillmentInfo[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.uri); + if (message.images != null && message.images.length) + for (var i = 0; i < message.images.length; ++i) + $root.google.cloud.retail.v2beta.Image.encode(message.images[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.audience != null && Object.hasOwnProperty.call(message, "audience")) + $root.google.cloud.retail.v2beta.Audience.encode(message.audience, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.colorInfo != null && Object.hasOwnProperty.call(message, "colorInfo")) + $root.google.cloud.retail.v2beta.ColorInfo.encode(message.colorInfo, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.sizes != null && message.sizes.length) + for (var i = 0; i < message.sizes.length; ++i) + writer.uint32(/* id 26, wireType 2 =*/210).string(message.sizes[i]); + if (message.materials != null && message.materials.length) + for (var i = 0; i < message.materials.length; ++i) + writer.uint32(/* id 27, wireType 2 =*/218).string(message.materials[i]); + if (message.patterns != null && message.patterns.length) + for (var i = 0; i < message.patterns.length; ++i) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.patterns[i]); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + writer.uint32(/* id 29, wireType 2 =*/234).string(message.conditions[i]); + if (message.retrievableFields != null && Object.hasOwnProperty.call(message, "retrievableFields")) + $root.google.protobuf.FieldMask.encode(message.retrievableFields, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.variants != null && message.variants.length) + for (var i = 0; i < message.variants.length; ++i) + $root.google.cloud.retail.v2beta.Product.encode(message.variants[i], writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.publishTime != null && Object.hasOwnProperty.call(message, "publishTime")) + $root.google.protobuf.Timestamp.encode(message.publishTime, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.promotions != null && message.promotions.length) + for (var i = 0; i < message.promotions.length; ++i) + $root.google.cloud.retail.v2beta.Promotion.encode(message.promotions[i], writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Product.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Product + * @static + * @param {google.cloud.retail.v2beta.IProduct} message Product message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Product.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Product message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Product + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Product} Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Product.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.v2beta.Product(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 16: + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 17: + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 1: + message.name = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + case 3: + message.type = reader.int32(); + break; + case 4: + message.primaryProductId = reader.string(); + break; + case 5: + if (!(message.collectionMemberIds && message.collectionMemberIds.length)) + message.collectionMemberIds = []; + message.collectionMemberIds.push(reader.string()); + break; + case 6: + message.gtin = reader.string(); + break; + case 7: + if (!(message.categories && message.categories.length)) + message.categories = []; + message.categories.push(reader.string()); + break; + case 8: + message.title = reader.string(); + break; + case 9: + if (!(message.brands && message.brands.length)) + message.brands = []; + message.brands.push(reader.string()); + break; + case 10: + message.description = reader.string(); + break; + case 11: + message.languageCode = reader.string(); + break; + case 12: + if (message.attributes === $util.emptyObject) + message.attributes = {}; + 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.v2beta.CustomAttribute.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + case 13: + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + case 14: + message.priceInfo = $root.google.cloud.retail.v2beta.PriceInfo.decode(reader, reader.uint32()); + break; + case 15: + message.rating = $root.google.cloud.retail.v2beta.Rating.decode(reader, reader.uint32()); + break; + case 18: + message.availableTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 19: + message.availability = reader.int32(); + break; + case 20: + message.availableQuantity = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); + break; + case 21: + if (!(message.fulfillmentInfo && message.fulfillmentInfo.length)) + message.fulfillmentInfo = []; + message.fulfillmentInfo.push($root.google.cloud.retail.v2beta.FulfillmentInfo.decode(reader, reader.uint32())); + break; + case 22: + message.uri = reader.string(); + break; + case 23: + if (!(message.images && message.images.length)) + message.images = []; + message.images.push($root.google.cloud.retail.v2beta.Image.decode(reader, reader.uint32())); + break; + case 24: + message.audience = $root.google.cloud.retail.v2beta.Audience.decode(reader, reader.uint32()); + break; + case 25: + message.colorInfo = $root.google.cloud.retail.v2beta.ColorInfo.decode(reader, reader.uint32()); + break; + case 26: + if (!(message.sizes && message.sizes.length)) + message.sizes = []; + message.sizes.push(reader.string()); + break; + case 27: + if (!(message.materials && message.materials.length)) + message.materials = []; + message.materials.push(reader.string()); + break; + case 28: + if (!(message.patterns && message.patterns.length)) + message.patterns = []; + message.patterns.push(reader.string()); + break; + case 29: + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push(reader.string()); + break; + case 34: + if (!(message.promotions && message.promotions.length)) + message.promotions = []; + message.promotions.push($root.google.cloud.retail.v2beta.Promotion.decode(reader, reader.uint32())); + break; + case 33: + message.publishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 30: + message.retrievableFields = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 31: + if (!(message.variants && message.variants.length)) + message.variants = []; + message.variants.push($root.google.cloud.retail.v2beta.Product.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Product message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Product + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Product} Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Product.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Product message. + * @function verify + * @memberof google.cloud.retail.v2beta.Product + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Product.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + properties.expiration = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + if (properties.expiration === 1) + return "expiration: multiple values"; + properties.expiration = 1; + { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.primaryProductId != null && message.hasOwnProperty("primaryProductId")) + if (!$util.isString(message.primaryProductId)) + return "primaryProductId: string expected"; + if (message.collectionMemberIds != null && message.hasOwnProperty("collectionMemberIds")) { + if (!Array.isArray(message.collectionMemberIds)) + return "collectionMemberIds: array expected"; + for (var i = 0; i < message.collectionMemberIds.length; ++i) + if (!$util.isString(message.collectionMemberIds[i])) + return "collectionMemberIds: string[] expected"; + } + if (message.gtin != null && message.hasOwnProperty("gtin")) + if (!$util.isString(message.gtin)) + return "gtin: string expected"; + if (message.categories != null && message.hasOwnProperty("categories")) { + if (!Array.isArray(message.categories)) + return "categories: array expected"; + for (var i = 0; i < message.categories.length; ++i) + if (!$util.isString(message.categories[i])) + return "categories: string[] expected"; + } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.brands != null && message.hasOwnProperty("brands")) { + if (!Array.isArray(message.brands)) + return "brands: array expected"; + for (var i = 0; i < message.brands.length; ++i) + if (!$util.isString(message.brands[i])) + return "brands: string[] expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.retail.v2beta.CustomAttribute.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) { + var error = $root.google.cloud.retail.v2beta.PriceInfo.verify(message.priceInfo); + if (error) + return "priceInfo." + error; + } + if (message.rating != null && message.hasOwnProperty("rating")) { + var error = $root.google.cloud.retail.v2beta.Rating.verify(message.rating); + if (error) + return "rating." + error; + } + if (message.availableTime != null && message.hasOwnProperty("availableTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.availableTime); + if (error) + return "availableTime." + error; + } + if (message.availability != null && message.hasOwnProperty("availability")) + switch (message.availability) { + default: + return "availability: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.availableQuantity != null && message.hasOwnProperty("availableQuantity")) { + var error = $root.google.protobuf.Int32Value.verify(message.availableQuantity); + if (error) + return "availableQuantity." + error; + } + if (message.fulfillmentInfo != null && message.hasOwnProperty("fulfillmentInfo")) { + if (!Array.isArray(message.fulfillmentInfo)) + return "fulfillmentInfo: array expected"; + for (var i = 0; i < message.fulfillmentInfo.length; ++i) { + var error = $root.google.cloud.retail.v2beta.FulfillmentInfo.verify(message.fulfillmentInfo[i]); + if (error) + return "fulfillmentInfo." + error; + } + } + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.images != null && message.hasOwnProperty("images")) { + if (!Array.isArray(message.images)) + return "images: array expected"; + for (var i = 0; i < message.images.length; ++i) { + var error = $root.google.cloud.retail.v2beta.Image.verify(message.images[i]); + if (error) + return "images." + error; + } + } + if (message.audience != null && message.hasOwnProperty("audience")) { + var error = $root.google.cloud.retail.v2beta.Audience.verify(message.audience); + if (error) + return "audience." + error; + } + if (message.colorInfo != null && message.hasOwnProperty("colorInfo")) { + var error = $root.google.cloud.retail.v2beta.ColorInfo.verify(message.colorInfo); + if (error) + return "colorInfo." + error; + } + if (message.sizes != null && message.hasOwnProperty("sizes")) { + if (!Array.isArray(message.sizes)) + return "sizes: array expected"; + for (var i = 0; i < message.sizes.length; ++i) + if (!$util.isString(message.sizes[i])) + return "sizes: string[] expected"; + } + if (message.materials != null && message.hasOwnProperty("materials")) { + if (!Array.isArray(message.materials)) + return "materials: array expected"; + for (var i = 0; i < message.materials.length; ++i) + if (!$util.isString(message.materials[i])) + return "materials: string[] expected"; + } + if (message.patterns != null && message.hasOwnProperty("patterns")) { + if (!Array.isArray(message.patterns)) + return "patterns: array expected"; + for (var i = 0; i < message.patterns.length; ++i) + if (!$util.isString(message.patterns[i])) + return "patterns: string[] expected"; + } + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) + if (!$util.isString(message.conditions[i])) + return "conditions: string[] expected"; + } + if (message.promotions != null && message.hasOwnProperty("promotions")) { + if (!Array.isArray(message.promotions)) + return "promotions: array expected"; + for (var i = 0; i < message.promotions.length; ++i) { + var error = $root.google.cloud.retail.v2beta.Promotion.verify(message.promotions[i]); + if (error) + return "promotions." + error; + } + } + if (message.publishTime != null && message.hasOwnProperty("publishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.publishTime); + if (error) + return "publishTime." + error; + } + if (message.retrievableFields != null && message.hasOwnProperty("retrievableFields")) { + var error = $root.google.protobuf.FieldMask.verify(message.retrievableFields); + if (error) + return "retrievableFields." + error; + } + if (message.variants != null && message.hasOwnProperty("variants")) { + if (!Array.isArray(message.variants)) + return "variants: array expected"; + for (var i = 0; i < message.variants.length; ++i) { + var error = $root.google.cloud.retail.v2beta.Product.verify(message.variants[i]); + if (error) + return "variants." + error; + } + } + return null; + }; + + /** + * Creates a Product message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Product + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Product} Product + */ + Product.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Product) + return object; + var message = new $root.google.cloud.retail.v2beta.Product(); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.Product.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.cloud.retail.v2beta.Product.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + if (object.name != null) + message.name = String(object.name); + if (object.id != null) + message.id = String(object.id); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PRIMARY": + case 1: + message.type = 1; + break; + case "VARIANT": + case 2: + message.type = 2; + break; + case "COLLECTION": + case 3: + message.type = 3; + break; + } + if (object.primaryProductId != null) + message.primaryProductId = String(object.primaryProductId); + if (object.collectionMemberIds) { + if (!Array.isArray(object.collectionMemberIds)) + throw TypeError(".google.cloud.retail.v2beta.Product.collectionMemberIds: array expected"); + message.collectionMemberIds = []; + for (var i = 0; i < object.collectionMemberIds.length; ++i) + message.collectionMemberIds[i] = String(object.collectionMemberIds[i]); + } + if (object.gtin != null) + message.gtin = String(object.gtin); + if (object.categories) { + if (!Array.isArray(object.categories)) + throw TypeError(".google.cloud.retail.v2beta.Product.categories: array expected"); + message.categories = []; + for (var i = 0; i < object.categories.length; ++i) + message.categories[i] = String(object.categories[i]); + } + if (object.title != null) + message.title = String(object.title); + if (object.brands) { + if (!Array.isArray(object.brands)) + throw TypeError(".google.cloud.retail.v2beta.Product.brands: array expected"); + message.brands = []; + for (var i = 0; i < object.brands.length; ++i) + message.brands[i] = String(object.brands[i]); + } + if (object.description != null) + message.description = String(object.description); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.retail.v2beta.Product.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2beta.Product.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.retail.v2beta.CustomAttribute.fromObject(object.attributes[keys[i]]); + } + } + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.retail.v2beta.Product.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.priceInfo != null) { + if (typeof object.priceInfo !== "object") + throw TypeError(".google.cloud.retail.v2beta.Product.priceInfo: object expected"); + message.priceInfo = $root.google.cloud.retail.v2beta.PriceInfo.fromObject(object.priceInfo); + } + if (object.rating != null) { + if (typeof object.rating !== "object") + throw TypeError(".google.cloud.retail.v2beta.Product.rating: object expected"); + message.rating = $root.google.cloud.retail.v2beta.Rating.fromObject(object.rating); + } + if (object.availableTime != null) { + if (typeof object.availableTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.Product.availableTime: object expected"); + message.availableTime = $root.google.protobuf.Timestamp.fromObject(object.availableTime); + } + switch (object.availability) { + case "AVAILABILITY_UNSPECIFIED": + case 0: + message.availability = 0; + break; + case "IN_STOCK": + case 1: + message.availability = 1; + break; + case "OUT_OF_STOCK": + case 2: + message.availability = 2; + break; + case "PREORDER": + case 3: + message.availability = 3; + break; + case "BACKORDER": + case 4: + message.availability = 4; + break; + } + if (object.availableQuantity != null) { + if (typeof object.availableQuantity !== "object") + throw TypeError(".google.cloud.retail.v2beta.Product.availableQuantity: object expected"); + message.availableQuantity = $root.google.protobuf.Int32Value.fromObject(object.availableQuantity); + } + if (object.fulfillmentInfo) { + if (!Array.isArray(object.fulfillmentInfo)) + throw TypeError(".google.cloud.retail.v2beta.Product.fulfillmentInfo: array expected"); + message.fulfillmentInfo = []; + for (var i = 0; i < object.fulfillmentInfo.length; ++i) { + if (typeof object.fulfillmentInfo[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.Product.fulfillmentInfo: object expected"); + message.fulfillmentInfo[i] = $root.google.cloud.retail.v2beta.FulfillmentInfo.fromObject(object.fulfillmentInfo[i]); + } + } + if (object.uri != null) + message.uri = String(object.uri); + if (object.images) { + if (!Array.isArray(object.images)) + throw TypeError(".google.cloud.retail.v2beta.Product.images: array expected"); + message.images = []; + for (var i = 0; i < object.images.length; ++i) { + if (typeof object.images[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.Product.images: object expected"); + message.images[i] = $root.google.cloud.retail.v2beta.Image.fromObject(object.images[i]); + } + } + if (object.audience != null) { + if (typeof object.audience !== "object") + throw TypeError(".google.cloud.retail.v2beta.Product.audience: object expected"); + message.audience = $root.google.cloud.retail.v2beta.Audience.fromObject(object.audience); + } + if (object.colorInfo != null) { + if (typeof object.colorInfo !== "object") + throw TypeError(".google.cloud.retail.v2beta.Product.colorInfo: object expected"); + message.colorInfo = $root.google.cloud.retail.v2beta.ColorInfo.fromObject(object.colorInfo); + } + if (object.sizes) { + if (!Array.isArray(object.sizes)) + throw TypeError(".google.cloud.retail.v2beta.Product.sizes: array expected"); + message.sizes = []; + for (var i = 0; i < object.sizes.length; ++i) + message.sizes[i] = String(object.sizes[i]); + } + if (object.materials) { + if (!Array.isArray(object.materials)) + throw TypeError(".google.cloud.retail.v2beta.Product.materials: array expected"); + message.materials = []; + for (var i = 0; i < object.materials.length; ++i) + message.materials[i] = String(object.materials[i]); + } + if (object.patterns) { + if (!Array.isArray(object.patterns)) + throw TypeError(".google.cloud.retail.v2beta.Product.patterns: array expected"); + message.patterns = []; + for (var i = 0; i < object.patterns.length; ++i) + message.patterns[i] = String(object.patterns[i]); + } + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.cloud.retail.v2beta.Product.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) + message.conditions[i] = String(object.conditions[i]); + } + if (object.promotions) { + if (!Array.isArray(object.promotions)) + throw TypeError(".google.cloud.retail.v2beta.Product.promotions: array expected"); + message.promotions = []; + for (var i = 0; i < object.promotions.length; ++i) { + if (typeof object.promotions[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.Product.promotions: object expected"); + message.promotions[i] = $root.google.cloud.retail.v2beta.Promotion.fromObject(object.promotions[i]); + } + } + if (object.publishTime != null) { + if (typeof object.publishTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.Product.publishTime: object expected"); + message.publishTime = $root.google.protobuf.Timestamp.fromObject(object.publishTime); + } + if (object.retrievableFields != null) { + if (typeof object.retrievableFields !== "object") + throw TypeError(".google.cloud.retail.v2beta.Product.retrievableFields: object expected"); + message.retrievableFields = $root.google.protobuf.FieldMask.fromObject(object.retrievableFields); + } + if (object.variants) { + if (!Array.isArray(object.variants)) + throw TypeError(".google.cloud.retail.v2beta.Product.variants: array expected"); + message.variants = []; + for (var i = 0; i < object.variants.length; ++i) { + if (typeof object.variants[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.Product.variants: object expected"); + message.variants[i] = $root.google.cloud.retail.v2beta.Product.fromObject(object.variants[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Product message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Product + * @static + * @param {google.cloud.retail.v2beta.Product} message Product + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Product.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.collectionMemberIds = []; + object.categories = []; + object.brands = []; + object.tags = []; + object.fulfillmentInfo = []; + object.images = []; + object.sizes = []; + object.materials = []; + object.patterns = []; + object.conditions = []; + object.variants = []; + object.promotions = []; + } + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.id = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.primaryProductId = ""; + object.gtin = ""; + object.title = ""; + object.description = ""; + object.languageCode = ""; + object.priceInfo = null; + object.rating = null; + object.availableTime = null; + object.availability = options.enums === String ? "AVAILABILITY_UNSPECIFIED" : 0; + object.availableQuantity = null; + object.uri = ""; + object.audience = null; + object.colorInfo = null; + object.retrievableFields = null; + object.publishTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.retail.v2beta.Product.Type[message.type] : message.type; + if (message.primaryProductId != null && message.hasOwnProperty("primaryProductId")) + object.primaryProductId = message.primaryProductId; + if (message.collectionMemberIds && message.collectionMemberIds.length) { + object.collectionMemberIds = []; + for (var j = 0; j < message.collectionMemberIds.length; ++j) + object.collectionMemberIds[j] = message.collectionMemberIds[j]; + } + if (message.gtin != null && message.hasOwnProperty("gtin")) + object.gtin = message.gtin; + if (message.categories && message.categories.length) { + object.categories = []; + for (var j = 0; j < message.categories.length; ++j) + object.categories[j] = message.categories[j]; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.brands && message.brands.length) { + object.brands = []; + for (var j = 0; j < message.brands.length; ++j) + object.brands[j] = message.brands[j]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.retail.v2beta.CustomAttribute.toObject(message.attributes[keys2[j]], options); + } + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) + object.priceInfo = $root.google.cloud.retail.v2beta.PriceInfo.toObject(message.priceInfo, options); + if (message.rating != null && message.hasOwnProperty("rating")) + object.rating = $root.google.cloud.retail.v2beta.Rating.toObject(message.rating, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (options.oneofs) + object.expiration = "expireTime"; + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + if (options.oneofs) + object.expiration = "ttl"; + } + if (message.availableTime != null && message.hasOwnProperty("availableTime")) + object.availableTime = $root.google.protobuf.Timestamp.toObject(message.availableTime, options); + if (message.availability != null && message.hasOwnProperty("availability")) + object.availability = options.enums === String ? $root.google.cloud.retail.v2beta.Product.Availability[message.availability] : message.availability; + if (message.availableQuantity != null && message.hasOwnProperty("availableQuantity")) + object.availableQuantity = $root.google.protobuf.Int32Value.toObject(message.availableQuantity, options); + if (message.fulfillmentInfo && message.fulfillmentInfo.length) { + object.fulfillmentInfo = []; + for (var j = 0; j < message.fulfillmentInfo.length; ++j) + object.fulfillmentInfo[j] = $root.google.cloud.retail.v2beta.FulfillmentInfo.toObject(message.fulfillmentInfo[j], options); + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.images && message.images.length) { + object.images = []; + for (var j = 0; j < message.images.length; ++j) + object.images[j] = $root.google.cloud.retail.v2beta.Image.toObject(message.images[j], options); + } + if (message.audience != null && message.hasOwnProperty("audience")) + object.audience = $root.google.cloud.retail.v2beta.Audience.toObject(message.audience, options); + if (message.colorInfo != null && message.hasOwnProperty("colorInfo")) + object.colorInfo = $root.google.cloud.retail.v2beta.ColorInfo.toObject(message.colorInfo, options); + if (message.sizes && message.sizes.length) { + object.sizes = []; + for (var j = 0; j < message.sizes.length; ++j) + object.sizes[j] = message.sizes[j]; + } + if (message.materials && message.materials.length) { + object.materials = []; + for (var j = 0; j < message.materials.length; ++j) + object.materials[j] = message.materials[j]; + } + if (message.patterns && message.patterns.length) { + object.patterns = []; + for (var j = 0; j < message.patterns.length; ++j) + object.patterns[j] = message.patterns[j]; + } + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = message.conditions[j]; + } + if (message.retrievableFields != null && message.hasOwnProperty("retrievableFields")) + object.retrievableFields = $root.google.protobuf.FieldMask.toObject(message.retrievableFields, options); + if (message.variants && message.variants.length) { + object.variants = []; + for (var j = 0; j < message.variants.length; ++j) + object.variants[j] = $root.google.cloud.retail.v2beta.Product.toObject(message.variants[j], options); + } + if (message.publishTime != null && message.hasOwnProperty("publishTime")) + object.publishTime = $root.google.protobuf.Timestamp.toObject(message.publishTime, options); + if (message.promotions && message.promotions.length) { + object.promotions = []; + for (var j = 0; j < message.promotions.length; ++j) + object.promotions[j] = $root.google.cloud.retail.v2beta.Promotion.toObject(message.promotions[j], options); + } + return object; + }; + + /** + * Converts this Product to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Product + * @instance + * @returns {Object.} JSON object + */ + Product.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.retail.v2beta.Product.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} PRIMARY=1 PRIMARY value + * @property {number} VARIANT=2 VARIANT value + * @property {number} COLLECTION=3 COLLECTION value + */ + Product.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY"] = 1; + values[valuesById[2] = "VARIANT"] = 2; + values[valuesById[3] = "COLLECTION"] = 3; + return values; + })(); + + /** + * Availability enum. + * @name google.cloud.retail.v2beta.Product.Availability + * @enum {number} + * @property {number} AVAILABILITY_UNSPECIFIED=0 AVAILABILITY_UNSPECIFIED value + * @property {number} IN_STOCK=1 IN_STOCK value + * @property {number} OUT_OF_STOCK=2 OUT_OF_STOCK value + * @property {number} PREORDER=3 PREORDER value + * @property {number} BACKORDER=4 BACKORDER value + */ + Product.Availability = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AVAILABILITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN_STOCK"] = 1; + values[valuesById[2] = "OUT_OF_STOCK"] = 2; + values[valuesById[3] = "PREORDER"] = 3; + values[valuesById[4] = "BACKORDER"] = 4; + return values; + })(); + + return Product; + })(); + + v2beta.Promotion = (function() { + + /** + * Properties of a Promotion. + * @memberof google.cloud.retail.v2beta + * @interface IPromotion + * @property {string|null} [promotionId] Promotion promotionId + */ + + /** + * Constructs a new Promotion. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a Promotion. + * @implements IPromotion + * @constructor + * @param {google.cloud.retail.v2beta.IPromotion=} [properties] Properties to set + */ + function Promotion(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]]; + } + + /** + * Promotion promotionId. + * @member {string} promotionId + * @memberof google.cloud.retail.v2beta.Promotion + * @instance + */ + Promotion.prototype.promotionId = ""; + + /** + * Creates a new Promotion instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Promotion + * @static + * @param {google.cloud.retail.v2beta.IPromotion=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Promotion} Promotion instance + */ + Promotion.create = function create(properties) { + return new Promotion(properties); + }; + + /** + * Encodes the specified Promotion message. Does not implicitly {@link google.cloud.retail.v2beta.Promotion.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Promotion + * @static + * @param {google.cloud.retail.v2beta.IPromotion} message Promotion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Promotion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.promotionId != null && Object.hasOwnProperty.call(message, "promotionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.promotionId); + return writer; + }; + + /** + * Encodes the specified Promotion message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Promotion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Promotion + * @static + * @param {google.cloud.retail.v2beta.IPromotion} message Promotion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Promotion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Promotion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Promotion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Promotion} Promotion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Promotion.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.v2beta.Promotion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.promotionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Promotion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Promotion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Promotion} Promotion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Promotion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Promotion message. + * @function verify + * @memberof google.cloud.retail.v2beta.Promotion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Promotion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.promotionId != null && message.hasOwnProperty("promotionId")) + if (!$util.isString(message.promotionId)) + return "promotionId: string expected"; + return null; + }; + + /** + * Creates a Promotion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Promotion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Promotion} Promotion + */ + Promotion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Promotion) + return object; + var message = new $root.google.cloud.retail.v2beta.Promotion(); + if (object.promotionId != null) + message.promotionId = String(object.promotionId); + return message; + }; + + /** + * Creates a plain object from a Promotion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Promotion + * @static + * @param {google.cloud.retail.v2beta.Promotion} message Promotion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Promotion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.promotionId = ""; + if (message.promotionId != null && message.hasOwnProperty("promotionId")) + object.promotionId = message.promotionId; + return object; + }; + + /** + * Converts this Promotion to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Promotion + * @instance + * @returns {Object.} JSON object + */ + Promotion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Promotion; + })(); + + v2beta.UserEvent = (function() { + + /** + * Properties of a UserEvent. + * @memberof google.cloud.retail.v2beta + * @interface IUserEvent + * @property {string|null} [eventType] UserEvent eventType + * @property {string|null} [visitorId] UserEvent visitorId + * @property {string|null} [sessionId] UserEvent sessionId + * @property {google.protobuf.ITimestamp|null} [eventTime] UserEvent eventTime + * @property {Array.|null} [experimentIds] UserEvent experimentIds + * @property {string|null} [attributionToken] UserEvent attributionToken + * @property {Array.|null} [productDetails] UserEvent productDetails + * @property {google.cloud.retail.v2beta.ICompletionDetail|null} [completionDetail] UserEvent completionDetail + * @property {Object.|null} [attributes] UserEvent attributes + * @property {string|null} [cartId] UserEvent cartId + * @property {google.cloud.retail.v2beta.IPurchaseTransaction|null} [purchaseTransaction] UserEvent purchaseTransaction + * @property {string|null} [searchQuery] UserEvent searchQuery + * @property {string|null} [filter] UserEvent filter + * @property {string|null} [orderBy] UserEvent orderBy + * @property {number|null} [offset] UserEvent offset + * @property {Array.|null} [pageCategories] UserEvent pageCategories + * @property {google.cloud.retail.v2beta.IUserInfo|null} [userInfo] UserEvent userInfo + * @property {string|null} [uri] UserEvent uri + * @property {string|null} [referrerUri] UserEvent referrerUri + * @property {string|null} [pageViewId] UserEvent pageViewId + */ + + /** + * Constructs a new UserEvent. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a UserEvent. + * @implements IUserEvent + * @constructor + * @param {google.cloud.retail.v2beta.IUserEvent=} [properties] Properties to set + */ + function UserEvent(properties) { + this.experimentIds = []; + this.productDetails = []; + this.attributes = {}; + this.pageCategories = []; + 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]]; + } + + /** + * UserEvent eventType. + * @member {string} eventType + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.eventType = ""; + + /** + * UserEvent visitorId. + * @member {string} visitorId + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.visitorId = ""; + + /** + * UserEvent sessionId. + * @member {string} sessionId + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.sessionId = ""; + + /** + * UserEvent eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.eventTime = null; + + /** + * UserEvent experimentIds. + * @member {Array.} experimentIds + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.experimentIds = $util.emptyArray; + + /** + * UserEvent attributionToken. + * @member {string} attributionToken + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.attributionToken = ""; + + /** + * UserEvent productDetails. + * @member {Array.} productDetails + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.productDetails = $util.emptyArray; + + /** + * UserEvent completionDetail. + * @member {google.cloud.retail.v2beta.ICompletionDetail|null|undefined} completionDetail + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.completionDetail = null; + + /** + * UserEvent attributes. + * @member {Object.} attributes + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.attributes = $util.emptyObject; + + /** + * UserEvent cartId. + * @member {string} cartId + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.cartId = ""; + + /** + * UserEvent purchaseTransaction. + * @member {google.cloud.retail.v2beta.IPurchaseTransaction|null|undefined} purchaseTransaction + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.purchaseTransaction = null; + + /** + * UserEvent searchQuery. + * @member {string} searchQuery + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.searchQuery = ""; + + /** + * UserEvent filter. + * @member {string} filter + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.filter = ""; + + /** + * UserEvent orderBy. + * @member {string} orderBy + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.orderBy = ""; + + /** + * UserEvent offset. + * @member {number} offset + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.offset = 0; + + /** + * UserEvent pageCategories. + * @member {Array.} pageCategories + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.pageCategories = $util.emptyArray; + + /** + * UserEvent userInfo. + * @member {google.cloud.retail.v2beta.IUserInfo|null|undefined} userInfo + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.userInfo = null; + + /** + * UserEvent uri. + * @member {string} uri + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.uri = ""; + + /** + * UserEvent referrerUri. + * @member {string} referrerUri + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.referrerUri = ""; + + /** + * UserEvent pageViewId. + * @member {string} pageViewId + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + */ + UserEvent.prototype.pageViewId = ""; + + /** + * Creates a new UserEvent instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.UserEvent + * @static + * @param {google.cloud.retail.v2beta.IUserEvent=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.UserEvent} UserEvent instance + */ + UserEvent.create = function create(properties) { + return new UserEvent(properties); + }; + + /** + * Encodes the specified UserEvent message. Does not implicitly {@link google.cloud.retail.v2beta.UserEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.UserEvent + * @static + * @param {google.cloud.retail.v2beta.IUserEvent} message UserEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventType); + if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.visitorId); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.experimentIds != null && message.experimentIds.length) + for (var i = 0; i < message.experimentIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.experimentIds[i]); + if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.attributionToken); + if (message.productDetails != null && message.productDetails.length) + for (var i = 0; i < message.productDetails.length; ++i) + $root.google.cloud.retail.v2beta.ProductDetail.encode(message.productDetails[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.retail.v2beta.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.cartId != null && Object.hasOwnProperty.call(message, "cartId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.cartId); + if (message.purchaseTransaction != null && Object.hasOwnProperty.call(message, "purchaseTransaction")) + $root.google.cloud.retail.v2beta.PurchaseTransaction.encode(message.purchaseTransaction, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.searchQuery != null && Object.hasOwnProperty.call(message, "searchQuery")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.searchQuery); + if (message.pageCategories != null && message.pageCategories.length) + for (var i = 0; i < message.pageCategories.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.pageCategories[i]); + if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) + $root.google.cloud.retail.v2beta.UserInfo.encode(message.userInfo, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.uri); + if (message.referrerUri != null && Object.hasOwnProperty.call(message, "referrerUri")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.referrerUri); + if (message.pageViewId != null && Object.hasOwnProperty.call(message, "pageViewId")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.pageViewId); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.orderBy); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.offset); + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.sessionId); + if (message.completionDetail != null && Object.hasOwnProperty.call(message, "completionDetail")) + $root.google.cloud.retail.v2beta.CompletionDetail.encode(message.completionDetail, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserEvent message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.UserEvent + * @static + * @param {google.cloud.retail.v2beta.IUserEvent} message UserEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.UserEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.UserEvent} UserEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserEvent.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.v2beta.UserEvent(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventType = reader.string(); + break; + case 2: + message.visitorId = reader.string(); + break; + case 21: + message.sessionId = reader.string(); + break; + case 3: + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.experimentIds && message.experimentIds.length)) + message.experimentIds = []; + message.experimentIds.push(reader.string()); + break; + case 5: + message.attributionToken = reader.string(); + break; + case 6: + if (!(message.productDetails && message.productDetails.length)) + message.productDetails = []; + message.productDetails.push($root.google.cloud.retail.v2beta.ProductDetail.decode(reader, reader.uint32())); + break; + case 22: + message.completionDetail = $root.google.cloud.retail.v2beta.CompletionDetail.decode(reader, reader.uint32()); + break; + case 7: + if (message.attributes === $util.emptyObject) + message.attributes = {}; + 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.v2beta.CustomAttribute.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + case 8: + message.cartId = reader.string(); + break; + case 9: + message.purchaseTransaction = $root.google.cloud.retail.v2beta.PurchaseTransaction.decode(reader, reader.uint32()); + break; + case 10: + message.searchQuery = reader.string(); + break; + case 16: + message.filter = reader.string(); + break; + case 17: + message.orderBy = reader.string(); + break; + case 18: + message.offset = reader.int32(); + break; + case 11: + if (!(message.pageCategories && message.pageCategories.length)) + message.pageCategories = []; + message.pageCategories.push(reader.string()); + break; + case 12: + message.userInfo = $root.google.cloud.retail.v2beta.UserInfo.decode(reader, reader.uint32()); + break; + case 13: + message.uri = reader.string(); + break; + case 14: + message.referrerUri = reader.string(); + break; + case 15: + message.pageViewId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.UserEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.UserEvent} UserEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserEvent message. + * @function verify + * @memberof google.cloud.retail.v2beta.UserEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.eventType != null && message.hasOwnProperty("eventType")) + if (!$util.isString(message.eventType)) + return "eventType: string expected"; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + if (!$util.isString(message.visitorId)) + return "visitorId: string expected"; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + if (!$util.isString(message.sessionId)) + return "sessionId: string expected"; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.experimentIds != null && message.hasOwnProperty("experimentIds")) { + if (!Array.isArray(message.experimentIds)) + return "experimentIds: array expected"; + for (var i = 0; i < message.experimentIds.length; ++i) + if (!$util.isString(message.experimentIds[i])) + return "experimentIds: string[] expected"; + } + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + if (!$util.isString(message.attributionToken)) + return "attributionToken: string expected"; + if (message.productDetails != null && message.hasOwnProperty("productDetails")) { + if (!Array.isArray(message.productDetails)) + return "productDetails: array expected"; + for (var i = 0; i < message.productDetails.length; ++i) { + var error = $root.google.cloud.retail.v2beta.ProductDetail.verify(message.productDetails[i]); + if (error) + return "productDetails." + error; + } + } + if (message.completionDetail != null && message.hasOwnProperty("completionDetail")) { + var error = $root.google.cloud.retail.v2beta.CompletionDetail.verify(message.completionDetail); + if (error) + return "completionDetail." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.retail.v2beta.CustomAttribute.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + if (message.cartId != null && message.hasOwnProperty("cartId")) + if (!$util.isString(message.cartId)) + return "cartId: string expected"; + if (message.purchaseTransaction != null && message.hasOwnProperty("purchaseTransaction")) { + var error = $root.google.cloud.retail.v2beta.PurchaseTransaction.verify(message.purchaseTransaction); + if (error) + return "purchaseTransaction." + error; + } + if (message.searchQuery != null && message.hasOwnProperty("searchQuery")) + if (!$util.isString(message.searchQuery)) + return "searchQuery: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.pageCategories != null && message.hasOwnProperty("pageCategories")) { + if (!Array.isArray(message.pageCategories)) + return "pageCategories: array expected"; + for (var i = 0; i < message.pageCategories.length; ++i) + if (!$util.isString(message.pageCategories[i])) + return "pageCategories: string[] expected"; + } + if (message.userInfo != null && message.hasOwnProperty("userInfo")) { + var error = $root.google.cloud.retail.v2beta.UserInfo.verify(message.userInfo); + if (error) + return "userInfo." + error; + } + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.referrerUri != null && message.hasOwnProperty("referrerUri")) + if (!$util.isString(message.referrerUri)) + return "referrerUri: string expected"; + if (message.pageViewId != null && message.hasOwnProperty("pageViewId")) + if (!$util.isString(message.pageViewId)) + return "pageViewId: string expected"; + return null; + }; + + /** + * Creates a UserEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.UserEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.UserEvent} UserEvent + */ + UserEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.UserEvent) + return object; + var message = new $root.google.cloud.retail.v2beta.UserEvent(); + if (object.eventType != null) + message.eventType = String(object.eventType); + if (object.visitorId != null) + message.visitorId = String(object.visitorId); + if (object.sessionId != null) + message.sessionId = String(object.sessionId); + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.UserEvent.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.experimentIds) { + if (!Array.isArray(object.experimentIds)) + throw TypeError(".google.cloud.retail.v2beta.UserEvent.experimentIds: array expected"); + message.experimentIds = []; + for (var i = 0; i < object.experimentIds.length; ++i) + message.experimentIds[i] = String(object.experimentIds[i]); + } + if (object.attributionToken != null) + message.attributionToken = String(object.attributionToken); + if (object.productDetails) { + if (!Array.isArray(object.productDetails)) + throw TypeError(".google.cloud.retail.v2beta.UserEvent.productDetails: array expected"); + message.productDetails = []; + for (var i = 0; i < object.productDetails.length; ++i) { + if (typeof object.productDetails[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.UserEvent.productDetails: object expected"); + message.productDetails[i] = $root.google.cloud.retail.v2beta.ProductDetail.fromObject(object.productDetails[i]); + } + } + if (object.completionDetail != null) { + if (typeof object.completionDetail !== "object") + throw TypeError(".google.cloud.retail.v2beta.UserEvent.completionDetail: object expected"); + message.completionDetail = $root.google.cloud.retail.v2beta.CompletionDetail.fromObject(object.completionDetail); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.retail.v2beta.UserEvent.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2beta.UserEvent.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.retail.v2beta.CustomAttribute.fromObject(object.attributes[keys[i]]); + } + } + if (object.cartId != null) + message.cartId = String(object.cartId); + if (object.purchaseTransaction != null) { + if (typeof object.purchaseTransaction !== "object") + throw TypeError(".google.cloud.retail.v2beta.UserEvent.purchaseTransaction: object expected"); + message.purchaseTransaction = $root.google.cloud.retail.v2beta.PurchaseTransaction.fromObject(object.purchaseTransaction); + } + if (object.searchQuery != null) + message.searchQuery = String(object.searchQuery); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.offset != null) + message.offset = object.offset | 0; + if (object.pageCategories) { + if (!Array.isArray(object.pageCategories)) + throw TypeError(".google.cloud.retail.v2beta.UserEvent.pageCategories: array expected"); + message.pageCategories = []; + for (var i = 0; i < object.pageCategories.length; ++i) + message.pageCategories[i] = String(object.pageCategories[i]); + } + if (object.userInfo != null) { + if (typeof object.userInfo !== "object") + throw TypeError(".google.cloud.retail.v2beta.UserEvent.userInfo: object expected"); + message.userInfo = $root.google.cloud.retail.v2beta.UserInfo.fromObject(object.userInfo); + } + if (object.uri != null) + message.uri = String(object.uri); + if (object.referrerUri != null) + message.referrerUri = String(object.referrerUri); + if (object.pageViewId != null) + message.pageViewId = String(object.pageViewId); + return message; + }; + + /** + * Creates a plain object from a UserEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.UserEvent + * @static + * @param {google.cloud.retail.v2beta.UserEvent} message UserEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.experimentIds = []; + object.productDetails = []; + object.pageCategories = []; + } + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.eventType = ""; + object.visitorId = ""; + object.eventTime = null; + object.attributionToken = ""; + object.cartId = ""; + object.purchaseTransaction = null; + object.searchQuery = ""; + object.userInfo = null; + object.uri = ""; + object.referrerUri = ""; + object.pageViewId = ""; + object.filter = ""; + object.orderBy = ""; + object.offset = 0; + object.sessionId = ""; + object.completionDetail = null; + } + if (message.eventType != null && message.hasOwnProperty("eventType")) + object.eventType = message.eventType; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + object.visitorId = message.visitorId; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.experimentIds && message.experimentIds.length) { + object.experimentIds = []; + for (var j = 0; j < message.experimentIds.length; ++j) + object.experimentIds[j] = message.experimentIds[j]; + } + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + object.attributionToken = message.attributionToken; + if (message.productDetails && message.productDetails.length) { + object.productDetails = []; + for (var j = 0; j < message.productDetails.length; ++j) + object.productDetails[j] = $root.google.cloud.retail.v2beta.ProductDetail.toObject(message.productDetails[j], options); + } + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.retail.v2beta.CustomAttribute.toObject(message.attributes[keys2[j]], options); + } + if (message.cartId != null && message.hasOwnProperty("cartId")) + object.cartId = message.cartId; + if (message.purchaseTransaction != null && message.hasOwnProperty("purchaseTransaction")) + object.purchaseTransaction = $root.google.cloud.retail.v2beta.PurchaseTransaction.toObject(message.purchaseTransaction, options); + if (message.searchQuery != null && message.hasOwnProperty("searchQuery")) + object.searchQuery = message.searchQuery; + if (message.pageCategories && message.pageCategories.length) { + object.pageCategories = []; + for (var j = 0; j < message.pageCategories.length; ++j) + object.pageCategories[j] = message.pageCategories[j]; + } + if (message.userInfo != null && message.hasOwnProperty("userInfo")) + object.userInfo = $root.google.cloud.retail.v2beta.UserInfo.toObject(message.userInfo, options); + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.referrerUri != null && message.hasOwnProperty("referrerUri")) + object.referrerUri = message.referrerUri; + if (message.pageViewId != null && message.hasOwnProperty("pageViewId")) + object.pageViewId = message.pageViewId; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + object.sessionId = message.sessionId; + if (message.completionDetail != null && message.hasOwnProperty("completionDetail")) + object.completionDetail = $root.google.cloud.retail.v2beta.CompletionDetail.toObject(message.completionDetail, options); + return object; + }; + + /** + * Converts this UserEvent to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.UserEvent + * @instance + * @returns {Object.} JSON object + */ + UserEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UserEvent; + })(); + + v2beta.ProductDetail = (function() { + + /** + * Properties of a ProductDetail. + * @memberof google.cloud.retail.v2beta + * @interface IProductDetail + * @property {google.cloud.retail.v2beta.IProduct|null} [product] ProductDetail product + * @property {google.protobuf.IInt32Value|null} [quantity] ProductDetail quantity + */ + + /** + * Constructs a new ProductDetail. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a ProductDetail. + * @implements IProductDetail + * @constructor + * @param {google.cloud.retail.v2beta.IProductDetail=} [properties] Properties to set + */ + function ProductDetail(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]]; + } + + /** + * ProductDetail product. + * @member {google.cloud.retail.v2beta.IProduct|null|undefined} product + * @memberof google.cloud.retail.v2beta.ProductDetail + * @instance + */ + ProductDetail.prototype.product = null; + + /** + * ProductDetail quantity. + * @member {google.protobuf.IInt32Value|null|undefined} quantity + * @memberof google.cloud.retail.v2beta.ProductDetail + * @instance + */ + ProductDetail.prototype.quantity = null; + + /** + * Creates a new ProductDetail instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.ProductDetail + * @static + * @param {google.cloud.retail.v2beta.IProductDetail=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ProductDetail} ProductDetail instance + */ + ProductDetail.create = function create(properties) { + return new ProductDetail(properties); + }; + + /** + * Encodes the specified ProductDetail message. Does not implicitly {@link google.cloud.retail.v2beta.ProductDetail.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ProductDetail + * @static + * @param {google.cloud.retail.v2beta.IProductDetail} message ProductDetail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductDetail.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + $root.google.cloud.retail.v2beta.Product.encode(message.product, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + $root.google.protobuf.Int32Value.encode(message.quantity, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProductDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ProductDetail.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ProductDetail + * @static + * @param {google.cloud.retail.v2beta.IProductDetail} message ProductDetail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductDetail.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProductDetail message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ProductDetail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ProductDetail} ProductDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductDetail.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.v2beta.ProductDetail(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.product = $root.google.cloud.retail.v2beta.Product.decode(reader, reader.uint32()); + break; + case 2: + message.quantity = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductDetail message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ProductDetail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ProductDetail} ProductDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductDetail.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductDetail message. + * @function verify + * @memberof google.cloud.retail.v2beta.ProductDetail + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductDetail.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.retail.v2beta.Product.verify(message.product); + if (error) + return "product." + error; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) { + var error = $root.google.protobuf.Int32Value.verify(message.quantity); + if (error) + return "quantity." + error; + } + return null; + }; + + /** + * Creates a ProductDetail message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ProductDetail + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ProductDetail} ProductDetail + */ + ProductDetail.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ProductDetail) + return object; + var message = new $root.google.cloud.retail.v2beta.ProductDetail(); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.retail.v2beta.ProductDetail.product: object expected"); + message.product = $root.google.cloud.retail.v2beta.Product.fromObject(object.product); + } + if (object.quantity != null) { + if (typeof object.quantity !== "object") + throw TypeError(".google.cloud.retail.v2beta.ProductDetail.quantity: object expected"); + message.quantity = $root.google.protobuf.Int32Value.fromObject(object.quantity); + } + return message; + }; + + /** + * Creates a plain object from a ProductDetail message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ProductDetail + * @static + * @param {google.cloud.retail.v2beta.ProductDetail} message ProductDetail + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductDetail.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.product = null; + object.quantity = null; + } + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.retail.v2beta.Product.toObject(message.product, options); + if (message.quantity != null && message.hasOwnProperty("quantity")) + object.quantity = $root.google.protobuf.Int32Value.toObject(message.quantity, options); + return object; + }; + + /** + * Converts this ProductDetail to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ProductDetail + * @instance + * @returns {Object.} JSON object + */ + ProductDetail.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProductDetail; + })(); + + v2beta.CompletionDetail = (function() { + + /** + * Properties of a CompletionDetail. + * @memberof google.cloud.retail.v2beta + * @interface ICompletionDetail + * @property {string|null} [completionAttributionToken] CompletionDetail completionAttributionToken + * @property {string|null} [selectedSuggestion] CompletionDetail selectedSuggestion + * @property {number|null} [selectedPosition] CompletionDetail selectedPosition + */ + + /** + * Constructs a new CompletionDetail. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a CompletionDetail. + * @implements ICompletionDetail + * @constructor + * @param {google.cloud.retail.v2beta.ICompletionDetail=} [properties] Properties to set + */ + function CompletionDetail(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]]; + } + + /** + * CompletionDetail completionAttributionToken. + * @member {string} completionAttributionToken + * @memberof google.cloud.retail.v2beta.CompletionDetail + * @instance + */ + CompletionDetail.prototype.completionAttributionToken = ""; + + /** + * CompletionDetail selectedSuggestion. + * @member {string} selectedSuggestion + * @memberof google.cloud.retail.v2beta.CompletionDetail + * @instance + */ + CompletionDetail.prototype.selectedSuggestion = ""; + + /** + * CompletionDetail selectedPosition. + * @member {number} selectedPosition + * @memberof google.cloud.retail.v2beta.CompletionDetail + * @instance + */ + CompletionDetail.prototype.selectedPosition = 0; + + /** + * Creates a new CompletionDetail instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.CompletionDetail + * @static + * @param {google.cloud.retail.v2beta.ICompletionDetail=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.CompletionDetail} CompletionDetail instance + */ + CompletionDetail.create = function create(properties) { + return new CompletionDetail(properties); + }; + + /** + * Encodes the specified CompletionDetail message. Does not implicitly {@link google.cloud.retail.v2beta.CompletionDetail.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.CompletionDetail + * @static + * @param {google.cloud.retail.v2beta.ICompletionDetail} message CompletionDetail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompletionDetail.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.completionAttributionToken != null && Object.hasOwnProperty.call(message, "completionAttributionToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.completionAttributionToken); + if (message.selectedSuggestion != null && Object.hasOwnProperty.call(message, "selectedSuggestion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.selectedSuggestion); + if (message.selectedPosition != null && Object.hasOwnProperty.call(message, "selectedPosition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.selectedPosition); + return writer; + }; + + /** + * Encodes the specified CompletionDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompletionDetail.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.CompletionDetail + * @static + * @param {google.cloud.retail.v2beta.ICompletionDetail} message CompletionDetail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompletionDetail.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompletionDetail message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.CompletionDetail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.CompletionDetail} CompletionDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompletionDetail.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.v2beta.CompletionDetail(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionAttributionToken = reader.string(); + break; + case 2: + message.selectedSuggestion = reader.string(); + break; + case 3: + message.selectedPosition = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompletionDetail message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.CompletionDetail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.CompletionDetail} CompletionDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompletionDetail.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompletionDetail message. + * @function verify + * @memberof google.cloud.retail.v2beta.CompletionDetail + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompletionDetail.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.completionAttributionToken != null && message.hasOwnProperty("completionAttributionToken")) + if (!$util.isString(message.completionAttributionToken)) + return "completionAttributionToken: string expected"; + if (message.selectedSuggestion != null && message.hasOwnProperty("selectedSuggestion")) + if (!$util.isString(message.selectedSuggestion)) + return "selectedSuggestion: string expected"; + if (message.selectedPosition != null && message.hasOwnProperty("selectedPosition")) + if (!$util.isInteger(message.selectedPosition)) + return "selectedPosition: integer expected"; + return null; + }; + + /** + * Creates a CompletionDetail message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.CompletionDetail + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.CompletionDetail} CompletionDetail + */ + CompletionDetail.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.CompletionDetail) + return object; + var message = new $root.google.cloud.retail.v2beta.CompletionDetail(); + if (object.completionAttributionToken != null) + message.completionAttributionToken = String(object.completionAttributionToken); + if (object.selectedSuggestion != null) + message.selectedSuggestion = String(object.selectedSuggestion); + if (object.selectedPosition != null) + message.selectedPosition = object.selectedPosition | 0; + return message; + }; + + /** + * Creates a plain object from a CompletionDetail message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.CompletionDetail + * @static + * @param {google.cloud.retail.v2beta.CompletionDetail} message CompletionDetail + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompletionDetail.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.completionAttributionToken = ""; + object.selectedSuggestion = ""; + object.selectedPosition = 0; + } + if (message.completionAttributionToken != null && message.hasOwnProperty("completionAttributionToken")) + object.completionAttributionToken = message.completionAttributionToken; + if (message.selectedSuggestion != null && message.hasOwnProperty("selectedSuggestion")) + object.selectedSuggestion = message.selectedSuggestion; + if (message.selectedPosition != null && message.hasOwnProperty("selectedPosition")) + object.selectedPosition = message.selectedPosition; + return object; + }; + + /** + * Converts this CompletionDetail to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.CompletionDetail + * @instance + * @returns {Object.} JSON object + */ + CompletionDetail.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CompletionDetail; + })(); + + v2beta.PurchaseTransaction = (function() { + + /** + * Properties of a PurchaseTransaction. + * @memberof google.cloud.retail.v2beta + * @interface IPurchaseTransaction + * @property {string|null} [id] PurchaseTransaction id + * @property {number|null} [revenue] PurchaseTransaction revenue + * @property {number|null} [tax] PurchaseTransaction tax + * @property {number|null} [cost] PurchaseTransaction cost + * @property {string|null} [currencyCode] PurchaseTransaction currencyCode + */ + + /** + * Constructs a new PurchaseTransaction. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a PurchaseTransaction. + * @implements IPurchaseTransaction + * @constructor + * @param {google.cloud.retail.v2beta.IPurchaseTransaction=} [properties] Properties to set + */ + function PurchaseTransaction(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]]; + } + + /** + * PurchaseTransaction id. + * @member {string} id + * @memberof google.cloud.retail.v2beta.PurchaseTransaction + * @instance + */ + PurchaseTransaction.prototype.id = ""; + + /** + * PurchaseTransaction revenue. + * @member {number} revenue + * @memberof google.cloud.retail.v2beta.PurchaseTransaction + * @instance + */ + PurchaseTransaction.prototype.revenue = 0; + + /** + * PurchaseTransaction tax. + * @member {number} tax + * @memberof google.cloud.retail.v2beta.PurchaseTransaction + * @instance + */ + PurchaseTransaction.prototype.tax = 0; + + /** + * PurchaseTransaction cost. + * @member {number} cost + * @memberof google.cloud.retail.v2beta.PurchaseTransaction + * @instance + */ + PurchaseTransaction.prototype.cost = 0; + + /** + * PurchaseTransaction currencyCode. + * @member {string} currencyCode + * @memberof google.cloud.retail.v2beta.PurchaseTransaction + * @instance + */ + PurchaseTransaction.prototype.currencyCode = ""; + + /** + * Creates a new PurchaseTransaction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.PurchaseTransaction + * @static + * @param {google.cloud.retail.v2beta.IPurchaseTransaction=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.PurchaseTransaction} PurchaseTransaction instance + */ + PurchaseTransaction.create = function create(properties) { + return new PurchaseTransaction(properties); + }; + + /** + * Encodes the specified PurchaseTransaction message. Does not implicitly {@link google.cloud.retail.v2beta.PurchaseTransaction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.PurchaseTransaction + * @static + * @param {google.cloud.retail.v2beta.IPurchaseTransaction} message PurchaseTransaction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurchaseTransaction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.revenue != null && Object.hasOwnProperty.call(message, "revenue")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.revenue); + if (message.tax != null && Object.hasOwnProperty.call(message, "tax")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.tax); + if (message.cost != null && Object.hasOwnProperty.call(message, "cost")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.cost); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.currencyCode); + return writer; + }; + + /** + * Encodes the specified PurchaseTransaction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurchaseTransaction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.PurchaseTransaction + * @static + * @param {google.cloud.retail.v2beta.IPurchaseTransaction} message PurchaseTransaction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurchaseTransaction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurchaseTransaction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.PurchaseTransaction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.PurchaseTransaction} PurchaseTransaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurchaseTransaction.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.v2beta.PurchaseTransaction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.revenue = reader.float(); + break; + case 3: + message.tax = reader.float(); + break; + case 4: + message.cost = reader.float(); + break; + case 5: + message.currencyCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PurchaseTransaction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.PurchaseTransaction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.PurchaseTransaction} PurchaseTransaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurchaseTransaction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurchaseTransaction message. + * @function verify + * @memberof google.cloud.retail.v2beta.PurchaseTransaction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurchaseTransaction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.revenue != null && message.hasOwnProperty("revenue")) + if (typeof message.revenue !== "number") + return "revenue: number expected"; + if (message.tax != null && message.hasOwnProperty("tax")) + if (typeof message.tax !== "number") + return "tax: number expected"; + if (message.cost != null && message.hasOwnProperty("cost")) + if (typeof message.cost !== "number") + return "cost: number expected"; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + return null; + }; + + /** + * Creates a PurchaseTransaction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.PurchaseTransaction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.PurchaseTransaction} PurchaseTransaction + */ + PurchaseTransaction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.PurchaseTransaction) + return object; + var message = new $root.google.cloud.retail.v2beta.PurchaseTransaction(); + if (object.id != null) + message.id = String(object.id); + if (object.revenue != null) + message.revenue = Number(object.revenue); + if (object.tax != null) + message.tax = Number(object.tax); + if (object.cost != null) + message.cost = Number(object.cost); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + return message; + }; + + /** + * Creates a plain object from a PurchaseTransaction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.PurchaseTransaction + * @static + * @param {google.cloud.retail.v2beta.PurchaseTransaction} message PurchaseTransaction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurchaseTransaction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.revenue = 0; + object.tax = 0; + object.cost = 0; + object.currencyCode = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.revenue != null && message.hasOwnProperty("revenue")) + object.revenue = options.json && !isFinite(message.revenue) ? String(message.revenue) : message.revenue; + if (message.tax != null && message.hasOwnProperty("tax")) + object.tax = options.json && !isFinite(message.tax) ? String(message.tax) : message.tax; + if (message.cost != null && message.hasOwnProperty("cost")) + object.cost = options.json && !isFinite(message.cost) ? String(message.cost) : message.cost; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + return object; + }; + + /** + * Converts this PurchaseTransaction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.PurchaseTransaction + * @instance + * @returns {Object.} JSON object + */ + PurchaseTransaction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PurchaseTransaction; + })(); + + v2beta.CatalogService = (function() { + + /** + * Constructs a new CatalogService service. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a CatalogService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function CatalogService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CatalogService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CatalogService; + + /** + * Creates new CatalogService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2beta.CatalogService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {CatalogService} RPC service. Useful where requests and/or responses are streamed. + */ + CatalogService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#listCatalogs}. + * @memberof google.cloud.retail.v2beta.CatalogService + * @typedef ListCatalogsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.ListCatalogsResponse} [response] ListCatalogsResponse + */ + + /** + * Calls ListCatalogs. + * @function listCatalogs + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IListCatalogsRequest} request ListCatalogsRequest message or plain object + * @param {google.cloud.retail.v2beta.CatalogService.ListCatalogsCallback} callback Node-style callback called with the error, if any, and ListCatalogsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.listCatalogs = function listCatalogs(request, callback) { + return this.rpcCall(listCatalogs, $root.google.cloud.retail.v2beta.ListCatalogsRequest, $root.google.cloud.retail.v2beta.ListCatalogsResponse, request, callback); + }, "name", { value: "ListCatalogs" }); + + /** + * Calls ListCatalogs. + * @function listCatalogs + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IListCatalogsRequest} request ListCatalogsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#updateCatalog}. + * @memberof google.cloud.retail.v2beta.CatalogService + * @typedef UpdateCatalogCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.Catalog} [response] Catalog + */ + + /** + * Calls UpdateCatalog. + * @function updateCatalog + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IUpdateCatalogRequest} request UpdateCatalogRequest message or plain object + * @param {google.cloud.retail.v2beta.CatalogService.UpdateCatalogCallback} callback Node-style callback called with the error, if any, and Catalog + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.updateCatalog = function updateCatalog(request, callback) { + return this.rpcCall(updateCatalog, $root.google.cloud.retail.v2beta.UpdateCatalogRequest, $root.google.cloud.retail.v2beta.Catalog, request, callback); + }, "name", { value: "UpdateCatalog" }); + + /** + * Calls UpdateCatalog. + * @function updateCatalog + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IUpdateCatalogRequest} request UpdateCatalogRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#setDefaultBranch}. + * @memberof google.cloud.retail.v2beta.CatalogService + * @typedef SetDefaultBranchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls SetDefaultBranch. + * @function setDefaultBranch + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.ISetDefaultBranchRequest} request SetDefaultBranchRequest message or plain object + * @param {google.cloud.retail.v2beta.CatalogService.SetDefaultBranchCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.setDefaultBranch = function setDefaultBranch(request, callback) { + return this.rpcCall(setDefaultBranch, $root.google.cloud.retail.v2beta.SetDefaultBranchRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "SetDefaultBranch" }); + + /** + * Calls SetDefaultBranch. + * @function setDefaultBranch + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.ISetDefaultBranchRequest} request SetDefaultBranchRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#getDefaultBranch}. + * @memberof google.cloud.retail.v2beta.CatalogService + * @typedef GetDefaultBranchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.GetDefaultBranchResponse} [response] GetDefaultBranchResponse + */ + + /** + * Calls GetDefaultBranch. + * @function getDefaultBranch + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IGetDefaultBranchRequest} request GetDefaultBranchRequest message or plain object + * @param {google.cloud.retail.v2beta.CatalogService.GetDefaultBranchCallback} callback Node-style callback called with the error, if any, and GetDefaultBranchResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.getDefaultBranch = function getDefaultBranch(request, callback) { + return this.rpcCall(getDefaultBranch, $root.google.cloud.retail.v2beta.GetDefaultBranchRequest, $root.google.cloud.retail.v2beta.GetDefaultBranchResponse, request, callback); + }, "name", { value: "GetDefaultBranch" }); + + /** + * Calls GetDefaultBranch. + * @function getDefaultBranch + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IGetDefaultBranchRequest} request GetDefaultBranchRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#getCompletionConfig}. + * @memberof google.cloud.retail.v2beta.CatalogService + * @typedef GetCompletionConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.CompletionConfig} [response] CompletionConfig + */ + + /** + * Calls GetCompletionConfig. + * @function getCompletionConfig + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IGetCompletionConfigRequest} request GetCompletionConfigRequest message or plain object + * @param {google.cloud.retail.v2beta.CatalogService.GetCompletionConfigCallback} callback Node-style callback called with the error, if any, and CompletionConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.getCompletionConfig = function getCompletionConfig(request, callback) { + return this.rpcCall(getCompletionConfig, $root.google.cloud.retail.v2beta.GetCompletionConfigRequest, $root.google.cloud.retail.v2beta.CompletionConfig, request, callback); + }, "name", { value: "GetCompletionConfig" }); + + /** + * Calls GetCompletionConfig. + * @function getCompletionConfig + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IGetCompletionConfigRequest} request GetCompletionConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#updateCompletionConfig}. + * @memberof google.cloud.retail.v2beta.CatalogService + * @typedef UpdateCompletionConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.CompletionConfig} [response] CompletionConfig + */ + + /** + * Calls UpdateCompletionConfig. + * @function updateCompletionConfig + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IUpdateCompletionConfigRequest} request UpdateCompletionConfigRequest message or plain object + * @param {google.cloud.retail.v2beta.CatalogService.UpdateCompletionConfigCallback} callback Node-style callback called with the error, if any, and CompletionConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.updateCompletionConfig = function updateCompletionConfig(request, callback) { + return this.rpcCall(updateCompletionConfig, $root.google.cloud.retail.v2beta.UpdateCompletionConfigRequest, $root.google.cloud.retail.v2beta.CompletionConfig, request, callback); + }, "name", { value: "UpdateCompletionConfig" }); + + /** + * Calls UpdateCompletionConfig. + * @function updateCompletionConfig + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IUpdateCompletionConfigRequest} request UpdateCompletionConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#getAttributesConfig}. + * @memberof google.cloud.retail.v2beta.CatalogService + * @typedef GetAttributesConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.AttributesConfig} [response] AttributesConfig + */ + + /** + * Calls GetAttributesConfig. + * @function getAttributesConfig + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IGetAttributesConfigRequest} request GetAttributesConfigRequest message or plain object + * @param {google.cloud.retail.v2beta.CatalogService.GetAttributesConfigCallback} callback Node-style callback called with the error, if any, and AttributesConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.getAttributesConfig = function getAttributesConfig(request, callback) { + return this.rpcCall(getAttributesConfig, $root.google.cloud.retail.v2beta.GetAttributesConfigRequest, $root.google.cloud.retail.v2beta.AttributesConfig, request, callback); + }, "name", { value: "GetAttributesConfig" }); + + /** + * Calls GetAttributesConfig. + * @function getAttributesConfig + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IGetAttributesConfigRequest} request GetAttributesConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#updateAttributesConfig}. + * @memberof google.cloud.retail.v2beta.CatalogService + * @typedef UpdateAttributesConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.AttributesConfig} [response] AttributesConfig + */ + + /** + * Calls UpdateAttributesConfig. + * @function updateAttributesConfig + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IUpdateAttributesConfigRequest} request UpdateAttributesConfigRequest message or plain object + * @param {google.cloud.retail.v2beta.CatalogService.UpdateAttributesConfigCallback} callback Node-style callback called with the error, if any, and AttributesConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.updateAttributesConfig = function updateAttributesConfig(request, callback) { + return this.rpcCall(updateAttributesConfig, $root.google.cloud.retail.v2beta.UpdateAttributesConfigRequest, $root.google.cloud.retail.v2beta.AttributesConfig, request, callback); + }, "name", { value: "UpdateAttributesConfig" }); + + /** + * Calls UpdateAttributesConfig. + * @function updateAttributesConfig + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IUpdateAttributesConfigRequest} request UpdateAttributesConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#addCatalogAttribute}. + * @memberof google.cloud.retail.v2beta.CatalogService + * @typedef AddCatalogAttributeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.AttributesConfig} [response] AttributesConfig + */ + + /** + * Calls AddCatalogAttribute. + * @function addCatalogAttribute + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IAddCatalogAttributeRequest} request AddCatalogAttributeRequest message or plain object + * @param {google.cloud.retail.v2beta.CatalogService.AddCatalogAttributeCallback} callback Node-style callback called with the error, if any, and AttributesConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.addCatalogAttribute = function addCatalogAttribute(request, callback) { + return this.rpcCall(addCatalogAttribute, $root.google.cloud.retail.v2beta.AddCatalogAttributeRequest, $root.google.cloud.retail.v2beta.AttributesConfig, request, callback); + }, "name", { value: "AddCatalogAttribute" }); + + /** + * Calls AddCatalogAttribute. + * @function addCatalogAttribute + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IAddCatalogAttributeRequest} request AddCatalogAttributeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#removeCatalogAttribute}. + * @memberof google.cloud.retail.v2beta.CatalogService + * @typedef RemoveCatalogAttributeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.AttributesConfig} [response] AttributesConfig + */ + + /** + * Calls RemoveCatalogAttribute. + * @function removeCatalogAttribute + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest} request RemoveCatalogAttributeRequest message or plain object + * @param {google.cloud.retail.v2beta.CatalogService.RemoveCatalogAttributeCallback} callback Node-style callback called with the error, if any, and AttributesConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.removeCatalogAttribute = function removeCatalogAttribute(request, callback) { + return this.rpcCall(removeCatalogAttribute, $root.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest, $root.google.cloud.retail.v2beta.AttributesConfig, request, callback); + }, "name", { value: "RemoveCatalogAttribute" }); + + /** + * Calls RemoveCatalogAttribute. + * @function removeCatalogAttribute + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest} request RemoveCatalogAttributeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#replaceCatalogAttribute}. + * @memberof google.cloud.retail.v2beta.CatalogService + * @typedef ReplaceCatalogAttributeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.AttributesConfig} [response] AttributesConfig + */ + + /** + * Calls ReplaceCatalogAttribute. + * @function replaceCatalogAttribute + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest} request ReplaceCatalogAttributeRequest message or plain object + * @param {google.cloud.retail.v2beta.CatalogService.ReplaceCatalogAttributeCallback} callback Node-style callback called with the error, if any, and AttributesConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.replaceCatalogAttribute = function replaceCatalogAttribute(request, callback) { + return this.rpcCall(replaceCatalogAttribute, $root.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest, $root.google.cloud.retail.v2beta.AttributesConfig, request, callback); + }, "name", { value: "ReplaceCatalogAttribute" }); + + /** + * Calls ReplaceCatalogAttribute. + * @function replaceCatalogAttribute + * @memberof google.cloud.retail.v2beta.CatalogService + * @instance + * @param {google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest} request ReplaceCatalogAttributeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CatalogService; + })(); + + v2beta.ListCatalogsRequest = (function() { + + /** + * Properties of a ListCatalogsRequest. + * @memberof google.cloud.retail.v2beta + * @interface IListCatalogsRequest + * @property {string|null} [parent] ListCatalogsRequest parent + * @property {number|null} [pageSize] ListCatalogsRequest pageSize + * @property {string|null} [pageToken] ListCatalogsRequest pageToken + */ + + /** + * Constructs a new ListCatalogsRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a ListCatalogsRequest. + * @implements IListCatalogsRequest + * @constructor + * @param {google.cloud.retail.v2beta.IListCatalogsRequest=} [properties] Properties to set + */ + function ListCatalogsRequest(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]]; + } + + /** + * ListCatalogsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @instance + */ + ListCatalogsRequest.prototype.parent = ""; + + /** + * ListCatalogsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @instance + */ + ListCatalogsRequest.prototype.pageSize = 0; + + /** + * ListCatalogsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @instance + */ + ListCatalogsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCatalogsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @static + * @param {google.cloud.retail.v2beta.IListCatalogsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ListCatalogsRequest} ListCatalogsRequest instance + */ + ListCatalogsRequest.create = function create(properties) { + return new ListCatalogsRequest(properties); + }; + + /** + * Encodes the specified ListCatalogsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ListCatalogsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @static + * @param {google.cloud.retail.v2beta.IListCatalogsRequest} message ListCatalogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCatalogsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCatalogsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListCatalogsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @static + * @param {google.cloud.retail.v2beta.IListCatalogsRequest} message ListCatalogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCatalogsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCatalogsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ListCatalogsRequest} ListCatalogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCatalogsRequest.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.v2beta.ListCatalogsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCatalogsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ListCatalogsRequest} ListCatalogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCatalogsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCatalogsRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCatalogsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListCatalogsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ListCatalogsRequest} ListCatalogsRequest + */ + ListCatalogsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ListCatalogsRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.ListCatalogsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListCatalogsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @static + * @param {google.cloud.retail.v2beta.ListCatalogsRequest} message ListCatalogsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCatalogsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListCatalogsRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCatalogsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListCatalogsRequest; + })(); + + v2beta.ListCatalogsResponse = (function() { + + /** + * Properties of a ListCatalogsResponse. + * @memberof google.cloud.retail.v2beta + * @interface IListCatalogsResponse + * @property {Array.|null} [catalogs] ListCatalogsResponse catalogs + * @property {string|null} [nextPageToken] ListCatalogsResponse nextPageToken + */ + + /** + * Constructs a new ListCatalogsResponse. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a ListCatalogsResponse. + * @implements IListCatalogsResponse + * @constructor + * @param {google.cloud.retail.v2beta.IListCatalogsResponse=} [properties] Properties to set + */ + function ListCatalogsResponse(properties) { + this.catalogs = []; + 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]]; + } + + /** + * ListCatalogsResponse catalogs. + * @member {Array.} catalogs + * @memberof google.cloud.retail.v2beta.ListCatalogsResponse + * @instance + */ + ListCatalogsResponse.prototype.catalogs = $util.emptyArray; + + /** + * ListCatalogsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.retail.v2beta.ListCatalogsResponse + * @instance + */ + ListCatalogsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCatalogsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.ListCatalogsResponse + * @static + * @param {google.cloud.retail.v2beta.IListCatalogsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ListCatalogsResponse} ListCatalogsResponse instance + */ + ListCatalogsResponse.create = function create(properties) { + return new ListCatalogsResponse(properties); + }; + + /** + * Encodes the specified ListCatalogsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ListCatalogsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ListCatalogsResponse + * @static + * @param {google.cloud.retail.v2beta.IListCatalogsResponse} message ListCatalogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCatalogsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.catalogs != null && message.catalogs.length) + for (var i = 0; i < message.catalogs.length; ++i) + $root.google.cloud.retail.v2beta.Catalog.encode(message.catalogs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListCatalogsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListCatalogsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ListCatalogsResponse + * @static + * @param {google.cloud.retail.v2beta.IListCatalogsResponse} message ListCatalogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCatalogsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCatalogsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ListCatalogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ListCatalogsResponse} ListCatalogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCatalogsResponse.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.v2beta.ListCatalogsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.catalogs && message.catalogs.length)) + message.catalogs = []; + message.catalogs.push($root.google.cloud.retail.v2beta.Catalog.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCatalogsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ListCatalogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ListCatalogsResponse} ListCatalogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCatalogsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCatalogsResponse message. + * @function verify + * @memberof google.cloud.retail.v2beta.ListCatalogsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCatalogsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.catalogs != null && message.hasOwnProperty("catalogs")) { + if (!Array.isArray(message.catalogs)) + return "catalogs: array expected"; + for (var i = 0; i < message.catalogs.length; ++i) { + var error = $root.google.cloud.retail.v2beta.Catalog.verify(message.catalogs[i]); + if (error) + return "catalogs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCatalogsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ListCatalogsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ListCatalogsResponse} ListCatalogsResponse + */ + ListCatalogsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ListCatalogsResponse) + return object; + var message = new $root.google.cloud.retail.v2beta.ListCatalogsResponse(); + if (object.catalogs) { + if (!Array.isArray(object.catalogs)) + throw TypeError(".google.cloud.retail.v2beta.ListCatalogsResponse.catalogs: array expected"); + message.catalogs = []; + for (var i = 0; i < object.catalogs.length; ++i) { + if (typeof object.catalogs[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.ListCatalogsResponse.catalogs: object expected"); + message.catalogs[i] = $root.google.cloud.retail.v2beta.Catalog.fromObject(object.catalogs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCatalogsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ListCatalogsResponse + * @static + * @param {google.cloud.retail.v2beta.ListCatalogsResponse} message ListCatalogsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCatalogsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.catalogs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.catalogs && message.catalogs.length) { + object.catalogs = []; + for (var j = 0; j < message.catalogs.length; ++j) + object.catalogs[j] = $root.google.cloud.retail.v2beta.Catalog.toObject(message.catalogs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCatalogsResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ListCatalogsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCatalogsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListCatalogsResponse; + })(); + + v2beta.UpdateCatalogRequest = (function() { + + /** + * Properties of an UpdateCatalogRequest. + * @memberof google.cloud.retail.v2beta + * @interface IUpdateCatalogRequest + * @property {google.cloud.retail.v2beta.ICatalog|null} [catalog] UpdateCatalogRequest catalog + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCatalogRequest updateMask + */ + + /** + * Constructs a new UpdateCatalogRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents an UpdateCatalogRequest. + * @implements IUpdateCatalogRequest + * @constructor + * @param {google.cloud.retail.v2beta.IUpdateCatalogRequest=} [properties] Properties to set + */ + function UpdateCatalogRequest(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]]; + } + + /** + * UpdateCatalogRequest catalog. + * @member {google.cloud.retail.v2beta.ICatalog|null|undefined} catalog + * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @instance + */ + UpdateCatalogRequest.prototype.catalog = null; + + /** + * UpdateCatalogRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @instance + */ + UpdateCatalogRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCatalogRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @static + * @param {google.cloud.retail.v2beta.IUpdateCatalogRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.UpdateCatalogRequest} UpdateCatalogRequest instance + */ + UpdateCatalogRequest.create = function create(properties) { + return new UpdateCatalogRequest(properties); + }; + + /** + * Encodes the specified UpdateCatalogRequest message. Does not implicitly {@link google.cloud.retail.v2beta.UpdateCatalogRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @static + * @param {google.cloud.retail.v2beta.IUpdateCatalogRequest} message UpdateCatalogRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCatalogRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) + $root.google.cloud.retail.v2beta.Catalog.encode(message.catalog, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateCatalogRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UpdateCatalogRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @static + * @param {google.cloud.retail.v2beta.IUpdateCatalogRequest} message UpdateCatalogRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCatalogRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCatalogRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.UpdateCatalogRequest} UpdateCatalogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCatalogRequest.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.v2beta.UpdateCatalogRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.catalog = $root.google.cloud.retail.v2beta.Catalog.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCatalogRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.UpdateCatalogRequest} UpdateCatalogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCatalogRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCatalogRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCatalogRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.catalog != null && message.hasOwnProperty("catalog")) { + var error = $root.google.cloud.retail.v2beta.Catalog.verify(message.catalog); + if (error) + return "catalog." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateCatalogRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.UpdateCatalogRequest} UpdateCatalogRequest + */ + UpdateCatalogRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.UpdateCatalogRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.UpdateCatalogRequest(); + if (object.catalog != null) { + if (typeof object.catalog !== "object") + throw TypeError(".google.cloud.retail.v2beta.UpdateCatalogRequest.catalog: object expected"); + message.catalog = $root.google.cloud.retail.v2beta.Catalog.fromObject(object.catalog); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2beta.UpdateCatalogRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCatalogRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @static + * @param {google.cloud.retail.v2beta.UpdateCatalogRequest} message UpdateCatalogRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCatalogRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.catalog = null; + object.updateMask = null; + } + if (message.catalog != null && message.hasOwnProperty("catalog")) + object.catalog = $root.google.cloud.retail.v2beta.Catalog.toObject(message.catalog, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCatalogRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCatalogRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateCatalogRequest; + })(); + + v2beta.SetDefaultBranchRequest = (function() { + + /** + * Properties of a SetDefaultBranchRequest. + * @memberof google.cloud.retail.v2beta + * @interface ISetDefaultBranchRequest + * @property {string|null} [catalog] SetDefaultBranchRequest catalog + * @property {string|null} [branchId] SetDefaultBranchRequest branchId + * @property {string|null} [note] SetDefaultBranchRequest note + * @property {boolean|null} [force] SetDefaultBranchRequest force + */ + + /** + * Constructs a new SetDefaultBranchRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a SetDefaultBranchRequest. + * @implements ISetDefaultBranchRequest + * @constructor + * @param {google.cloud.retail.v2beta.ISetDefaultBranchRequest=} [properties] Properties to set + */ + function SetDefaultBranchRequest(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]]; + } + + /** + * SetDefaultBranchRequest catalog. + * @member {string} catalog + * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @instance + */ + SetDefaultBranchRequest.prototype.catalog = ""; + + /** + * SetDefaultBranchRequest branchId. + * @member {string} branchId + * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @instance + */ + SetDefaultBranchRequest.prototype.branchId = ""; + + /** + * SetDefaultBranchRequest note. + * @member {string} note + * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @instance + */ + SetDefaultBranchRequest.prototype.note = ""; + + /** + * SetDefaultBranchRequest force. + * @member {boolean} force + * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @instance + */ + SetDefaultBranchRequest.prototype.force = false; + + /** + * Creates a new SetDefaultBranchRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @static + * @param {google.cloud.retail.v2beta.ISetDefaultBranchRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.SetDefaultBranchRequest} SetDefaultBranchRequest instance + */ + SetDefaultBranchRequest.create = function create(properties) { + return new SetDefaultBranchRequest(properties); + }; + + /** + * Encodes the specified SetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2beta.SetDefaultBranchRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @static + * @param {google.cloud.retail.v2beta.ISetDefaultBranchRequest} message SetDefaultBranchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDefaultBranchRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); + if (message.branchId != null && Object.hasOwnProperty.call(message, "branchId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.branchId); + if (message.note != null && Object.hasOwnProperty.call(message, "note")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.note); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.force); + return writer; + }; + + /** + * Encodes the specified SetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SetDefaultBranchRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @static + * @param {google.cloud.retail.v2beta.ISetDefaultBranchRequest} message SetDefaultBranchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDefaultBranchRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetDefaultBranchRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.SetDefaultBranchRequest} SetDefaultBranchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDefaultBranchRequest.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.v2beta.SetDefaultBranchRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.catalog = reader.string(); + break; + case 2: + message.branchId = reader.string(); + break; + case 3: + message.note = reader.string(); + break; + case 4: + message.force = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetDefaultBranchRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.SetDefaultBranchRequest} SetDefaultBranchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDefaultBranchRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetDefaultBranchRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetDefaultBranchRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.catalog != null && message.hasOwnProperty("catalog")) + if (!$util.isString(message.catalog)) + return "catalog: string expected"; + if (message.branchId != null && message.hasOwnProperty("branchId")) + if (!$util.isString(message.branchId)) + return "branchId: string expected"; + if (message.note != null && message.hasOwnProperty("note")) + if (!$util.isString(message.note)) + return "note: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a SetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.SetDefaultBranchRequest} SetDefaultBranchRequest + */ + SetDefaultBranchRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.SetDefaultBranchRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.SetDefaultBranchRequest(); + if (object.catalog != null) + message.catalog = String(object.catalog); + if (object.branchId != null) + message.branchId = String(object.branchId); + if (object.note != null) + message.note = String(object.note); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a SetDefaultBranchRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @static + * @param {google.cloud.retail.v2beta.SetDefaultBranchRequest} message SetDefaultBranchRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetDefaultBranchRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.catalog = ""; + object.branchId = ""; + object.note = ""; + object.force = false; + } + if (message.catalog != null && message.hasOwnProperty("catalog")) + object.catalog = message.catalog; + if (message.branchId != null && message.hasOwnProperty("branchId")) + object.branchId = message.branchId; + if (message.note != null && message.hasOwnProperty("note")) + object.note = message.note; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this SetDefaultBranchRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @instance + * @returns {Object.} JSON object + */ + SetDefaultBranchRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetDefaultBranchRequest; + })(); + + v2beta.GetDefaultBranchRequest = (function() { + + /** + * Properties of a GetDefaultBranchRequest. + * @memberof google.cloud.retail.v2beta + * @interface IGetDefaultBranchRequest + * @property {string|null} [catalog] GetDefaultBranchRequest catalog + */ + + /** + * Constructs a new GetDefaultBranchRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a GetDefaultBranchRequest. + * @implements IGetDefaultBranchRequest + * @constructor + * @param {google.cloud.retail.v2beta.IGetDefaultBranchRequest=} [properties] Properties to set + */ + function GetDefaultBranchRequest(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]]; + } + + /** + * GetDefaultBranchRequest catalog. + * @member {string} catalog + * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @instance + */ + GetDefaultBranchRequest.prototype.catalog = ""; + + /** + * Creates a new GetDefaultBranchRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @static + * @param {google.cloud.retail.v2beta.IGetDefaultBranchRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.GetDefaultBranchRequest} GetDefaultBranchRequest instance + */ + GetDefaultBranchRequest.create = function create(properties) { + return new GetDefaultBranchRequest(properties); + }; + + /** + * Encodes the specified GetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2beta.GetDefaultBranchRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @static + * @param {google.cloud.retail.v2beta.IGetDefaultBranchRequest} message GetDefaultBranchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDefaultBranchRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); + return writer; + }; + + /** + * Encodes the specified GetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetDefaultBranchRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @static + * @param {google.cloud.retail.v2beta.IGetDefaultBranchRequest} message GetDefaultBranchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDefaultBranchRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDefaultBranchRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.GetDefaultBranchRequest} GetDefaultBranchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDefaultBranchRequest.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.v2beta.GetDefaultBranchRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.catalog = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDefaultBranchRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.GetDefaultBranchRequest} GetDefaultBranchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDefaultBranchRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDefaultBranchRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDefaultBranchRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.catalog != null && message.hasOwnProperty("catalog")) + if (!$util.isString(message.catalog)) + return "catalog: string expected"; + return null; + }; + + /** + * Creates a GetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.GetDefaultBranchRequest} GetDefaultBranchRequest + */ + GetDefaultBranchRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.GetDefaultBranchRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.GetDefaultBranchRequest(); + if (object.catalog != null) + message.catalog = String(object.catalog); + return message; + }; + + /** + * Creates a plain object from a GetDefaultBranchRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @static + * @param {google.cloud.retail.v2beta.GetDefaultBranchRequest} message GetDefaultBranchRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDefaultBranchRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.catalog = ""; + if (message.catalog != null && message.hasOwnProperty("catalog")) + object.catalog = message.catalog; + return object; + }; + + /** + * Converts this GetDefaultBranchRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @instance + * @returns {Object.} JSON object + */ + GetDefaultBranchRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDefaultBranchRequest; + })(); + + v2beta.GetDefaultBranchResponse = (function() { + + /** + * Properties of a GetDefaultBranchResponse. + * @memberof google.cloud.retail.v2beta + * @interface IGetDefaultBranchResponse + * @property {string|null} [branch] GetDefaultBranchResponse branch + * @property {google.protobuf.ITimestamp|null} [setTime] GetDefaultBranchResponse setTime + * @property {string|null} [note] GetDefaultBranchResponse note + */ + + /** + * Constructs a new GetDefaultBranchResponse. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a GetDefaultBranchResponse. + * @implements IGetDefaultBranchResponse + * @constructor + * @param {google.cloud.retail.v2beta.IGetDefaultBranchResponse=} [properties] Properties to set + */ + function GetDefaultBranchResponse(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]]; + } + + /** + * GetDefaultBranchResponse branch. + * @member {string} branch + * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @instance + */ + GetDefaultBranchResponse.prototype.branch = ""; + + /** + * GetDefaultBranchResponse setTime. + * @member {google.protobuf.ITimestamp|null|undefined} setTime + * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @instance + */ + GetDefaultBranchResponse.prototype.setTime = null; + + /** + * GetDefaultBranchResponse note. + * @member {string} note + * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @instance + */ + GetDefaultBranchResponse.prototype.note = ""; + + /** + * Creates a new GetDefaultBranchResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @static + * @param {google.cloud.retail.v2beta.IGetDefaultBranchResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.GetDefaultBranchResponse} GetDefaultBranchResponse instance + */ + GetDefaultBranchResponse.create = function create(properties) { + return new GetDefaultBranchResponse(properties); + }; + + /** + * Encodes the specified GetDefaultBranchResponse message. Does not implicitly {@link google.cloud.retail.v2beta.GetDefaultBranchResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @static + * @param {google.cloud.retail.v2beta.IGetDefaultBranchResponse} message GetDefaultBranchResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDefaultBranchResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.branch); + if (message.setTime != null && Object.hasOwnProperty.call(message, "setTime")) + $root.google.protobuf.Timestamp.encode(message.setTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.note != null && Object.hasOwnProperty.call(message, "note")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.note); + return writer; + }; + + /** + * Encodes the specified GetDefaultBranchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetDefaultBranchResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @static + * @param {google.cloud.retail.v2beta.IGetDefaultBranchResponse} message GetDefaultBranchResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDefaultBranchResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDefaultBranchResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.GetDefaultBranchResponse} GetDefaultBranchResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDefaultBranchResponse.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.v2beta.GetDefaultBranchResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.branch = reader.string(); + break; + case 2: + message.setTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.note = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDefaultBranchResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.GetDefaultBranchResponse} GetDefaultBranchResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDefaultBranchResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDefaultBranchResponse message. + * @function verify + * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDefaultBranchResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.branch != null && message.hasOwnProperty("branch")) + if (!$util.isString(message.branch)) + return "branch: string expected"; + if (message.setTime != null && message.hasOwnProperty("setTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.setTime); + if (error) + return "setTime." + error; + } + if (message.note != null && message.hasOwnProperty("note")) + if (!$util.isString(message.note)) + return "note: string expected"; + return null; + }; + + /** + * Creates a GetDefaultBranchResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.GetDefaultBranchResponse} GetDefaultBranchResponse + */ + GetDefaultBranchResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.GetDefaultBranchResponse) + return object; + var message = new $root.google.cloud.retail.v2beta.GetDefaultBranchResponse(); + if (object.branch != null) + message.branch = String(object.branch); + if (object.setTime != null) { + if (typeof object.setTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.GetDefaultBranchResponse.setTime: object expected"); + message.setTime = $root.google.protobuf.Timestamp.fromObject(object.setTime); + } + if (object.note != null) + message.note = String(object.note); + return message; + }; + + /** + * Creates a plain object from a GetDefaultBranchResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @static + * @param {google.cloud.retail.v2beta.GetDefaultBranchResponse} message GetDefaultBranchResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDefaultBranchResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.branch = ""; + object.setTime = null; + object.note = ""; + } + if (message.branch != null && message.hasOwnProperty("branch")) + object.branch = message.branch; + if (message.setTime != null && message.hasOwnProperty("setTime")) + object.setTime = $root.google.protobuf.Timestamp.toObject(message.setTime, options); + if (message.note != null && message.hasOwnProperty("note")) + object.note = message.note; + return object; + }; + + /** + * Converts this GetDefaultBranchResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @instance + * @returns {Object.} JSON object + */ + GetDefaultBranchResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDefaultBranchResponse; + })(); + + v2beta.GetCompletionConfigRequest = (function() { + + /** + * Properties of a GetCompletionConfigRequest. + * @memberof google.cloud.retail.v2beta + * @interface IGetCompletionConfigRequest + * @property {string|null} [name] GetCompletionConfigRequest name + */ + + /** + * Constructs a new GetCompletionConfigRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a GetCompletionConfigRequest. + * @implements IGetCompletionConfigRequest + * @constructor + * @param {google.cloud.retail.v2beta.IGetCompletionConfigRequest=} [properties] Properties to set + */ + function GetCompletionConfigRequest(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]]; + } + + /** + * GetCompletionConfigRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2beta.GetCompletionConfigRequest + * @instance + */ + GetCompletionConfigRequest.prototype.name = ""; + + /** + * Creates a new GetCompletionConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.GetCompletionConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IGetCompletionConfigRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.GetCompletionConfigRequest} GetCompletionConfigRequest instance + */ + GetCompletionConfigRequest.create = function create(properties) { + return new GetCompletionConfigRequest(properties); + }; + + /** + * Encodes the specified GetCompletionConfigRequest message. Does not implicitly {@link google.cloud.retail.v2beta.GetCompletionConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.GetCompletionConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IGetCompletionConfigRequest} message GetCompletionConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCompletionConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetCompletionConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetCompletionConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.GetCompletionConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IGetCompletionConfigRequest} message GetCompletionConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCompletionConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCompletionConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.GetCompletionConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.GetCompletionConfigRequest} GetCompletionConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCompletionConfigRequest.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.v2beta.GetCompletionConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCompletionConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.GetCompletionConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.GetCompletionConfigRequest} GetCompletionConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCompletionConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCompletionConfigRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.GetCompletionConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCompletionConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetCompletionConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.GetCompletionConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.GetCompletionConfigRequest} GetCompletionConfigRequest + */ + GetCompletionConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.GetCompletionConfigRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.GetCompletionConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCompletionConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.GetCompletionConfigRequest + * @static + * @param {google.cloud.retail.v2beta.GetCompletionConfigRequest} message GetCompletionConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCompletionConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetCompletionConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.GetCompletionConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetCompletionConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetCompletionConfigRequest; + })(); + + v2beta.UpdateCompletionConfigRequest = (function() { + + /** + * Properties of an UpdateCompletionConfigRequest. + * @memberof google.cloud.retail.v2beta + * @interface IUpdateCompletionConfigRequest + * @property {google.cloud.retail.v2beta.ICompletionConfig|null} [completionConfig] UpdateCompletionConfigRequest completionConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCompletionConfigRequest updateMask + */ + + /** + * Constructs a new UpdateCompletionConfigRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents an UpdateCompletionConfigRequest. + * @implements IUpdateCompletionConfigRequest + * @constructor + * @param {google.cloud.retail.v2beta.IUpdateCompletionConfigRequest=} [properties] Properties to set + */ + function UpdateCompletionConfigRequest(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]]; + } + + /** + * UpdateCompletionConfigRequest completionConfig. + * @member {google.cloud.retail.v2beta.ICompletionConfig|null|undefined} completionConfig + * @memberof google.cloud.retail.v2beta.UpdateCompletionConfigRequest + * @instance + */ + UpdateCompletionConfigRequest.prototype.completionConfig = null; + + /** + * UpdateCompletionConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2beta.UpdateCompletionConfigRequest + * @instance + */ + UpdateCompletionConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCompletionConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.UpdateCompletionConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IUpdateCompletionConfigRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.UpdateCompletionConfigRequest} UpdateCompletionConfigRequest instance + */ + UpdateCompletionConfigRequest.create = function create(properties) { + return new UpdateCompletionConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateCompletionConfigRequest message. Does not implicitly {@link google.cloud.retail.v2beta.UpdateCompletionConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.UpdateCompletionConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IUpdateCompletionConfigRequest} message UpdateCompletionConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCompletionConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.completionConfig != null && Object.hasOwnProperty.call(message, "completionConfig")) + $root.google.cloud.retail.v2beta.CompletionConfig.encode(message.completionConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateCompletionConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UpdateCompletionConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.UpdateCompletionConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IUpdateCompletionConfigRequest} message UpdateCompletionConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCompletionConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCompletionConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.UpdateCompletionConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.UpdateCompletionConfigRequest} UpdateCompletionConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCompletionConfigRequest.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.v2beta.UpdateCompletionConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionConfig = $root.google.cloud.retail.v2beta.CompletionConfig.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCompletionConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.UpdateCompletionConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.UpdateCompletionConfigRequest} UpdateCompletionConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCompletionConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCompletionConfigRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.UpdateCompletionConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCompletionConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.completionConfig != null && message.hasOwnProperty("completionConfig")) { + var error = $root.google.cloud.retail.v2beta.CompletionConfig.verify(message.completionConfig); + if (error) + return "completionConfig." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateCompletionConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.UpdateCompletionConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.UpdateCompletionConfigRequest} UpdateCompletionConfigRequest + */ + UpdateCompletionConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.UpdateCompletionConfigRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.UpdateCompletionConfigRequest(); + if (object.completionConfig != null) { + if (typeof object.completionConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.UpdateCompletionConfigRequest.completionConfig: object expected"); + message.completionConfig = $root.google.cloud.retail.v2beta.CompletionConfig.fromObject(object.completionConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2beta.UpdateCompletionConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCompletionConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.UpdateCompletionConfigRequest + * @static + * @param {google.cloud.retail.v2beta.UpdateCompletionConfigRequest} message UpdateCompletionConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCompletionConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.completionConfig = null; + object.updateMask = null; + } + if (message.completionConfig != null && message.hasOwnProperty("completionConfig")) + object.completionConfig = $root.google.cloud.retail.v2beta.CompletionConfig.toObject(message.completionConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCompletionConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.UpdateCompletionConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCompletionConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateCompletionConfigRequest; + })(); + + v2beta.GetAttributesConfigRequest = (function() { + + /** + * Properties of a GetAttributesConfigRequest. + * @memberof google.cloud.retail.v2beta + * @interface IGetAttributesConfigRequest + * @property {string|null} [name] GetAttributesConfigRequest name + */ + + /** + * Constructs a new GetAttributesConfigRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a GetAttributesConfigRequest. + * @implements IGetAttributesConfigRequest + * @constructor + * @param {google.cloud.retail.v2beta.IGetAttributesConfigRequest=} [properties] Properties to set + */ + function GetAttributesConfigRequest(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]]; + } + + /** + * GetAttributesConfigRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2beta.GetAttributesConfigRequest + * @instance + */ + GetAttributesConfigRequest.prototype.name = ""; + + /** + * Creates a new GetAttributesConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.GetAttributesConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IGetAttributesConfigRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.GetAttributesConfigRequest} GetAttributesConfigRequest instance + */ + GetAttributesConfigRequest.create = function create(properties) { + return new GetAttributesConfigRequest(properties); + }; + + /** + * Encodes the specified GetAttributesConfigRequest message. Does not implicitly {@link google.cloud.retail.v2beta.GetAttributesConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.GetAttributesConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IGetAttributesConfigRequest} message GetAttributesConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAttributesConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetAttributesConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetAttributesConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.GetAttributesConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IGetAttributesConfigRequest} message GetAttributesConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAttributesConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAttributesConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.GetAttributesConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.GetAttributesConfigRequest} GetAttributesConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAttributesConfigRequest.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.v2beta.GetAttributesConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAttributesConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.GetAttributesConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.GetAttributesConfigRequest} GetAttributesConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAttributesConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAttributesConfigRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.GetAttributesConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAttributesConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetAttributesConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.GetAttributesConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.GetAttributesConfigRequest} GetAttributesConfigRequest + */ + GetAttributesConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.GetAttributesConfigRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.GetAttributesConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAttributesConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.GetAttributesConfigRequest + * @static + * @param {google.cloud.retail.v2beta.GetAttributesConfigRequest} message GetAttributesConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAttributesConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetAttributesConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.GetAttributesConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetAttributesConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetAttributesConfigRequest; + })(); + + v2beta.UpdateAttributesConfigRequest = (function() { + + /** + * Properties of an UpdateAttributesConfigRequest. + * @memberof google.cloud.retail.v2beta + * @interface IUpdateAttributesConfigRequest + * @property {google.cloud.retail.v2beta.IAttributesConfig|null} [attributesConfig] UpdateAttributesConfigRequest attributesConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAttributesConfigRequest updateMask + */ + + /** + * Constructs a new UpdateAttributesConfigRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents an UpdateAttributesConfigRequest. + * @implements IUpdateAttributesConfigRequest + * @constructor + * @param {google.cloud.retail.v2beta.IUpdateAttributesConfigRequest=} [properties] Properties to set + */ + function UpdateAttributesConfigRequest(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]]; + } + + /** + * UpdateAttributesConfigRequest attributesConfig. + * @member {google.cloud.retail.v2beta.IAttributesConfig|null|undefined} attributesConfig + * @memberof google.cloud.retail.v2beta.UpdateAttributesConfigRequest + * @instance + */ + UpdateAttributesConfigRequest.prototype.attributesConfig = null; + + /** + * UpdateAttributesConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2beta.UpdateAttributesConfigRequest + * @instance + */ + UpdateAttributesConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAttributesConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.UpdateAttributesConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IUpdateAttributesConfigRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.UpdateAttributesConfigRequest} UpdateAttributesConfigRequest instance + */ + UpdateAttributesConfigRequest.create = function create(properties) { + return new UpdateAttributesConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateAttributesConfigRequest message. Does not implicitly {@link google.cloud.retail.v2beta.UpdateAttributesConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.UpdateAttributesConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IUpdateAttributesConfigRequest} message UpdateAttributesConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAttributesConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributesConfig != null && Object.hasOwnProperty.call(message, "attributesConfig")) + $root.google.cloud.retail.v2beta.AttributesConfig.encode(message.attributesConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateAttributesConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UpdateAttributesConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.UpdateAttributesConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IUpdateAttributesConfigRequest} message UpdateAttributesConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAttributesConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAttributesConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.UpdateAttributesConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.UpdateAttributesConfigRequest} UpdateAttributesConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAttributesConfigRequest.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.v2beta.UpdateAttributesConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.attributesConfig = $root.google.cloud.retail.v2beta.AttributesConfig.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAttributesConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.UpdateAttributesConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.UpdateAttributesConfigRequest} UpdateAttributesConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAttributesConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAttributesConfigRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.UpdateAttributesConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAttributesConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) { + var error = $root.google.cloud.retail.v2beta.AttributesConfig.verify(message.attributesConfig); + if (error) + return "attributesConfig." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateAttributesConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.UpdateAttributesConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.UpdateAttributesConfigRequest} UpdateAttributesConfigRequest + */ + UpdateAttributesConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.UpdateAttributesConfigRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.UpdateAttributesConfigRequest(); + if (object.attributesConfig != null) { + if (typeof object.attributesConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.UpdateAttributesConfigRequest.attributesConfig: object expected"); + message.attributesConfig = $root.google.cloud.retail.v2beta.AttributesConfig.fromObject(object.attributesConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2beta.UpdateAttributesConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAttributesConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.UpdateAttributesConfigRequest + * @static + * @param {google.cloud.retail.v2beta.UpdateAttributesConfigRequest} message UpdateAttributesConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAttributesConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attributesConfig = null; + object.updateMask = null; + } + if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) + object.attributesConfig = $root.google.cloud.retail.v2beta.AttributesConfig.toObject(message.attributesConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAttributesConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.UpdateAttributesConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAttributesConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateAttributesConfigRequest; + })(); + + v2beta.AddCatalogAttributeRequest = (function() { + + /** + * Properties of an AddCatalogAttributeRequest. + * @memberof google.cloud.retail.v2beta + * @interface IAddCatalogAttributeRequest + * @property {string|null} [attributesConfig] AddCatalogAttributeRequest attributesConfig + * @property {google.cloud.retail.v2beta.ICatalogAttribute|null} [catalogAttribute] AddCatalogAttributeRequest catalogAttribute + */ + + /** + * Constructs a new AddCatalogAttributeRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents an AddCatalogAttributeRequest. + * @implements IAddCatalogAttributeRequest + * @constructor + * @param {google.cloud.retail.v2beta.IAddCatalogAttributeRequest=} [properties] Properties to set + */ + function AddCatalogAttributeRequest(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]]; + } + + /** + * AddCatalogAttributeRequest attributesConfig. + * @member {string} attributesConfig + * @memberof google.cloud.retail.v2beta.AddCatalogAttributeRequest + * @instance + */ + AddCatalogAttributeRequest.prototype.attributesConfig = ""; + + /** + * AddCatalogAttributeRequest catalogAttribute. + * @member {google.cloud.retail.v2beta.ICatalogAttribute|null|undefined} catalogAttribute + * @memberof google.cloud.retail.v2beta.AddCatalogAttributeRequest + * @instance + */ + AddCatalogAttributeRequest.prototype.catalogAttribute = null; + + /** + * Creates a new AddCatalogAttributeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.AddCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2beta.IAddCatalogAttributeRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.AddCatalogAttributeRequest} AddCatalogAttributeRequest instance + */ + AddCatalogAttributeRequest.create = function create(properties) { + return new AddCatalogAttributeRequest(properties); + }; + + /** + * Encodes the specified AddCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2beta.AddCatalogAttributeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.AddCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2beta.IAddCatalogAttributeRequest} message AddCatalogAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddCatalogAttributeRequest.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.catalogAttribute != null && Object.hasOwnProperty.call(message, "catalogAttribute")) + $root.google.cloud.retail.v2beta.CatalogAttribute.encode(message.catalogAttribute, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddCatalogAttributeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.AddCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2beta.IAddCatalogAttributeRequest} message AddCatalogAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddCatalogAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddCatalogAttributeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.AddCatalogAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.AddCatalogAttributeRequest} AddCatalogAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddCatalogAttributeRequest.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.v2beta.AddCatalogAttributeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.attributesConfig = reader.string(); + break; + case 2: + message.catalogAttribute = $root.google.cloud.retail.v2beta.CatalogAttribute.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddCatalogAttributeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.AddCatalogAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.AddCatalogAttributeRequest} AddCatalogAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddCatalogAttributeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddCatalogAttributeRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.AddCatalogAttributeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddCatalogAttributeRequest.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.catalogAttribute != null && message.hasOwnProperty("catalogAttribute")) { + var error = $root.google.cloud.retail.v2beta.CatalogAttribute.verify(message.catalogAttribute); + if (error) + return "catalogAttribute." + error; + } + return null; + }; + + /** + * Creates an AddCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.AddCatalogAttributeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.AddCatalogAttributeRequest} AddCatalogAttributeRequest + */ + AddCatalogAttributeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.AddCatalogAttributeRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.AddCatalogAttributeRequest(); + if (object.attributesConfig != null) + message.attributesConfig = String(object.attributesConfig); + if (object.catalogAttribute != null) { + if (typeof object.catalogAttribute !== "object") + throw TypeError(".google.cloud.retail.v2beta.AddCatalogAttributeRequest.catalogAttribute: object expected"); + message.catalogAttribute = $root.google.cloud.retail.v2beta.CatalogAttribute.fromObject(object.catalogAttribute); + } + return message; + }; + + /** + * Creates a plain object from an AddCatalogAttributeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.AddCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2beta.AddCatalogAttributeRequest} message AddCatalogAttributeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddCatalogAttributeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attributesConfig = ""; + object.catalogAttribute = null; + } + if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) + object.attributesConfig = message.attributesConfig; + if (message.catalogAttribute != null && message.hasOwnProperty("catalogAttribute")) + object.catalogAttribute = $root.google.cloud.retail.v2beta.CatalogAttribute.toObject(message.catalogAttribute, options); + return object; + }; + + /** + * Converts this AddCatalogAttributeRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.AddCatalogAttributeRequest + * @instance + * @returns {Object.} JSON object + */ + AddCatalogAttributeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddCatalogAttributeRequest; + })(); + + v2beta.RemoveCatalogAttributeRequest = (function() { + + /** + * Properties of a RemoveCatalogAttributeRequest. + * @memberof google.cloud.retail.v2beta + * @interface IRemoveCatalogAttributeRequest + * @property {string|null} [attributesConfig] RemoveCatalogAttributeRequest attributesConfig + * @property {string|null} [key] RemoveCatalogAttributeRequest key + */ + + /** + * Constructs a new RemoveCatalogAttributeRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a RemoveCatalogAttributeRequest. + * @implements IRemoveCatalogAttributeRequest + * @constructor + * @param {google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest=} [properties] Properties to set + */ + function RemoveCatalogAttributeRequest(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]]; + } + + /** + * RemoveCatalogAttributeRequest attributesConfig. + * @member {string} attributesConfig + * @memberof google.cloud.retail.v2beta.RemoveCatalogAttributeRequest + * @instance + */ + RemoveCatalogAttributeRequest.prototype.attributesConfig = ""; + + /** + * RemoveCatalogAttributeRequest key. + * @member {string} key + * @memberof google.cloud.retail.v2beta.RemoveCatalogAttributeRequest + * @instance + */ + RemoveCatalogAttributeRequest.prototype.key = ""; + + /** + * Creates a new RemoveCatalogAttributeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.RemoveCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.RemoveCatalogAttributeRequest} RemoveCatalogAttributeRequest instance + */ + RemoveCatalogAttributeRequest.create = function create(properties) { + return new RemoveCatalogAttributeRequest(properties); + }; + + /** + * Encodes the specified RemoveCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2beta.RemoveCatalogAttributeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.RemoveCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest} message RemoveCatalogAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveCatalogAttributeRequest.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.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.key); + return writer; + }; + + /** + * Encodes the specified RemoveCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.RemoveCatalogAttributeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.RemoveCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest} message RemoveCatalogAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveCatalogAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveCatalogAttributeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.RemoveCatalogAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.RemoveCatalogAttributeRequest} RemoveCatalogAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveCatalogAttributeRequest.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.v2beta.RemoveCatalogAttributeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.attributesConfig = reader.string(); + break; + case 2: + message.key = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveCatalogAttributeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.RemoveCatalogAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.RemoveCatalogAttributeRequest} RemoveCatalogAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveCatalogAttributeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveCatalogAttributeRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.RemoveCatalogAttributeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveCatalogAttributeRequest.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.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + return null; + }; + + /** + * Creates a RemoveCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.RemoveCatalogAttributeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.RemoveCatalogAttributeRequest} RemoveCatalogAttributeRequest + */ + RemoveCatalogAttributeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest(); + if (object.attributesConfig != null) + message.attributesConfig = String(object.attributesConfig); + if (object.key != null) + message.key = String(object.key); + return message; + }; + + /** + * Creates a plain object from a RemoveCatalogAttributeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.RemoveCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2beta.RemoveCatalogAttributeRequest} message RemoveCatalogAttributeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveCatalogAttributeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attributesConfig = ""; + object.key = ""; + } + if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) + object.attributesConfig = message.attributesConfig; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + return object; + }; + + /** + * Converts this RemoveCatalogAttributeRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.RemoveCatalogAttributeRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveCatalogAttributeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveCatalogAttributeRequest; + })(); + + v2beta.ReplaceCatalogAttributeRequest = (function() { + + /** + * Properties of a ReplaceCatalogAttributeRequest. + * @memberof google.cloud.retail.v2beta + * @interface IReplaceCatalogAttributeRequest + * @property {string|null} [attributesConfig] ReplaceCatalogAttributeRequest attributesConfig + * @property {google.cloud.retail.v2beta.ICatalogAttribute|null} [catalogAttribute] ReplaceCatalogAttributeRequest catalogAttribute + * @property {google.protobuf.IFieldMask|null} [updateMask] ReplaceCatalogAttributeRequest updateMask + */ + + /** + * Constructs a new ReplaceCatalogAttributeRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a ReplaceCatalogAttributeRequest. + * @implements IReplaceCatalogAttributeRequest + * @constructor + * @param {google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest=} [properties] Properties to set + */ + function ReplaceCatalogAttributeRequest(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]]; + } + + /** + * ReplaceCatalogAttributeRequest attributesConfig. + * @member {string} attributesConfig + * @memberof google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest + * @instance + */ + ReplaceCatalogAttributeRequest.prototype.attributesConfig = ""; + + /** + * ReplaceCatalogAttributeRequest catalogAttribute. + * @member {google.cloud.retail.v2beta.ICatalogAttribute|null|undefined} catalogAttribute + * @memberof google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest + * @instance + */ + ReplaceCatalogAttributeRequest.prototype.catalogAttribute = null; + + /** + * ReplaceCatalogAttributeRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest + * @instance + */ + ReplaceCatalogAttributeRequest.prototype.updateMask = null; + + /** + * Creates a new ReplaceCatalogAttributeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest} ReplaceCatalogAttributeRequest instance + */ + ReplaceCatalogAttributeRequest.create = function create(properties) { + return new ReplaceCatalogAttributeRequest(properties); + }; + + /** + * Encodes the specified ReplaceCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest} message ReplaceCatalogAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplaceCatalogAttributeRequest.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.catalogAttribute != null && Object.hasOwnProperty.call(message, "catalogAttribute")) + $root.google.cloud.retail.v2beta.CatalogAttribute.encode(message.catalogAttribute, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReplaceCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest} message ReplaceCatalogAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplaceCatalogAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplaceCatalogAttributeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest} ReplaceCatalogAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplaceCatalogAttributeRequest.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.v2beta.ReplaceCatalogAttributeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.attributesConfig = reader.string(); + break; + case 2: + message.catalogAttribute = $root.google.cloud.retail.v2beta.CatalogAttribute.decode(reader, reader.uint32()); + break; + case 3: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplaceCatalogAttributeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest} ReplaceCatalogAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplaceCatalogAttributeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplaceCatalogAttributeRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplaceCatalogAttributeRequest.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.catalogAttribute != null && message.hasOwnProperty("catalogAttribute")) { + var error = $root.google.cloud.retail.v2beta.CatalogAttribute.verify(message.catalogAttribute); + if (error) + return "catalogAttribute." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a ReplaceCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest} ReplaceCatalogAttributeRequest + */ + ReplaceCatalogAttributeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest(); + if (object.attributesConfig != null) + message.attributesConfig = String(object.attributesConfig); + if (object.catalogAttribute != null) { + if (typeof object.catalogAttribute !== "object") + throw TypeError(".google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest.catalogAttribute: object expected"); + message.catalogAttribute = $root.google.cloud.retail.v2beta.CatalogAttribute.fromObject(object.catalogAttribute); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a ReplaceCatalogAttributeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest} message ReplaceCatalogAttributeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplaceCatalogAttributeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attributesConfig = ""; + object.catalogAttribute = null; + object.updateMask = null; + } + if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) + object.attributesConfig = message.attributesConfig; + if (message.catalogAttribute != null && message.hasOwnProperty("catalogAttribute")) + object.catalogAttribute = $root.google.cloud.retail.v2beta.CatalogAttribute.toObject(message.catalogAttribute, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this ReplaceCatalogAttributeRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest + * @instance + * @returns {Object.} JSON object + */ + ReplaceCatalogAttributeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReplaceCatalogAttributeRequest; + })(); + + v2beta.CompletionService = (function() { + + /** + * Constructs a new CompletionService service. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a CompletionService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function CompletionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CompletionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CompletionService; + + /** + * Creates new CompletionService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2beta.CompletionService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {CompletionService} RPC service. Useful where requests and/or responses are streamed. + */ + CompletionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.retail.v2beta.CompletionService#completeQuery}. + * @memberof google.cloud.retail.v2beta.CompletionService + * @typedef CompleteQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.CompleteQueryResponse} [response] CompleteQueryResponse + */ + + /** + * Calls CompleteQuery. + * @function completeQuery + * @memberof google.cloud.retail.v2beta.CompletionService + * @instance + * @param {google.cloud.retail.v2beta.ICompleteQueryRequest} request CompleteQueryRequest message or plain object + * @param {google.cloud.retail.v2beta.CompletionService.CompleteQueryCallback} callback Node-style callback called with the error, if any, and CompleteQueryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CompletionService.prototype.completeQuery = function completeQuery(request, callback) { + return this.rpcCall(completeQuery, $root.google.cloud.retail.v2beta.CompleteQueryRequest, $root.google.cloud.retail.v2beta.CompleteQueryResponse, request, callback); + }, "name", { value: "CompleteQuery" }); + + /** + * Calls CompleteQuery. + * @function completeQuery + * @memberof google.cloud.retail.v2beta.CompletionService + * @instance + * @param {google.cloud.retail.v2beta.ICompleteQueryRequest} request CompleteQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2beta.CompletionService#importCompletionData}. + * @memberof google.cloud.retail.v2beta.CompletionService + * @typedef ImportCompletionDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportCompletionData. + * @function importCompletionData + * @memberof google.cloud.retail.v2beta.CompletionService + * @instance + * @param {google.cloud.retail.v2beta.IImportCompletionDataRequest} request ImportCompletionDataRequest message or plain object + * @param {google.cloud.retail.v2beta.CompletionService.ImportCompletionDataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CompletionService.prototype.importCompletionData = function importCompletionData(request, callback) { + return this.rpcCall(importCompletionData, $root.google.cloud.retail.v2beta.ImportCompletionDataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportCompletionData" }); + + /** + * Calls ImportCompletionData. + * @function importCompletionData + * @memberof google.cloud.retail.v2beta.CompletionService + * @instance + * @param {google.cloud.retail.v2beta.IImportCompletionDataRequest} request ImportCompletionDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CompletionService; + })(); + + v2beta.CompleteQueryRequest = (function() { + + /** + * Properties of a CompleteQueryRequest. + * @memberof google.cloud.retail.v2beta + * @interface ICompleteQueryRequest + * @property {string|null} [catalog] CompleteQueryRequest catalog + * @property {string|null} [query] CompleteQueryRequest query + * @property {string|null} [visitorId] CompleteQueryRequest visitorId + * @property {Array.|null} [languageCodes] CompleteQueryRequest languageCodes + * @property {string|null} [deviceType] CompleteQueryRequest deviceType + * @property {string|null} [dataset] CompleteQueryRequest dataset + * @property {number|null} [maxSuggestions] CompleteQueryRequest maxSuggestions + */ + + /** + * Constructs a new CompleteQueryRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a CompleteQueryRequest. + * @implements ICompleteQueryRequest + * @constructor + * @param {google.cloud.retail.v2beta.ICompleteQueryRequest=} [properties] Properties to set + */ + function CompleteQueryRequest(properties) { + this.languageCodes = []; + 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]]; + } + + /** + * CompleteQueryRequest catalog. + * @member {string} catalog + * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.catalog = ""; + + /** + * CompleteQueryRequest query. + * @member {string} query + * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.query = ""; + + /** + * CompleteQueryRequest visitorId. + * @member {string} visitorId + * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.visitorId = ""; + + /** + * CompleteQueryRequest languageCodes. + * @member {Array.} languageCodes + * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.languageCodes = $util.emptyArray; + + /** + * CompleteQueryRequest deviceType. + * @member {string} deviceType + * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.deviceType = ""; + + /** + * CompleteQueryRequest dataset. + * @member {string} dataset + * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.dataset = ""; + + /** + * CompleteQueryRequest maxSuggestions. + * @member {number} maxSuggestions + * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.maxSuggestions = 0; + + /** + * Creates a new CompleteQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @static + * @param {google.cloud.retail.v2beta.ICompleteQueryRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.CompleteQueryRequest} CompleteQueryRequest instance + */ + CompleteQueryRequest.create = function create(properties) { + return new CompleteQueryRequest(properties); + }; + + /** + * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @static + * @param {google.cloud.retail.v2beta.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.languageCodes != null && message.languageCodes.length) + for (var i = 0; i < message.languageCodes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCodes[i]); + if (message.deviceType != null && Object.hasOwnProperty.call(message, "deviceType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.deviceType); + if (message.maxSuggestions != null && Object.hasOwnProperty.call(message, "maxSuggestions")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxSuggestions); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + 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); + return writer; + }; + + /** + * Encodes the specified CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @static + * @param {google.cloud.retail.v2beta.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompleteQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.CompleteQueryRequest} CompleteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryRequest.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.v2beta.CompleteQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.catalog = reader.string(); + break; + case 2: + message.query = reader.string(); + break; + case 7: + message.visitorId = reader.string(); + break; + case 3: + if (!(message.languageCodes && message.languageCodes.length)) + message.languageCodes = []; + message.languageCodes.push(reader.string()); + break; + case 4: + message.deviceType = reader.string(); + break; + case 6: + message.dataset = reader.string(); + break; + case 5: + message.maxSuggestions = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.CompleteQueryRequest} CompleteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompleteQueryRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompleteQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.catalog != null && message.hasOwnProperty("catalog")) + if (!$util.isString(message.catalog)) + return "catalog: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + if (!$util.isString(message.visitorId)) + return "visitorId: string expected"; + if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { + if (!Array.isArray(message.languageCodes)) + return "languageCodes: array expected"; + for (var i = 0; i < message.languageCodes.length; ++i) + if (!$util.isString(message.languageCodes[i])) + return "languageCodes: string[] expected"; + } + if (message.deviceType != null && message.hasOwnProperty("deviceType")) + if (!$util.isString(message.deviceType)) + return "deviceType: string expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) + if (!$util.isInteger(message.maxSuggestions)) + return "maxSuggestions: integer expected"; + return null; + }; + + /** + * Creates a CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.CompleteQueryRequest} CompleteQueryRequest + */ + CompleteQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.CompleteQueryRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.CompleteQueryRequest(); + if (object.catalog != null) + message.catalog = String(object.catalog); + if (object.query != null) + message.query = String(object.query); + if (object.visitorId != null) + message.visitorId = String(object.visitorId); + if (object.languageCodes) { + if (!Array.isArray(object.languageCodes)) + throw TypeError(".google.cloud.retail.v2beta.CompleteQueryRequest.languageCodes: array expected"); + message.languageCodes = []; + for (var i = 0; i < object.languageCodes.length; ++i) + message.languageCodes[i] = String(object.languageCodes[i]); + } + if (object.deviceType != null) + message.deviceType = String(object.deviceType); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.maxSuggestions != null) + message.maxSuggestions = object.maxSuggestions | 0; + return message; + }; + + /** + * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @static + * @param {google.cloud.retail.v2beta.CompleteQueryRequest} message CompleteQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompleteQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageCodes = []; + if (options.defaults) { + object.catalog = ""; + object.query = ""; + object.deviceType = ""; + object.maxSuggestions = 0; + object.dataset = ""; + object.visitorId = ""; + } + if (message.catalog != null && message.hasOwnProperty("catalog")) + object.catalog = message.catalog; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.languageCodes && message.languageCodes.length) { + object.languageCodes = []; + for (var j = 0; j < message.languageCodes.length; ++j) + object.languageCodes[j] = message.languageCodes[j]; + } + if (message.deviceType != null && message.hasOwnProperty("deviceType")) + object.deviceType = message.deviceType; + if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) + object.maxSuggestions = message.maxSuggestions; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + object.visitorId = message.visitorId; + return object; + }; + + /** + * Converts this CompleteQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @instance + * @returns {Object.} JSON object + */ + CompleteQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CompleteQueryRequest; + })(); + + v2beta.CompleteQueryResponse = (function() { + + /** + * Properties of a CompleteQueryResponse. + * @memberof google.cloud.retail.v2beta + * @interface ICompleteQueryResponse + * @property {Array.|null} [completionResults] CompleteQueryResponse completionResults + * @property {string|null} [attributionToken] CompleteQueryResponse attributionToken + * @property {Array.|null} [recentSearchResults] CompleteQueryResponse recentSearchResults + */ + + /** + * Constructs a new CompleteQueryResponse. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a CompleteQueryResponse. + * @implements ICompleteQueryResponse + * @constructor + * @param {google.cloud.retail.v2beta.ICompleteQueryResponse=} [properties] Properties to set + */ + function CompleteQueryResponse(properties) { + this.completionResults = []; + this.recentSearchResults = []; + 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]]; + } + + /** + * CompleteQueryResponse completionResults. + * @member {Array.} completionResults + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @instance + */ + CompleteQueryResponse.prototype.completionResults = $util.emptyArray; + + /** + * CompleteQueryResponse attributionToken. + * @member {string} attributionToken + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @instance + */ + CompleteQueryResponse.prototype.attributionToken = ""; + + /** + * CompleteQueryResponse recentSearchResults. + * @member {Array.} recentSearchResults + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @instance + */ + CompleteQueryResponse.prototype.recentSearchResults = $util.emptyArray; + + /** + * Creates a new CompleteQueryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @static + * @param {google.cloud.retail.v2beta.ICompleteQueryResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.CompleteQueryResponse} CompleteQueryResponse instance + */ + CompleteQueryResponse.create = function create(properties) { + return new CompleteQueryResponse(properties); + }; + + /** + * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @static + * @param {google.cloud.retail.v2beta.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.completionResults != null && message.completionResults.length) + for (var i = 0; i < message.completionResults.length; ++i) + $root.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.encode(message.completionResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributionToken); + if (message.recentSearchResults != null && message.recentSearchResults.length) + for (var i = 0; i < message.recentSearchResults.length; ++i) + $root.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.encode(message.recentSearchResults[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @static + * @param {google.cloud.retail.v2beta.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompleteQueryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.CompleteQueryResponse} CompleteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.v2beta.CompleteQueryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.completionResults && message.completionResults.length)) + message.completionResults = []; + message.completionResults.push($root.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.decode(reader, reader.uint32())); + break; + case 2: + message.attributionToken = reader.string(); + break; + case 3: + if (!(message.recentSearchResults && message.recentSearchResults.length)) + message.recentSearchResults = []; + message.recentSearchResults.push($root.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.CompleteQueryResponse} CompleteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompleteQueryResponse message. + * @function verify + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompleteQueryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.completionResults != null && message.hasOwnProperty("completionResults")) { + if (!Array.isArray(message.completionResults)) + return "completionResults: array expected"; + for (var i = 0; i < message.completionResults.length; ++i) { + var error = $root.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.verify(message.completionResults[i]); + if (error) + return "completionResults." + error; + } + } + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + if (!$util.isString(message.attributionToken)) + return "attributionToken: string expected"; + if (message.recentSearchResults != null && message.hasOwnProperty("recentSearchResults")) { + if (!Array.isArray(message.recentSearchResults)) + return "recentSearchResults: array expected"; + for (var i = 0; i < message.recentSearchResults.length; ++i) { + var error = $root.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.verify(message.recentSearchResults[i]); + if (error) + return "recentSearchResults." + error; + } + } + return null; + }; + + /** + * Creates a CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.CompleteQueryResponse} CompleteQueryResponse + */ + CompleteQueryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.CompleteQueryResponse) + return object; + var message = new $root.google.cloud.retail.v2beta.CompleteQueryResponse(); + if (object.completionResults) { + if (!Array.isArray(object.completionResults)) + throw TypeError(".google.cloud.retail.v2beta.CompleteQueryResponse.completionResults: array expected"); + message.completionResults = []; + for (var i = 0; i < object.completionResults.length; ++i) { + if (typeof object.completionResults[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.CompleteQueryResponse.completionResults: object expected"); + message.completionResults[i] = $root.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.fromObject(object.completionResults[i]); + } + } + if (object.attributionToken != null) + message.attributionToken = String(object.attributionToken); + if (object.recentSearchResults) { + if (!Array.isArray(object.recentSearchResults)) + throw TypeError(".google.cloud.retail.v2beta.CompleteQueryResponse.recentSearchResults: array expected"); + message.recentSearchResults = []; + for (var i = 0; i < object.recentSearchResults.length; ++i) { + if (typeof object.recentSearchResults[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.CompleteQueryResponse.recentSearchResults: object expected"); + message.recentSearchResults[i] = $root.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.fromObject(object.recentSearchResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @static + * @param {google.cloud.retail.v2beta.CompleteQueryResponse} message CompleteQueryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompleteQueryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.completionResults = []; + object.recentSearchResults = []; + } + if (options.defaults) + object.attributionToken = ""; + if (message.completionResults && message.completionResults.length) { + object.completionResults = []; + for (var j = 0; j < message.completionResults.length; ++j) + object.completionResults[j] = $root.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.toObject(message.completionResults[j], options); + } + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + object.attributionToken = message.attributionToken; + if (message.recentSearchResults && message.recentSearchResults.length) { + object.recentSearchResults = []; + for (var j = 0; j < message.recentSearchResults.length; ++j) + object.recentSearchResults[j] = $root.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.toObject(message.recentSearchResults[j], options); + } + return object; + }; + + /** + * Converts this CompleteQueryResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @instance + * @returns {Object.} JSON object + */ + CompleteQueryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + CompleteQueryResponse.CompletionResult = (function() { + + /** + * Properties of a CompletionResult. + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @interface ICompletionResult + * @property {string|null} [suggestion] CompletionResult suggestion + * @property {Object.|null} [attributes] CompletionResult attributes + */ + + /** + * Constructs a new CompletionResult. + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @classdesc Represents a CompletionResult. + * @implements ICompletionResult + * @constructor + * @param {google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult=} [properties] Properties to set + */ + function CompletionResult(properties) { + this.attributes = {}; + 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]]; + } + + /** + * CompletionResult suggestion. + * @member {string} suggestion + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + * @instance + */ + CompletionResult.prototype.suggestion = ""; + + /** + * CompletionResult attributes. + * @member {Object.} attributes + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + * @instance + */ + CompletionResult.prototype.attributes = $util.emptyObject; + + /** + * Creates a new CompletionResult instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult} CompletionResult instance + */ + CompletionResult.create = function create(properties) { + return new CompletionResult(properties); + }; + + /** + * Encodes the specified CompletionResult message. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult} message CompletionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompletionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.suggestion != null && Object.hasOwnProperty.call(message, "suggestion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.suggestion); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.retail.v2beta.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CompletionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult} message CompletionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompletionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompletionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult} CompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompletionResult.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.v2beta.CompleteQueryResponse.CompletionResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.suggestion = reader.string(); + break; + case 2: + if (message.attributes === $util.emptyObject) + message.attributes = {}; + 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.v2beta.CustomAttribute.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompletionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult} CompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompletionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompletionResult message. + * @function verify + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompletionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.suggestion != null && message.hasOwnProperty("suggestion")) + if (!$util.isString(message.suggestion)) + return "suggestion: string expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.retail.v2beta.CustomAttribute.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + return null; + }; + + /** + * Creates a CompletionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult} CompletionResult + */ + CompletionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult) + return object; + var message = new $root.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult(); + if (object.suggestion != null) + message.suggestion = String(object.suggestion); + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.retail.v2beta.CustomAttribute.fromObject(object.attributes[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a CompletionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult} message CompletionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompletionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) + object.suggestion = ""; + if (message.suggestion != null && message.hasOwnProperty("suggestion")) + object.suggestion = message.suggestion; + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.retail.v2beta.CustomAttribute.toObject(message.attributes[keys2[j]], options); + } + return object; + }; + + /** + * Converts this CompletionResult to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + * @instance + * @returns {Object.} JSON object + */ + CompletionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CompletionResult; + })(); + + CompleteQueryResponse.RecentSearchResult = (function() { + + /** + * Properties of a RecentSearchResult. + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @interface IRecentSearchResult + * @property {string|null} [recentSearch] RecentSearchResult recentSearch + */ + + /** + * Constructs a new RecentSearchResult. + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @classdesc Represents a RecentSearchResult. + * @implements IRecentSearchResult + * @constructor + * @param {google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult=} [properties] Properties to set + */ + function RecentSearchResult(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]]; + } + + /** + * RecentSearchResult recentSearch. + * @member {string} recentSearch + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + * @instance + */ + RecentSearchResult.prototype.recentSearch = ""; + + /** + * Creates a new RecentSearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + * @static + * @param {google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult} RecentSearchResult instance + */ + RecentSearchResult.create = function create(properties) { + return new RecentSearchResult(properties); + }; + + /** + * Encodes the specified RecentSearchResult message. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + * @static + * @param {google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult} message RecentSearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecentSearchResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recentSearch != null && Object.hasOwnProperty.call(message, "recentSearch")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.recentSearch); + return writer; + }; + + /** + * Encodes the specified RecentSearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + * @static + * @param {google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult} message RecentSearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecentSearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecentSearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult} RecentSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecentSearchResult.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.v2beta.CompleteQueryResponse.RecentSearchResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.recentSearch = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecentSearchResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult} RecentSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecentSearchResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecentSearchResult message. + * @function verify + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecentSearchResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recentSearch != null && message.hasOwnProperty("recentSearch")) + if (!$util.isString(message.recentSearch)) + return "recentSearch: string expected"; + return null; + }; + + /** + * Creates a RecentSearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult} RecentSearchResult + */ + RecentSearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult) + return object; + var message = new $root.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult(); + if (object.recentSearch != null) + message.recentSearch = String(object.recentSearch); + return message; + }; + + /** + * Creates a plain object from a RecentSearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + * @static + * @param {google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult} message RecentSearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecentSearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.recentSearch = ""; + if (message.recentSearch != null && message.hasOwnProperty("recentSearch")) + object.recentSearch = message.recentSearch; + return object; + }; + + /** + * Converts this RecentSearchResult to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + * @instance + * @returns {Object.} JSON object + */ + RecentSearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RecentSearchResult; + })(); + + return CompleteQueryResponse; + })(); + + v2beta.Control = (function() { + + /** + * Properties of a Control. + * @memberof google.cloud.retail.v2beta + * @interface IControl + * @property {google.cloud.retail.v2beta.SearchRequest.IFacetSpec|null} [facetSpec] Control facetSpec + * @property {google.cloud.retail.v2beta.IRule|null} [rule] Control rule + * @property {string|null} [name] Control name + * @property {string|null} [displayName] Control displayName + * @property {Array.|null} [associatedServingConfigIds] Control associatedServingConfigIds + * @property {Array.|null} [solutionTypes] Control solutionTypes + */ + + /** + * Constructs a new Control. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a Control. + * @implements IControl + * @constructor + * @param {google.cloud.retail.v2beta.IControl=} [properties] Properties to set + */ + function Control(properties) { + this.associatedServingConfigIds = []; + this.solutionTypes = []; + 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]]; + } + + /** + * Control facetSpec. + * @member {google.cloud.retail.v2beta.SearchRequest.IFacetSpec|null|undefined} facetSpec + * @memberof google.cloud.retail.v2beta.Control + * @instance + */ + Control.prototype.facetSpec = null; + + /** + * Control rule. + * @member {google.cloud.retail.v2beta.IRule|null|undefined} rule + * @memberof google.cloud.retail.v2beta.Control + * @instance + */ + Control.prototype.rule = null; + + /** + * Control name. + * @member {string} name + * @memberof google.cloud.retail.v2beta.Control + * @instance + */ + Control.prototype.name = ""; + + /** + * Control displayName. + * @member {string} displayName + * @memberof google.cloud.retail.v2beta.Control + * @instance + */ + Control.prototype.displayName = ""; + + /** + * Control associatedServingConfigIds. + * @member {Array.} associatedServingConfigIds + * @memberof google.cloud.retail.v2beta.Control + * @instance + */ + Control.prototype.associatedServingConfigIds = $util.emptyArray; + + /** + * Control solutionTypes. + * @member {Array.} solutionTypes + * @memberof google.cloud.retail.v2beta.Control + * @instance + */ + Control.prototype.solutionTypes = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Control control. + * @member {"facetSpec"|"rule"|undefined} control + * @memberof google.cloud.retail.v2beta.Control + * @instance + */ + Object.defineProperty(Control.prototype, "control", { + get: $util.oneOfGetter($oneOfFields = ["facetSpec", "rule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Control instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Control + * @static + * @param {google.cloud.retail.v2beta.IControl=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Control} Control instance + */ + Control.create = function create(properties) { + return new Control(properties); + }; + + /** + * Encodes the specified Control message. Does not implicitly {@link google.cloud.retail.v2beta.Control.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Control + * @static + * @param {google.cloud.retail.v2beta.IControl} message Control message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Control.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.facetSpec != null && Object.hasOwnProperty.call(message, "facetSpec")) + $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.encode(message.facetSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rule != null && Object.hasOwnProperty.call(message, "rule")) + $root.google.cloud.retail.v2beta.Rule.encode(message.rule, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.associatedServingConfigIds != null && message.associatedServingConfigIds.length) + for (var i = 0; i < message.associatedServingConfigIds.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.associatedServingConfigIds[i]); + if (message.solutionTypes != null && message.solutionTypes.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.solutionTypes.length; ++i) + writer.int32(message.solutionTypes[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Control message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Control.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Control + * @static + * @param {google.cloud.retail.v2beta.IControl} message Control message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Control.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Control message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Control + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Control} Control + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Control.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.v2beta.Control(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.facetSpec = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.decode(reader, reader.uint32()); + break; + case 4: + message.rule = $root.google.cloud.retail.v2beta.Rule.decode(reader, reader.uint32()); + break; + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 5: + if (!(message.associatedServingConfigIds && message.associatedServingConfigIds.length)) + message.associatedServingConfigIds = []; + message.associatedServingConfigIds.push(reader.string()); + break; + case 6: + if (!(message.solutionTypes && message.solutionTypes.length)) + message.solutionTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.solutionTypes.push(reader.int32()); + } else + message.solutionTypes.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Control message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Control + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Control} Control + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Control.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Control message. + * @function verify + * @memberof google.cloud.retail.v2beta.Control + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Control.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.facetSpec != null && message.hasOwnProperty("facetSpec")) { + properties.control = 1; + { + var error = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.verify(message.facetSpec); + if (error) + return "facetSpec." + error; + } + } + if (message.rule != null && message.hasOwnProperty("rule")) { + if (properties.control === 1) + return "control: multiple values"; + properties.control = 1; + { + var error = $root.google.cloud.retail.v2beta.Rule.verify(message.rule); + if (error) + return "rule." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.associatedServingConfigIds != null && message.hasOwnProperty("associatedServingConfigIds")) { + if (!Array.isArray(message.associatedServingConfigIds)) + return "associatedServingConfigIds: array expected"; + for (var i = 0; i < message.associatedServingConfigIds.length; ++i) + if (!$util.isString(message.associatedServingConfigIds[i])) + return "associatedServingConfigIds: string[] expected"; + } + if (message.solutionTypes != null && message.hasOwnProperty("solutionTypes")) { + if (!Array.isArray(message.solutionTypes)) + return "solutionTypes: array expected"; + for (var i = 0; i < message.solutionTypes.length; ++i) + switch (message.solutionTypes[i]) { + default: + return "solutionTypes: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a Control message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Control + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Control} Control + */ + Control.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Control) + return object; + var message = new $root.google.cloud.retail.v2beta.Control(); + if (object.facetSpec != null) { + if (typeof object.facetSpec !== "object") + throw TypeError(".google.cloud.retail.v2beta.Control.facetSpec: object expected"); + message.facetSpec = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.fromObject(object.facetSpec); + } + if (object.rule != null) { + if (typeof object.rule !== "object") + throw TypeError(".google.cloud.retail.v2beta.Control.rule: object expected"); + message.rule = $root.google.cloud.retail.v2beta.Rule.fromObject(object.rule); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.associatedServingConfigIds) { + if (!Array.isArray(object.associatedServingConfigIds)) + throw TypeError(".google.cloud.retail.v2beta.Control.associatedServingConfigIds: array expected"); + message.associatedServingConfigIds = []; + for (var i = 0; i < object.associatedServingConfigIds.length; ++i) + message.associatedServingConfigIds[i] = String(object.associatedServingConfigIds[i]); + } + if (object.solutionTypes) { + if (!Array.isArray(object.solutionTypes)) + throw TypeError(".google.cloud.retail.v2beta.Control.solutionTypes: array expected"); + message.solutionTypes = []; + for (var i = 0; i < object.solutionTypes.length; ++i) + switch (object.solutionTypes[i]) { + default: + case "SOLUTION_TYPE_UNSPECIFIED": + case 0: + message.solutionTypes[i] = 0; + break; + case "SOLUTION_TYPE_RECOMMENDATION": + case 1: + message.solutionTypes[i] = 1; + break; + case "SOLUTION_TYPE_SEARCH": + case 2: + message.solutionTypes[i] = 2; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a Control message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Control + * @static + * @param {google.cloud.retail.v2beta.Control} message Control + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Control.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.associatedServingConfigIds = []; + object.solutionTypes = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.facetSpec != null && message.hasOwnProperty("facetSpec")) { + object.facetSpec = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.toObject(message.facetSpec, options); + if (options.oneofs) + object.control = "facetSpec"; + } + if (message.rule != null && message.hasOwnProperty("rule")) { + object.rule = $root.google.cloud.retail.v2beta.Rule.toObject(message.rule, options); + if (options.oneofs) + object.control = "rule"; + } + if (message.associatedServingConfigIds && message.associatedServingConfigIds.length) { + object.associatedServingConfigIds = []; + for (var j = 0; j < message.associatedServingConfigIds.length; ++j) + object.associatedServingConfigIds[j] = message.associatedServingConfigIds[j]; + } + if (message.solutionTypes && message.solutionTypes.length) { + object.solutionTypes = []; + for (var j = 0; j < message.solutionTypes.length; ++j) + object.solutionTypes[j] = options.enums === String ? $root.google.cloud.retail.v2beta.SolutionType[message.solutionTypes[j]] : message.solutionTypes[j]; + } + return object; + }; + + /** + * Converts this Control to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Control + * @instance + * @returns {Object.} JSON object + */ + Control.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Control; + })(); + + v2beta.SearchService = (function() { + + /** + * Constructs a new SearchService service. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a SearchService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function SearchService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SearchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SearchService; + + /** + * Creates new SearchService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2beta.SearchService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {SearchService} RPC service. Useful where requests and/or responses are streamed. + */ + SearchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.retail.v2beta.SearchService#search}. + * @memberof google.cloud.retail.v2beta.SearchService + * @typedef SearchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.SearchResponse} [response] SearchResponse + */ + + /** + * Calls Search. + * @function search + * @memberof google.cloud.retail.v2beta.SearchService + * @instance + * @param {google.cloud.retail.v2beta.ISearchRequest} request SearchRequest message or plain object + * @param {google.cloud.retail.v2beta.SearchService.SearchCallback} callback Node-style callback called with the error, if any, and SearchResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SearchService.prototype.search = function search(request, callback) { + return this.rpcCall(search, $root.google.cloud.retail.v2beta.SearchRequest, $root.google.cloud.retail.v2beta.SearchResponse, request, callback); + }, "name", { value: "Search" }); + + /** + * Calls Search. + * @function search + * @memberof google.cloud.retail.v2beta.SearchService + * @instance + * @param {google.cloud.retail.v2beta.ISearchRequest} request SearchRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SearchService; + })(); + + v2beta.SearchRequest = (function() { + + /** + * Properties of a SearchRequest. + * @memberof google.cloud.retail.v2beta + * @interface ISearchRequest + * @property {string|null} [placement] SearchRequest placement + * @property {string|null} [branch] SearchRequest branch + * @property {string|null} [query] SearchRequest query + * @property {string|null} [visitorId] SearchRequest visitorId + * @property {google.cloud.retail.v2beta.IUserInfo|null} [userInfo] SearchRequest userInfo + * @property {number|null} [pageSize] SearchRequest pageSize + * @property {string|null} [pageToken] SearchRequest pageToken + * @property {number|null} [offset] SearchRequest offset + * @property {string|null} [filter] SearchRequest filter + * @property {string|null} [canonicalFilter] SearchRequest canonicalFilter + * @property {string|null} [orderBy] SearchRequest orderBy + * @property {Array.|null} [facetSpecs] SearchRequest facetSpecs + * @property {google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec|null} [dynamicFacetSpec] SearchRequest dynamicFacetSpec + * @property {google.cloud.retail.v2beta.SearchRequest.IBoostSpec|null} [boostSpec] SearchRequest boostSpec + * @property {google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec|null} [queryExpansionSpec] SearchRequest queryExpansionSpec + * @property {Array.|null} [variantRollupKeys] SearchRequest variantRollupKeys + * @property {Array.|null} [pageCategories] SearchRequest pageCategories + * @property {google.cloud.retail.v2beta.SearchRequest.SearchMode|null} [searchMode] SearchRequest searchMode + * @property {google.cloud.retail.v2beta.SearchRequest.IPersonalizationSpec|null} [personalizationSpec] SearchRequest personalizationSpec + */ + + /** + * Constructs a new SearchRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a SearchRequest. + * @implements ISearchRequest + * @constructor + * @param {google.cloud.retail.v2beta.ISearchRequest=} [properties] Properties to set + */ + function SearchRequest(properties) { + this.facetSpecs = []; + this.variantRollupKeys = []; + this.pageCategories = []; + 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]]; + } + + /** + * SearchRequest placement. + * @member {string} placement + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.placement = ""; + + /** + * SearchRequest branch. + * @member {string} branch + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.branch = ""; + + /** + * SearchRequest query. + * @member {string} query + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.query = ""; + + /** + * SearchRequest visitorId. + * @member {string} visitorId + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.visitorId = ""; + + /** + * SearchRequest userInfo. + * @member {google.cloud.retail.v2beta.IUserInfo|null|undefined} userInfo + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.userInfo = null; + + /** + * SearchRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.pageSize = 0; + + /** + * SearchRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.pageToken = ""; + + /** + * SearchRequest offset. + * @member {number} offset + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.offset = 0; + + /** + * SearchRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.filter = ""; + + /** + * SearchRequest canonicalFilter. + * @member {string} canonicalFilter + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.canonicalFilter = ""; + + /** + * SearchRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.orderBy = ""; + + /** + * SearchRequest facetSpecs. + * @member {Array.} facetSpecs + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.facetSpecs = $util.emptyArray; + + /** + * SearchRequest dynamicFacetSpec. + * @member {google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec|null|undefined} dynamicFacetSpec + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.dynamicFacetSpec = null; + + /** + * SearchRequest boostSpec. + * @member {google.cloud.retail.v2beta.SearchRequest.IBoostSpec|null|undefined} boostSpec + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.boostSpec = null; + + /** + * SearchRequest queryExpansionSpec. + * @member {google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec|null|undefined} queryExpansionSpec + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.queryExpansionSpec = null; + + /** + * SearchRequest variantRollupKeys. + * @member {Array.} variantRollupKeys + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.variantRollupKeys = $util.emptyArray; + + /** + * SearchRequest pageCategories. + * @member {Array.} pageCategories + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.pageCategories = $util.emptyArray; + + /** + * SearchRequest searchMode. + * @member {google.cloud.retail.v2beta.SearchRequest.SearchMode} searchMode + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.searchMode = 0; + + /** + * SearchRequest personalizationSpec. + * @member {google.cloud.retail.v2beta.SearchRequest.IPersonalizationSpec|null|undefined} personalizationSpec + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + */ + SearchRequest.prototype.personalizationSpec = null; + + /** + * Creates a new SearchRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.SearchRequest + * @static + * @param {google.cloud.retail.v2beta.ISearchRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.SearchRequest} SearchRequest instance + */ + SearchRequest.create = function create(properties) { + return new SearchRequest(properties); + }; + + /** + * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.SearchRequest + * @static + * @param {google.cloud.retail.v2beta.ISearchRequest} message SearchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.placement); + if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.branch); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); + if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.visitorId); + if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) + $root.google.cloud.retail.v2beta.UserInfo.encode(message.userInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.offset); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.orderBy); + if (message.facetSpecs != null && message.facetSpecs.length) + for (var i = 0; i < message.facetSpecs.length; ++i) + $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.encode(message.facetSpecs[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.boostSpec != null && Object.hasOwnProperty.call(message, "boostSpec")) + $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.encode(message.boostSpec, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.queryExpansionSpec != null && Object.hasOwnProperty.call(message, "queryExpansionSpec")) + $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.encode(message.queryExpansionSpec, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.variantRollupKeys != null && message.variantRollupKeys.length) + for (var i = 0; i < message.variantRollupKeys.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.variantRollupKeys[i]); + if (message.dynamicFacetSpec != null && Object.hasOwnProperty.call(message, "dynamicFacetSpec")) + $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.encode(message.dynamicFacetSpec, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.pageCategories != null && message.pageCategories.length) + for (var i = 0; i < message.pageCategories.length; ++i) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.pageCategories[i]); + if (message.canonicalFilter != null && Object.hasOwnProperty.call(message, "canonicalFilter")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.canonicalFilter); + if (message.searchMode != null && Object.hasOwnProperty.call(message, "searchMode")) + writer.uint32(/* id 31, wireType 0 =*/248).int32(message.searchMode); + if (message.personalizationSpec != null && Object.hasOwnProperty.call(message, "personalizationSpec")) + $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.encode(message.personalizationSpec, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.SearchRequest + * @static + * @param {google.cloud.retail.v2beta.ISearchRequest} message SearchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.SearchRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.SearchRequest} SearchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchRequest.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.v2beta.SearchRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.placement = reader.string(); + break; + case 2: + message.branch = reader.string(); + break; + case 3: + message.query = reader.string(); + break; + case 4: + message.visitorId = reader.string(); + break; + case 5: + message.userInfo = $root.google.cloud.retail.v2beta.UserInfo.decode(reader, reader.uint32()); + break; + case 7: + message.pageSize = reader.int32(); + break; + case 8: + message.pageToken = reader.string(); + break; + case 9: + message.offset = reader.int32(); + break; + case 10: + message.filter = reader.string(); + break; + case 28: + message.canonicalFilter = reader.string(); + break; + case 11: + message.orderBy = reader.string(); + break; + case 12: + if (!(message.facetSpecs && message.facetSpecs.length)) + message.facetSpecs = []; + message.facetSpecs.push($root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.decode(reader, reader.uint32())); + break; + case 21: + message.dynamicFacetSpec = $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.decode(reader, reader.uint32()); + break; + case 13: + message.boostSpec = $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.decode(reader, reader.uint32()); + break; + case 14: + message.queryExpansionSpec = $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.decode(reader, reader.uint32()); + break; + case 17: + if (!(message.variantRollupKeys && message.variantRollupKeys.length)) + message.variantRollupKeys = []; + message.variantRollupKeys.push(reader.string()); + break; + case 23: + if (!(message.pageCategories && message.pageCategories.length)) + message.pageCategories = []; + message.pageCategories.push(reader.string()); + break; + case 31: + message.searchMode = reader.int32(); + break; + case 32: + message.personalizationSpec = $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.SearchRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.SearchRequest} SearchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.SearchRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.placement != null && message.hasOwnProperty("placement")) + if (!$util.isString(message.placement)) + return "placement: string expected"; + if (message.branch != null && message.hasOwnProperty("branch")) + if (!$util.isString(message.branch)) + return "branch: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + if (!$util.isString(message.visitorId)) + return "visitorId: string expected"; + if (message.userInfo != null && message.hasOwnProperty("userInfo")) { + var error = $root.google.cloud.retail.v2beta.UserInfo.verify(message.userInfo); + if (error) + return "userInfo." + error; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) + if (!$util.isString(message.canonicalFilter)) + return "canonicalFilter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.facetSpecs != null && message.hasOwnProperty("facetSpecs")) { + if (!Array.isArray(message.facetSpecs)) + return "facetSpecs: array expected"; + for (var i = 0; i < message.facetSpecs.length; ++i) { + var error = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.verify(message.facetSpecs[i]); + if (error) + return "facetSpecs." + error; + } + } + if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) { + var error = $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.verify(message.dynamicFacetSpec); + if (error) + return "dynamicFacetSpec." + error; + } + if (message.boostSpec != null && message.hasOwnProperty("boostSpec")) { + var error = $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.verify(message.boostSpec); + if (error) + return "boostSpec." + error; + } + if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) { + var error = $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.verify(message.queryExpansionSpec); + if (error) + return "queryExpansionSpec." + error; + } + if (message.variantRollupKeys != null && message.hasOwnProperty("variantRollupKeys")) { + if (!Array.isArray(message.variantRollupKeys)) + return "variantRollupKeys: array expected"; + for (var i = 0; i < message.variantRollupKeys.length; ++i) + if (!$util.isString(message.variantRollupKeys[i])) + return "variantRollupKeys: string[] expected"; + } + if (message.pageCategories != null && message.hasOwnProperty("pageCategories")) { + if (!Array.isArray(message.pageCategories)) + return "pageCategories: array expected"; + for (var i = 0; i < message.pageCategories.length; ++i) + if (!$util.isString(message.pageCategories[i])) + return "pageCategories: string[] expected"; + } + if (message.searchMode != null && message.hasOwnProperty("searchMode")) + switch (message.searchMode) { + default: + return "searchMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) { + var error = $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.verify(message.personalizationSpec); + if (error) + return "personalizationSpec." + error; + } + return null; + }; + + /** + * Creates a SearchRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.SearchRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.SearchRequest} SearchRequest + */ + SearchRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.SearchRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.SearchRequest(); + if (object.placement != null) + message.placement = String(object.placement); + if (object.branch != null) + message.branch = String(object.branch); + if (object.query != null) + message.query = String(object.query); + if (object.visitorId != null) + message.visitorId = String(object.visitorId); + if (object.userInfo != null) { + if (typeof object.userInfo !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.userInfo: object expected"); + message.userInfo = $root.google.cloud.retail.v2beta.UserInfo.fromObject(object.userInfo); + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.offset != null) + message.offset = object.offset | 0; + if (object.filter != null) + message.filter = String(object.filter); + if (object.canonicalFilter != null) + message.canonicalFilter = String(object.canonicalFilter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.facetSpecs) { + if (!Array.isArray(object.facetSpecs)) + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.facetSpecs: array expected"); + message.facetSpecs = []; + for (var i = 0; i < object.facetSpecs.length; ++i) { + if (typeof object.facetSpecs[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.facetSpecs: object expected"); + message.facetSpecs[i] = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.fromObject(object.facetSpecs[i]); + } + } + if (object.dynamicFacetSpec != null) { + if (typeof object.dynamicFacetSpec !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.dynamicFacetSpec: object expected"); + message.dynamicFacetSpec = $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.fromObject(object.dynamicFacetSpec); + } + if (object.boostSpec != null) { + if (typeof object.boostSpec !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.boostSpec: object expected"); + message.boostSpec = $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.fromObject(object.boostSpec); + } + if (object.queryExpansionSpec != null) { + if (typeof object.queryExpansionSpec !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.queryExpansionSpec: object expected"); + message.queryExpansionSpec = $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.fromObject(object.queryExpansionSpec); + } + if (object.variantRollupKeys) { + if (!Array.isArray(object.variantRollupKeys)) + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.variantRollupKeys: array expected"); + message.variantRollupKeys = []; + for (var i = 0; i < object.variantRollupKeys.length; ++i) + message.variantRollupKeys[i] = String(object.variantRollupKeys[i]); + } + if (object.pageCategories) { + if (!Array.isArray(object.pageCategories)) + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.pageCategories: array expected"); + message.pageCategories = []; + for (var i = 0; i < object.pageCategories.length; ++i) + message.pageCategories[i] = String(object.pageCategories[i]); + } + switch (object.searchMode) { + case "SEARCH_MODE_UNSPECIFIED": + case 0: + message.searchMode = 0; + break; + case "PRODUCT_SEARCH_ONLY": + case 1: + message.searchMode = 1; + break; + case "FACETED_SEARCH_ONLY": + case 2: + message.searchMode = 2; + break; + } + if (object.personalizationSpec != null) { + if (typeof object.personalizationSpec !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.personalizationSpec: object expected"); + message.personalizationSpec = $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.fromObject(object.personalizationSpec); + } + return message; + }; + + /** + * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.SearchRequest + * @static + * @param {google.cloud.retail.v2beta.SearchRequest} message SearchRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.facetSpecs = []; + object.variantRollupKeys = []; + object.pageCategories = []; + } + if (options.defaults) { + object.placement = ""; + object.branch = ""; + object.query = ""; + object.visitorId = ""; + object.userInfo = null; + object.pageSize = 0; + object.pageToken = ""; + object.offset = 0; + object.filter = ""; + object.orderBy = ""; + object.boostSpec = null; + object.queryExpansionSpec = null; + object.dynamicFacetSpec = null; + object.canonicalFilter = ""; + object.searchMode = options.enums === String ? "SEARCH_MODE_UNSPECIFIED" : 0; + object.personalizationSpec = null; + } + if (message.placement != null && message.hasOwnProperty("placement")) + object.placement = message.placement; + if (message.branch != null && message.hasOwnProperty("branch")) + object.branch = message.branch; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + object.visitorId = message.visitorId; + if (message.userInfo != null && message.hasOwnProperty("userInfo")) + object.userInfo = $root.google.cloud.retail.v2beta.UserInfo.toObject(message.userInfo, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.facetSpecs && message.facetSpecs.length) { + object.facetSpecs = []; + for (var j = 0; j < message.facetSpecs.length; ++j) + object.facetSpecs[j] = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.toObject(message.facetSpecs[j], options); + } + if (message.boostSpec != null && message.hasOwnProperty("boostSpec")) + object.boostSpec = $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.toObject(message.boostSpec, options); + if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) + object.queryExpansionSpec = $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.toObject(message.queryExpansionSpec, options); + if (message.variantRollupKeys && message.variantRollupKeys.length) { + object.variantRollupKeys = []; + for (var j = 0; j < message.variantRollupKeys.length; ++j) + object.variantRollupKeys[j] = message.variantRollupKeys[j]; + } + if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) + object.dynamicFacetSpec = $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.toObject(message.dynamicFacetSpec, options); + if (message.pageCategories && message.pageCategories.length) { + object.pageCategories = []; + for (var j = 0; j < message.pageCategories.length; ++j) + object.pageCategories[j] = message.pageCategories[j]; + } + if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) + object.canonicalFilter = message.canonicalFilter; + if (message.searchMode != null && message.hasOwnProperty("searchMode")) + object.searchMode = options.enums === String ? $root.google.cloud.retail.v2beta.SearchRequest.SearchMode[message.searchMode] : message.searchMode; + if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) + object.personalizationSpec = $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.toObject(message.personalizationSpec, options); + return object; + }; + + /** + * Converts this SearchRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.SearchRequest + * @instance + * @returns {Object.} JSON object + */ + SearchRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SearchRequest.FacetSpec = (function() { + + /** + * Properties of a FacetSpec. + * @memberof google.cloud.retail.v2beta.SearchRequest + * @interface IFacetSpec + * @property {google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey|null} [facetKey] FacetSpec facetKey + * @property {number|null} [limit] FacetSpec limit + * @property {Array.|null} [excludedFilterKeys] FacetSpec excludedFilterKeys + * @property {boolean|null} [enableDynamicPosition] FacetSpec enableDynamicPosition + */ + + /** + * Constructs a new FacetSpec. + * @memberof google.cloud.retail.v2beta.SearchRequest + * @classdesc Represents a FacetSpec. + * @implements IFacetSpec + * @constructor + * @param {google.cloud.retail.v2beta.SearchRequest.IFacetSpec=} [properties] Properties to set + */ + function FacetSpec(properties) { + this.excludedFilterKeys = []; + 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]]; + } + + /** + * FacetSpec facetKey. + * @member {google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey|null|undefined} facetKey + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec + * @instance + */ + FacetSpec.prototype.facetKey = null; + + /** + * FacetSpec limit. + * @member {number} limit + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec + * @instance + */ + FacetSpec.prototype.limit = 0; + + /** + * FacetSpec excludedFilterKeys. + * @member {Array.} excludedFilterKeys + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec + * @instance + */ + FacetSpec.prototype.excludedFilterKeys = $util.emptyArray; + + /** + * FacetSpec enableDynamicPosition. + * @member {boolean} enableDynamicPosition + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec + * @instance + */ + FacetSpec.prototype.enableDynamicPosition = false; + + /** + * Creates a new FacetSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.IFacetSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.SearchRequest.FacetSpec} FacetSpec instance + */ + FacetSpec.create = function create(properties) { + return new FacetSpec(properties); + }; + + /** + * Encodes the specified FacetSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.FacetSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.IFacetSpec} message FacetSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.facetKey != null && Object.hasOwnProperty.call(message, "facetKey")) + $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.encode(message.facetKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.limit); + if (message.excludedFilterKeys != null && message.excludedFilterKeys.length) + for (var i = 0; i < message.excludedFilterKeys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.excludedFilterKeys[i]); + if (message.enableDynamicPosition != null && Object.hasOwnProperty.call(message, "enableDynamicPosition")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableDynamicPosition); + return writer; + }; + + /** + * Encodes the specified FacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.FacetSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.IFacetSpec} message FacetSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FacetSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.SearchRequest.FacetSpec} FacetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetSpec.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.v2beta.SearchRequest.FacetSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.facetKey = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.decode(reader, reader.uint32()); + break; + case 2: + message.limit = reader.int32(); + break; + case 3: + if (!(message.excludedFilterKeys && message.excludedFilterKeys.length)) + message.excludedFilterKeys = []; + message.excludedFilterKeys.push(reader.string()); + break; + case 4: + message.enableDynamicPosition = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FacetSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.SearchRequest.FacetSpec} FacetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FacetSpec message. + * @function verify + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.facetKey != null && message.hasOwnProperty("facetKey")) { + var error = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.verify(message.facetKey); + if (error) + return "facetKey." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.excludedFilterKeys != null && message.hasOwnProperty("excludedFilterKeys")) { + if (!Array.isArray(message.excludedFilterKeys)) + return "excludedFilterKeys: array expected"; + for (var i = 0; i < message.excludedFilterKeys.length; ++i) + if (!$util.isString(message.excludedFilterKeys[i])) + return "excludedFilterKeys: string[] expected"; + } + if (message.enableDynamicPosition != null && message.hasOwnProperty("enableDynamicPosition")) + if (typeof message.enableDynamicPosition !== "boolean") + return "enableDynamicPosition: boolean expected"; + return null; + }; + + /** + * Creates a FacetSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.SearchRequest.FacetSpec} FacetSpec + */ + FacetSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec) + return object; + var message = new $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec(); + if (object.facetKey != null) { + if (typeof object.facetKey !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.FacetSpec.facetKey: object expected"); + message.facetKey = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.fromObject(object.facetKey); + } + if (object.limit != null) + message.limit = object.limit | 0; + if (object.excludedFilterKeys) { + if (!Array.isArray(object.excludedFilterKeys)) + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.FacetSpec.excludedFilterKeys: array expected"); + message.excludedFilterKeys = []; + for (var i = 0; i < object.excludedFilterKeys.length; ++i) + message.excludedFilterKeys[i] = String(object.excludedFilterKeys[i]); + } + if (object.enableDynamicPosition != null) + message.enableDynamicPosition = Boolean(object.enableDynamicPosition); + return message; + }; + + /** + * Creates a plain object from a FacetSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.FacetSpec} message FacetSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.excludedFilterKeys = []; + if (options.defaults) { + object.facetKey = null; + object.limit = 0; + object.enableDynamicPosition = false; + } + if (message.facetKey != null && message.hasOwnProperty("facetKey")) + object.facetKey = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.toObject(message.facetKey, options); + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.excludedFilterKeys && message.excludedFilterKeys.length) { + object.excludedFilterKeys = []; + for (var j = 0; j < message.excludedFilterKeys.length; ++j) + object.excludedFilterKeys[j] = message.excludedFilterKeys[j]; + } + if (message.enableDynamicPosition != null && message.hasOwnProperty("enableDynamicPosition")) + object.enableDynamicPosition = message.enableDynamicPosition; + return object; + }; + + /** + * Converts this FacetSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec + * @instance + * @returns {Object.} JSON object + */ + FacetSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + FacetSpec.FacetKey = (function() { + + /** + * Properties of a FacetKey. + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec + * @interface IFacetKey + * @property {string|null} [key] FacetKey key + * @property {Array.|null} [intervals] FacetKey intervals + * @property {Array.|null} [restrictedValues] FacetKey restrictedValues + * @property {Array.|null} [prefixes] FacetKey prefixes + * @property {Array.|null} [contains] FacetKey contains + * @property {string|null} [orderBy] FacetKey orderBy + * @property {string|null} [query] FacetKey query + */ + + /** + * Constructs a new FacetKey. + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec + * @classdesc Represents a FacetKey. + * @implements IFacetKey + * @constructor + * @param {google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey=} [properties] Properties to set + */ + function FacetKey(properties) { + this.intervals = []; + this.restrictedValues = []; + this.prefixes = []; + this.contains = []; + 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]]; + } + + /** + * FacetKey key. + * @member {string} key + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.key = ""; + + /** + * FacetKey intervals. + * @member {Array.} intervals + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.intervals = $util.emptyArray; + + /** + * FacetKey restrictedValues. + * @member {Array.} restrictedValues + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.restrictedValues = $util.emptyArray; + + /** + * FacetKey prefixes. + * @member {Array.} prefixes + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.prefixes = $util.emptyArray; + + /** + * FacetKey contains. + * @member {Array.} contains + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.contains = $util.emptyArray; + + /** + * FacetKey orderBy. + * @member {string} orderBy + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.orderBy = ""; + + /** + * FacetKey query. + * @member {string} query + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.query = ""; + + /** + * Creates a new FacetKey instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey} FacetKey instance + */ + FacetKey.create = function create(properties) { + return new FacetKey(properties); + }; + + /** + * Encodes the specified FacetKey message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey} message FacetKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.intervals != null && message.intervals.length) + for (var i = 0; i < message.intervals.length; ++i) + $root.google.cloud.retail.v2beta.Interval.encode(message.intervals[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.restrictedValues != null && message.restrictedValues.length) + for (var i = 0; i < message.restrictedValues.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.restrictedValues[i]); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.query); + if (message.prefixes != null && message.prefixes.length) + for (var i = 0; i < message.prefixes.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.prefixes[i]); + if (message.contains != null && message.contains.length) + for (var i = 0; i < message.contains.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.contains[i]); + return writer; + }; + + /** + * Encodes the specified FacetKey message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey} message FacetKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FacetKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey} FacetKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetKey.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.v2beta.SearchRequest.FacetSpec.FacetKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + if (!(message.intervals && message.intervals.length)) + message.intervals = []; + message.intervals.push($root.google.cloud.retail.v2beta.Interval.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.restrictedValues && message.restrictedValues.length)) + message.restrictedValues = []; + message.restrictedValues.push(reader.string()); + break; + case 8: + if (!(message.prefixes && message.prefixes.length)) + message.prefixes = []; + message.prefixes.push(reader.string()); + break; + case 9: + if (!(message.contains && message.contains.length)) + message.contains = []; + message.contains.push(reader.string()); + break; + case 4: + message.orderBy = reader.string(); + break; + case 5: + message.query = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FacetKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey} FacetKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FacetKey message. + * @function verify + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.intervals != null && message.hasOwnProperty("intervals")) { + if (!Array.isArray(message.intervals)) + return "intervals: array expected"; + for (var i = 0; i < message.intervals.length; ++i) { + var error = $root.google.cloud.retail.v2beta.Interval.verify(message.intervals[i]); + if (error) + return "intervals." + error; + } + } + if (message.restrictedValues != null && message.hasOwnProperty("restrictedValues")) { + if (!Array.isArray(message.restrictedValues)) + return "restrictedValues: array expected"; + for (var i = 0; i < message.restrictedValues.length; ++i) + if (!$util.isString(message.restrictedValues[i])) + return "restrictedValues: string[] expected"; + } + if (message.prefixes != null && message.hasOwnProperty("prefixes")) { + if (!Array.isArray(message.prefixes)) + return "prefixes: array expected"; + for (var i = 0; i < message.prefixes.length; ++i) + if (!$util.isString(message.prefixes[i])) + return "prefixes: string[] expected"; + } + if (message.contains != null && message.hasOwnProperty("contains")) { + if (!Array.isArray(message.contains)) + return "contains: array expected"; + for (var i = 0; i < message.contains.length; ++i) + if (!$util.isString(message.contains[i])) + return "contains: string[] expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + return null; + }; + + /** + * Creates a FacetKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey} FacetKey + */ + FacetKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey) + return object; + var message = new $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey(); + if (object.key != null) + message.key = String(object.key); + if (object.intervals) { + if (!Array.isArray(object.intervals)) + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.intervals: array expected"); + message.intervals = []; + for (var i = 0; i < object.intervals.length; ++i) { + if (typeof object.intervals[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.intervals: object expected"); + message.intervals[i] = $root.google.cloud.retail.v2beta.Interval.fromObject(object.intervals[i]); + } + } + if (object.restrictedValues) { + if (!Array.isArray(object.restrictedValues)) + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.restrictedValues: array expected"); + message.restrictedValues = []; + for (var i = 0; i < object.restrictedValues.length; ++i) + message.restrictedValues[i] = String(object.restrictedValues[i]); + } + if (object.prefixes) { + if (!Array.isArray(object.prefixes)) + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.prefixes: array expected"); + message.prefixes = []; + for (var i = 0; i < object.prefixes.length; ++i) + message.prefixes[i] = String(object.prefixes[i]); + } + if (object.contains) { + if (!Array.isArray(object.contains)) + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.contains: array expected"); + message.contains = []; + for (var i = 0; i < object.contains.length; ++i) + message.contains[i] = String(object.contains[i]); + } + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.query != null) + message.query = String(object.query); + return message; + }; + + /** + * Creates a plain object from a FacetKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey} message FacetKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.intervals = []; + object.restrictedValues = []; + object.prefixes = []; + object.contains = []; + } + if (options.defaults) { + object.key = ""; + object.orderBy = ""; + object.query = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.intervals && message.intervals.length) { + object.intervals = []; + for (var j = 0; j < message.intervals.length; ++j) + object.intervals[j] = $root.google.cloud.retail.v2beta.Interval.toObject(message.intervals[j], options); + } + if (message.restrictedValues && message.restrictedValues.length) { + object.restrictedValues = []; + for (var j = 0; j < message.restrictedValues.length; ++j) + object.restrictedValues[j] = message.restrictedValues[j]; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.prefixes && message.prefixes.length) { + object.prefixes = []; + for (var j = 0; j < message.prefixes.length; ++j) + object.prefixes[j] = message.prefixes[j]; + } + if (message.contains && message.contains.length) { + object.contains = []; + for (var j = 0; j < message.contains.length; ++j) + object.contains[j] = message.contains[j]; + } + return object; + }; + + /** + * Converts this FacetKey to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + * @instance + * @returns {Object.} JSON object + */ + FacetKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FacetKey; + })(); + + return FacetSpec; + })(); + + SearchRequest.DynamicFacetSpec = (function() { + + /** + * Properties of a DynamicFacetSpec. + * @memberof google.cloud.retail.v2beta.SearchRequest + * @interface IDynamicFacetSpec + * @property {google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode|null} [mode] DynamicFacetSpec mode + */ + + /** + * Constructs a new DynamicFacetSpec. + * @memberof google.cloud.retail.v2beta.SearchRequest + * @classdesc Represents a DynamicFacetSpec. + * @implements IDynamicFacetSpec + * @constructor + * @param {google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec=} [properties] Properties to set + */ + function DynamicFacetSpec(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]]; + } + + /** + * DynamicFacetSpec mode. + * @member {google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode} mode + * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec + * @instance + */ + DynamicFacetSpec.prototype.mode = 0; + + /** + * Creates a new DynamicFacetSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec} DynamicFacetSpec instance + */ + DynamicFacetSpec.create = function create(properties) { + return new DynamicFacetSpec(properties); + }; + + /** + * Encodes the specified DynamicFacetSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec} message DynamicFacetSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DynamicFacetSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + return writer; + }; + + /** + * Encodes the specified DynamicFacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec} message DynamicFacetSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DynamicFacetSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DynamicFacetSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec} DynamicFacetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DynamicFacetSpec.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.v2beta.SearchRequest.DynamicFacetSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DynamicFacetSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec} DynamicFacetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DynamicFacetSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DynamicFacetSpec message. + * @function verify + * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DynamicFacetSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a DynamicFacetSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec} DynamicFacetSpec + */ + DynamicFacetSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec) + return object; + var message = new $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec(); + switch (object.mode) { + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "DISABLED": + case 1: + message.mode = 1; + break; + case "ENABLED": + case 2: + message.mode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a DynamicFacetSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec} message DynamicFacetSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DynamicFacetSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode[message.mode] : message.mode; + return object; + }; + + /** + * Converts this DynamicFacetSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec + * @instance + * @returns {Object.} JSON object + */ + DynamicFacetSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Mode enum. + * @name google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} ENABLED=2 ENABLED value + */ + DynamicFacetSpec.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[2] = "ENABLED"] = 2; + return values; + })(); + + return DynamicFacetSpec; + })(); + + SearchRequest.BoostSpec = (function() { + + /** + * Properties of a BoostSpec. + * @memberof google.cloud.retail.v2beta.SearchRequest + * @interface IBoostSpec + * @property {Array.|null} [conditionBoostSpecs] BoostSpec conditionBoostSpecs + * @property {boolean|null} [skipBoostSpecValidation] BoostSpec skipBoostSpecValidation + */ + + /** + * Constructs a new BoostSpec. + * @memberof google.cloud.retail.v2beta.SearchRequest + * @classdesc Represents a BoostSpec. + * @implements IBoostSpec + * @constructor + * @param {google.cloud.retail.v2beta.SearchRequest.IBoostSpec=} [properties] Properties to set + */ + function BoostSpec(properties) { + this.conditionBoostSpecs = []; + 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]]; + } + + /** + * BoostSpec conditionBoostSpecs. + * @member {Array.} conditionBoostSpecs + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec + * @instance + */ + BoostSpec.prototype.conditionBoostSpecs = $util.emptyArray; + + /** + * BoostSpec skipBoostSpecValidation. + * @member {boolean|null|undefined} skipBoostSpecValidation + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec + * @instance + */ + BoostSpec.prototype.skipBoostSpecValidation = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BoostSpec _skipBoostSpecValidation. + * @member {"skipBoostSpecValidation"|undefined} _skipBoostSpecValidation + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec + * @instance + */ + Object.defineProperty(BoostSpec.prototype, "_skipBoostSpecValidation", { + get: $util.oneOfGetter($oneOfFields = ["skipBoostSpecValidation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.IBoostSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.SearchRequest.BoostSpec} BoostSpec instance + */ + BoostSpec.create = function create(properties) { + return new BoostSpec(properties); + }; + + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.BoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditionBoostSpecs != null && message.conditionBoostSpecs.length) + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) + $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.encode(message.conditionBoostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.skipBoostSpecValidation != null && Object.hasOwnProperty.call(message, "skipBoostSpecValidation")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.skipBoostSpecValidation); + return writer; + }; + + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.BoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.SearchRequest.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.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.v2beta.SearchRequest.BoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.conditionBoostSpecs && message.conditionBoostSpecs.length)) + message.conditionBoostSpecs = []; + message.conditionBoostSpecs.push($root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); + break; + case 2: + message.skipBoostSpecValidation = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.SearchRequest.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostSpec message. + * @function verify + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.conditionBoostSpecs != null && message.hasOwnProperty("conditionBoostSpecs")) { + if (!Array.isArray(message.conditionBoostSpecs)) + return "conditionBoostSpecs: array expected"; + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) { + var error = $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.verify(message.conditionBoostSpecs[i]); + if (error) + return "conditionBoostSpecs." + error; + } + } + if (message.skipBoostSpecValidation != null && message.hasOwnProperty("skipBoostSpecValidation")) { + properties._skipBoostSpecValidation = 1; + if (typeof message.skipBoostSpecValidation !== "boolean") + return "skipBoostSpecValidation: boolean expected"; + } + return null; + }; + + /** + * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.SearchRequest.BoostSpec} BoostSpec + */ + BoostSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec) + return object; + var message = new $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec(); + if (object.conditionBoostSpecs) { + if (!Array.isArray(object.conditionBoostSpecs)) + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.BoostSpec.conditionBoostSpecs: array expected"); + message.conditionBoostSpecs = []; + for (var i = 0; i < object.conditionBoostSpecs.length; ++i) { + if (typeof object.conditionBoostSpecs[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchRequest.BoostSpec.conditionBoostSpecs: object expected"); + message.conditionBoostSpecs[i] = $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.fromObject(object.conditionBoostSpecs[i]); + } + } + if (object.skipBoostSpecValidation != null) + message.skipBoostSpecValidation = Boolean(object.skipBoostSpecValidation); + return message; + }; + + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec} message BoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditionBoostSpecs = []; + if (message.conditionBoostSpecs && message.conditionBoostSpecs.length) { + object.conditionBoostSpecs = []; + for (var j = 0; j < message.conditionBoostSpecs.length; ++j) + object.conditionBoostSpecs[j] = $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.toObject(message.conditionBoostSpecs[j], options); + } + if (message.skipBoostSpecValidation != null && message.hasOwnProperty("skipBoostSpecValidation")) { + object.skipBoostSpecValidation = message.skipBoostSpecValidation; + if (options.oneofs) + object._skipBoostSpecValidation = "skipBoostSpecValidation"; + } + return object; + }; + + /** + * Converts this BoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec + * @instance + * @returns {Object.} JSON object + */ + BoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + BoostSpec.ConditionBoostSpec = (function() { + + /** + * Properties of a ConditionBoostSpec. + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec + * @interface IConditionBoostSpec + * @property {string|null} [condition] ConditionBoostSpec condition + * @property {number|null} [boost] ConditionBoostSpec boost + */ + + /** + * Constructs a new ConditionBoostSpec. + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec + * @classdesc Represents a ConditionBoostSpec. + * @implements IConditionBoostSpec + * @constructor + * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + */ + function ConditionBoostSpec(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]]; + } + + /** + * ConditionBoostSpec condition. + * @member {string} condition + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.condition = ""; + + /** + * ConditionBoostSpec boost. + * @member {number} boost + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.boost = 0; + + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec instance + */ + ConditionBoostSpec.create = function create(properties) { + return new ConditionBoostSpec(properties); + }; + + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + return writer; + }; + + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.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.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.condition = reader.string(); + break; + case 2: + message.boost = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionBoostSpec message. + * @function verify + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionBoostSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + return null; + }; + + /** + * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + */ + ConditionBoostSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec) + return object; + var message = new $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec(); + if (object.condition != null) + message.condition = String(object.condition); + if (object.boost != null) + message.boost = Number(object.boost); + return message; + }; + + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec} message ConditionBoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionBoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.condition = ""; + object.boost = 0; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + return object; + }; + + /** + * Converts this ConditionBoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + * @instance + * @returns {Object.} JSON object + */ + ConditionBoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConditionBoostSpec; + })(); + + return BoostSpec; + })(); + + SearchRequest.QueryExpansionSpec = (function() { + + /** + * Properties of a QueryExpansionSpec. + * @memberof google.cloud.retail.v2beta.SearchRequest + * @interface IQueryExpansionSpec + * @property {google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition|null} [condition] QueryExpansionSpec condition + * @property {boolean|null} [pinUnexpandedResults] QueryExpansionSpec pinUnexpandedResults + */ + + /** + * Constructs a new QueryExpansionSpec. + * @memberof google.cloud.retail.v2beta.SearchRequest + * @classdesc Represents a QueryExpansionSpec. + * @implements IQueryExpansionSpec + * @constructor + * @param {google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set + */ + function QueryExpansionSpec(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]]; + } + + /** + * QueryExpansionSpec condition. + * @member {google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition} condition + * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec + * @instance + */ + QueryExpansionSpec.prototype.condition = 0; + + /** + * QueryExpansionSpec pinUnexpandedResults. + * @member {boolean} pinUnexpandedResults + * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec + * @instance + */ + QueryExpansionSpec.prototype.pinUnexpandedResults = false; + + /** + * Creates a new QueryExpansionSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec} QueryExpansionSpec instance + */ + QueryExpansionSpec.create = function create(properties) { + return new QueryExpansionSpec(properties); + }; + + /** + * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryExpansionSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.condition); + if (message.pinUnexpandedResults != null && Object.hasOwnProperty.call(message, "pinUnexpandedResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.pinUnexpandedResults); + return writer; + }; + + /** + * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryExpansionSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryExpansionSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec} QueryExpansionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryExpansionSpec.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.v2beta.SearchRequest.QueryExpansionSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.condition = reader.int32(); + break; + case 2: + message.pinUnexpandedResults = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec} QueryExpansionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryExpansionSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryExpansionSpec message. + * @function verify + * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryExpansionSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + switch (message.condition) { + default: + return "condition: enum value expected"; + case 0: + case 1: + case 3: + break; + } + if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) + if (typeof message.pinUnexpandedResults !== "boolean") + return "pinUnexpandedResults: boolean expected"; + return null; + }; + + /** + * Creates a QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec} QueryExpansionSpec + */ + QueryExpansionSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec) + return object; + var message = new $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec(); + switch (object.condition) { + case "CONDITION_UNSPECIFIED": + case 0: + message.condition = 0; + break; + case "DISABLED": + case 1: + message.condition = 1; + break; + case "AUTO": + case 3: + message.condition = 3; + break; + } + if (object.pinUnexpandedResults != null) + message.pinUnexpandedResults = Boolean(object.pinUnexpandedResults); + return message; + }; + + /** + * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec} message QueryExpansionSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryExpansionSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.condition = options.enums === String ? "CONDITION_UNSPECIFIED" : 0; + object.pinUnexpandedResults = false; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = options.enums === String ? $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition[message.condition] : message.condition; + if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) + object.pinUnexpandedResults = message.pinUnexpandedResults; + return object; + }; + + /** + * Converts this QueryExpansionSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec + * @instance + * @returns {Object.} JSON object + */ + QueryExpansionSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Condition enum. + * @name google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition + * @enum {number} + * @property {number} CONDITION_UNSPECIFIED=0 CONDITION_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} AUTO=3 AUTO value + */ + QueryExpansionSpec.Condition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONDITION_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[3] = "AUTO"] = 3; + return values; + })(); + + return QueryExpansionSpec; + })(); + + SearchRequest.PersonalizationSpec = (function() { + + /** + * Properties of a PersonalizationSpec. + * @memberof google.cloud.retail.v2beta.SearchRequest + * @interface IPersonalizationSpec + * @property {google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode|null} [mode] PersonalizationSpec mode + */ + + /** + * Constructs a new PersonalizationSpec. + * @memberof google.cloud.retail.v2beta.SearchRequest + * @classdesc Represents a PersonalizationSpec. + * @implements IPersonalizationSpec + * @constructor + * @param {google.cloud.retail.v2beta.SearchRequest.IPersonalizationSpec=} [properties] Properties to set + */ + function PersonalizationSpec(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]]; + } + + /** + * PersonalizationSpec mode. + * @member {google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode} mode + * @memberof google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec + * @instance + */ + PersonalizationSpec.prototype.mode = 0; + + /** + * Creates a new PersonalizationSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.IPersonalizationSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec} PersonalizationSpec instance + */ + PersonalizationSpec.create = function create(properties) { + return new PersonalizationSpec(properties); + }; + + /** + * Encodes the specified PersonalizationSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.IPersonalizationSpec} message PersonalizationSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalizationSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + return writer; + }; + + /** + * Encodes the specified PersonalizationSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.IPersonalizationSpec} message PersonalizationSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalizationSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonalizationSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec} PersonalizationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalizationSpec.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.v2beta.SearchRequest.PersonalizationSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PersonalizationSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec} PersonalizationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalizationSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonalizationSpec message. + * @function verify + * @memberof google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonalizationSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a PersonalizationSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec} PersonalizationSpec + */ + PersonalizationSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec) + return object; + var message = new $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec(); + switch (object.mode) { + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "AUTO": + case 1: + message.mode = 1; + break; + case "DISABLED": + case 2: + message.mode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a PersonalizationSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec + * @static + * @param {google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec} message PersonalizationSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonalizationSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode[message.mode] : message.mode; + return object; + }; + + /** + * Converts this PersonalizationSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec + * @instance + * @returns {Object.} JSON object + */ + PersonalizationSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Mode enum. + * @name google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} AUTO=1 AUTO value + * @property {number} DISABLED=2 DISABLED value + */ + PersonalizationSpec.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTO"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + return values; + })(); - /** - * Type enum. - * @name google.cloud.retail.v2beta.Product.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} PRIMARY=1 PRIMARY value - * @property {number} VARIANT=2 VARIANT value - * @property {number} COLLECTION=3 COLLECTION value - */ - Product.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIMARY"] = 1; - values[valuesById[2] = "VARIANT"] = 2; - values[valuesById[3] = "COLLECTION"] = 3; - return values; + return PersonalizationSpec; })(); /** - * Availability enum. - * @name google.cloud.retail.v2beta.Product.Availability + * SearchMode enum. + * @name google.cloud.retail.v2beta.SearchRequest.SearchMode * @enum {number} - * @property {number} AVAILABILITY_UNSPECIFIED=0 AVAILABILITY_UNSPECIFIED value - * @property {number} IN_STOCK=1 IN_STOCK value - * @property {number} OUT_OF_STOCK=2 OUT_OF_STOCK value - * @property {number} PREORDER=3 PREORDER value - * @property {number} BACKORDER=4 BACKORDER value + * @property {number} SEARCH_MODE_UNSPECIFIED=0 SEARCH_MODE_UNSPECIFIED value + * @property {number} PRODUCT_SEARCH_ONLY=1 PRODUCT_SEARCH_ONLY value + * @property {number} FACETED_SEARCH_ONLY=2 FACETED_SEARCH_ONLY value */ - Product.Availability = (function() { + SearchRequest.SearchMode = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AVAILABILITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "IN_STOCK"] = 1; - values[valuesById[2] = "OUT_OF_STOCK"] = 2; - values[valuesById[3] = "PREORDER"] = 3; - values[valuesById[4] = "BACKORDER"] = 4; + values[valuesById[0] = "SEARCH_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRODUCT_SEARCH_ONLY"] = 1; + values[valuesById[2] = "FACETED_SEARCH_ONLY"] = 2; return values; })(); - return Product; + return SearchRequest; })(); - v2beta.UserEvent = (function() { + v2beta.SearchResponse = (function() { /** - * Properties of a UserEvent. + * Properties of a SearchResponse. * @memberof google.cloud.retail.v2beta - * @interface IUserEvent - * @property {string|null} [eventType] UserEvent eventType - * @property {string|null} [visitorId] UserEvent visitorId - * @property {string|null} [sessionId] UserEvent sessionId - * @property {google.protobuf.ITimestamp|null} [eventTime] UserEvent eventTime - * @property {Array.|null} [experimentIds] UserEvent experimentIds - * @property {string|null} [attributionToken] UserEvent attributionToken - * @property {Array.|null} [productDetails] UserEvent productDetails - * @property {google.cloud.retail.v2beta.ICompletionDetail|null} [completionDetail] UserEvent completionDetail - * @property {Object.|null} [attributes] UserEvent attributes - * @property {string|null} [cartId] UserEvent cartId - * @property {google.cloud.retail.v2beta.IPurchaseTransaction|null} [purchaseTransaction] UserEvent purchaseTransaction - * @property {string|null} [searchQuery] UserEvent searchQuery - * @property {string|null} [filter] UserEvent filter - * @property {string|null} [orderBy] UserEvent orderBy - * @property {number|null} [offset] UserEvent offset - * @property {Array.|null} [pageCategories] UserEvent pageCategories - * @property {google.cloud.retail.v2beta.IUserInfo|null} [userInfo] UserEvent userInfo - * @property {string|null} [uri] UserEvent uri - * @property {string|null} [referrerUri] UserEvent referrerUri - * @property {string|null} [pageViewId] UserEvent pageViewId + * @interface ISearchResponse + * @property {Array.|null} [results] SearchResponse results + * @property {Array.|null} [facets] SearchResponse facets + * @property {number|null} [totalSize] SearchResponse totalSize + * @property {string|null} [correctedQuery] SearchResponse correctedQuery + * @property {string|null} [attributionToken] SearchResponse attributionToken + * @property {string|null} [nextPageToken] SearchResponse nextPageToken + * @property {google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo|null} [queryExpansionInfo] SearchResponse queryExpansionInfo + * @property {string|null} [redirectUri] SearchResponse redirectUri + * @property {Array.|null} [appliedControls] SearchResponse appliedControls + * @property {Array.|null} [invalidConditionBoostSpecs] SearchResponse invalidConditionBoostSpecs */ /** - * Constructs a new UserEvent. + * Constructs a new SearchResponse. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a UserEvent. - * @implements IUserEvent + * @classdesc Represents a SearchResponse. + * @implements ISearchResponse * @constructor - * @param {google.cloud.retail.v2beta.IUserEvent=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.ISearchResponse=} [properties] Properties to set */ - function UserEvent(properties) { - this.experimentIds = []; - this.productDetails = []; - this.attributes = {}; - this.pageCategories = []; + function SearchResponse(properties) { + this.results = []; + this.facets = []; + this.appliedControls = []; + this.invalidConditionBoostSpecs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -63906,353 +76759,204 @@ } /** - * UserEvent eventType. - * @member {string} eventType - * @memberof google.cloud.retail.v2beta.UserEvent - * @instance - */ - UserEvent.prototype.eventType = ""; - - /** - * UserEvent visitorId. - * @member {string} visitorId - * @memberof google.cloud.retail.v2beta.UserEvent + * SearchResponse results. + * @member {Array.} results + * @memberof google.cloud.retail.v2beta.SearchResponse * @instance */ - UserEvent.prototype.visitorId = ""; + SearchResponse.prototype.results = $util.emptyArray; /** - * UserEvent sessionId. - * @member {string} sessionId - * @memberof google.cloud.retail.v2beta.UserEvent + * SearchResponse facets. + * @member {Array.} facets + * @memberof google.cloud.retail.v2beta.SearchResponse * @instance */ - UserEvent.prototype.sessionId = ""; + SearchResponse.prototype.facets = $util.emptyArray; /** - * UserEvent eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.retail.v2beta.UserEvent + * SearchResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.retail.v2beta.SearchResponse * @instance */ - UserEvent.prototype.eventTime = null; + SearchResponse.prototype.totalSize = 0; /** - * UserEvent experimentIds. - * @member {Array.} experimentIds - * @memberof google.cloud.retail.v2beta.UserEvent + * SearchResponse correctedQuery. + * @member {string} correctedQuery + * @memberof google.cloud.retail.v2beta.SearchResponse * @instance */ - UserEvent.prototype.experimentIds = $util.emptyArray; + SearchResponse.prototype.correctedQuery = ""; /** - * UserEvent attributionToken. + * SearchResponse attributionToken. * @member {string} attributionToken - * @memberof google.cloud.retail.v2beta.UserEvent - * @instance - */ - UserEvent.prototype.attributionToken = ""; - - /** - * UserEvent productDetails. - * @member {Array.} productDetails - * @memberof google.cloud.retail.v2beta.UserEvent - * @instance - */ - UserEvent.prototype.productDetails = $util.emptyArray; - - /** - * UserEvent completionDetail. - * @member {google.cloud.retail.v2beta.ICompletionDetail|null|undefined} completionDetail - * @memberof google.cloud.retail.v2beta.UserEvent - * @instance - */ - UserEvent.prototype.completionDetail = null; - - /** - * UserEvent attributes. - * @member {Object.} attributes - * @memberof google.cloud.retail.v2beta.UserEvent - * @instance - */ - UserEvent.prototype.attributes = $util.emptyObject; - - /** - * UserEvent cartId. - * @member {string} cartId - * @memberof google.cloud.retail.v2beta.UserEvent - * @instance - */ - UserEvent.prototype.cartId = ""; - - /** - * UserEvent purchaseTransaction. - * @member {google.cloud.retail.v2beta.IPurchaseTransaction|null|undefined} purchaseTransaction - * @memberof google.cloud.retail.v2beta.UserEvent - * @instance - */ - UserEvent.prototype.purchaseTransaction = null; - - /** - * UserEvent searchQuery. - * @member {string} searchQuery - * @memberof google.cloud.retail.v2beta.UserEvent - * @instance - */ - UserEvent.prototype.searchQuery = ""; - - /** - * UserEvent filter. - * @member {string} filter - * @memberof google.cloud.retail.v2beta.UserEvent - * @instance - */ - UserEvent.prototype.filter = ""; - - /** - * UserEvent orderBy. - * @member {string} orderBy - * @memberof google.cloud.retail.v2beta.UserEvent - * @instance - */ - UserEvent.prototype.orderBy = ""; - - /** - * UserEvent offset. - * @member {number} offset - * @memberof google.cloud.retail.v2beta.UserEvent + * @memberof google.cloud.retail.v2beta.SearchResponse * @instance */ - UserEvent.prototype.offset = 0; + SearchResponse.prototype.attributionToken = ""; /** - * UserEvent pageCategories. - * @member {Array.} pageCategories - * @memberof google.cloud.retail.v2beta.UserEvent + * SearchResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.retail.v2beta.SearchResponse * @instance */ - UserEvent.prototype.pageCategories = $util.emptyArray; + SearchResponse.prototype.nextPageToken = ""; /** - * UserEvent userInfo. - * @member {google.cloud.retail.v2beta.IUserInfo|null|undefined} userInfo - * @memberof google.cloud.retail.v2beta.UserEvent + * SearchResponse queryExpansionInfo. + * @member {google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo|null|undefined} queryExpansionInfo + * @memberof google.cloud.retail.v2beta.SearchResponse * @instance */ - UserEvent.prototype.userInfo = null; + SearchResponse.prototype.queryExpansionInfo = null; /** - * UserEvent uri. - * @member {string} uri - * @memberof google.cloud.retail.v2beta.UserEvent + * SearchResponse redirectUri. + * @member {string} redirectUri + * @memberof google.cloud.retail.v2beta.SearchResponse * @instance */ - UserEvent.prototype.uri = ""; + SearchResponse.prototype.redirectUri = ""; /** - * UserEvent referrerUri. - * @member {string} referrerUri - * @memberof google.cloud.retail.v2beta.UserEvent + * SearchResponse appliedControls. + * @member {Array.} appliedControls + * @memberof google.cloud.retail.v2beta.SearchResponse * @instance */ - UserEvent.prototype.referrerUri = ""; + SearchResponse.prototype.appliedControls = $util.emptyArray; /** - * UserEvent pageViewId. - * @member {string} pageViewId - * @memberof google.cloud.retail.v2beta.UserEvent + * SearchResponse invalidConditionBoostSpecs. + * @member {Array.} invalidConditionBoostSpecs + * @memberof google.cloud.retail.v2beta.SearchResponse * @instance */ - UserEvent.prototype.pageViewId = ""; + SearchResponse.prototype.invalidConditionBoostSpecs = $util.emptyArray; /** - * Creates a new UserEvent instance using the specified properties. + * Creates a new SearchResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.UserEvent + * @memberof google.cloud.retail.v2beta.SearchResponse * @static - * @param {google.cloud.retail.v2beta.IUserEvent=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.UserEvent} UserEvent instance + * @param {google.cloud.retail.v2beta.ISearchResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.SearchResponse} SearchResponse instance */ - UserEvent.create = function create(properties) { - return new UserEvent(properties); + SearchResponse.create = function create(properties) { + return new SearchResponse(properties); }; /** - * Encodes the specified UserEvent message. Does not implicitly {@link google.cloud.retail.v2beta.UserEvent.verify|verify} messages. + * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.UserEvent + * @memberof google.cloud.retail.v2beta.SearchResponse * @static - * @param {google.cloud.retail.v2beta.IUserEvent} message UserEvent message or plain object to encode + * @param {google.cloud.retail.v2beta.ISearchResponse} message SearchResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEvent.encode = function encode(message, writer) { + SearchResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventType); - if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.visitorId); - if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.experimentIds != null && message.experimentIds.length) - for (var i = 0; i < message.experimentIds.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.experimentIds[i]); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.retail.v2beta.SearchResponse.SearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.facets != null && message.facets.length) + for (var i = 0; i < message.facets.length; ++i) + $root.google.cloud.retail.v2beta.SearchResponse.Facet.encode(message.facets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + if (message.correctedQuery != null && Object.hasOwnProperty.call(message, "correctedQuery")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.correctedQuery); if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.attributionToken); - if (message.productDetails != null && message.productDetails.length) - for (var i = 0; i < message.productDetails.length; ++i) - $root.google.cloud.retail.v2beta.ProductDetail.encode(message.productDetails[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.retail.v2beta.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.cartId != null && Object.hasOwnProperty.call(message, "cartId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.cartId); - if (message.purchaseTransaction != null && Object.hasOwnProperty.call(message, "purchaseTransaction")) - $root.google.cloud.retail.v2beta.PurchaseTransaction.encode(message.purchaseTransaction, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.searchQuery != null && Object.hasOwnProperty.call(message, "searchQuery")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.searchQuery); - if (message.pageCategories != null && message.pageCategories.length) - for (var i = 0; i < message.pageCategories.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.pageCategories[i]); - if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) - $root.google.cloud.retail.v2beta.UserInfo.encode(message.userInfo, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.uri); - if (message.referrerUri != null && Object.hasOwnProperty.call(message, "referrerUri")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.referrerUri); - if (message.pageViewId != null && Object.hasOwnProperty.call(message, "pageViewId")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.pageViewId); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.orderBy); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 18, wireType 0 =*/144).int32(message.offset); - if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) - writer.uint32(/* id 21, wireType 2 =*/170).string(message.sessionId); - if (message.completionDetail != null && Object.hasOwnProperty.call(message, "completionDetail")) - $root.google.cloud.retail.v2beta.CompletionDetail.encode(message.completionDetail, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.nextPageToken); + if (message.queryExpansionInfo != null && Object.hasOwnProperty.call(message, "queryExpansionInfo")) + $root.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.encode(message.queryExpansionInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.redirectUri != null && Object.hasOwnProperty.call(message, "redirectUri")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.redirectUri); + if (message.appliedControls != null && message.appliedControls.length) + for (var i = 0; i < message.appliedControls.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.appliedControls[i]); + if (message.invalidConditionBoostSpecs != null && message.invalidConditionBoostSpecs.length) + for (var i = 0; i < message.invalidConditionBoostSpecs.length; ++i) + $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.encode(message.invalidConditionBoostSpecs[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); return writer; }; /** - * Encodes the specified UserEvent message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UserEvent.verify|verify} messages. + * Encodes the specified SearchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.UserEvent + * @memberof google.cloud.retail.v2beta.SearchResponse * @static - * @param {google.cloud.retail.v2beta.IUserEvent} message UserEvent message or plain object to encode + * @param {google.cloud.retail.v2beta.ISearchResponse} message SearchResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEvent.encodeDelimited = function encodeDelimited(message, writer) { + SearchResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserEvent message from the specified reader or buffer. + * Decodes a SearchResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.UserEvent + * @memberof google.cloud.retail.v2beta.SearchResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.UserEvent} UserEvent + * @returns {google.cloud.retail.v2beta.SearchResponse} SearchResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEvent.decode = function decode(reader, length) { + SearchResponse.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.v2beta.UserEvent(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.SearchResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.eventType = reader.string(); + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.retail.v2beta.SearchResponse.SearchResult.decode(reader, reader.uint32())); break; case 2: - message.visitorId = reader.string(); - break; - case 21: - message.sessionId = reader.string(); + if (!(message.facets && message.facets.length)) + message.facets = []; + message.facets.push($root.google.cloud.retail.v2beta.SearchResponse.Facet.decode(reader, reader.uint32())); break; case 3: - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.totalSize = reader.int32(); break; case 4: - if (!(message.experimentIds && message.experimentIds.length)) - message.experimentIds = []; - message.experimentIds.push(reader.string()); + message.correctedQuery = reader.string(); break; case 5: message.attributionToken = reader.string(); break; case 6: - if (!(message.productDetails && message.productDetails.length)) - message.productDetails = []; - message.productDetails.push($root.google.cloud.retail.v2beta.ProductDetail.decode(reader, reader.uint32())); - break; - case 22: - message.completionDetail = $root.google.cloud.retail.v2beta.CompletionDetail.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; case 7: - if (message.attributes === $util.emptyObject) - message.attributes = {}; - 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.v2beta.CustomAttribute.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributes[key] = value; - break; - case 8: - message.cartId = reader.string(); - break; - case 9: - message.purchaseTransaction = $root.google.cloud.retail.v2beta.PurchaseTransaction.decode(reader, reader.uint32()); + message.queryExpansionInfo = $root.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.decode(reader, reader.uint32()); break; case 10: - message.searchQuery = reader.string(); - break; - case 16: - message.filter = reader.string(); - break; - case 17: - message.orderBy = reader.string(); - break; - case 18: - message.offset = reader.int32(); - break; - case 11: - if (!(message.pageCategories && message.pageCategories.length)) - message.pageCategories = []; - message.pageCategories.push(reader.string()); + message.redirectUri = reader.string(); break; case 12: - message.userInfo = $root.google.cloud.retail.v2beta.UserInfo.decode(reader, reader.uint32()); - break; - case 13: - message.uri = reader.string(); + if (!(message.appliedControls && message.appliedControls.length)) + message.appliedControls = []; + message.appliedControls.push(reader.string()); break; case 14: - message.referrerUri = reader.string(); - break; - case 15: - message.pageViewId = reader.string(); + if (!(message.invalidConditionBoostSpecs && message.invalidConditionBoostSpecs.length)) + message.invalidConditionBoostSpecs = []; + message.invalidConditionBoostSpecs.push($root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -64263,1240 +76967,1572 @@ }; /** - * Decodes a UserEvent message from the specified reader or buffer, length delimited. + * Decodes a SearchResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.UserEvent + * @memberof google.cloud.retail.v2beta.SearchResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.UserEvent} UserEvent + * @returns {google.cloud.retail.v2beta.SearchResponse} SearchResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEvent.decodeDelimited = function decodeDelimited(reader) { + SearchResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserEvent message. + * Verifies a SearchResponse message. * @function verify - * @memberof google.cloud.retail.v2beta.UserEvent + * @memberof google.cloud.retail.v2beta.SearchResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserEvent.verify = function verify(message) { + SearchResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.eventType != null && message.hasOwnProperty("eventType")) - if (!$util.isString(message.eventType)) - return "eventType: string expected"; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - if (!$util.isString(message.visitorId)) - return "visitorId: string expected"; - if (message.sessionId != null && message.hasOwnProperty("sessionId")) - if (!$util.isString(message.sessionId)) - return "sessionId: string expected"; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } - if (message.experimentIds != null && message.hasOwnProperty("experimentIds")) { - if (!Array.isArray(message.experimentIds)) - return "experimentIds: array expected"; - for (var i = 0; i < message.experimentIds.length; ++i) - if (!$util.isString(message.experimentIds[i])) - return "experimentIds: string[] expected"; - } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - if (!$util.isString(message.attributionToken)) - return "attributionToken: string expected"; - if (message.productDetails != null && message.hasOwnProperty("productDetails")) { - if (!Array.isArray(message.productDetails)) - return "productDetails: array expected"; - for (var i = 0; i < message.productDetails.length; ++i) { - var error = $root.google.cloud.retail.v2beta.ProductDetail.verify(message.productDetails[i]); + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.retail.v2beta.SearchResponse.SearchResult.verify(message.results[i]); if (error) - return "productDetails." + error; + return "results." + error; } } - if (message.completionDetail != null && message.hasOwnProperty("completionDetail")) { - var error = $root.google.cloud.retail.v2beta.CompletionDetail.verify(message.completionDetail); - if (error) - return "completionDetail." + error; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.retail.v2beta.CustomAttribute.verify(message.attributes[key[i]]); + if (message.facets != null && message.hasOwnProperty("facets")) { + if (!Array.isArray(message.facets)) + return "facets: array expected"; + for (var i = 0; i < message.facets.length; ++i) { + var error = $root.google.cloud.retail.v2beta.SearchResponse.Facet.verify(message.facets[i]); if (error) - return "attributes." + error; + return "facets." + error; } } - if (message.cartId != null && message.hasOwnProperty("cartId")) - if (!$util.isString(message.cartId)) - return "cartId: string expected"; - if (message.purchaseTransaction != null && message.hasOwnProperty("purchaseTransaction")) { - var error = $root.google.cloud.retail.v2beta.PurchaseTransaction.verify(message.purchaseTransaction); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) + if (!$util.isString(message.correctedQuery)) + return "correctedQuery: string expected"; + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + if (!$util.isString(message.attributionToken)) + return "attributionToken: string expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.queryExpansionInfo != null && message.hasOwnProperty("queryExpansionInfo")) { + var error = $root.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.verify(message.queryExpansionInfo); if (error) - return "purchaseTransaction." + error; + return "queryExpansionInfo." + error; } - if (message.searchQuery != null && message.hasOwnProperty("searchQuery")) - if (!$util.isString(message.searchQuery)) - return "searchQuery: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset)) - return "offset: integer expected"; - if (message.pageCategories != null && message.hasOwnProperty("pageCategories")) { - if (!Array.isArray(message.pageCategories)) - return "pageCategories: array expected"; - for (var i = 0; i < message.pageCategories.length; ++i) - if (!$util.isString(message.pageCategories[i])) - return "pageCategories: string[] expected"; + if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) + if (!$util.isString(message.redirectUri)) + return "redirectUri: string expected"; + if (message.appliedControls != null && message.hasOwnProperty("appliedControls")) { + if (!Array.isArray(message.appliedControls)) + return "appliedControls: array expected"; + for (var i = 0; i < message.appliedControls.length; ++i) + if (!$util.isString(message.appliedControls[i])) + return "appliedControls: string[] expected"; } - if (message.userInfo != null && message.hasOwnProperty("userInfo")) { - var error = $root.google.cloud.retail.v2beta.UserInfo.verify(message.userInfo); - if (error) - return "userInfo." + error; + if (message.invalidConditionBoostSpecs != null && message.hasOwnProperty("invalidConditionBoostSpecs")) { + if (!Array.isArray(message.invalidConditionBoostSpecs)) + return "invalidConditionBoostSpecs: array expected"; + for (var i = 0; i < message.invalidConditionBoostSpecs.length; ++i) { + var error = $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.verify(message.invalidConditionBoostSpecs[i]); + if (error) + return "invalidConditionBoostSpecs." + error; + } } - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - if (message.referrerUri != null && message.hasOwnProperty("referrerUri")) - if (!$util.isString(message.referrerUri)) - return "referrerUri: string expected"; - if (message.pageViewId != null && message.hasOwnProperty("pageViewId")) - if (!$util.isString(message.pageViewId)) - return "pageViewId: string expected"; return null; }; /** - * Creates a UserEvent message from a plain object. Also converts values to their respective internal types. + * Creates a SearchResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.UserEvent + * @memberof google.cloud.retail.v2beta.SearchResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.UserEvent} UserEvent + * @returns {google.cloud.retail.v2beta.SearchResponse} SearchResponse */ - UserEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.UserEvent) + SearchResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.SearchResponse) return object; - var message = new $root.google.cloud.retail.v2beta.UserEvent(); - if (object.eventType != null) - message.eventType = String(object.eventType); - if (object.visitorId != null) - message.visitorId = String(object.visitorId); - if (object.sessionId != null) - message.sessionId = String(object.sessionId); - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.retail.v2beta.UserEvent.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + var message = new $root.google.cloud.retail.v2beta.SearchResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.retail.v2beta.SearchResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchResponse.results: object expected"); + message.results[i] = $root.google.cloud.retail.v2beta.SearchResponse.SearchResult.fromObject(object.results[i]); + } } - if (object.experimentIds) { - if (!Array.isArray(object.experimentIds)) - throw TypeError(".google.cloud.retail.v2beta.UserEvent.experimentIds: array expected"); - message.experimentIds = []; - for (var i = 0; i < object.experimentIds.length; ++i) - message.experimentIds[i] = String(object.experimentIds[i]); + if (object.facets) { + if (!Array.isArray(object.facets)) + throw TypeError(".google.cloud.retail.v2beta.SearchResponse.facets: array expected"); + message.facets = []; + for (var i = 0; i < object.facets.length; ++i) { + if (typeof object.facets[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchResponse.facets: object expected"); + message.facets[i] = $root.google.cloud.retail.v2beta.SearchResponse.Facet.fromObject(object.facets[i]); + } } + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + if (object.correctedQuery != null) + message.correctedQuery = String(object.correctedQuery); if (object.attributionToken != null) message.attributionToken = String(object.attributionToken); - if (object.productDetails) { - if (!Array.isArray(object.productDetails)) - throw TypeError(".google.cloud.retail.v2beta.UserEvent.productDetails: array expected"); - message.productDetails = []; - for (var i = 0; i < object.productDetails.length; ++i) { - if (typeof object.productDetails[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.UserEvent.productDetails: object expected"); - message.productDetails[i] = $root.google.cloud.retail.v2beta.ProductDetail.fromObject(object.productDetails[i]); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.queryExpansionInfo != null) { + if (typeof object.queryExpansionInfo !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchResponse.queryExpansionInfo: object expected"); + message.queryExpansionInfo = $root.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.fromObject(object.queryExpansionInfo); + } + if (object.redirectUri != null) + message.redirectUri = String(object.redirectUri); + if (object.appliedControls) { + if (!Array.isArray(object.appliedControls)) + throw TypeError(".google.cloud.retail.v2beta.SearchResponse.appliedControls: array expected"); + message.appliedControls = []; + for (var i = 0; i < object.appliedControls.length; ++i) + message.appliedControls[i] = String(object.appliedControls[i]); + } + if (object.invalidConditionBoostSpecs) { + if (!Array.isArray(object.invalidConditionBoostSpecs)) + throw TypeError(".google.cloud.retail.v2beta.SearchResponse.invalidConditionBoostSpecs: array expected"); + message.invalidConditionBoostSpecs = []; + for (var i = 0; i < object.invalidConditionBoostSpecs.length; ++i) { + if (typeof object.invalidConditionBoostSpecs[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchResponse.invalidConditionBoostSpecs: object expected"); + message.invalidConditionBoostSpecs[i] = $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.fromObject(object.invalidConditionBoostSpecs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.SearchResponse + * @static + * @param {google.cloud.retail.v2beta.SearchResponse} message SearchResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.results = []; + object.facets = []; + object.appliedControls = []; + object.invalidConditionBoostSpecs = []; + } + if (options.defaults) { + object.totalSize = 0; + object.correctedQuery = ""; + object.attributionToken = ""; + object.nextPageToken = ""; + object.queryExpansionInfo = null; + object.redirectUri = ""; + } + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.retail.v2beta.SearchResponse.SearchResult.toObject(message.results[j], options); + } + if (message.facets && message.facets.length) { + object.facets = []; + for (var j = 0; j < message.facets.length; ++j) + object.facets[j] = $root.google.cloud.retail.v2beta.SearchResponse.Facet.toObject(message.facets[j], options); + } + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) + object.correctedQuery = message.correctedQuery; + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + object.attributionToken = message.attributionToken; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.queryExpansionInfo != null && message.hasOwnProperty("queryExpansionInfo")) + object.queryExpansionInfo = $root.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.toObject(message.queryExpansionInfo, options); + if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) + object.redirectUri = message.redirectUri; + if (message.appliedControls && message.appliedControls.length) { + object.appliedControls = []; + for (var j = 0; j < message.appliedControls.length; ++j) + object.appliedControls[j] = message.appliedControls[j]; + } + if (message.invalidConditionBoostSpecs && message.invalidConditionBoostSpecs.length) { + object.invalidConditionBoostSpecs = []; + for (var j = 0; j < message.invalidConditionBoostSpecs.length; ++j) + object.invalidConditionBoostSpecs[j] = $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.toObject(message.invalidConditionBoostSpecs[j], options); + } + return object; + }; + + /** + * Converts this SearchResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.SearchResponse + * @instance + * @returns {Object.} JSON object + */ + SearchResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SearchResponse.SearchResult = (function() { + + /** + * Properties of a SearchResult. + * @memberof google.cloud.retail.v2beta.SearchResponse + * @interface ISearchResult + * @property {string|null} [id] SearchResult id + * @property {google.cloud.retail.v2beta.IProduct|null} [product] SearchResult product + * @property {number|null} [matchingVariantCount] SearchResult matchingVariantCount + * @property {Object.|null} [matchingVariantFields] SearchResult matchingVariantFields + * @property {Object.|null} [variantRollupValues] SearchResult variantRollupValues + */ + + /** + * Constructs a new SearchResult. + * @memberof google.cloud.retail.v2beta.SearchResponse + * @classdesc Represents a SearchResult. + * @implements ISearchResult + * @constructor + * @param {google.cloud.retail.v2beta.SearchResponse.ISearchResult=} [properties] Properties to set + */ + function SearchResult(properties) { + this.matchingVariantFields = {}; + this.variantRollupValues = {}; + 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]]; + } + + /** + * SearchResult id. + * @member {string} id + * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.id = ""; + + /** + * SearchResult product. + * @member {google.cloud.retail.v2beta.IProduct|null|undefined} product + * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.product = null; + + /** + * SearchResult matchingVariantCount. + * @member {number} matchingVariantCount + * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.matchingVariantCount = 0; + + /** + * SearchResult matchingVariantFields. + * @member {Object.} matchingVariantFields + * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.matchingVariantFields = $util.emptyObject; + + /** + * SearchResult variantRollupValues. + * @member {Object.} variantRollupValues + * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.variantRollupValues = $util.emptyObject; + + /** + * Creates a new SearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult + * @static + * @param {google.cloud.retail.v2beta.SearchResponse.ISearchResult=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.SearchResponse.SearchResult} SearchResult instance + */ + SearchResult.create = function create(properties) { + return new SearchResult(properties); + }; + + /** + * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.SearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult + * @static + * @param {google.cloud.retail.v2beta.SearchResponse.ISearchResult} message SearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + $root.google.cloud.retail.v2beta.Product.encode(message.product, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.matchingVariantCount != null && Object.hasOwnProperty.call(message, "matchingVariantCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.matchingVariantCount); + if (message.matchingVariantFields != null && Object.hasOwnProperty.call(message, "matchingVariantFields")) + for (var keys = Object.keys(message.matchingVariantFields), 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.protobuf.FieldMask.encode(message.matchingVariantFields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.variantRollupValues != null && Object.hasOwnProperty.call(message, "variantRollupValues")) + for (var keys = Object.keys(message.variantRollupValues), i = 0; i < keys.length; ++i) { + 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(); + } + return writer; + }; + + /** + * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.SearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult + * @static + * @param {google.cloud.retail.v2beta.SearchResponse.ISearchResult} message SearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.SearchResponse.SearchResult} SearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResult.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.v2beta.SearchResponse.SearchResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.product = $root.google.cloud.retail.v2beta.Product.decode(reader, reader.uint32()); + break; + case 3: + message.matchingVariantCount = reader.int32(); + break; + case 4: + if (message.matchingVariantFields === $util.emptyObject) + message.matchingVariantFields = {}; + 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.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.matchingVariantFields[key] = value; + break; + case 5: + if (message.variantRollupValues === $util.emptyObject) + message.variantRollupValues = {}; + 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.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.variantRollupValues[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.SearchResponse.SearchResult} SearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchResult message. + * @function verify + * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.retail.v2beta.Product.verify(message.product); + if (error) + return "product." + error; + } + if (message.matchingVariantCount != null && message.hasOwnProperty("matchingVariantCount")) + if (!$util.isInteger(message.matchingVariantCount)) + return "matchingVariantCount: integer expected"; + if (message.matchingVariantFields != null && message.hasOwnProperty("matchingVariantFields")) { + if (!$util.isObject(message.matchingVariantFields)) + return "matchingVariantFields: object expected"; + var key = Object.keys(message.matchingVariantFields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.FieldMask.verify(message.matchingVariantFields[key[i]]); + if (error) + return "matchingVariantFields." + error; + } + } + if (message.variantRollupValues != null && message.hasOwnProperty("variantRollupValues")) { + if (!$util.isObject(message.variantRollupValues)) + return "variantRollupValues: object expected"; + var key = Object.keys(message.variantRollupValues); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.variantRollupValues[key[i]]); + if (error) + return "variantRollupValues." + error; + } + } + return null; + }; + + /** + * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.SearchResponse.SearchResult} SearchResult + */ + SearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.SearchResponse.SearchResult) + return object; + var message = new $root.google.cloud.retail.v2beta.SearchResponse.SearchResult(); + if (object.id != null) + message.id = String(object.id); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchResponse.SearchResult.product: object expected"); + message.product = $root.google.cloud.retail.v2beta.Product.fromObject(object.product); + } + if (object.matchingVariantCount != null) + message.matchingVariantCount = object.matchingVariantCount | 0; + if (object.matchingVariantFields) { + if (typeof object.matchingVariantFields !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchResponse.SearchResult.matchingVariantFields: object expected"); + message.matchingVariantFields = {}; + for (var keys = Object.keys(object.matchingVariantFields), i = 0; i < keys.length; ++i) { + if (typeof object.matchingVariantFields[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchResponse.SearchResult.matchingVariantFields: object expected"); + message.matchingVariantFields[keys[i]] = $root.google.protobuf.FieldMask.fromObject(object.matchingVariantFields[keys[i]]); + } + } + if (object.variantRollupValues) { + if (typeof object.variantRollupValues !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchResponse.SearchResult.variantRollupValues: object expected"); + message.variantRollupValues = {}; + for (var keys = Object.keys(object.variantRollupValues), i = 0; i < keys.length; ++i) { + if (typeof object.variantRollupValues[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchResponse.SearchResult.variantRollupValues: object expected"); + message.variantRollupValues[keys[i]] = $root.google.protobuf.Value.fromObject(object.variantRollupValues[keys[i]]); + } } - } - if (object.completionDetail != null) { - if (typeof object.completionDetail !== "object") - throw TypeError(".google.cloud.retail.v2beta.UserEvent.completionDetail: object expected"); - message.completionDetail = $root.google.cloud.retail.v2beta.CompletionDetail.fromObject(object.completionDetail); - } - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.retail.v2beta.UserEvent.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { - if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2beta.UserEvent.attributes: object expected"); - message.attributes[keys[i]] = $root.google.cloud.retail.v2beta.CustomAttribute.fromObject(object.attributes[keys[i]]); + return message; + }; + + /** + * Creates a plain object from a SearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult + * @static + * @param {google.cloud.retail.v2beta.SearchResponse.SearchResult} message SearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.matchingVariantFields = {}; + object.variantRollupValues = {}; } - } - if (object.cartId != null) - message.cartId = String(object.cartId); - if (object.purchaseTransaction != null) { - if (typeof object.purchaseTransaction !== "object") - throw TypeError(".google.cloud.retail.v2beta.UserEvent.purchaseTransaction: object expected"); - message.purchaseTransaction = $root.google.cloud.retail.v2beta.PurchaseTransaction.fromObject(object.purchaseTransaction); - } - if (object.searchQuery != null) - message.searchQuery = String(object.searchQuery); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.offset != null) - message.offset = object.offset | 0; - if (object.pageCategories) { - if (!Array.isArray(object.pageCategories)) - throw TypeError(".google.cloud.retail.v2beta.UserEvent.pageCategories: array expected"); - message.pageCategories = []; - for (var i = 0; i < object.pageCategories.length; ++i) - message.pageCategories[i] = String(object.pageCategories[i]); - } - if (object.userInfo != null) { - if (typeof object.userInfo !== "object") - throw TypeError(".google.cloud.retail.v2beta.UserEvent.userInfo: object expected"); - message.userInfo = $root.google.cloud.retail.v2beta.UserInfo.fromObject(object.userInfo); - } - if (object.uri != null) - message.uri = String(object.uri); - if (object.referrerUri != null) - message.referrerUri = String(object.referrerUri); - if (object.pageViewId != null) - message.pageViewId = String(object.pageViewId); - return message; - }; + if (options.defaults) { + object.id = ""; + object.product = null; + object.matchingVariantCount = 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.retail.v2beta.Product.toObject(message.product, options); + if (message.matchingVariantCount != null && message.hasOwnProperty("matchingVariantCount")) + object.matchingVariantCount = message.matchingVariantCount; + var keys2; + if (message.matchingVariantFields && (keys2 = Object.keys(message.matchingVariantFields)).length) { + object.matchingVariantFields = {}; + for (var j = 0; j < keys2.length; ++j) + object.matchingVariantFields[keys2[j]] = $root.google.protobuf.FieldMask.toObject(message.matchingVariantFields[keys2[j]], options); + } + if (message.variantRollupValues && (keys2 = Object.keys(message.variantRollupValues)).length) { + object.variantRollupValues = {}; + for (var j = 0; j < keys2.length; ++j) + object.variantRollupValues[keys2[j]] = $root.google.protobuf.Value.toObject(message.variantRollupValues[keys2[j]], options); + } + return object; + }; - /** - * Creates a plain object from a UserEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.UserEvent - * @static - * @param {google.cloud.retail.v2beta.UserEvent} message UserEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UserEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.experimentIds = []; - object.productDetails = []; - object.pageCategories = []; - } - if (options.objects || options.defaults) - object.attributes = {}; - if (options.defaults) { - object.eventType = ""; - object.visitorId = ""; - object.eventTime = null; - object.attributionToken = ""; - object.cartId = ""; - object.purchaseTransaction = null; - object.searchQuery = ""; - object.userInfo = null; - object.uri = ""; - object.referrerUri = ""; - object.pageViewId = ""; - object.filter = ""; - object.orderBy = ""; - object.offset = 0; - object.sessionId = ""; - object.completionDetail = null; - } - if (message.eventType != null && message.hasOwnProperty("eventType")) - object.eventType = message.eventType; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - object.visitorId = message.visitorId; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - if (message.experimentIds && message.experimentIds.length) { - object.experimentIds = []; - for (var j = 0; j < message.experimentIds.length; ++j) - object.experimentIds[j] = message.experimentIds[j]; - } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - object.attributionToken = message.attributionToken; - if (message.productDetails && message.productDetails.length) { - object.productDetails = []; - for (var j = 0; j < message.productDetails.length; ++j) - object.productDetails[j] = $root.google.cloud.retail.v2beta.ProductDetail.toObject(message.productDetails[j], options); - } - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = $root.google.cloud.retail.v2beta.CustomAttribute.toObject(message.attributes[keys2[j]], options); - } - if (message.cartId != null && message.hasOwnProperty("cartId")) - object.cartId = message.cartId; - if (message.purchaseTransaction != null && message.hasOwnProperty("purchaseTransaction")) - object.purchaseTransaction = $root.google.cloud.retail.v2beta.PurchaseTransaction.toObject(message.purchaseTransaction, options); - if (message.searchQuery != null && message.hasOwnProperty("searchQuery")) - object.searchQuery = message.searchQuery; - if (message.pageCategories && message.pageCategories.length) { - object.pageCategories = []; - for (var j = 0; j < message.pageCategories.length; ++j) - object.pageCategories[j] = message.pageCategories[j]; - } - if (message.userInfo != null && message.hasOwnProperty("userInfo")) - object.userInfo = $root.google.cloud.retail.v2beta.UserInfo.toObject(message.userInfo, options); - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - if (message.referrerUri != null && message.hasOwnProperty("referrerUri")) - object.referrerUri = message.referrerUri; - if (message.pageViewId != null && message.hasOwnProperty("pageViewId")) - object.pageViewId = message.pageViewId; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = message.offset; - if (message.sessionId != null && message.hasOwnProperty("sessionId")) - object.sessionId = message.sessionId; - if (message.completionDetail != null && message.hasOwnProperty("completionDetail")) - object.completionDetail = $root.google.cloud.retail.v2beta.CompletionDetail.toObject(message.completionDetail, options); - return object; - }; + /** + * Converts this SearchResult to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult + * @instance + * @returns {Object.} JSON object + */ + SearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this UserEvent to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.UserEvent - * @instance - * @returns {Object.} JSON object - */ - UserEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return SearchResult; + })(); - return UserEvent; - })(); + SearchResponse.Facet = (function() { - v2beta.ProductDetail = (function() { + /** + * Properties of a Facet. + * @memberof google.cloud.retail.v2beta.SearchResponse + * @interface IFacet + * @property {string|null} [key] Facet key + * @property {Array.|null} [values] Facet values + * @property {boolean|null} [dynamicFacet] Facet dynamicFacet + */ - /** - * Properties of a ProductDetail. - * @memberof google.cloud.retail.v2beta - * @interface IProductDetail - * @property {google.cloud.retail.v2beta.IProduct|null} [product] ProductDetail product - * @property {google.protobuf.IInt32Value|null} [quantity] ProductDetail quantity - */ + /** + * Constructs a new Facet. + * @memberof google.cloud.retail.v2beta.SearchResponse + * @classdesc Represents a Facet. + * @implements IFacet + * @constructor + * @param {google.cloud.retail.v2beta.SearchResponse.IFacet=} [properties] Properties to set + */ + function Facet(properties) { + this.values = []; + 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]]; + } - /** - * Constructs a new ProductDetail. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a ProductDetail. - * @implements IProductDetail - * @constructor - * @param {google.cloud.retail.v2beta.IProductDetail=} [properties] Properties to set - */ - function ProductDetail(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]]; - } + /** + * Facet key. + * @member {string} key + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet + * @instance + */ + Facet.prototype.key = ""; - /** - * ProductDetail product. - * @member {google.cloud.retail.v2beta.IProduct|null|undefined} product - * @memberof google.cloud.retail.v2beta.ProductDetail - * @instance - */ - ProductDetail.prototype.product = null; + /** + * Facet values. + * @member {Array.} values + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet + * @instance + */ + Facet.prototype.values = $util.emptyArray; - /** - * ProductDetail quantity. - * @member {google.protobuf.IInt32Value|null|undefined} quantity - * @memberof google.cloud.retail.v2beta.ProductDetail - * @instance - */ - ProductDetail.prototype.quantity = null; + /** + * Facet dynamicFacet. + * @member {boolean} dynamicFacet + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet + * @instance + */ + Facet.prototype.dynamicFacet = false; - /** - * Creates a new ProductDetail instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.ProductDetail - * @static - * @param {google.cloud.retail.v2beta.IProductDetail=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ProductDetail} ProductDetail instance - */ - ProductDetail.create = function create(properties) { - return new ProductDetail(properties); - }; + /** + * Creates a new Facet instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet + * @static + * @param {google.cloud.retail.v2beta.SearchResponse.IFacet=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.SearchResponse.Facet} Facet instance + */ + Facet.create = function create(properties) { + return new Facet(properties); + }; - /** - * Encodes the specified ProductDetail message. Does not implicitly {@link google.cloud.retail.v2beta.ProductDetail.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.ProductDetail - * @static - * @param {google.cloud.retail.v2beta.IProductDetail} message ProductDetail message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProductDetail.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - $root.google.cloud.retail.v2beta.Product.encode(message.product, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) - $root.google.protobuf.Int32Value.encode(message.quantity, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified Facet message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.Facet.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet + * @static + * @param {google.cloud.retail.v2beta.SearchResponse.IFacet} message Facet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Facet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.encode(message.values[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dynamicFacet != null && Object.hasOwnProperty.call(message, "dynamicFacet")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.dynamicFacet); + return writer; + }; - /** - * Encodes the specified ProductDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ProductDetail.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ProductDetail - * @static - * @param {google.cloud.retail.v2beta.IProductDetail} message ProductDetail message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProductDetail.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Facet message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.Facet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet + * @static + * @param {google.cloud.retail.v2beta.SearchResponse.IFacet} message Facet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Facet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ProductDetail message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.ProductDetail - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ProductDetail} ProductDetail - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProductDetail.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.v2beta.ProductDetail(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.product = $root.google.cloud.retail.v2beta.Product.decode(reader, reader.uint32()); - break; - case 2: - message.quantity = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a Facet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.SearchResponse.Facet} Facet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Facet.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.v2beta.SearchResponse.Facet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.decode(reader, reader.uint32())); + break; + case 3: + message.dynamicFacet = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; - - /** - * Decodes a ProductDetail message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ProductDetail - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ProductDetail} ProductDetail - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProductDetail.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProductDetail message. - * @function verify - * @memberof google.cloud.retail.v2beta.ProductDetail - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProductDetail.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.product != null && message.hasOwnProperty("product")) { - var error = $root.google.cloud.retail.v2beta.Product.verify(message.product); - if (error) - return "product." + error; - } - if (message.quantity != null && message.hasOwnProperty("quantity")) { - var error = $root.google.protobuf.Int32Value.verify(message.quantity); - if (error) - return "quantity." + error; - } - return null; - }; + return message; + }; - /** - * Creates a ProductDetail message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.ProductDetail - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ProductDetail} ProductDetail - */ - ProductDetail.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ProductDetail) - return object; - var message = new $root.google.cloud.retail.v2beta.ProductDetail(); - if (object.product != null) { - if (typeof object.product !== "object") - throw TypeError(".google.cloud.retail.v2beta.ProductDetail.product: object expected"); - message.product = $root.google.cloud.retail.v2beta.Product.fromObject(object.product); - } - if (object.quantity != null) { - if (typeof object.quantity !== "object") - throw TypeError(".google.cloud.retail.v2beta.ProductDetail.quantity: object expected"); - message.quantity = $root.google.protobuf.Int32Value.fromObject(object.quantity); - } - return message; - }; + /** + * Decodes a Facet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.SearchResponse.Facet} Facet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Facet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a ProductDetail message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.ProductDetail - * @static - * @param {google.cloud.retail.v2beta.ProductDetail} message ProductDetail - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProductDetail.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.product = null; - object.quantity = null; - } - if (message.product != null && message.hasOwnProperty("product")) - object.product = $root.google.cloud.retail.v2beta.Product.toObject(message.product, options); - if (message.quantity != null && message.hasOwnProperty("quantity")) - object.quantity = $root.google.protobuf.Int32Value.toObject(message.quantity, options); - return object; - }; + /** + * Verifies a Facet message. + * @function verify + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Facet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.verify(message.values[i]); + if (error) + return "values." + error; + } + } + if (message.dynamicFacet != null && message.hasOwnProperty("dynamicFacet")) + if (typeof message.dynamicFacet !== "boolean") + return "dynamicFacet: boolean expected"; + return null; + }; - /** - * Converts this ProductDetail to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.ProductDetail - * @instance - * @returns {Object.} JSON object - */ - ProductDetail.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a Facet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.SearchResponse.Facet} Facet + */ + Facet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.SearchResponse.Facet) + return object; + var message = new $root.google.cloud.retail.v2beta.SearchResponse.Facet(); + if (object.key != null) + message.key = String(object.key); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.retail.v2beta.SearchResponse.Facet.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchResponse.Facet.values: object expected"); + message.values[i] = $root.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.fromObject(object.values[i]); + } + } + if (object.dynamicFacet != null) + message.dynamicFacet = Boolean(object.dynamicFacet); + return message; + }; - return ProductDetail; - })(); + /** + * Creates a plain object from a Facet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet + * @static + * @param {google.cloud.retail.v2beta.SearchResponse.Facet} message Facet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Facet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) { + object.key = ""; + object.dynamicFacet = false; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.toObject(message.values[j], options); + } + if (message.dynamicFacet != null && message.hasOwnProperty("dynamicFacet")) + object.dynamicFacet = message.dynamicFacet; + return object; + }; - v2beta.CompletionDetail = (function() { + /** + * Converts this Facet to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet + * @instance + * @returns {Object.} JSON object + */ + Facet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a CompletionDetail. - * @memberof google.cloud.retail.v2beta - * @interface ICompletionDetail - * @property {string|null} [completionAttributionToken] CompletionDetail completionAttributionToken - * @property {string|null} [selectedSuggestion] CompletionDetail selectedSuggestion - * @property {number|null} [selectedPosition] CompletionDetail selectedPosition - */ + Facet.FacetValue = (function() { - /** - * Constructs a new CompletionDetail. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a CompletionDetail. - * @implements ICompletionDetail - * @constructor - * @param {google.cloud.retail.v2beta.ICompletionDetail=} [properties] Properties to set - */ - function CompletionDetail(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]]; - } + /** + * Properties of a FacetValue. + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet + * @interface IFacetValue + * @property {string|null} [value] FacetValue value + * @property {google.cloud.retail.v2beta.IInterval|null} [interval] FacetValue interval + * @property {number|Long|null} [count] FacetValue count + */ - /** - * CompletionDetail completionAttributionToken. - * @member {string} completionAttributionToken - * @memberof google.cloud.retail.v2beta.CompletionDetail - * @instance - */ - CompletionDetail.prototype.completionAttributionToken = ""; + /** + * Constructs a new FacetValue. + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet + * @classdesc Represents a FacetValue. + * @implements IFacetValue + * @constructor + * @param {google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue=} [properties] Properties to set + */ + function FacetValue(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]]; + } - /** - * CompletionDetail selectedSuggestion. - * @member {string} selectedSuggestion - * @memberof google.cloud.retail.v2beta.CompletionDetail - * @instance - */ - CompletionDetail.prototype.selectedSuggestion = ""; + /** + * FacetValue value. + * @member {string|null|undefined} value + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + * @instance + */ + FacetValue.prototype.value = null; - /** - * CompletionDetail selectedPosition. - * @member {number} selectedPosition - * @memberof google.cloud.retail.v2beta.CompletionDetail - * @instance - */ - CompletionDetail.prototype.selectedPosition = 0; + /** + * FacetValue interval. + * @member {google.cloud.retail.v2beta.IInterval|null|undefined} interval + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + * @instance + */ + FacetValue.prototype.interval = null; - /** - * Creates a new CompletionDetail instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.CompletionDetail - * @static - * @param {google.cloud.retail.v2beta.ICompletionDetail=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.CompletionDetail} CompletionDetail instance - */ - CompletionDetail.create = function create(properties) { - return new CompletionDetail(properties); - }; + /** + * FacetValue count. + * @member {number|Long} count + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + * @instance + */ + FacetValue.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Encodes the specified CompletionDetail message. Does not implicitly {@link google.cloud.retail.v2beta.CompletionDetail.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.CompletionDetail - * @static - * @param {google.cloud.retail.v2beta.ICompletionDetail} message CompletionDetail message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompletionDetail.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.completionAttributionToken != null && Object.hasOwnProperty.call(message, "completionAttributionToken")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.completionAttributionToken); - if (message.selectedSuggestion != null && Object.hasOwnProperty.call(message, "selectedSuggestion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.selectedSuggestion); - if (message.selectedPosition != null && Object.hasOwnProperty.call(message, "selectedPosition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.selectedPosition); - return writer; - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Encodes the specified CompletionDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompletionDetail.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.CompletionDetail - * @static - * @param {google.cloud.retail.v2beta.ICompletionDetail} message CompletionDetail message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompletionDetail.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * FacetValue facetValue. + * @member {"value"|"interval"|undefined} facetValue + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + * @instance + */ + Object.defineProperty(FacetValue.prototype, "facetValue", { + get: $util.oneOfGetter($oneOfFields = ["value", "interval"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Decodes a CompletionDetail message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.CompletionDetail - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.CompletionDetail} CompletionDetail - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompletionDetail.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.v2beta.CompletionDetail(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.completionAttributionToken = reader.string(); - break; - case 2: - message.selectedSuggestion = reader.string(); - break; - case 3: - message.selectedPosition = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new FacetValue instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + * @static + * @param {google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue} FacetValue instance + */ + FacetValue.create = function create(properties) { + return new FacetValue(properties); + }; - /** - * Decodes a CompletionDetail message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.CompletionDetail - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.CompletionDetail} CompletionDetail - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompletionDetail.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + * @static + * @param {google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue} message FacetValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + $root.google.cloud.retail.v2beta.Interval.encode(message.interval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.count); + return writer; + }; - /** - * Verifies a CompletionDetail message. - * @function verify - * @memberof google.cloud.retail.v2beta.CompletionDetail - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CompletionDetail.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.completionAttributionToken != null && message.hasOwnProperty("completionAttributionToken")) - if (!$util.isString(message.completionAttributionToken)) - return "completionAttributionToken: string expected"; - if (message.selectedSuggestion != null && message.hasOwnProperty("selectedSuggestion")) - if (!$util.isString(message.selectedSuggestion)) - return "selectedSuggestion: string expected"; - if (message.selectedPosition != null && message.hasOwnProperty("selectedPosition")) - if (!$util.isInteger(message.selectedPosition)) - return "selectedPosition: integer expected"; - return null; - }; + /** + * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + * @static + * @param {google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue} message FacetValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a CompletionDetail message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.CompletionDetail - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.CompletionDetail} CompletionDetail - */ - CompletionDetail.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.CompletionDetail) - return object; - var message = new $root.google.cloud.retail.v2beta.CompletionDetail(); - if (object.completionAttributionToken != null) - message.completionAttributionToken = String(object.completionAttributionToken); - if (object.selectedSuggestion != null) - message.selectedSuggestion = String(object.selectedSuggestion); - if (object.selectedPosition != null) - message.selectedPosition = object.selectedPosition | 0; - return message; - }; + /** + * Decodes a FacetValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue} FacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetValue.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.v2beta.SearchResponse.Facet.FacetValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.string(); + break; + case 2: + message.interval = $root.google.cloud.retail.v2beta.Interval.decode(reader, reader.uint32()); + break; + case 3: + message.count = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a plain object from a CompletionDetail message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.CompletionDetail - * @static - * @param {google.cloud.retail.v2beta.CompletionDetail} message CompletionDetail - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CompletionDetail.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.completionAttributionToken = ""; - object.selectedSuggestion = ""; - object.selectedPosition = 0; - } - if (message.completionAttributionToken != null && message.hasOwnProperty("completionAttributionToken")) - object.completionAttributionToken = message.completionAttributionToken; - if (message.selectedSuggestion != null && message.hasOwnProperty("selectedSuggestion")) - object.selectedSuggestion = message.selectedSuggestion; - if (message.selectedPosition != null && message.hasOwnProperty("selectedPosition")) - object.selectedPosition = message.selectedPosition; - return object; - }; + /** + * Decodes a FacetValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue} FacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FacetValue message. + * @function verify + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) { + properties.facetValue = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + if (message.interval != null && message.hasOwnProperty("interval")) { + if (properties.facetValue === 1) + return "facetValue: multiple values"; + properties.facetValue = 1; + { + var error = $root.google.cloud.retail.v2beta.Interval.verify(message.interval); + if (error) + return "interval." + error; + } + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; - /** - * Converts this CompletionDetail to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.CompletionDetail - * @instance - * @returns {Object.} JSON object - */ - CompletionDetail.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a FacetValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue} FacetValue + */ + FacetValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue) + return object; + var message = new $root.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue(); + if (object.value != null) + message.value = String(object.value); + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.interval: object expected"); + message.interval = $root.google.cloud.retail.v2beta.Interval.fromObject(object.interval); + } + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; - return CompletionDetail; - })(); + /** + * Creates a plain object from a FacetValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + * @static + * @param {google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue} message FacetValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetValue.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.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object.facetValue = "value"; + } + if (message.interval != null && message.hasOwnProperty("interval")) { + object.interval = $root.google.cloud.retail.v2beta.Interval.toObject(message.interval, options); + if (options.oneofs) + object.facetValue = "interval"; + } + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; - v2beta.PurchaseTransaction = (function() { + /** + * Converts this FacetValue to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + * @instance + * @returns {Object.} JSON object + */ + FacetValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a PurchaseTransaction. - * @memberof google.cloud.retail.v2beta - * @interface IPurchaseTransaction - * @property {string|null} [id] PurchaseTransaction id - * @property {number|null} [revenue] PurchaseTransaction revenue - * @property {number|null} [tax] PurchaseTransaction tax - * @property {number|null} [cost] PurchaseTransaction cost - * @property {string|null} [currencyCode] PurchaseTransaction currencyCode - */ + return FacetValue; + })(); - /** - * Constructs a new PurchaseTransaction. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a PurchaseTransaction. - * @implements IPurchaseTransaction - * @constructor - * @param {google.cloud.retail.v2beta.IPurchaseTransaction=} [properties] Properties to set - */ - function PurchaseTransaction(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]]; - } + return Facet; + })(); - /** - * PurchaseTransaction id. - * @member {string} id - * @memberof google.cloud.retail.v2beta.PurchaseTransaction - * @instance - */ - PurchaseTransaction.prototype.id = ""; + SearchResponse.QueryExpansionInfo = (function() { - /** - * PurchaseTransaction revenue. - * @member {number} revenue - * @memberof google.cloud.retail.v2beta.PurchaseTransaction - * @instance - */ - PurchaseTransaction.prototype.revenue = 0; + /** + * Properties of a QueryExpansionInfo. + * @memberof google.cloud.retail.v2beta.SearchResponse + * @interface IQueryExpansionInfo + * @property {boolean|null} [expandedQuery] QueryExpansionInfo expandedQuery + * @property {number|Long|null} [pinnedResultCount] QueryExpansionInfo pinnedResultCount + */ - /** - * PurchaseTransaction tax. - * @member {number} tax - * @memberof google.cloud.retail.v2beta.PurchaseTransaction - * @instance - */ - PurchaseTransaction.prototype.tax = 0; + /** + * Constructs a new QueryExpansionInfo. + * @memberof google.cloud.retail.v2beta.SearchResponse + * @classdesc Represents a QueryExpansionInfo. + * @implements IQueryExpansionInfo + * @constructor + * @param {google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo=} [properties] Properties to set + */ + function QueryExpansionInfo(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]]; + } - /** - * PurchaseTransaction cost. - * @member {number} cost - * @memberof google.cloud.retail.v2beta.PurchaseTransaction - * @instance - */ - PurchaseTransaction.prototype.cost = 0; + /** + * QueryExpansionInfo expandedQuery. + * @member {boolean} expandedQuery + * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + * @instance + */ + QueryExpansionInfo.prototype.expandedQuery = false; - /** - * PurchaseTransaction currencyCode. - * @member {string} currencyCode - * @memberof google.cloud.retail.v2beta.PurchaseTransaction - * @instance - */ - PurchaseTransaction.prototype.currencyCode = ""; + /** + * QueryExpansionInfo pinnedResultCount. + * @member {number|Long} pinnedResultCount + * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + * @instance + */ + QueryExpansionInfo.prototype.pinnedResultCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Creates a new PurchaseTransaction instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.PurchaseTransaction - * @static - * @param {google.cloud.retail.v2beta.IPurchaseTransaction=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.PurchaseTransaction} PurchaseTransaction instance - */ - PurchaseTransaction.create = function create(properties) { - return new PurchaseTransaction(properties); - }; + /** + * Creates a new QueryExpansionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + * @static + * @param {google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo} QueryExpansionInfo instance + */ + QueryExpansionInfo.create = function create(properties) { + return new QueryExpansionInfo(properties); + }; - /** - * Encodes the specified PurchaseTransaction message. Does not implicitly {@link google.cloud.retail.v2beta.PurchaseTransaction.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.PurchaseTransaction - * @static - * @param {google.cloud.retail.v2beta.IPurchaseTransaction} message PurchaseTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PurchaseTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.revenue != null && Object.hasOwnProperty.call(message, "revenue")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.revenue); - if (message.tax != null && Object.hasOwnProperty.call(message, "tax")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.tax); - if (message.cost != null && Object.hasOwnProperty.call(message, "cost")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.cost); - if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.currencyCode); - return writer; - }; + /** + * Encodes the specified QueryExpansionInfo message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + * @static + * @param {google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo} message QueryExpansionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryExpansionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expandedQuery != null && Object.hasOwnProperty.call(message, "expandedQuery")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandedQuery); + if (message.pinnedResultCount != null && Object.hasOwnProperty.call(message, "pinnedResultCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.pinnedResultCount); + return writer; + }; - /** - * Encodes the specified PurchaseTransaction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurchaseTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.PurchaseTransaction - * @static - * @param {google.cloud.retail.v2beta.IPurchaseTransaction} message PurchaseTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PurchaseTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified QueryExpansionInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + * @static + * @param {google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo} message QueryExpansionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryExpansionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a PurchaseTransaction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.PurchaseTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.PurchaseTransaction} PurchaseTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PurchaseTransaction.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.v2beta.PurchaseTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - message.revenue = reader.float(); - break; - case 3: - message.tax = reader.float(); - break; - case 4: - message.cost = reader.float(); - break; - case 5: - message.currencyCode = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a QueryExpansionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo} QueryExpansionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryExpansionInfo.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.v2beta.SearchResponse.QueryExpansionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expandedQuery = reader.bool(); + break; + case 2: + message.pinnedResultCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a PurchaseTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.PurchaseTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.PurchaseTransaction} PurchaseTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PurchaseTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a QueryExpansionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo} QueryExpansionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryExpansionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a PurchaseTransaction message. - * @function verify - * @memberof google.cloud.retail.v2beta.PurchaseTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PurchaseTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.revenue != null && message.hasOwnProperty("revenue")) - if (typeof message.revenue !== "number") - return "revenue: number expected"; - if (message.tax != null && message.hasOwnProperty("tax")) - if (typeof message.tax !== "number") - return "tax: number expected"; - if (message.cost != null && message.hasOwnProperty("cost")) - if (typeof message.cost !== "number") - return "cost: number expected"; - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - if (!$util.isString(message.currencyCode)) - return "currencyCode: string expected"; - return null; - }; + /** + * Verifies a QueryExpansionInfo message. + * @function verify + * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryExpansionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expandedQuery != null && message.hasOwnProperty("expandedQuery")) + if (typeof message.expandedQuery !== "boolean") + return "expandedQuery: boolean expected"; + if (message.pinnedResultCount != null && message.hasOwnProperty("pinnedResultCount")) + if (!$util.isInteger(message.pinnedResultCount) && !(message.pinnedResultCount && $util.isInteger(message.pinnedResultCount.low) && $util.isInteger(message.pinnedResultCount.high))) + return "pinnedResultCount: integer|Long expected"; + return null; + }; - /** - * Creates a PurchaseTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.PurchaseTransaction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.PurchaseTransaction} PurchaseTransaction - */ - PurchaseTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.PurchaseTransaction) - return object; - var message = new $root.google.cloud.retail.v2beta.PurchaseTransaction(); - if (object.id != null) - message.id = String(object.id); - if (object.revenue != null) - message.revenue = Number(object.revenue); - if (object.tax != null) - message.tax = Number(object.tax); - if (object.cost != null) - message.cost = Number(object.cost); - if (object.currencyCode != null) - message.currencyCode = String(object.currencyCode); - return message; - }; + /** + * Creates a QueryExpansionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo} QueryExpansionInfo + */ + QueryExpansionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo) + return object; + var message = new $root.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo(); + if (object.expandedQuery != null) + message.expandedQuery = Boolean(object.expandedQuery); + if (object.pinnedResultCount != null) + if ($util.Long) + (message.pinnedResultCount = $util.Long.fromValue(object.pinnedResultCount)).unsigned = false; + else if (typeof object.pinnedResultCount === "string") + message.pinnedResultCount = parseInt(object.pinnedResultCount, 10); + else if (typeof object.pinnedResultCount === "number") + message.pinnedResultCount = object.pinnedResultCount; + else if (typeof object.pinnedResultCount === "object") + message.pinnedResultCount = new $util.LongBits(object.pinnedResultCount.low >>> 0, object.pinnedResultCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a QueryExpansionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + * @static + * @param {google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo} message QueryExpansionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryExpansionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expandedQuery = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.pinnedResultCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.pinnedResultCount = options.longs === String ? "0" : 0; + } + if (message.expandedQuery != null && message.hasOwnProperty("expandedQuery")) + object.expandedQuery = message.expandedQuery; + if (message.pinnedResultCount != null && message.hasOwnProperty("pinnedResultCount")) + if (typeof message.pinnedResultCount === "number") + object.pinnedResultCount = options.longs === String ? String(message.pinnedResultCount) : message.pinnedResultCount; + else + object.pinnedResultCount = options.longs === String ? $util.Long.prototype.toString.call(message.pinnedResultCount) : options.longs === Number ? new $util.LongBits(message.pinnedResultCount.low >>> 0, message.pinnedResultCount.high >>> 0).toNumber() : message.pinnedResultCount; + return object; + }; - /** - * Creates a plain object from a PurchaseTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.PurchaseTransaction - * @static - * @param {google.cloud.retail.v2beta.PurchaseTransaction} message PurchaseTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PurchaseTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.revenue = 0; - object.tax = 0; - object.cost = 0; - object.currencyCode = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.revenue != null && message.hasOwnProperty("revenue")) - object.revenue = options.json && !isFinite(message.revenue) ? String(message.revenue) : message.revenue; - if (message.tax != null && message.hasOwnProperty("tax")) - object.tax = options.json && !isFinite(message.tax) ? String(message.tax) : message.tax; - if (message.cost != null && message.hasOwnProperty("cost")) - object.cost = options.json && !isFinite(message.cost) ? String(message.cost) : message.cost; - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - object.currencyCode = message.currencyCode; - return object; - }; + /** + * Converts this QueryExpansionInfo to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + * @instance + * @returns {Object.} JSON object + */ + QueryExpansionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this PurchaseTransaction to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.PurchaseTransaction - * @instance - * @returns {Object.} JSON object - */ - PurchaseTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return QueryExpansionInfo; + })(); - return PurchaseTransaction; + return SearchResponse; })(); - v2beta.CatalogService = (function() { + v2beta.ControlService = (function() { /** - * Constructs a new CatalogService service. + * Constructs a new ControlService service. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a CatalogService + * @classdesc Represents a ControlService * @extends $protobuf.rpc.Service * @constructor * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ - function CatalogService(rpcImpl, requestDelimited, responseDelimited) { + function ControlService(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - (CatalogService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CatalogService; + (ControlService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ControlService; /** - * Creates new CatalogService service using the specified rpc implementation. + * Creates new ControlService service using the specified rpc implementation. * @function create - * @memberof google.cloud.retail.v2beta.CatalogService + * @memberof google.cloud.retail.v2beta.ControlService * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {CatalogService} RPC service. Useful where requests and/or responses are streamed. + * @returns {ControlService} RPC service. Useful where requests and/or responses are streamed. */ - CatalogService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + ControlService.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#listCatalogs}. - * @memberof google.cloud.retail.v2beta.CatalogService - * @typedef ListCatalogsCallback + * Callback as used by {@link google.cloud.retail.v2beta.ControlService#createControl}. + * @memberof google.cloud.retail.v2beta.ControlService + * @typedef CreateControlCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2beta.ListCatalogsResponse} [response] ListCatalogsResponse + * @param {google.cloud.retail.v2beta.Control} [response] Control */ /** - * Calls ListCatalogs. - * @function listCatalogs - * @memberof google.cloud.retail.v2beta.CatalogService + * Calls CreateControl. + * @function createControl + * @memberof google.cloud.retail.v2beta.ControlService * @instance - * @param {google.cloud.retail.v2beta.IListCatalogsRequest} request ListCatalogsRequest message or plain object - * @param {google.cloud.retail.v2beta.CatalogService.ListCatalogsCallback} callback Node-style callback called with the error, if any, and ListCatalogsResponse + * @param {google.cloud.retail.v2beta.ICreateControlRequest} request CreateControlRequest message or plain object + * @param {google.cloud.retail.v2beta.ControlService.CreateControlCallback} callback Node-style callback called with the error, if any, and Control * @returns {undefined} * @variation 1 */ - Object.defineProperty(CatalogService.prototype.listCatalogs = function listCatalogs(request, callback) { - return this.rpcCall(listCatalogs, $root.google.cloud.retail.v2beta.ListCatalogsRequest, $root.google.cloud.retail.v2beta.ListCatalogsResponse, request, callback); - }, "name", { value: "ListCatalogs" }); + Object.defineProperty(ControlService.prototype.createControl = function createControl(request, callback) { + return this.rpcCall(createControl, $root.google.cloud.retail.v2beta.CreateControlRequest, $root.google.cloud.retail.v2beta.Control, request, callback); + }, "name", { value: "CreateControl" }); /** - * Calls ListCatalogs. - * @function listCatalogs - * @memberof google.cloud.retail.v2beta.CatalogService + * Calls CreateControl. + * @function createControl + * @memberof google.cloud.retail.v2beta.ControlService * @instance - * @param {google.cloud.retail.v2beta.IListCatalogsRequest} request ListCatalogsRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.retail.v2beta.ICreateControlRequest} request CreateControlRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#updateCatalog}. - * @memberof google.cloud.retail.v2beta.CatalogService - * @typedef UpdateCatalogCallback + * Callback as used by {@link google.cloud.retail.v2beta.ControlService#deleteControl}. + * @memberof google.cloud.retail.v2beta.ControlService + * @typedef DeleteControlCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2beta.Catalog} [response] Catalog + * @param {google.protobuf.Empty} [response] Empty */ /** - * Calls UpdateCatalog. - * @function updateCatalog - * @memberof google.cloud.retail.v2beta.CatalogService + * Calls DeleteControl. + * @function deleteControl + * @memberof google.cloud.retail.v2beta.ControlService * @instance - * @param {google.cloud.retail.v2beta.IUpdateCatalogRequest} request UpdateCatalogRequest message or plain object - * @param {google.cloud.retail.v2beta.CatalogService.UpdateCatalogCallback} callback Node-style callback called with the error, if any, and Catalog + * @param {google.cloud.retail.v2beta.IDeleteControlRequest} request DeleteControlRequest message or plain object + * @param {google.cloud.retail.v2beta.ControlService.DeleteControlCallback} callback Node-style callback called with the error, if any, and Empty * @returns {undefined} * @variation 1 */ - Object.defineProperty(CatalogService.prototype.updateCatalog = function updateCatalog(request, callback) { - return this.rpcCall(updateCatalog, $root.google.cloud.retail.v2beta.UpdateCatalogRequest, $root.google.cloud.retail.v2beta.Catalog, request, callback); - }, "name", { value: "UpdateCatalog" }); + Object.defineProperty(ControlService.prototype.deleteControl = function deleteControl(request, callback) { + return this.rpcCall(deleteControl, $root.google.cloud.retail.v2beta.DeleteControlRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteControl" }); /** - * Calls UpdateCatalog. - * @function updateCatalog - * @memberof google.cloud.retail.v2beta.CatalogService + * Calls DeleteControl. + * @function deleteControl + * @memberof google.cloud.retail.v2beta.ControlService * @instance - * @param {google.cloud.retail.v2beta.IUpdateCatalogRequest} request UpdateCatalogRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.retail.v2beta.IDeleteControlRequest} request DeleteControlRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#setDefaultBranch}. - * @memberof google.cloud.retail.v2beta.CatalogService - * @typedef SetDefaultBranchCallback + * Callback as used by {@link google.cloud.retail.v2beta.ControlService#updateControl}. + * @memberof google.cloud.retail.v2beta.ControlService + * @typedef UpdateControlCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * @param {google.cloud.retail.v2beta.Control} [response] Control */ /** - * Calls SetDefaultBranch. - * @function setDefaultBranch - * @memberof google.cloud.retail.v2beta.CatalogService + * Calls UpdateControl. + * @function updateControl + * @memberof google.cloud.retail.v2beta.ControlService * @instance - * @param {google.cloud.retail.v2beta.ISetDefaultBranchRequest} request SetDefaultBranchRequest message or plain object - * @param {google.cloud.retail.v2beta.CatalogService.SetDefaultBranchCallback} callback Node-style callback called with the error, if any, and Empty + * @param {google.cloud.retail.v2beta.IUpdateControlRequest} request UpdateControlRequest message or plain object + * @param {google.cloud.retail.v2beta.ControlService.UpdateControlCallback} callback Node-style callback called with the error, if any, and Control * @returns {undefined} * @variation 1 */ - Object.defineProperty(CatalogService.prototype.setDefaultBranch = function setDefaultBranch(request, callback) { - return this.rpcCall(setDefaultBranch, $root.google.cloud.retail.v2beta.SetDefaultBranchRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "SetDefaultBranch" }); + Object.defineProperty(ControlService.prototype.updateControl = function updateControl(request, callback) { + return this.rpcCall(updateControl, $root.google.cloud.retail.v2beta.UpdateControlRequest, $root.google.cloud.retail.v2beta.Control, request, callback); + }, "name", { value: "UpdateControl" }); /** - * Calls SetDefaultBranch. - * @function setDefaultBranch - * @memberof google.cloud.retail.v2beta.CatalogService + * Calls UpdateControl. + * @function updateControl + * @memberof google.cloud.retail.v2beta.ControlService * @instance - * @param {google.cloud.retail.v2beta.ISetDefaultBranchRequest} request SetDefaultBranchRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.retail.v2beta.IUpdateControlRequest} request UpdateControlRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.retail.v2beta.CatalogService#getDefaultBranch}. - * @memberof google.cloud.retail.v2beta.CatalogService - * @typedef GetDefaultBranchCallback + * Callback as used by {@link google.cloud.retail.v2beta.ControlService#getControl}. + * @memberof google.cloud.retail.v2beta.ControlService + * @typedef GetControlCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2beta.GetDefaultBranchResponse} [response] GetDefaultBranchResponse + * @param {google.cloud.retail.v2beta.Control} [response] Control */ /** - * Calls GetDefaultBranch. - * @function getDefaultBranch - * @memberof google.cloud.retail.v2beta.CatalogService + * Calls GetControl. + * @function getControl + * @memberof google.cloud.retail.v2beta.ControlService * @instance - * @param {google.cloud.retail.v2beta.IGetDefaultBranchRequest} request GetDefaultBranchRequest message or plain object - * @param {google.cloud.retail.v2beta.CatalogService.GetDefaultBranchCallback} callback Node-style callback called with the error, if any, and GetDefaultBranchResponse + * @param {google.cloud.retail.v2beta.IGetControlRequest} request GetControlRequest message or plain object + * @param {google.cloud.retail.v2beta.ControlService.GetControlCallback} callback Node-style callback called with the error, if any, and Control * @returns {undefined} * @variation 1 */ - Object.defineProperty(CatalogService.prototype.getDefaultBranch = function getDefaultBranch(request, callback) { - return this.rpcCall(getDefaultBranch, $root.google.cloud.retail.v2beta.GetDefaultBranchRequest, $root.google.cloud.retail.v2beta.GetDefaultBranchResponse, request, callback); - }, "name", { value: "GetDefaultBranch" }); + Object.defineProperty(ControlService.prototype.getControl = function getControl(request, callback) { + return this.rpcCall(getControl, $root.google.cloud.retail.v2beta.GetControlRequest, $root.google.cloud.retail.v2beta.Control, request, callback); + }, "name", { value: "GetControl" }); /** - * Calls GetDefaultBranch. - * @function getDefaultBranch - * @memberof google.cloud.retail.v2beta.CatalogService + * Calls GetControl. + * @function getControl + * @memberof google.cloud.retail.v2beta.ControlService * @instance - * @param {google.cloud.retail.v2beta.IGetDefaultBranchRequest} request GetDefaultBranchRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.retail.v2beta.IGetControlRequest} request GetControlRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ - return CatalogService; + /** + * Callback as used by {@link google.cloud.retail.v2beta.ControlService#listControls}. + * @memberof google.cloud.retail.v2beta.ControlService + * @typedef ListControlsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.ListControlsResponse} [response] ListControlsResponse + */ + + /** + * Calls ListControls. + * @function listControls + * @memberof google.cloud.retail.v2beta.ControlService + * @instance + * @param {google.cloud.retail.v2beta.IListControlsRequest} request ListControlsRequest message or plain object + * @param {google.cloud.retail.v2beta.ControlService.ListControlsCallback} callback Node-style callback called with the error, if any, and ListControlsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ControlService.prototype.listControls = function listControls(request, callback) { + return this.rpcCall(listControls, $root.google.cloud.retail.v2beta.ListControlsRequest, $root.google.cloud.retail.v2beta.ListControlsResponse, request, callback); + }, "name", { value: "ListControls" }); + + /** + * Calls ListControls. + * @function listControls + * @memberof google.cloud.retail.v2beta.ControlService + * @instance + * @param {google.cloud.retail.v2beta.IListControlsRequest} request ListControlsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ControlService; })(); - v2beta.ListCatalogsRequest = (function() { + v2beta.CreateControlRequest = (function() { /** - * Properties of a ListCatalogsRequest. + * Properties of a CreateControlRequest. * @memberof google.cloud.retail.v2beta - * @interface IListCatalogsRequest - * @property {string|null} [parent] ListCatalogsRequest parent - * @property {number|null} [pageSize] ListCatalogsRequest pageSize - * @property {string|null} [pageToken] ListCatalogsRequest pageToken + * @interface ICreateControlRequest + * @property {string|null} [parent] CreateControlRequest parent + * @property {google.cloud.retail.v2beta.IControl|null} [control] CreateControlRequest control + * @property {string|null} [controlId] CreateControlRequest controlId */ /** - * Constructs a new ListCatalogsRequest. + * Constructs a new CreateControlRequest. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a ListCatalogsRequest. - * @implements IListCatalogsRequest + * @classdesc Represents a CreateControlRequest. + * @implements ICreateControlRequest * @constructor - * @param {google.cloud.retail.v2beta.IListCatalogsRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.ICreateControlRequest=} [properties] Properties to set */ - function ListCatalogsRequest(properties) { + function CreateControlRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -65504,90 +78540,90 @@ } /** - * ListCatalogsRequest parent. + * CreateControlRequest parent. * @member {string} parent - * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @memberof google.cloud.retail.v2beta.CreateControlRequest * @instance */ - ListCatalogsRequest.prototype.parent = ""; + CreateControlRequest.prototype.parent = ""; /** - * ListCatalogsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * CreateControlRequest control. + * @member {google.cloud.retail.v2beta.IControl|null|undefined} control + * @memberof google.cloud.retail.v2beta.CreateControlRequest * @instance */ - ListCatalogsRequest.prototype.pageSize = 0; + CreateControlRequest.prototype.control = null; /** - * ListCatalogsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * CreateControlRequest controlId. + * @member {string} controlId + * @memberof google.cloud.retail.v2beta.CreateControlRequest * @instance */ - ListCatalogsRequest.prototype.pageToken = ""; + CreateControlRequest.prototype.controlId = ""; /** - * Creates a new ListCatalogsRequest instance using the specified properties. + * Creates a new CreateControlRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @memberof google.cloud.retail.v2beta.CreateControlRequest * @static - * @param {google.cloud.retail.v2beta.IListCatalogsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ListCatalogsRequest} ListCatalogsRequest instance + * @param {google.cloud.retail.v2beta.ICreateControlRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.CreateControlRequest} CreateControlRequest instance */ - ListCatalogsRequest.create = function create(properties) { - return new ListCatalogsRequest(properties); + CreateControlRequest.create = function create(properties) { + return new CreateControlRequest(properties); }; /** - * Encodes the specified ListCatalogsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ListCatalogsRequest.verify|verify} messages. + * Encodes the specified CreateControlRequest message. Does not implicitly {@link google.cloud.retail.v2beta.CreateControlRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @memberof google.cloud.retail.v2beta.CreateControlRequest * @static - * @param {google.cloud.retail.v2beta.IListCatalogsRequest} message ListCatalogsRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.ICreateControlRequest} message CreateControlRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListCatalogsRequest.encode = function encode(message, writer) { + CreateControlRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.control != null && Object.hasOwnProperty.call(message, "control")) + $root.google.cloud.retail.v2beta.Control.encode(message.control, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.controlId != null && Object.hasOwnProperty.call(message, "controlId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.controlId); return writer; }; /** - * Encodes the specified ListCatalogsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListCatalogsRequest.verify|verify} messages. + * Encodes the specified CreateControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CreateControlRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @memberof google.cloud.retail.v2beta.CreateControlRequest * @static - * @param {google.cloud.retail.v2beta.IListCatalogsRequest} message ListCatalogsRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.ICreateControlRequest} message CreateControlRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListCatalogsRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateControlRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListCatalogsRequest message from the specified reader or buffer. + * Decodes a CreateControlRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @memberof google.cloud.retail.v2beta.CreateControlRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ListCatalogsRequest} ListCatalogsRequest + * @returns {google.cloud.retail.v2beta.CreateControlRequest} CreateControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListCatalogsRequest.decode = function decode(reader, length) { + CreateControlRequest.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.v2beta.ListCatalogsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.CreateControlRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -65595,10 +78631,10 @@ message.parent = reader.string(); break; case 2: - message.pageSize = reader.int32(); + message.control = $root.google.cloud.retail.v2beta.Control.decode(reader, reader.uint32()); break; case 3: - message.pageToken = reader.string(); + message.controlId = reader.string(); break; default: reader.skipType(tag & 7); @@ -65609,356 +78645,130 @@ }; /** - * Decodes a ListCatalogsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateControlRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @memberof google.cloud.retail.v2beta.CreateControlRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ListCatalogsRequest} ListCatalogsRequest + * @returns {google.cloud.retail.v2beta.CreateControlRequest} CreateControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListCatalogsRequest.decodeDelimited = function decodeDelimited(reader) { + CreateControlRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListCatalogsRequest message. + * Verifies a CreateControlRequest message. * @function verify - * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @memberof google.cloud.retail.v2beta.CreateControlRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListCatalogsRequest.verify = function verify(message) { + CreateControlRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; + if (message.control != null && message.hasOwnProperty("control")) { + var error = $root.google.cloud.retail.v2beta.Control.verify(message.control); + if (error) + return "control." + error; + } + if (message.controlId != null && message.hasOwnProperty("controlId")) + if (!$util.isString(message.controlId)) + return "controlId: string expected"; return null; }; /** - * Creates a ListCatalogsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateControlRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @memberof google.cloud.retail.v2beta.CreateControlRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ListCatalogsRequest} ListCatalogsRequest + * @returns {google.cloud.retail.v2beta.CreateControlRequest} CreateControlRequest */ - ListCatalogsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ListCatalogsRequest) + CreateControlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.CreateControlRequest) return object; - var message = new $root.google.cloud.retail.v2beta.ListCatalogsRequest(); + var message = new $root.google.cloud.retail.v2beta.CreateControlRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + if (object.control != null) { + if (typeof object.control !== "object") + throw TypeError(".google.cloud.retail.v2beta.CreateControlRequest.control: object expected"); + message.control = $root.google.cloud.retail.v2beta.Control.fromObject(object.control); + } + if (object.controlId != null) + message.controlId = String(object.controlId); return message; }; /** - * Creates a plain object from a ListCatalogsRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateControlRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.ListCatalogsRequest + * @memberof google.cloud.retail.v2beta.CreateControlRequest * @static - * @param {google.cloud.retail.v2beta.ListCatalogsRequest} message ListCatalogsRequest + * @param {google.cloud.retail.v2beta.CreateControlRequest} message CreateControlRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListCatalogsRequest.toObject = function toObject(message, options) { + CreateControlRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; + object.control = null; + object.controlId = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListCatalogsRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.ListCatalogsRequest - * @instance - * @returns {Object.} JSON object - */ - ListCatalogsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ListCatalogsRequest; - })(); - - v2beta.ListCatalogsResponse = (function() { - - /** - * Properties of a ListCatalogsResponse. - * @memberof google.cloud.retail.v2beta - * @interface IListCatalogsResponse - * @property {Array.|null} [catalogs] ListCatalogsResponse catalogs - * @property {string|null} [nextPageToken] ListCatalogsResponse nextPageToken - */ - - /** - * Constructs a new ListCatalogsResponse. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a ListCatalogsResponse. - * @implements IListCatalogsResponse - * @constructor - * @param {google.cloud.retail.v2beta.IListCatalogsResponse=} [properties] Properties to set - */ - function ListCatalogsResponse(properties) { - this.catalogs = []; - 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]]; - } - - /** - * ListCatalogsResponse catalogs. - * @member {Array.} catalogs - * @memberof google.cloud.retail.v2beta.ListCatalogsResponse - * @instance - */ - ListCatalogsResponse.prototype.catalogs = $util.emptyArray; - - /** - * ListCatalogsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.retail.v2beta.ListCatalogsResponse - * @instance - */ - ListCatalogsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListCatalogsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.ListCatalogsResponse - * @static - * @param {google.cloud.retail.v2beta.IListCatalogsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ListCatalogsResponse} ListCatalogsResponse instance - */ - ListCatalogsResponse.create = function create(properties) { - return new ListCatalogsResponse(properties); - }; - - /** - * Encodes the specified ListCatalogsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ListCatalogsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.ListCatalogsResponse - * @static - * @param {google.cloud.retail.v2beta.IListCatalogsResponse} message ListCatalogsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCatalogsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.catalogs != null && message.catalogs.length) - for (var i = 0; i < message.catalogs.length; ++i) - $root.google.cloud.retail.v2beta.Catalog.encode(message.catalogs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListCatalogsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListCatalogsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ListCatalogsResponse - * @static - * @param {google.cloud.retail.v2beta.IListCatalogsResponse} message ListCatalogsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCatalogsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCatalogsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.ListCatalogsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ListCatalogsResponse} ListCatalogsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCatalogsResponse.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.v2beta.ListCatalogsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.catalogs && message.catalogs.length)) - message.catalogs = []; - message.catalogs.push($root.google.cloud.retail.v2beta.Catalog.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCatalogsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ListCatalogsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ListCatalogsResponse} ListCatalogsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCatalogsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCatalogsResponse message. - * @function verify - * @memberof google.cloud.retail.v2beta.ListCatalogsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCatalogsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.catalogs != null && message.hasOwnProperty("catalogs")) { - if (!Array.isArray(message.catalogs)) - return "catalogs: array expected"; - for (var i = 0; i < message.catalogs.length; ++i) { - var error = $root.google.cloud.retail.v2beta.Catalog.verify(message.catalogs[i]); - if (error) - return "catalogs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListCatalogsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.ListCatalogsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ListCatalogsResponse} ListCatalogsResponse - */ - ListCatalogsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ListCatalogsResponse) - return object; - var message = new $root.google.cloud.retail.v2beta.ListCatalogsResponse(); - if (object.catalogs) { - if (!Array.isArray(object.catalogs)) - throw TypeError(".google.cloud.retail.v2beta.ListCatalogsResponse.catalogs: array expected"); - message.catalogs = []; - for (var i = 0; i < object.catalogs.length; ++i) { - if (typeof object.catalogs[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.ListCatalogsResponse.catalogs: object expected"); - message.catalogs[i] = $root.google.cloud.retail.v2beta.Catalog.fromObject(object.catalogs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListCatalogsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.ListCatalogsResponse - * @static - * @param {google.cloud.retail.v2beta.ListCatalogsResponse} message ListCatalogsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCatalogsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.catalogs = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.catalogs && message.catalogs.length) { - object.catalogs = []; - for (var j = 0; j < message.catalogs.length; ++j) - object.catalogs[j] = $root.google.cloud.retail.v2beta.Catalog.toObject(message.catalogs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.control != null && message.hasOwnProperty("control")) + object.control = $root.google.cloud.retail.v2beta.Control.toObject(message.control, options); + if (message.controlId != null && message.hasOwnProperty("controlId")) + object.controlId = message.controlId; return object; }; /** - * Converts this ListCatalogsResponse to JSON. + * Converts this CreateControlRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.ListCatalogsResponse + * @memberof google.cloud.retail.v2beta.CreateControlRequest * @instance * @returns {Object.} JSON object */ - ListCatalogsResponse.prototype.toJSON = function toJSON() { + CreateControlRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListCatalogsResponse; + return CreateControlRequest; })(); - v2beta.UpdateCatalogRequest = (function() { + v2beta.UpdateControlRequest = (function() { /** - * Properties of an UpdateCatalogRequest. + * Properties of an UpdateControlRequest. * @memberof google.cloud.retail.v2beta - * @interface IUpdateCatalogRequest - * @property {google.cloud.retail.v2beta.ICatalog|null} [catalog] UpdateCatalogRequest catalog - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCatalogRequest updateMask + * @interface IUpdateControlRequest + * @property {google.cloud.retail.v2beta.IControl|null} [control] UpdateControlRequest control + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateControlRequest updateMask */ /** - * Constructs a new UpdateCatalogRequest. + * Constructs a new UpdateControlRequest. * @memberof google.cloud.retail.v2beta - * @classdesc Represents an UpdateCatalogRequest. - * @implements IUpdateCatalogRequest + * @classdesc Represents an UpdateControlRequest. + * @implements IUpdateControlRequest * @constructor - * @param {google.cloud.retail.v2beta.IUpdateCatalogRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IUpdateControlRequest=} [properties] Properties to set */ - function UpdateCatalogRequest(properties) { + function UpdateControlRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -65966,85 +78776,85 @@ } /** - * UpdateCatalogRequest catalog. - * @member {google.cloud.retail.v2beta.ICatalog|null|undefined} catalog - * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * UpdateControlRequest control. + * @member {google.cloud.retail.v2beta.IControl|null|undefined} control + * @memberof google.cloud.retail.v2beta.UpdateControlRequest * @instance */ - UpdateCatalogRequest.prototype.catalog = null; + UpdateControlRequest.prototype.control = null; /** - * UpdateCatalogRequest updateMask. + * UpdateControlRequest updateMask. * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @memberof google.cloud.retail.v2beta.UpdateControlRequest * @instance */ - UpdateCatalogRequest.prototype.updateMask = null; + UpdateControlRequest.prototype.updateMask = null; /** - * Creates a new UpdateCatalogRequest instance using the specified properties. + * Creates a new UpdateControlRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @memberof google.cloud.retail.v2beta.UpdateControlRequest * @static - * @param {google.cloud.retail.v2beta.IUpdateCatalogRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.UpdateCatalogRequest} UpdateCatalogRequest instance + * @param {google.cloud.retail.v2beta.IUpdateControlRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.UpdateControlRequest} UpdateControlRequest instance */ - UpdateCatalogRequest.create = function create(properties) { - return new UpdateCatalogRequest(properties); + UpdateControlRequest.create = function create(properties) { + return new UpdateControlRequest(properties); }; /** - * Encodes the specified UpdateCatalogRequest message. Does not implicitly {@link google.cloud.retail.v2beta.UpdateCatalogRequest.verify|verify} messages. + * Encodes the specified UpdateControlRequest message. Does not implicitly {@link google.cloud.retail.v2beta.UpdateControlRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @memberof google.cloud.retail.v2beta.UpdateControlRequest * @static - * @param {google.cloud.retail.v2beta.IUpdateCatalogRequest} message UpdateCatalogRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IUpdateControlRequest} message UpdateControlRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateCatalogRequest.encode = function encode(message, writer) { + UpdateControlRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) - $root.google.cloud.retail.v2beta.Catalog.encode(message.catalog, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.control != null && Object.hasOwnProperty.call(message, "control")) + $root.google.cloud.retail.v2beta.Control.encode(message.control, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateCatalogRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UpdateCatalogRequest.verify|verify} messages. + * Encodes the specified UpdateControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UpdateControlRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @memberof google.cloud.retail.v2beta.UpdateControlRequest * @static - * @param {google.cloud.retail.v2beta.IUpdateCatalogRequest} message UpdateCatalogRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IUpdateControlRequest} message UpdateControlRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateCatalogRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateControlRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateCatalogRequest message from the specified reader or buffer. + * Decodes an UpdateControlRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @memberof google.cloud.retail.v2beta.UpdateControlRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.UpdateCatalogRequest} UpdateCatalogRequest + * @returns {google.cloud.retail.v2beta.UpdateControlRequest} UpdateControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateCatalogRequest.decode = function decode(reader, length) { + UpdateControlRequest.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.v2beta.UpdateCatalogRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.UpdateControlRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.catalog = $root.google.cloud.retail.v2beta.Catalog.decode(reader, reader.uint32()); + message.control = $root.google.cloud.retail.v2beta.Control.decode(reader, reader.uint32()); break; case 2: message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); @@ -66058,36 +78868,36 @@ }; /** - * Decodes an UpdateCatalogRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateControlRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @memberof google.cloud.retail.v2beta.UpdateControlRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.UpdateCatalogRequest} UpdateCatalogRequest + * @returns {google.cloud.retail.v2beta.UpdateControlRequest} UpdateControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateCatalogRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateControlRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateCatalogRequest message. + * Verifies an UpdateControlRequest message. * @function verify - * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @memberof google.cloud.retail.v2beta.UpdateControlRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateCatalogRequest.verify = function verify(message) { + UpdateControlRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.catalog != null && message.hasOwnProperty("catalog")) { - var error = $root.google.cloud.retail.v2beta.Catalog.verify(message.catalog); + if (message.control != null && message.hasOwnProperty("control")) { + var error = $root.google.cloud.retail.v2beta.Control.verify(message.control); if (error) - return "catalog." + error; + return "control." + error; } if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask); @@ -66098,88 +78908,86 @@ }; /** - * Creates an UpdateCatalogRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateControlRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @memberof google.cloud.retail.v2beta.UpdateControlRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.UpdateCatalogRequest} UpdateCatalogRequest + * @returns {google.cloud.retail.v2beta.UpdateControlRequest} UpdateControlRequest */ - UpdateCatalogRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.UpdateCatalogRequest) + UpdateControlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.UpdateControlRequest) return object; - var message = new $root.google.cloud.retail.v2beta.UpdateCatalogRequest(); - if (object.catalog != null) { - if (typeof object.catalog !== "object") - throw TypeError(".google.cloud.retail.v2beta.UpdateCatalogRequest.catalog: object expected"); - message.catalog = $root.google.cloud.retail.v2beta.Catalog.fromObject(object.catalog); + var message = new $root.google.cloud.retail.v2beta.UpdateControlRequest(); + if (object.control != null) { + if (typeof object.control !== "object") + throw TypeError(".google.cloud.retail.v2beta.UpdateControlRequest.control: object expected"); + message.control = $root.google.cloud.retail.v2beta.Control.fromObject(object.control); } if (object.updateMask != null) { if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.retail.v2beta.UpdateCatalogRequest.updateMask: object expected"); + throw TypeError(".google.cloud.retail.v2beta.UpdateControlRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from an UpdateCatalogRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateControlRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @memberof google.cloud.retail.v2beta.UpdateControlRequest * @static - * @param {google.cloud.retail.v2beta.UpdateCatalogRequest} message UpdateCatalogRequest + * @param {google.cloud.retail.v2beta.UpdateControlRequest} message UpdateControlRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateCatalogRequest.toObject = function toObject(message, options) { + UpdateControlRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.catalog = null; + object.control = null; object.updateMask = null; } - if (message.catalog != null && message.hasOwnProperty("catalog")) - object.catalog = $root.google.cloud.retail.v2beta.Catalog.toObject(message.catalog, options); + if (message.control != null && message.hasOwnProperty("control")) + object.control = $root.google.cloud.retail.v2beta.Control.toObject(message.control, options); if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this UpdateCatalogRequest to JSON. + * Converts this UpdateControlRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.UpdateCatalogRequest + * @memberof google.cloud.retail.v2beta.UpdateControlRequest * @instance * @returns {Object.} JSON object */ - UpdateCatalogRequest.prototype.toJSON = function toJSON() { + UpdateControlRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateCatalogRequest; + return UpdateControlRequest; })(); - v2beta.SetDefaultBranchRequest = (function() { + v2beta.DeleteControlRequest = (function() { /** - * Properties of a SetDefaultBranchRequest. + * Properties of a DeleteControlRequest. * @memberof google.cloud.retail.v2beta - * @interface ISetDefaultBranchRequest - * @property {string|null} [catalog] SetDefaultBranchRequest catalog - * @property {string|null} [branchId] SetDefaultBranchRequest branchId - * @property {string|null} [note] SetDefaultBranchRequest note + * @interface IDeleteControlRequest + * @property {string|null} [name] DeleteControlRequest name */ /** - * Constructs a new SetDefaultBranchRequest. + * Constructs a new DeleteControlRequest. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a SetDefaultBranchRequest. - * @implements ISetDefaultBranchRequest + * @classdesc Represents a DeleteControlRequest. + * @implements IDeleteControlRequest * @constructor - * @param {google.cloud.retail.v2beta.ISetDefaultBranchRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IDeleteControlRequest=} [properties] Properties to set */ - function SetDefaultBranchRequest(properties) { + function DeleteControlRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -66187,101 +78995,75 @@ } /** - * SetDefaultBranchRequest catalog. - * @member {string} catalog - * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest - * @instance - */ - SetDefaultBranchRequest.prototype.catalog = ""; - - /** - * SetDefaultBranchRequest branchId. - * @member {string} branchId - * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest - * @instance - */ - SetDefaultBranchRequest.prototype.branchId = ""; - - /** - * SetDefaultBranchRequest note. - * @member {string} note - * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * DeleteControlRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2beta.DeleteControlRequest * @instance */ - SetDefaultBranchRequest.prototype.note = ""; + DeleteControlRequest.prototype.name = ""; /** - * Creates a new SetDefaultBranchRequest instance using the specified properties. + * Creates a new DeleteControlRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.DeleteControlRequest * @static - * @param {google.cloud.retail.v2beta.ISetDefaultBranchRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.SetDefaultBranchRequest} SetDefaultBranchRequest instance + * @param {google.cloud.retail.v2beta.IDeleteControlRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.DeleteControlRequest} DeleteControlRequest instance */ - SetDefaultBranchRequest.create = function create(properties) { - return new SetDefaultBranchRequest(properties); + DeleteControlRequest.create = function create(properties) { + return new DeleteControlRequest(properties); }; /** - * Encodes the specified SetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2beta.SetDefaultBranchRequest.verify|verify} messages. + * Encodes the specified DeleteControlRequest message. Does not implicitly {@link google.cloud.retail.v2beta.DeleteControlRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.DeleteControlRequest * @static - * @param {google.cloud.retail.v2beta.ISetDefaultBranchRequest} message SetDefaultBranchRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IDeleteControlRequest} message DeleteControlRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetDefaultBranchRequest.encode = function encode(message, writer) { + DeleteControlRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); - if (message.branchId != null && Object.hasOwnProperty.call(message, "branchId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.branchId); - if (message.note != null && Object.hasOwnProperty.call(message, "note")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.note); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified SetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SetDefaultBranchRequest.verify|verify} messages. + * Encodes the specified DeleteControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.DeleteControlRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.DeleteControlRequest * @static - * @param {google.cloud.retail.v2beta.ISetDefaultBranchRequest} message SetDefaultBranchRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IDeleteControlRequest} message DeleteControlRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetDefaultBranchRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteControlRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetDefaultBranchRequest message from the specified reader or buffer. + * Decodes a DeleteControlRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.DeleteControlRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.SetDefaultBranchRequest} SetDefaultBranchRequest + * @returns {google.cloud.retail.v2beta.DeleteControlRequest} DeleteControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetDefaultBranchRequest.decode = function decode(reader, length) { + DeleteControlRequest.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.v2beta.SetDefaultBranchRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.DeleteControlRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.catalog = reader.string(); - break; - case 2: - message.branchId = reader.string(); - break; - case 3: - message.note = reader.string(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -66292,124 +79074,107 @@ }; /** - * Decodes a SetDefaultBranchRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteControlRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.DeleteControlRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.SetDefaultBranchRequest} SetDefaultBranchRequest + * @returns {google.cloud.retail.v2beta.DeleteControlRequest} DeleteControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetDefaultBranchRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteControlRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetDefaultBranchRequest message. + * Verifies a DeleteControlRequest message. * @function verify - * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.DeleteControlRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetDefaultBranchRequest.verify = function verify(message) { + DeleteControlRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.catalog != null && message.hasOwnProperty("catalog")) - if (!$util.isString(message.catalog)) - return "catalog: string expected"; - if (message.branchId != null && message.hasOwnProperty("branchId")) - if (!$util.isString(message.branchId)) - return "branchId: string expected"; - if (message.note != null && message.hasOwnProperty("note")) - if (!$util.isString(message.note)) - return "note: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a SetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteControlRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.DeleteControlRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.SetDefaultBranchRequest} SetDefaultBranchRequest + * @returns {google.cloud.retail.v2beta.DeleteControlRequest} DeleteControlRequest */ - SetDefaultBranchRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.SetDefaultBranchRequest) + DeleteControlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.DeleteControlRequest) return object; - var message = new $root.google.cloud.retail.v2beta.SetDefaultBranchRequest(); - if (object.catalog != null) - message.catalog = String(object.catalog); - if (object.branchId != null) - message.branchId = String(object.branchId); - if (object.note != null) - message.note = String(object.note); + var message = new $root.google.cloud.retail.v2beta.DeleteControlRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a SetDefaultBranchRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteControlRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.DeleteControlRequest * @static - * @param {google.cloud.retail.v2beta.SetDefaultBranchRequest} message SetDefaultBranchRequest + * @param {google.cloud.retail.v2beta.DeleteControlRequest} message DeleteControlRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetDefaultBranchRequest.toObject = function toObject(message, options) { + DeleteControlRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.catalog = ""; - object.branchId = ""; - object.note = ""; - } - if (message.catalog != null && message.hasOwnProperty("catalog")) - object.catalog = message.catalog; - if (message.branchId != null && message.hasOwnProperty("branchId")) - object.branchId = message.branchId; - if (message.note != null && message.hasOwnProperty("note")) - object.note = message.note; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this SetDefaultBranchRequest to JSON. + * Converts this DeleteControlRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.DeleteControlRequest * @instance * @returns {Object.} JSON object */ - SetDefaultBranchRequest.prototype.toJSON = function toJSON() { + DeleteControlRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SetDefaultBranchRequest; + return DeleteControlRequest; })(); - v2beta.GetDefaultBranchRequest = (function() { + v2beta.GetControlRequest = (function() { /** - * Properties of a GetDefaultBranchRequest. + * Properties of a GetControlRequest. * @memberof google.cloud.retail.v2beta - * @interface IGetDefaultBranchRequest - * @property {string|null} [catalog] GetDefaultBranchRequest catalog + * @interface IGetControlRequest + * @property {string|null} [name] GetControlRequest name */ /** - * Constructs a new GetDefaultBranchRequest. + * Constructs a new GetControlRequest. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a GetDefaultBranchRequest. - * @implements IGetDefaultBranchRequest + * @classdesc Represents a GetControlRequest. + * @implements IGetControlRequest * @constructor - * @param {google.cloud.retail.v2beta.IGetDefaultBranchRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IGetControlRequest=} [properties] Properties to set */ - function GetDefaultBranchRequest(properties) { + function GetControlRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -66417,75 +79182,75 @@ } /** - * GetDefaultBranchRequest catalog. - * @member {string} catalog - * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * GetControlRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2beta.GetControlRequest * @instance */ - GetDefaultBranchRequest.prototype.catalog = ""; + GetControlRequest.prototype.name = ""; /** - * Creates a new GetDefaultBranchRequest instance using the specified properties. + * Creates a new GetControlRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.GetControlRequest * @static - * @param {google.cloud.retail.v2beta.IGetDefaultBranchRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.GetDefaultBranchRequest} GetDefaultBranchRequest instance + * @param {google.cloud.retail.v2beta.IGetControlRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.GetControlRequest} GetControlRequest instance */ - GetDefaultBranchRequest.create = function create(properties) { - return new GetDefaultBranchRequest(properties); + GetControlRequest.create = function create(properties) { + return new GetControlRequest(properties); }; /** - * Encodes the specified GetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2beta.GetDefaultBranchRequest.verify|verify} messages. + * Encodes the specified GetControlRequest message. Does not implicitly {@link google.cloud.retail.v2beta.GetControlRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.GetControlRequest * @static - * @param {google.cloud.retail.v2beta.IGetDefaultBranchRequest} message GetDefaultBranchRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IGetControlRequest} message GetControlRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDefaultBranchRequest.encode = function encode(message, writer) { + GetControlRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified GetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetDefaultBranchRequest.verify|verify} messages. + * Encodes the specified GetControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetControlRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.GetControlRequest * @static - * @param {google.cloud.retail.v2beta.IGetDefaultBranchRequest} message GetDefaultBranchRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IGetControlRequest} message GetControlRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDefaultBranchRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetControlRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDefaultBranchRequest message from the specified reader or buffer. + * Decodes a GetControlRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.GetControlRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.GetDefaultBranchRequest} GetDefaultBranchRequest + * @returns {google.cloud.retail.v2beta.GetControlRequest} GetControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDefaultBranchRequest.decode = function decode(reader, length) { + GetControlRequest.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.v2beta.GetDefaultBranchRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.GetControlRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.catalog = reader.string(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -66496,109 +79261,110 @@ }; /** - * Decodes a GetDefaultBranchRequest message from the specified reader or buffer, length delimited. + * Decodes a GetControlRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.GetControlRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.GetDefaultBranchRequest} GetDefaultBranchRequest + * @returns {google.cloud.retail.v2beta.GetControlRequest} GetControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDefaultBranchRequest.decodeDelimited = function decodeDelimited(reader) { + GetControlRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDefaultBranchRequest message. + * Verifies a GetControlRequest message. * @function verify - * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.GetControlRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDefaultBranchRequest.verify = function verify(message) { + GetControlRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.catalog != null && message.hasOwnProperty("catalog")) - if (!$util.isString(message.catalog)) - return "catalog: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a GetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetControlRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.GetControlRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.GetDefaultBranchRequest} GetDefaultBranchRequest + * @returns {google.cloud.retail.v2beta.GetControlRequest} GetControlRequest */ - GetDefaultBranchRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.GetDefaultBranchRequest) + GetControlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.GetControlRequest) return object; - var message = new $root.google.cloud.retail.v2beta.GetDefaultBranchRequest(); - if (object.catalog != null) - message.catalog = String(object.catalog); + var message = new $root.google.cloud.retail.v2beta.GetControlRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a GetDefaultBranchRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetControlRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.GetControlRequest * @static - * @param {google.cloud.retail.v2beta.GetDefaultBranchRequest} message GetDefaultBranchRequest + * @param {google.cloud.retail.v2beta.GetControlRequest} message GetControlRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDefaultBranchRequest.toObject = function toObject(message, options) { + GetControlRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.catalog = ""; - if (message.catalog != null && message.hasOwnProperty("catalog")) - object.catalog = message.catalog; + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this GetDefaultBranchRequest to JSON. + * Converts this GetControlRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2beta.GetControlRequest * @instance * @returns {Object.} JSON object */ - GetDefaultBranchRequest.prototype.toJSON = function toJSON() { + GetControlRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetDefaultBranchRequest; + return GetControlRequest; })(); - v2beta.GetDefaultBranchResponse = (function() { + v2beta.ListControlsRequest = (function() { /** - * Properties of a GetDefaultBranchResponse. + * Properties of a ListControlsRequest. * @memberof google.cloud.retail.v2beta - * @interface IGetDefaultBranchResponse - * @property {string|null} [branch] GetDefaultBranchResponse branch - * @property {google.protobuf.ITimestamp|null} [setTime] GetDefaultBranchResponse setTime - * @property {string|null} [note] GetDefaultBranchResponse note + * @interface IListControlsRequest + * @property {string|null} [parent] ListControlsRequest parent + * @property {number|null} [pageSize] ListControlsRequest pageSize + * @property {string|null} [pageToken] ListControlsRequest pageToken + * @property {string|null} [filter] ListControlsRequest filter */ /** - * Constructs a new GetDefaultBranchResponse. + * Constructs a new ListControlsRequest. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a GetDefaultBranchResponse. - * @implements IGetDefaultBranchResponse + * @classdesc Represents a ListControlsRequest. + * @implements IListControlsRequest * @constructor - * @param {google.cloud.retail.v2beta.IGetDefaultBranchResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IListControlsRequest=} [properties] Properties to set */ - function GetDefaultBranchResponse(properties) { + function ListControlsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -66606,101 +79372,114 @@ } /** - * GetDefaultBranchResponse branch. - * @member {string} branch - * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * ListControlsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2beta.ListControlsRequest * @instance */ - GetDefaultBranchResponse.prototype.branch = ""; + ListControlsRequest.prototype.parent = ""; /** - * GetDefaultBranchResponse setTime. - * @member {google.protobuf.ITimestamp|null|undefined} setTime - * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * ListControlsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.retail.v2beta.ListControlsRequest * @instance */ - GetDefaultBranchResponse.prototype.setTime = null; + ListControlsRequest.prototype.pageSize = 0; /** - * GetDefaultBranchResponse note. - * @member {string} note - * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * ListControlsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.retail.v2beta.ListControlsRequest * @instance */ - GetDefaultBranchResponse.prototype.note = ""; + ListControlsRequest.prototype.pageToken = ""; /** - * Creates a new GetDefaultBranchResponse instance using the specified properties. + * ListControlsRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2beta.ListControlsRequest + * @instance + */ + ListControlsRequest.prototype.filter = ""; + + /** + * Creates a new ListControlsRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2beta.ListControlsRequest * @static - * @param {google.cloud.retail.v2beta.IGetDefaultBranchResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.GetDefaultBranchResponse} GetDefaultBranchResponse instance + * @param {google.cloud.retail.v2beta.IListControlsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ListControlsRequest} ListControlsRequest instance */ - GetDefaultBranchResponse.create = function create(properties) { - return new GetDefaultBranchResponse(properties); + ListControlsRequest.create = function create(properties) { + return new ListControlsRequest(properties); }; /** - * Encodes the specified GetDefaultBranchResponse message. Does not implicitly {@link google.cloud.retail.v2beta.GetDefaultBranchResponse.verify|verify} messages. + * Encodes the specified ListControlsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ListControlsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2beta.ListControlsRequest * @static - * @param {google.cloud.retail.v2beta.IGetDefaultBranchResponse} message GetDefaultBranchResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IListControlsRequest} message ListControlsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDefaultBranchResponse.encode = function encode(message, writer) { + ListControlsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.branch); - if (message.setTime != null && Object.hasOwnProperty.call(message, "setTime")) - $root.google.protobuf.Timestamp.encode(message.setTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.note != null && Object.hasOwnProperty.call(message, "note")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.note); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); return writer; }; /** - * Encodes the specified GetDefaultBranchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetDefaultBranchResponse.verify|verify} messages. + * Encodes the specified ListControlsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListControlsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2beta.ListControlsRequest * @static - * @param {google.cloud.retail.v2beta.IGetDefaultBranchResponse} message GetDefaultBranchResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IListControlsRequest} message ListControlsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDefaultBranchResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListControlsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDefaultBranchResponse message from the specified reader or buffer. + * Decodes a ListControlsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2beta.ListControlsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.GetDefaultBranchResponse} GetDefaultBranchResponse + * @returns {google.cloud.retail.v2beta.ListControlsRequest} ListControlsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDefaultBranchResponse.decode = function decode(reader, length) { + ListControlsRequest.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.v2beta.GetDefaultBranchResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.ListControlsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.branch = reader.string(); + message.parent = reader.string(); break; case 2: - message.setTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); break; case 3: - message.note = reader.string(); + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); break; default: reader.skipType(tag & 7); @@ -66711,237 +79490,363 @@ }; /** - * Decodes a GetDefaultBranchResponse message from the specified reader or buffer, length delimited. + * Decodes a ListControlsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2beta.ListControlsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.GetDefaultBranchResponse} GetDefaultBranchResponse + * @returns {google.cloud.retail.v2beta.ListControlsRequest} ListControlsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDefaultBranchResponse.decodeDelimited = function decodeDelimited(reader) { + ListControlsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDefaultBranchResponse message. + * Verifies a ListControlsRequest message. * @function verify - * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2beta.ListControlsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDefaultBranchResponse.verify = function verify(message) { + ListControlsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.branch != null && message.hasOwnProperty("branch")) - if (!$util.isString(message.branch)) - return "branch: string expected"; - if (message.setTime != null && message.hasOwnProperty("setTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.setTime); - if (error) - return "setTime." + error; - } - if (message.note != null && message.hasOwnProperty("note")) - if (!$util.isString(message.note)) - return "note: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; return null; }; /** - * Creates a GetDefaultBranchResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListControlsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2beta.ListControlsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.GetDefaultBranchResponse} GetDefaultBranchResponse + * @returns {google.cloud.retail.v2beta.ListControlsRequest} ListControlsRequest */ - GetDefaultBranchResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.GetDefaultBranchResponse) + ListControlsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ListControlsRequest) return object; - var message = new $root.google.cloud.retail.v2beta.GetDefaultBranchResponse(); - if (object.branch != null) - message.branch = String(object.branch); - if (object.setTime != null) { - if (typeof object.setTime !== "object") - throw TypeError(".google.cloud.retail.v2beta.GetDefaultBranchResponse.setTime: object expected"); - message.setTime = $root.google.protobuf.Timestamp.fromObject(object.setTime); - } - if (object.note != null) - message.note = String(object.note); + var message = new $root.google.cloud.retail.v2beta.ListControlsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); return message; }; /** - * Creates a plain object from a GetDefaultBranchResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListControlsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2beta.ListControlsRequest * @static - * @param {google.cloud.retail.v2beta.GetDefaultBranchResponse} message GetDefaultBranchResponse + * @param {google.cloud.retail.v2beta.ListControlsRequest} message ListControlsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDefaultBranchResponse.toObject = function toObject(message, options) { + ListControlsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.branch = ""; - object.setTime = null; - object.note = ""; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; } - if (message.branch != null && message.hasOwnProperty("branch")) - object.branch = message.branch; - if (message.setTime != null && message.hasOwnProperty("setTime")) - object.setTime = $root.google.protobuf.Timestamp.toObject(message.setTime, options); - if (message.note != null && message.hasOwnProperty("note")) - object.note = message.note; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; return object; }; /** - * Converts this GetDefaultBranchResponse to JSON. + * Converts this ListControlsRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2beta.ListControlsRequest * @instance * @returns {Object.} JSON object */ - GetDefaultBranchResponse.prototype.toJSON = function toJSON() { + ListControlsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetDefaultBranchResponse; + return ListControlsRequest; })(); - v2beta.CompletionService = (function() { + v2beta.ListControlsResponse = (function() { /** - * Constructs a new CompletionService service. + * Properties of a ListControlsResponse. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a CompletionService - * @extends $protobuf.rpc.Service + * @interface IListControlsResponse + * @property {Array.|null} [controls] ListControlsResponse controls + * @property {string|null} [nextPageToken] ListControlsResponse nextPageToken + */ + + /** + * Constructs a new ListControlsResponse. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a ListControlsResponse. + * @implements IListControlsResponse * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @param {google.cloud.retail.v2beta.IListControlsResponse=} [properties] Properties to set */ - function CompletionService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function ListControlsResponse(properties) { + this.controls = []; + 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]]; } - (CompletionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CompletionService; + /** + * ListControlsResponse controls. + * @member {Array.} controls + * @memberof google.cloud.retail.v2beta.ListControlsResponse + * @instance + */ + ListControlsResponse.prototype.controls = $util.emptyArray; /** - * Creates new CompletionService service using the specified rpc implementation. + * ListControlsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.retail.v2beta.ListControlsResponse + * @instance + */ + ListControlsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListControlsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.CompletionService + * @memberof google.cloud.retail.v2beta.ListControlsResponse * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {CompletionService} RPC service. Useful where requests and/or responses are streamed. + * @param {google.cloud.retail.v2beta.IListControlsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ListControlsResponse} ListControlsResponse instance */ - CompletionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + ListControlsResponse.create = function create(properties) { + return new ListControlsResponse(properties); }; /** - * Callback as used by {@link google.cloud.retail.v2beta.CompletionService#completeQuery}. - * @memberof google.cloud.retail.v2beta.CompletionService - * @typedef CompleteQueryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2beta.CompleteQueryResponse} [response] CompleteQueryResponse + * Encodes the specified ListControlsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ListControlsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ListControlsResponse + * @static + * @param {google.cloud.retail.v2beta.IListControlsResponse} message ListControlsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + ListControlsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.controls != null && message.controls.length) + for (var i = 0; i < message.controls.length; ++i) + $root.google.cloud.retail.v2beta.Control.encode(message.controls[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; /** - * Calls CompleteQuery. - * @function completeQuery - * @memberof google.cloud.retail.v2beta.CompletionService - * @instance - * @param {google.cloud.retail.v2beta.ICompleteQueryRequest} request CompleteQueryRequest message or plain object - * @param {google.cloud.retail.v2beta.CompletionService.CompleteQueryCallback} callback Node-style callback called with the error, if any, and CompleteQueryResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified ListControlsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListControlsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ListControlsResponse + * @static + * @param {google.cloud.retail.v2beta.IListControlsResponse} message ListControlsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(CompletionService.prototype.completeQuery = function completeQuery(request, callback) { - return this.rpcCall(completeQuery, $root.google.cloud.retail.v2beta.CompleteQueryRequest, $root.google.cloud.retail.v2beta.CompleteQueryResponse, request, callback); - }, "name", { value: "CompleteQuery" }); + ListControlsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls CompleteQuery. - * @function completeQuery - * @memberof google.cloud.retail.v2beta.CompletionService - * @instance - * @param {google.cloud.retail.v2beta.ICompleteQueryRequest} request CompleteQueryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a ListControlsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ListControlsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ListControlsResponse} ListControlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListControlsResponse.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.v2beta.ListControlsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.controls && message.controls.length)) + message.controls = []; + message.controls.push($root.google.cloud.retail.v2beta.Control.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListControlsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ListControlsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ListControlsResponse} ListControlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListControlsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListControlsResponse message. + * @function verify + * @memberof google.cloud.retail.v2beta.ListControlsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + ListControlsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.controls != null && message.hasOwnProperty("controls")) { + if (!Array.isArray(message.controls)) + return "controls: array expected"; + for (var i = 0; i < message.controls.length; ++i) { + var error = $root.google.cloud.retail.v2beta.Control.verify(message.controls[i]); + if (error) + return "controls." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; /** - * Callback as used by {@link google.cloud.retail.v2beta.CompletionService#importCompletionData}. - * @memberof google.cloud.retail.v2beta.CompletionService - * @typedef ImportCompletionDataCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a ListControlsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ListControlsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ListControlsResponse} ListControlsResponse */ + ListControlsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ListControlsResponse) + return object; + var message = new $root.google.cloud.retail.v2beta.ListControlsResponse(); + if (object.controls) { + if (!Array.isArray(object.controls)) + throw TypeError(".google.cloud.retail.v2beta.ListControlsResponse.controls: array expected"); + message.controls = []; + for (var i = 0; i < object.controls.length; ++i) { + if (typeof object.controls[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.ListControlsResponse.controls: object expected"); + message.controls[i] = $root.google.cloud.retail.v2beta.Control.fromObject(object.controls[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; /** - * Calls ImportCompletionData. - * @function importCompletionData - * @memberof google.cloud.retail.v2beta.CompletionService - * @instance - * @param {google.cloud.retail.v2beta.IImportCompletionDataRequest} request ImportCompletionDataRequest message or plain object - * @param {google.cloud.retail.v2beta.CompletionService.ImportCompletionDataCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Creates a plain object from a ListControlsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ListControlsResponse + * @static + * @param {google.cloud.retail.v2beta.ListControlsResponse} message ListControlsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(CompletionService.prototype.importCompletionData = function importCompletionData(request, callback) { - return this.rpcCall(importCompletionData, $root.google.cloud.retail.v2beta.ImportCompletionDataRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportCompletionData" }); + ListControlsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.controls = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.controls && message.controls.length) { + object.controls = []; + for (var j = 0; j < message.controls.length; ++j) + object.controls[j] = $root.google.cloud.retail.v2beta.Control.toObject(message.controls[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; /** - * Calls ImportCompletionData. - * @function importCompletionData - * @memberof google.cloud.retail.v2beta.CompletionService + * Converts this ListControlsResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ListControlsResponse * @instance - * @param {google.cloud.retail.v2beta.IImportCompletionDataRequest} request ImportCompletionDataRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + ListControlsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return CompletionService; + return ListControlsResponse; })(); - v2beta.CompleteQueryRequest = (function() { + v2beta.ExportErrorsConfig = (function() { /** - * Properties of a CompleteQueryRequest. + * Properties of an ExportErrorsConfig. * @memberof google.cloud.retail.v2beta - * @interface ICompleteQueryRequest - * @property {string|null} [catalog] CompleteQueryRequest catalog - * @property {string|null} [query] CompleteQueryRequest query - * @property {string|null} [visitorId] CompleteQueryRequest visitorId - * @property {Array.|null} [languageCodes] CompleteQueryRequest languageCodes - * @property {string|null} [deviceType] CompleteQueryRequest deviceType - * @property {string|null} [dataset] CompleteQueryRequest dataset - * @property {number|null} [maxSuggestions] CompleteQueryRequest maxSuggestions + * @interface IExportErrorsConfig + * @property {string|null} [gcsPrefix] ExportErrorsConfig gcsPrefix */ /** - * Constructs a new CompleteQueryRequest. + * Constructs a new ExportErrorsConfig. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a CompleteQueryRequest. - * @implements ICompleteQueryRequest + * @classdesc Represents an ExportErrorsConfig. + * @implements IExportErrorsConfig * @constructor - * @param {google.cloud.retail.v2beta.ICompleteQueryRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IExportErrorsConfig=} [properties] Properties to set */ - function CompleteQueryRequest(properties) { - this.languageCodes = []; + function ExportErrorsConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -66949,156 +79854,89 @@ } /** - * CompleteQueryRequest catalog. - * @member {string} catalog - * @memberof google.cloud.retail.v2beta.CompleteQueryRequest - * @instance - */ - CompleteQueryRequest.prototype.catalog = ""; - - /** - * CompleteQueryRequest query. - * @member {string} query - * @memberof google.cloud.retail.v2beta.CompleteQueryRequest - * @instance - */ - CompleteQueryRequest.prototype.query = ""; - - /** - * CompleteQueryRequest visitorId. - * @member {string} visitorId - * @memberof google.cloud.retail.v2beta.CompleteQueryRequest - * @instance - */ - CompleteQueryRequest.prototype.visitorId = ""; - - /** - * CompleteQueryRequest languageCodes. - * @member {Array.} languageCodes - * @memberof google.cloud.retail.v2beta.CompleteQueryRequest - * @instance - */ - CompleteQueryRequest.prototype.languageCodes = $util.emptyArray; - - /** - * CompleteQueryRequest deviceType. - * @member {string} deviceType - * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * ExportErrorsConfig gcsPrefix. + * @member {string|null|undefined} gcsPrefix + * @memberof google.cloud.retail.v2beta.ExportErrorsConfig * @instance */ - CompleteQueryRequest.prototype.deviceType = ""; + ExportErrorsConfig.prototype.gcsPrefix = null; - /** - * CompleteQueryRequest dataset. - * @member {string} dataset - * @memberof google.cloud.retail.v2beta.CompleteQueryRequest - * @instance - */ - CompleteQueryRequest.prototype.dataset = ""; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * CompleteQueryRequest maxSuggestions. - * @member {number} maxSuggestions - * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * ExportErrorsConfig destination. + * @member {"gcsPrefix"|undefined} destination + * @memberof google.cloud.retail.v2beta.ExportErrorsConfig * @instance */ - CompleteQueryRequest.prototype.maxSuggestions = 0; + Object.defineProperty(ExportErrorsConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsPrefix"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new CompleteQueryRequest instance using the specified properties. + * Creates a new ExportErrorsConfig instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @memberof google.cloud.retail.v2beta.ExportErrorsConfig * @static - * @param {google.cloud.retail.v2beta.ICompleteQueryRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.CompleteQueryRequest} CompleteQueryRequest instance + * @param {google.cloud.retail.v2beta.IExportErrorsConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ExportErrorsConfig} ExportErrorsConfig instance */ - CompleteQueryRequest.create = function create(properties) { - return new CompleteQueryRequest(properties); + ExportErrorsConfig.create = function create(properties) { + return new ExportErrorsConfig(properties); }; /** - * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryRequest.verify|verify} messages. + * Encodes the specified ExportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ExportErrorsConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @memberof google.cloud.retail.v2beta.ExportErrorsConfig * @static - * @param {google.cloud.retail.v2beta.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IExportErrorsConfig} message ExportErrorsConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompleteQueryRequest.encode = function encode(message, writer) { + ExportErrorsConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); - if (message.languageCodes != null && message.languageCodes.length) - for (var i = 0; i < message.languageCodes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCodes[i]); - if (message.deviceType != null && Object.hasOwnProperty.call(message, "deviceType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.deviceType); - if (message.maxSuggestions != null && Object.hasOwnProperty.call(message, "maxSuggestions")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxSuggestions); - if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) - 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.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsPrefix); return writer; }; /** - * Encodes the specified CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryRequest.verify|verify} messages. + * Encodes the specified ExportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ExportErrorsConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @memberof google.cloud.retail.v2beta.ExportErrorsConfig * @static - * @param {google.cloud.retail.v2beta.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IExportErrorsConfig} message ExportErrorsConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompleteQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + ExportErrorsConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CompleteQueryRequest message from the specified reader or buffer. + * Decodes an ExportErrorsConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @memberof google.cloud.retail.v2beta.ExportErrorsConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.CompleteQueryRequest} CompleteQueryRequest + * @returns {google.cloud.retail.v2beta.ExportErrorsConfig} ExportErrorsConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteQueryRequest.decode = function decode(reader, length) { + ExportErrorsConfig.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.v2beta.CompleteQueryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.ExportErrorsConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.catalog = reader.string(); - break; - case 2: - message.query = reader.string(); - break; - case 7: - message.visitorId = reader.string(); - break; - case 3: - if (!(message.languageCodes && message.languageCodes.length)) - message.languageCodes = []; - message.languageCodes.push(reader.string()); - break; - case 4: - message.deviceType = reader.string(); - break; - case 6: - message.dataset = reader.string(); - break; - case 5: - message.maxSuggestions = reader.int32(); + message.gcsPrefix = reader.string(); break; default: reader.skipType(tag & 7); @@ -67109,173 +79947,112 @@ }; /** - * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. + * Decodes an ExportErrorsConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @memberof google.cloud.retail.v2beta.ExportErrorsConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.CompleteQueryRequest} CompleteQueryRequest + * @returns {google.cloud.retail.v2beta.ExportErrorsConfig} ExportErrorsConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteQueryRequest.decodeDelimited = function decodeDelimited(reader) { + ExportErrorsConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CompleteQueryRequest message. + * Verifies an ExportErrorsConfig message. * @function verify - * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @memberof google.cloud.retail.v2beta.ExportErrorsConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CompleteQueryRequest.verify = function verify(message) { + ExportErrorsConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.catalog != null && message.hasOwnProperty("catalog")) - if (!$util.isString(message.catalog)) - return "catalog: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: string expected"; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - if (!$util.isString(message.visitorId)) - return "visitorId: string expected"; - if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { - if (!Array.isArray(message.languageCodes)) - return "languageCodes: array expected"; - for (var i = 0; i < message.languageCodes.length; ++i) - if (!$util.isString(message.languageCodes[i])) - return "languageCodes: string[] expected"; + var properties = {}; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + properties.destination = 1; + if (!$util.isString(message.gcsPrefix)) + return "gcsPrefix: string expected"; } - if (message.deviceType != null && message.hasOwnProperty("deviceType")) - if (!$util.isString(message.deviceType)) - return "deviceType: string expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) - if (!$util.isInteger(message.maxSuggestions)) - return "maxSuggestions: integer expected"; return null; }; /** - * Creates a CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExportErrorsConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @memberof google.cloud.retail.v2beta.ExportErrorsConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.CompleteQueryRequest} CompleteQueryRequest + * @returns {google.cloud.retail.v2beta.ExportErrorsConfig} ExportErrorsConfig */ - CompleteQueryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.CompleteQueryRequest) + ExportErrorsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ExportErrorsConfig) return object; - var message = new $root.google.cloud.retail.v2beta.CompleteQueryRequest(); - if (object.catalog != null) - message.catalog = String(object.catalog); - if (object.query != null) - message.query = String(object.query); - if (object.visitorId != null) - message.visitorId = String(object.visitorId); - if (object.languageCodes) { - if (!Array.isArray(object.languageCodes)) - throw TypeError(".google.cloud.retail.v2beta.CompleteQueryRequest.languageCodes: array expected"); - message.languageCodes = []; - for (var i = 0; i < object.languageCodes.length; ++i) - message.languageCodes[i] = String(object.languageCodes[i]); - } - if (object.deviceType != null) - message.deviceType = String(object.deviceType); - if (object.dataset != null) - message.dataset = String(object.dataset); - if (object.maxSuggestions != null) - message.maxSuggestions = object.maxSuggestions | 0; + var message = new $root.google.cloud.retail.v2beta.ExportErrorsConfig(); + if (object.gcsPrefix != null) + message.gcsPrefix = String(object.gcsPrefix); return message; }; /** - * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. + * Creates a plain object from an ExportErrorsConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @memberof google.cloud.retail.v2beta.ExportErrorsConfig * @static - * @param {google.cloud.retail.v2beta.CompleteQueryRequest} message CompleteQueryRequest + * @param {google.cloud.retail.v2beta.ExportErrorsConfig} message ExportErrorsConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CompleteQueryRequest.toObject = function toObject(message, options) { + ExportErrorsConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.languageCodes = []; - if (options.defaults) { - object.catalog = ""; - object.query = ""; - object.deviceType = ""; - object.maxSuggestions = 0; - object.dataset = ""; - object.visitorId = ""; - } - if (message.catalog != null && message.hasOwnProperty("catalog")) - object.catalog = message.catalog; - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.languageCodes && message.languageCodes.length) { - object.languageCodes = []; - for (var j = 0; j < message.languageCodes.length; ++j) - object.languageCodes[j] = message.languageCodes[j]; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + object.gcsPrefix = message.gcsPrefix; + if (options.oneofs) + object.destination = "gcsPrefix"; } - if (message.deviceType != null && message.hasOwnProperty("deviceType")) - object.deviceType = message.deviceType; - if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) - object.maxSuggestions = message.maxSuggestions; - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = message.dataset; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - object.visitorId = message.visitorId; return object; }; /** - * Converts this CompleteQueryRequest to JSON. + * Converts this ExportErrorsConfig to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @memberof google.cloud.retail.v2beta.ExportErrorsConfig * @instance * @returns {Object.} JSON object */ - CompleteQueryRequest.prototype.toJSON = function toJSON() { + ExportErrorsConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CompleteQueryRequest; + return ExportErrorsConfig; })(); - v2beta.CompleteQueryResponse = (function() { + v2beta.ExportMetadata = (function() { /** - * Properties of a CompleteQueryResponse. + * Properties of an ExportMetadata. * @memberof google.cloud.retail.v2beta - * @interface ICompleteQueryResponse - * @property {Array.|null} [completionResults] CompleteQueryResponse completionResults - * @property {string|null} [attributionToken] CompleteQueryResponse attributionToken - * @property {Array.|null} [recentSearchResults] CompleteQueryResponse recentSearchResults + * @interface IExportMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] ExportMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ExportMetadata updateTime */ /** - * Constructs a new CompleteQueryResponse. + * Constructs a new ExportMetadata. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a CompleteQueryResponse. - * @implements ICompleteQueryResponse + * @classdesc Represents an ExportMetadata. + * @implements IExportMetadata * @constructor - * @param {google.cloud.retail.v2beta.ICompleteQueryResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IExportMetadata=} [properties] Properties to set */ - function CompleteQueryResponse(properties) { - this.completionResults = []; - this.recentSearchResults = []; + function ExportMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -67283,107 +80060,88 @@ } /** - * CompleteQueryResponse completionResults. - * @member {Array.} completionResults - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse - * @instance - */ - CompleteQueryResponse.prototype.completionResults = $util.emptyArray; - - /** - * CompleteQueryResponse attributionToken. - * @member {string} attributionToken - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * ExportMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.retail.v2beta.ExportMetadata * @instance */ - CompleteQueryResponse.prototype.attributionToken = ""; + ExportMetadata.prototype.createTime = null; /** - * CompleteQueryResponse recentSearchResults. - * @member {Array.} recentSearchResults - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * ExportMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.retail.v2beta.ExportMetadata * @instance */ - CompleteQueryResponse.prototype.recentSearchResults = $util.emptyArray; + ExportMetadata.prototype.updateTime = null; /** - * Creates a new CompleteQueryResponse instance using the specified properties. + * Creates a new ExportMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @memberof google.cloud.retail.v2beta.ExportMetadata * @static - * @param {google.cloud.retail.v2beta.ICompleteQueryResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.CompleteQueryResponse} CompleteQueryResponse instance + * @param {google.cloud.retail.v2beta.IExportMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ExportMetadata} ExportMetadata instance */ - CompleteQueryResponse.create = function create(properties) { - return new CompleteQueryResponse(properties); + ExportMetadata.create = function create(properties) { + return new ExportMetadata(properties); }; /** - * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.verify|verify} messages. + * Encodes the specified ExportMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.ExportMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @memberof google.cloud.retail.v2beta.ExportMetadata * @static - * @param {google.cloud.retail.v2beta.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IExportMetadata} message ExportMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompleteQueryResponse.encode = function encode(message, writer) { + ExportMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.completionResults != null && message.completionResults.length) - for (var i = 0; i < message.completionResults.length; ++i) - $root.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.encode(message.completionResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributionToken); - if (message.recentSearchResults != null && message.recentSearchResults.length) - for (var i = 0; i < message.recentSearchResults.length; ++i) - $root.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.encode(message.recentSearchResults[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.verify|verify} messages. + * Encodes the specified ExportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ExportMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @memberof google.cloud.retail.v2beta.ExportMetadata * @static - * @param {google.cloud.retail.v2beta.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IExportMetadata} message ExportMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompleteQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + ExportMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CompleteQueryResponse message from the specified reader or buffer. + * Decodes an ExportMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @memberof google.cloud.retail.v2beta.ExportMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.CompleteQueryResponse} CompleteQueryResponse + * @returns {google.cloud.retail.v2beta.ExportMetadata} ExportMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteQueryResponse.decode = function decode(reader, length) { + ExportMetadata.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.v2beta.CompleteQueryResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.ExportMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.completionResults && message.completionResults.length)) - message.completionResults = []; - message.completionResults.push($root.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.decode(reader, reader.uint32())); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 2: - message.attributionToken = reader.string(); - break; - case 3: - if (!(message.recentSearchResults && message.recentSearchResults.length)) - message.recentSearchResults = []; - message.recentSearchResults.push($root.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.decode(reader, reader.uint32())); + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -67394,598 +80152,128 @@ }; /** - * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. + * Decodes an ExportMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @memberof google.cloud.retail.v2beta.ExportMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.CompleteQueryResponse} CompleteQueryResponse + * @returns {google.cloud.retail.v2beta.ExportMetadata} ExportMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteQueryResponse.decodeDelimited = function decodeDelimited(reader) { + ExportMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CompleteQueryResponse message. + * Verifies an ExportMetadata message. * @function verify - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @memberof google.cloud.retail.v2beta.ExportMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CompleteQueryResponse.verify = function verify(message) { + ExportMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.completionResults != null && message.hasOwnProperty("completionResults")) { - if (!Array.isArray(message.completionResults)) - return "completionResults: array expected"; - for (var i = 0; i < message.completionResults.length; ++i) { - var error = $root.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.verify(message.completionResults[i]); - if (error) - return "completionResults." + error; - } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - if (!$util.isString(message.attributionToken)) - return "attributionToken: string expected"; - if (message.recentSearchResults != null && message.hasOwnProperty("recentSearchResults")) { - if (!Array.isArray(message.recentSearchResults)) - return "recentSearchResults: array expected"; - for (var i = 0; i < message.recentSearchResults.length; ++i) { - var error = $root.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.verify(message.recentSearchResults[i]); - if (error) - return "recentSearchResults." + error; - } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; } return null; }; /** - * Creates a CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ExportMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @memberof google.cloud.retail.v2beta.ExportMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.CompleteQueryResponse} CompleteQueryResponse + * @returns {google.cloud.retail.v2beta.ExportMetadata} ExportMetadata */ - CompleteQueryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.CompleteQueryResponse) + ExportMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ExportMetadata) return object; - var message = new $root.google.cloud.retail.v2beta.CompleteQueryResponse(); - if (object.completionResults) { - if (!Array.isArray(object.completionResults)) - throw TypeError(".google.cloud.retail.v2beta.CompleteQueryResponse.completionResults: array expected"); - message.completionResults = []; - for (var i = 0; i < object.completionResults.length; ++i) { - if (typeof object.completionResults[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.CompleteQueryResponse.completionResults: object expected"); - message.completionResults[i] = $root.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.fromObject(object.completionResults[i]); - } + var message = new $root.google.cloud.retail.v2beta.ExportMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.ExportMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } - if (object.attributionToken != null) - message.attributionToken = String(object.attributionToken); - if (object.recentSearchResults) { - if (!Array.isArray(object.recentSearchResults)) - throw TypeError(".google.cloud.retail.v2beta.CompleteQueryResponse.recentSearchResults: array expected"); - message.recentSearchResults = []; - for (var i = 0; i < object.recentSearchResults.length; ++i) { - if (typeof object.recentSearchResults[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.CompleteQueryResponse.recentSearchResults: object expected"); - message.recentSearchResults[i] = $root.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.fromObject(object.recentSearchResults[i]); - } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.ExportMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } return message; }; /** - * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. + * Creates a plain object from an ExportMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @memberof google.cloud.retail.v2beta.ExportMetadata * @static - * @param {google.cloud.retail.v2beta.CompleteQueryResponse} message CompleteQueryResponse + * @param {google.cloud.retail.v2beta.ExportMetadata} message ExportMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CompleteQueryResponse.toObject = function toObject(message, options) { + ExportMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.completionResults = []; - object.recentSearchResults = []; - } - if (options.defaults) - object.attributionToken = ""; - if (message.completionResults && message.completionResults.length) { - object.completionResults = []; - for (var j = 0; j < message.completionResults.length; ++j) - object.completionResults[j] = $root.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.toObject(message.completionResults[j], options); - } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - object.attributionToken = message.attributionToken; - if (message.recentSearchResults && message.recentSearchResults.length) { - object.recentSearchResults = []; - for (var j = 0; j < message.recentSearchResults.length; ++j) - object.recentSearchResults[j] = $root.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.toObject(message.recentSearchResults[j], options); + if (options.defaults) { + object.createTime = null; + object.updateTime = null; } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; /** - * Converts this CompleteQueryResponse to JSON. + * Converts this ExportMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse + * @memberof google.cloud.retail.v2beta.ExportMetadata * @instance * @returns {Object.} JSON object */ - CompleteQueryResponse.prototype.toJSON = function toJSON() { + ExportMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - CompleteQueryResponse.CompletionResult = (function() { - - /** - * Properties of a CompletionResult. - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse - * @interface ICompletionResult - * @property {string|null} [suggestion] CompletionResult suggestion - * @property {Object.|null} [attributes] CompletionResult attributes - */ - - /** - * Constructs a new CompletionResult. - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse - * @classdesc Represents a CompletionResult. - * @implements ICompletionResult - * @constructor - * @param {google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult=} [properties] Properties to set - */ - function CompletionResult(properties) { - this.attributes = {}; - 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]]; - } - - /** - * CompletionResult suggestion. - * @member {string} suggestion - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult - * @instance - */ - CompletionResult.prototype.suggestion = ""; - - /** - * CompletionResult attributes. - * @member {Object.} attributes - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult - * @instance - */ - CompletionResult.prototype.attributes = $util.emptyObject; - - /** - * Creates a new CompletionResult instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult - * @static - * @param {google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult} CompletionResult instance - */ - CompletionResult.create = function create(properties) { - return new CompletionResult(properties); - }; - - /** - * Encodes the specified CompletionResult message. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult - * @static - * @param {google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult} message CompletionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompletionResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.suggestion != null && Object.hasOwnProperty.call(message, "suggestion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.suggestion); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.retail.v2beta.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CompletionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult - * @static - * @param {google.cloud.retail.v2beta.CompleteQueryResponse.ICompletionResult} message CompletionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompletionResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CompletionResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult} CompletionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompletionResult.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.v2beta.CompleteQueryResponse.CompletionResult(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.suggestion = reader.string(); - break; - case 2: - if (message.attributes === $util.emptyObject) - message.attributes = {}; - 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.v2beta.CustomAttribute.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributes[key] = value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CompletionResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult} CompletionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompletionResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CompletionResult message. - * @function verify - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CompletionResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.suggestion != null && message.hasOwnProperty("suggestion")) - if (!$util.isString(message.suggestion)) - return "suggestion: string expected"; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.retail.v2beta.CustomAttribute.verify(message.attributes[key[i]]); - if (error) - return "attributes." + error; - } - } - return null; - }; - - /** - * Creates a CompletionResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult} CompletionResult - */ - CompletionResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult) - return object; - var message = new $root.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult(); - if (object.suggestion != null) - message.suggestion = String(object.suggestion); - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { - if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.attributes: object expected"); - message.attributes[keys[i]] = $root.google.cloud.retail.v2beta.CustomAttribute.fromObject(object.attributes[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a CompletionResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult - * @static - * @param {google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult} message CompletionResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CompletionResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.attributes = {}; - if (options.defaults) - object.suggestion = ""; - if (message.suggestion != null && message.hasOwnProperty("suggestion")) - object.suggestion = message.suggestion; - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = $root.google.cloud.retail.v2beta.CustomAttribute.toObject(message.attributes[keys2[j]], options); - } - return object; - }; - - /** - * Converts this CompletionResult to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult - * @instance - * @returns {Object.} JSON object - */ - CompletionResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CompletionResult; - })(); - - CompleteQueryResponse.RecentSearchResult = (function() { - - /** - * Properties of a RecentSearchResult. - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse - * @interface IRecentSearchResult - * @property {string|null} [recentSearch] RecentSearchResult recentSearch - */ - - /** - * Constructs a new RecentSearchResult. - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse - * @classdesc Represents a RecentSearchResult. - * @implements IRecentSearchResult - * @constructor - * @param {google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult=} [properties] Properties to set - */ - function RecentSearchResult(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]]; - } - - /** - * RecentSearchResult recentSearch. - * @member {string} recentSearch - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult - * @instance - */ - RecentSearchResult.prototype.recentSearch = ""; - - /** - * Creates a new RecentSearchResult instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult - * @static - * @param {google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult} RecentSearchResult instance - */ - RecentSearchResult.create = function create(properties) { - return new RecentSearchResult(properties); - }; - - /** - * Encodes the specified RecentSearchResult message. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult - * @static - * @param {google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult} message RecentSearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RecentSearchResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.recentSearch != null && Object.hasOwnProperty.call(message, "recentSearch")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.recentSearch); - return writer; - }; - - /** - * Encodes the specified RecentSearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult - * @static - * @param {google.cloud.retail.v2beta.CompleteQueryResponse.IRecentSearchResult} message RecentSearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RecentSearchResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RecentSearchResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult} RecentSearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RecentSearchResult.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.v2beta.CompleteQueryResponse.RecentSearchResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.recentSearch = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RecentSearchResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult} RecentSearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RecentSearchResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RecentSearchResult message. - * @function verify - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RecentSearchResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.recentSearch != null && message.hasOwnProperty("recentSearch")) - if (!$util.isString(message.recentSearch)) - return "recentSearch: string expected"; - return null; - }; - - /** - * Creates a RecentSearchResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult} RecentSearchResult - */ - RecentSearchResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult) - return object; - var message = new $root.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult(); - if (object.recentSearch != null) - message.recentSearch = String(object.recentSearch); - return message; - }; - - /** - * Creates a plain object from a RecentSearchResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult - * @static - * @param {google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult} message RecentSearchResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RecentSearchResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.recentSearch = ""; - if (message.recentSearch != null && message.hasOwnProperty("recentSearch")) - object.recentSearch = message.recentSearch; - return object; - }; - - /** - * Converts this RecentSearchResult to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult - * @instance - * @returns {Object.} JSON object - */ - RecentSearchResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RecentSearchResult; - })(); - - return CompleteQueryResponse; + return ExportMetadata; })(); - v2beta.ExportErrorsConfig = (function() { + v2beta.ExportProductsResponse = (function() { /** - * Properties of an ExportErrorsConfig. + * Properties of an ExportProductsResponse. * @memberof google.cloud.retail.v2beta - * @interface IExportErrorsConfig - * @property {string|null} [gcsPrefix] ExportErrorsConfig gcsPrefix + * @interface IExportProductsResponse + * @property {Array.|null} [errorSamples] ExportProductsResponse errorSamples + * @property {google.cloud.retail.v2beta.IExportErrorsConfig|null} [errorsConfig] ExportProductsResponse errorsConfig */ /** - * Constructs a new ExportErrorsConfig. + * Constructs a new ExportProductsResponse. * @memberof google.cloud.retail.v2beta - * @classdesc Represents an ExportErrorsConfig. - * @implements IExportErrorsConfig + * @classdesc Represents an ExportProductsResponse. + * @implements IExportProductsResponse * @constructor - * @param {google.cloud.retail.v2beta.IExportErrorsConfig=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IExportProductsResponse=} [properties] Properties to set */ - function ExportErrorsConfig(properties) { + function ExportProductsResponse(properties) { + this.errorSamples = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -67993,89 +80281,91 @@ } /** - * ExportErrorsConfig gcsPrefix. - * @member {string|null|undefined} gcsPrefix - * @memberof google.cloud.retail.v2beta.ExportErrorsConfig + * ExportProductsResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.retail.v2beta.ExportProductsResponse * @instance */ - ExportErrorsConfig.prototype.gcsPrefix = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ExportProductsResponse.prototype.errorSamples = $util.emptyArray; /** - * ExportErrorsConfig destination. - * @member {"gcsPrefix"|undefined} destination - * @memberof google.cloud.retail.v2beta.ExportErrorsConfig + * ExportProductsResponse errorsConfig. + * @member {google.cloud.retail.v2beta.IExportErrorsConfig|null|undefined} errorsConfig + * @memberof google.cloud.retail.v2beta.ExportProductsResponse * @instance */ - Object.defineProperty(ExportErrorsConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsPrefix"]), - set: $util.oneOfSetter($oneOfFields) - }); + ExportProductsResponse.prototype.errorsConfig = null; /** - * Creates a new ExportErrorsConfig instance using the specified properties. + * Creates a new ExportProductsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.ExportErrorsConfig + * @memberof google.cloud.retail.v2beta.ExportProductsResponse * @static - * @param {google.cloud.retail.v2beta.IExportErrorsConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ExportErrorsConfig} ExportErrorsConfig instance + * @param {google.cloud.retail.v2beta.IExportProductsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ExportProductsResponse} ExportProductsResponse instance */ - ExportErrorsConfig.create = function create(properties) { - return new ExportErrorsConfig(properties); + ExportProductsResponse.create = function create(properties) { + return new ExportProductsResponse(properties); }; /** - * Encodes the specified ExportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ExportErrorsConfig.verify|verify} messages. + * Encodes the specified ExportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ExportProductsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.ExportErrorsConfig + * @memberof google.cloud.retail.v2beta.ExportProductsResponse * @static - * @param {google.cloud.retail.v2beta.IExportErrorsConfig} message ExportErrorsConfig message or plain object to encode + * @param {google.cloud.retail.v2beta.IExportProductsResponse} message ExportProductsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportErrorsConfig.encode = function encode(message, writer) { + ExportProductsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsPrefix); + if (message.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) + $root.google.cloud.retail.v2beta.ExportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ExportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ExportErrorsConfig.verify|verify} messages. + * Encodes the specified ExportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ExportProductsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ExportErrorsConfig + * @memberof google.cloud.retail.v2beta.ExportProductsResponse * @static - * @param {google.cloud.retail.v2beta.IExportErrorsConfig} message ExportErrorsConfig message or plain object to encode + * @param {google.cloud.retail.v2beta.IExportProductsResponse} message ExportProductsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportErrorsConfig.encodeDelimited = function encodeDelimited(message, writer) { + ExportProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportErrorsConfig message from the specified reader or buffer. + * Decodes an ExportProductsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.ExportErrorsConfig + * @memberof google.cloud.retail.v2beta.ExportProductsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ExportErrorsConfig} ExportErrorsConfig + * @returns {google.cloud.retail.v2beta.ExportProductsResponse} ExportProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportErrorsConfig.decode = function decode(reader, length) { + ExportProductsResponse.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.v2beta.ExportErrorsConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.ExportProductsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gcsPrefix = reader.string(); + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + case 2: + message.errorsConfig = $root.google.cloud.retail.v2beta.ExportErrorsConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -68086,112 +80376,140 @@ }; /** - * Decodes an ExportErrorsConfig message from the specified reader or buffer, length delimited. + * Decodes an ExportProductsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ExportErrorsConfig + * @memberof google.cloud.retail.v2beta.ExportProductsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ExportErrorsConfig} ExportErrorsConfig + * @returns {google.cloud.retail.v2beta.ExportProductsResponse} ExportProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportErrorsConfig.decodeDelimited = function decodeDelimited(reader) { + ExportProductsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportErrorsConfig message. + * Verifies an ExportProductsResponse message. * @function verify - * @memberof google.cloud.retail.v2beta.ExportErrorsConfig + * @memberof google.cloud.retail.v2beta.ExportProductsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportErrorsConfig.verify = function verify(message) { + ExportProductsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { - properties.destination = 1; - if (!$util.isString(message.gcsPrefix)) - return "gcsPrefix: string expected"; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } + } + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { + var error = $root.google.cloud.retail.v2beta.ExportErrorsConfig.verify(message.errorsConfig); + if (error) + return "errorsConfig." + error; } return null; }; /** - * Creates an ExportErrorsConfig message from a plain object. Also converts values to their respective internal types. + * Creates an ExportProductsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.ExportErrorsConfig + * @memberof google.cloud.retail.v2beta.ExportProductsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ExportErrorsConfig} ExportErrorsConfig + * @returns {google.cloud.retail.v2beta.ExportProductsResponse} ExportProductsResponse */ - ExportErrorsConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ExportErrorsConfig) + ExportProductsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ExportProductsResponse) return object; - var message = new $root.google.cloud.retail.v2beta.ExportErrorsConfig(); - if (object.gcsPrefix != null) - message.gcsPrefix = String(object.gcsPrefix); + var message = new $root.google.cloud.retail.v2beta.ExportProductsResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.retail.v2beta.ExportProductsResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.ExportProductsResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } + } + if (object.errorsConfig != null) { + if (typeof object.errorsConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.ExportProductsResponse.errorsConfig: object expected"); + message.errorsConfig = $root.google.cloud.retail.v2beta.ExportErrorsConfig.fromObject(object.errorsConfig); + } return message; }; /** - * Creates a plain object from an ExportErrorsConfig message. Also converts values to other types if specified. + * Creates a plain object from an ExportProductsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.ExportErrorsConfig + * @memberof google.cloud.retail.v2beta.ExportProductsResponse * @static - * @param {google.cloud.retail.v2beta.ExportErrorsConfig} message ExportErrorsConfig + * @param {google.cloud.retail.v2beta.ExportProductsResponse} message ExportProductsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportErrorsConfig.toObject = function toObject(message, options) { + ExportProductsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { - object.gcsPrefix = message.gcsPrefix; - if (options.oneofs) - object.destination = "gcsPrefix"; + if (options.arrays || options.defaults) + object.errorSamples = []; + if (options.defaults) + object.errorsConfig = null; + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); } + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) + object.errorsConfig = $root.google.cloud.retail.v2beta.ExportErrorsConfig.toObject(message.errorsConfig, options); return object; }; /** - * Converts this ExportErrorsConfig to JSON. + * Converts this ExportProductsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.ExportErrorsConfig + * @memberof google.cloud.retail.v2beta.ExportProductsResponse * @instance * @returns {Object.} JSON object */ - ExportErrorsConfig.prototype.toJSON = function toJSON() { + ExportProductsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportErrorsConfig; + return ExportProductsResponse; })(); - v2beta.ExportMetadata = (function() { + v2beta.ExportUserEventsResponse = (function() { /** - * Properties of an ExportMetadata. + * Properties of an ExportUserEventsResponse. * @memberof google.cloud.retail.v2beta - * @interface IExportMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] ExportMetadata createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ExportMetadata updateTime + * @interface IExportUserEventsResponse + * @property {Array.|null} [errorSamples] ExportUserEventsResponse errorSamples + * @property {google.cloud.retail.v2beta.IExportErrorsConfig|null} [errorsConfig] ExportUserEventsResponse errorsConfig */ /** - * Constructs a new ExportMetadata. + * Constructs a new ExportUserEventsResponse. * @memberof google.cloud.retail.v2beta - * @classdesc Represents an ExportMetadata. - * @implements IExportMetadata + * @classdesc Represents an ExportUserEventsResponse. + * @implements IExportUserEventsResponse * @constructor - * @param {google.cloud.retail.v2beta.IExportMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IExportUserEventsResponse=} [properties] Properties to set */ - function ExportMetadata(properties) { + function ExportUserEventsResponse(properties) { + this.errorSamples = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -68199,88 +80517,91 @@ } /** - * ExportMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.retail.v2beta.ExportMetadata + * ExportUserEventsResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse * @instance */ - ExportMetadata.prototype.createTime = null; + ExportUserEventsResponse.prototype.errorSamples = $util.emptyArray; /** - * ExportMetadata updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.retail.v2beta.ExportMetadata + * ExportUserEventsResponse errorsConfig. + * @member {google.cloud.retail.v2beta.IExportErrorsConfig|null|undefined} errorsConfig + * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse * @instance */ - ExportMetadata.prototype.updateTime = null; + ExportUserEventsResponse.prototype.errorsConfig = null; /** - * Creates a new ExportMetadata instance using the specified properties. + * Creates a new ExportUserEventsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.ExportMetadata + * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse * @static - * @param {google.cloud.retail.v2beta.IExportMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ExportMetadata} ExportMetadata instance + * @param {google.cloud.retail.v2beta.IExportUserEventsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ExportUserEventsResponse} ExportUserEventsResponse instance */ - ExportMetadata.create = function create(properties) { - return new ExportMetadata(properties); + ExportUserEventsResponse.create = function create(properties) { + return new ExportUserEventsResponse(properties); }; /** - * Encodes the specified ExportMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.ExportMetadata.verify|verify} messages. + * Encodes the specified ExportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ExportUserEventsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.ExportMetadata + * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse * @static - * @param {google.cloud.retail.v2beta.IExportMetadata} message ExportMetadata message or plain object to encode + * @param {google.cloud.retail.v2beta.IExportUserEventsResponse} message ExportUserEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportMetadata.encode = function encode(message, writer) { + ExportUserEventsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) + $root.google.cloud.retail.v2beta.ExportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ExportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ExportMetadata.verify|verify} messages. + * Encodes the specified ExportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ExportUserEventsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ExportMetadata + * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse * @static - * @param {google.cloud.retail.v2beta.IExportMetadata} message ExportMetadata message or plain object to encode + * @param {google.cloud.retail.v2beta.IExportUserEventsResponse} message ExportUserEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportMetadata.encodeDelimited = function encodeDelimited(message, writer) { + ExportUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportMetadata message from the specified reader or buffer. + * Decodes an ExportUserEventsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.ExportMetadata + * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ExportMetadata} ExportMetadata + * @returns {google.cloud.retail.v2beta.ExportUserEventsResponse} ExportUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportMetadata.decode = function decode(reader, length) { + ExportUserEventsResponse.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.v2beta.ExportMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.ExportUserEventsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); break; case 2: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.errorsConfig = $root.google.cloud.retail.v2beta.ExportErrorsConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -68291,128 +80612,215 @@ }; /** - * Decodes an ExportMetadata message from the specified reader or buffer, length delimited. + * Decodes an ExportUserEventsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ExportMetadata + * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ExportMetadata} ExportMetadata + * @returns {google.cloud.retail.v2beta.ExportUserEventsResponse} ExportUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportMetadata.decodeDelimited = function decodeDelimited(reader) { + ExportUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportMetadata message. + * Verifies an ExportUserEventsResponse message. * @function verify - * @memberof google.cloud.retail.v2beta.ExportMetadata + * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportMetadata.verify = function verify(message) { + ExportUserEventsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { + var error = $root.google.cloud.retail.v2beta.ExportErrorsConfig.verify(message.errorsConfig); if (error) - return "updateTime." + error; + return "errorsConfig." + error; } return null; }; /** - * Creates an ExportMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an ExportUserEventsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.ExportMetadata + * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ExportMetadata} ExportMetadata + * @returns {google.cloud.retail.v2beta.ExportUserEventsResponse} ExportUserEventsResponse */ - ExportMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ExportMetadata) + ExportUserEventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ExportUserEventsResponse) return object; - var message = new $root.google.cloud.retail.v2beta.ExportMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.retail.v2beta.ExportMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + var message = new $root.google.cloud.retail.v2beta.ExportUserEventsResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.retail.v2beta.ExportUserEventsResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.ExportUserEventsResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.retail.v2beta.ExportMetadata.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + if (object.errorsConfig != null) { + if (typeof object.errorsConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.ExportUserEventsResponse.errorsConfig: object expected"); + message.errorsConfig = $root.google.cloud.retail.v2beta.ExportErrorsConfig.fromObject(object.errorsConfig); } return message; }; /** - * Creates a plain object from an ExportMetadata message. Also converts values to other types if specified. + * Creates a plain object from an ExportUserEventsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.ExportMetadata + * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse * @static - * @param {google.cloud.retail.v2beta.ExportMetadata} message ExportMetadata + * @param {google.cloud.retail.v2beta.ExportUserEventsResponse} message ExportUserEventsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportMetadata.toObject = function toObject(message, options) { + ExportUserEventsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.createTime = null; - object.updateTime = null; + if (options.arrays || options.defaults) + object.errorSamples = []; + if (options.defaults) + object.errorsConfig = null; + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) + object.errorsConfig = $root.google.cloud.retail.v2beta.ExportErrorsConfig.toObject(message.errorsConfig, options); return object; }; /** - * Converts this ExportMetadata to JSON. + * Converts this ExportUserEventsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.ExportMetadata + * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse * @instance * @returns {Object.} JSON object */ - ExportMetadata.prototype.toJSON = function toJSON() { + ExportUserEventsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportMetadata; + return ExportUserEventsResponse; })(); - v2beta.ExportProductsResponse = (function() { + v2beta.PredictionService = (function() { /** - * Properties of an ExportProductsResponse. + * Constructs a new PredictionService service. * @memberof google.cloud.retail.v2beta - * @interface IExportProductsResponse - * @property {Array.|null} [errorSamples] ExportProductsResponse errorSamples - * @property {google.cloud.retail.v2beta.IExportErrorsConfig|null} [errorsConfig] ExportProductsResponse errorsConfig + * @classdesc Represents a PredictionService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ + function PredictionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PredictionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PredictionService; /** - * Constructs a new ExportProductsResponse. + * Creates new PredictionService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2beta.PredictionService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {PredictionService} RPC service. Useful where requests and/or responses are streamed. + */ + PredictionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.retail.v2beta.PredictionService#predict}. + * @memberof google.cloud.retail.v2beta.PredictionService + * @typedef PredictCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.PredictResponse} [response] PredictResponse + */ + + /** + * Calls Predict. + * @function predict + * @memberof google.cloud.retail.v2beta.PredictionService + * @instance + * @param {google.cloud.retail.v2beta.IPredictRequest} request PredictRequest message or plain object + * @param {google.cloud.retail.v2beta.PredictionService.PredictCallback} callback Node-style callback called with the error, if any, and PredictResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PredictionService.prototype.predict = function predict(request, callback) { + return this.rpcCall(predict, $root.google.cloud.retail.v2beta.PredictRequest, $root.google.cloud.retail.v2beta.PredictResponse, request, callback); + }, "name", { value: "Predict" }); + + /** + * Calls Predict. + * @function predict + * @memberof google.cloud.retail.v2beta.PredictionService + * @instance + * @param {google.cloud.retail.v2beta.IPredictRequest} request PredictRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PredictionService; + })(); + + v2beta.PredictRequest = (function() { + + /** + * Properties of a PredictRequest. * @memberof google.cloud.retail.v2beta - * @classdesc Represents an ExportProductsResponse. - * @implements IExportProductsResponse + * @interface IPredictRequest + * @property {string|null} [placement] PredictRequest placement + * @property {google.cloud.retail.v2beta.IUserEvent|null} [userEvent] PredictRequest userEvent + * @property {number|null} [pageSize] PredictRequest pageSize + * @property {string|null} [pageToken] PredictRequest pageToken + * @property {string|null} [filter] PredictRequest filter + * @property {boolean|null} [validateOnly] PredictRequest validateOnly + * @property {Object.|null} [params] PredictRequest params + * @property {Object.|null} [labels] PredictRequest labels + */ + + /** + * Constructs a new PredictRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a PredictRequest. + * @implements IPredictRequest * @constructor - * @param {google.cloud.retail.v2beta.IExportProductsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IPredictRequest=} [properties] Properties to set */ - function ExportProductsResponse(properties) { - this.errorSamples = []; + function PredictRequest(properties) { + this.params = {}; + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -68420,91 +80828,208 @@ } /** - * ExportProductsResponse errorSamples. - * @member {Array.} errorSamples - * @memberof google.cloud.retail.v2beta.ExportProductsResponse + * PredictRequest placement. + * @member {string} placement + * @memberof google.cloud.retail.v2beta.PredictRequest * @instance */ - ExportProductsResponse.prototype.errorSamples = $util.emptyArray; + PredictRequest.prototype.placement = ""; /** - * ExportProductsResponse errorsConfig. - * @member {google.cloud.retail.v2beta.IExportErrorsConfig|null|undefined} errorsConfig - * @memberof google.cloud.retail.v2beta.ExportProductsResponse + * PredictRequest userEvent. + * @member {google.cloud.retail.v2beta.IUserEvent|null|undefined} userEvent + * @memberof google.cloud.retail.v2beta.PredictRequest + * @instance + */ + PredictRequest.prototype.userEvent = null; + + /** + * PredictRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.retail.v2beta.PredictRequest + * @instance + */ + PredictRequest.prototype.pageSize = 0; + + /** + * PredictRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.retail.v2beta.PredictRequest + * @instance + */ + PredictRequest.prototype.pageToken = ""; + + /** + * PredictRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2beta.PredictRequest + * @instance + */ + PredictRequest.prototype.filter = ""; + + /** + * PredictRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.retail.v2beta.PredictRequest + * @instance + */ + PredictRequest.prototype.validateOnly = false; + + /** + * PredictRequest params. + * @member {Object.} params + * @memberof google.cloud.retail.v2beta.PredictRequest + * @instance + */ + PredictRequest.prototype.params = $util.emptyObject; + + /** + * PredictRequest labels. + * @member {Object.} labels + * @memberof google.cloud.retail.v2beta.PredictRequest * @instance */ - ExportProductsResponse.prototype.errorsConfig = null; + PredictRequest.prototype.labels = $util.emptyObject; /** - * Creates a new ExportProductsResponse instance using the specified properties. + * Creates a new PredictRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.ExportProductsResponse + * @memberof google.cloud.retail.v2beta.PredictRequest * @static - * @param {google.cloud.retail.v2beta.IExportProductsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ExportProductsResponse} ExportProductsResponse instance + * @param {google.cloud.retail.v2beta.IPredictRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.PredictRequest} PredictRequest instance */ - ExportProductsResponse.create = function create(properties) { - return new ExportProductsResponse(properties); + PredictRequest.create = function create(properties) { + return new PredictRequest(properties); }; /** - * Encodes the specified ExportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ExportProductsResponse.verify|verify} messages. + * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.retail.v2beta.PredictRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.ExportProductsResponse + * @memberof google.cloud.retail.v2beta.PredictRequest * @static - * @param {google.cloud.retail.v2beta.IExportProductsResponse} message ExportProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IPredictRequest} message PredictRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportProductsResponse.encode = function encode(message, writer) { + PredictRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorSamples != null && message.errorSamples.length) - for (var i = 0; i < message.errorSamples.length; ++i) - $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) - $root.google.cloud.retail.v2beta.ExportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.placement); + if (message.userEvent != null && Object.hasOwnProperty.call(message, "userEvent")) + $root.google.cloud.retail.v2beta.UserEvent.encode(message.userEvent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.params[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified ExportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ExportProductsResponse.verify|verify} messages. + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PredictRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ExportProductsResponse + * @memberof google.cloud.retail.v2beta.PredictRequest * @static - * @param {google.cloud.retail.v2beta.IExportProductsResponse} message ExportProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IPredictRequest} message PredictRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { + PredictRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportProductsResponse message from the specified reader or buffer. + * Decodes a PredictRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.ExportProductsResponse + * @memberof google.cloud.retail.v2beta.PredictRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ExportProductsResponse} ExportProductsResponse + * @returns {google.cloud.retail.v2beta.PredictRequest} PredictRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportProductsResponse.decode = function decode(reader, length) { + PredictRequest.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.v2beta.ExportProductsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.PredictRequest(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.errorSamples && message.errorSamples.length)) - message.errorSamples = []; - message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + message.placement = reader.string(); break; case 2: - message.errorsConfig = $root.google.cloud.retail.v2beta.ExportErrorsConfig.decode(reader, reader.uint32()); + message.userEvent = $root.google.cloud.retail.v2beta.UserEvent.decode(reader, reader.uint32()); + break; + case 3: + message.pageSize = reader.int32(); + break; + case 4: + message.pageToken = reader.string(); + break; + case 5: + message.filter = reader.string(); + break; + case 6: + message.validateOnly = reader.bool(); + break; + case 7: + if (message.params === $util.emptyObject) + message.params = {}; + 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.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.params[key] = value; + break; + case 8: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; break; default: reader.skipType(tag & 7); @@ -68515,140 +81040,208 @@ }; /** - * Decodes an ExportProductsResponse message from the specified reader or buffer, length delimited. + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ExportProductsResponse + * @memberof google.cloud.retail.v2beta.PredictRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ExportProductsResponse} ExportProductsResponse + * @returns {google.cloud.retail.v2beta.PredictRequest} PredictRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportProductsResponse.decodeDelimited = function decodeDelimited(reader) { + PredictRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportProductsResponse message. + * Verifies a PredictRequest message. * @function verify - * @memberof google.cloud.retail.v2beta.ExportProductsResponse + * @memberof google.cloud.retail.v2beta.PredictRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportProductsResponse.verify = function verify(message) { + PredictRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { - if (!Array.isArray(message.errorSamples)) - return "errorSamples: array expected"; - for (var i = 0; i < message.errorSamples.length; ++i) { - var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (message.placement != null && message.hasOwnProperty("placement")) + if (!$util.isString(message.placement)) + return "placement: string expected"; + if (message.userEvent != null && message.hasOwnProperty("userEvent")) { + var error = $root.google.cloud.retail.v2beta.UserEvent.verify(message.userEvent); + if (error) + return "userEvent." + error; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.params[key[i]]); if (error) - return "errorSamples." + error; + return "params." + error; } } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { - var error = $root.google.cloud.retail.v2beta.ExportErrorsConfig.verify(message.errorsConfig); - if (error) - return "errorsConfig." + error; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; } return null; }; /** - * Creates an ExportProductsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.ExportProductsResponse + * @memberof google.cloud.retail.v2beta.PredictRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ExportProductsResponse} ExportProductsResponse + * @returns {google.cloud.retail.v2beta.PredictRequest} PredictRequest */ - ExportProductsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ExportProductsResponse) + PredictRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.PredictRequest) return object; - var message = new $root.google.cloud.retail.v2beta.ExportProductsResponse(); - if (object.errorSamples) { - if (!Array.isArray(object.errorSamples)) - throw TypeError(".google.cloud.retail.v2beta.ExportProductsResponse.errorSamples: array expected"); - message.errorSamples = []; - for (var i = 0; i < object.errorSamples.length; ++i) { - if (typeof object.errorSamples[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.ExportProductsResponse.errorSamples: object expected"); - message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + var message = new $root.google.cloud.retail.v2beta.PredictRequest(); + if (object.placement != null) + message.placement = String(object.placement); + if (object.userEvent != null) { + if (typeof object.userEvent !== "object") + throw TypeError(".google.cloud.retail.v2beta.PredictRequest.userEvent: object expected"); + message.userEvent = $root.google.cloud.retail.v2beta.UserEvent.fromObject(object.userEvent); + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.retail.v2beta.PredictRequest.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) { + if (typeof object.params[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2beta.PredictRequest.params: object expected"); + message.params[keys[i]] = $root.google.protobuf.Value.fromObject(object.params[keys[i]]); } } - if (object.errorsConfig != null) { - if (typeof object.errorsConfig !== "object") - throw TypeError(".google.cloud.retail.v2beta.ExportProductsResponse.errorsConfig: object expected"); - message.errorsConfig = $root.google.cloud.retail.v2beta.ExportErrorsConfig.fromObject(object.errorsConfig); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.retail.v2beta.PredictRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); } return message; }; /** - * Creates a plain object from an ExportProductsResponse message. Also converts values to other types if specified. + * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.ExportProductsResponse + * @memberof google.cloud.retail.v2beta.PredictRequest * @static - * @param {google.cloud.retail.v2beta.ExportProductsResponse} message ExportProductsResponse + * @param {google.cloud.retail.v2beta.PredictRequest} message PredictRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportProductsResponse.toObject = function toObject(message, options) { + PredictRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.errorSamples = []; - if (options.defaults) - object.errorsConfig = null; - if (message.errorSamples && message.errorSamples.length) { - object.errorSamples = []; - for (var j = 0; j < message.errorSamples.length; ++j) - object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + if (options.objects || options.defaults) { + object.params = {}; + object.labels = {}; + } + if (options.defaults) { + object.placement = ""; + object.userEvent = null; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.validateOnly = false; + } + if (message.placement != null && message.hasOwnProperty("placement")) + object.placement = message.placement; + if (message.userEvent != null && message.hasOwnProperty("userEvent")) + object.userEvent = $root.google.cloud.retail.v2beta.UserEvent.toObject(message.userEvent, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = $root.google.protobuf.Value.toObject(message.params[keys2[j]], options); + } + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) - object.errorsConfig = $root.google.cloud.retail.v2beta.ExportErrorsConfig.toObject(message.errorsConfig, options); return object; }; /** - * Converts this ExportProductsResponse to JSON. + * Converts this PredictRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.ExportProductsResponse + * @memberof google.cloud.retail.v2beta.PredictRequest * @instance * @returns {Object.} JSON object */ - ExportProductsResponse.prototype.toJSON = function toJSON() { + PredictRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportProductsResponse; + return PredictRequest; })(); - v2beta.ExportUserEventsResponse = (function() { + v2beta.PredictResponse = (function() { /** - * Properties of an ExportUserEventsResponse. + * Properties of a PredictResponse. * @memberof google.cloud.retail.v2beta - * @interface IExportUserEventsResponse - * @property {Array.|null} [errorSamples] ExportUserEventsResponse errorSamples - * @property {google.cloud.retail.v2beta.IExportErrorsConfig|null} [errorsConfig] ExportUserEventsResponse errorsConfig + * @interface IPredictResponse + * @property {Array.|null} [results] PredictResponse results + * @property {string|null} [attributionToken] PredictResponse attributionToken + * @property {Array.|null} [missingIds] PredictResponse missingIds + * @property {boolean|null} [validateOnly] PredictResponse validateOnly */ /** - * Constructs a new ExportUserEventsResponse. + * Constructs a new PredictResponse. * @memberof google.cloud.retail.v2beta - * @classdesc Represents an ExportUserEventsResponse. - * @implements IExportUserEventsResponse + * @classdesc Represents a PredictResponse. + * @implements IPredictResponse * @constructor - * @param {google.cloud.retail.v2beta.IExportUserEventsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IPredictResponse=} [properties] Properties to set */ - function ExportUserEventsResponse(properties) { - this.errorSamples = []; + function PredictResponse(properties) { + this.results = []; + this.missingIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -68656,91 +81249,120 @@ } /** - * ExportUserEventsResponse errorSamples. - * @member {Array.} errorSamples - * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse + * PredictResponse results. + * @member {Array.} results + * @memberof google.cloud.retail.v2beta.PredictResponse * @instance */ - ExportUserEventsResponse.prototype.errorSamples = $util.emptyArray; + PredictResponse.prototype.results = $util.emptyArray; /** - * ExportUserEventsResponse errorsConfig. - * @member {google.cloud.retail.v2beta.IExportErrorsConfig|null|undefined} errorsConfig - * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse + * PredictResponse attributionToken. + * @member {string} attributionToken + * @memberof google.cloud.retail.v2beta.PredictResponse * @instance */ - ExportUserEventsResponse.prototype.errorsConfig = null; + PredictResponse.prototype.attributionToken = ""; /** - * Creates a new ExportUserEventsResponse instance using the specified properties. + * PredictResponse missingIds. + * @member {Array.} missingIds + * @memberof google.cloud.retail.v2beta.PredictResponse + * @instance + */ + PredictResponse.prototype.missingIds = $util.emptyArray; + + /** + * PredictResponse validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.retail.v2beta.PredictResponse + * @instance + */ + PredictResponse.prototype.validateOnly = false; + + /** + * Creates a new PredictResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse + * @memberof google.cloud.retail.v2beta.PredictResponse * @static - * @param {google.cloud.retail.v2beta.IExportUserEventsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ExportUserEventsResponse} ExportUserEventsResponse instance + * @param {google.cloud.retail.v2beta.IPredictResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.PredictResponse} PredictResponse instance */ - ExportUserEventsResponse.create = function create(properties) { - return new ExportUserEventsResponse(properties); + PredictResponse.create = function create(properties) { + return new PredictResponse(properties); }; /** - * Encodes the specified ExportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ExportUserEventsResponse.verify|verify} messages. + * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.retail.v2beta.PredictResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse + * @memberof google.cloud.retail.v2beta.PredictResponse * @static - * @param {google.cloud.retail.v2beta.IExportUserEventsResponse} message ExportUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IPredictResponse} message PredictResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportUserEventsResponse.encode = function encode(message, writer) { + PredictResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorSamples != null && message.errorSamples.length) - for (var i = 0; i < message.errorSamples.length; ++i) - $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) - $root.google.cloud.retail.v2beta.ExportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.retail.v2beta.PredictResponse.PredictionResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributionToken); + if (message.missingIds != null && message.missingIds.length) + for (var i = 0; i < message.missingIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.missingIds[i]); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); return writer; }; /** - * Encodes the specified ExportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ExportUserEventsResponse.verify|verify} messages. + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PredictResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse + * @memberof google.cloud.retail.v2beta.PredictResponse * @static - * @param {google.cloud.retail.v2beta.IExportUserEventsResponse} message ExportUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IPredictResponse} message PredictResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + PredictResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportUserEventsResponse message from the specified reader or buffer. + * Decodes a PredictResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse + * @memberof google.cloud.retail.v2beta.PredictResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ExportUserEventsResponse} ExportUserEventsResponse + * @returns {google.cloud.retail.v2beta.PredictResponse} PredictResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportUserEventsResponse.decode = function decode(reader, length) { + PredictResponse.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.v2beta.ExportUserEventsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.PredictResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.errorSamples && message.errorSamples.length)) - message.errorSamples = []; - message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.retail.v2beta.PredictResponse.PredictionResult.decode(reader, reader.uint32())); break; case 2: - message.errorsConfig = $root.google.cloud.retail.v2beta.ExportErrorsConfig.decode(reader, reader.uint32()); + message.attributionToken = reader.string(); + break; + case 3: + if (!(message.missingIds && message.missingIds.length)) + message.missingIds = []; + message.missingIds.push(reader.string()); + break; + case 4: + message.validateOnly = reader.bool(); break; default: reader.skipType(tag & 7); @@ -68751,636 +81373,815 @@ }; /** - * Decodes an ExportUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes a PredictResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse + * @memberof google.cloud.retail.v2beta.PredictResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ExportUserEventsResponse} ExportUserEventsResponse + * @returns {google.cloud.retail.v2beta.PredictResponse} PredictResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { + PredictResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportUserEventsResponse message. + * Verifies a PredictResponse message. * @function verify - * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse + * @memberof google.cloud.retail.v2beta.PredictResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportUserEventsResponse.verify = function verify(message) { + PredictResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { - if (!Array.isArray(message.errorSamples)) - return "errorSamples: array expected"; - for (var i = 0; i < message.errorSamples.length; ++i) { - var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.retail.v2beta.PredictResponse.PredictionResult.verify(message.results[i]); if (error) - return "errorSamples." + error; + return "results." + error; } } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { - var error = $root.google.cloud.retail.v2beta.ExportErrorsConfig.verify(message.errorsConfig); - if (error) - return "errorsConfig." + error; + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + if (!$util.isString(message.attributionToken)) + return "attributionToken: string expected"; + if (message.missingIds != null && message.hasOwnProperty("missingIds")) { + if (!Array.isArray(message.missingIds)) + return "missingIds: array expected"; + for (var i = 0; i < message.missingIds.length; ++i) + if (!$util.isString(message.missingIds[i])) + return "missingIds: string[] expected"; } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates an ExportUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse + * @memberof google.cloud.retail.v2beta.PredictResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ExportUserEventsResponse} ExportUserEventsResponse + * @returns {google.cloud.retail.v2beta.PredictResponse} PredictResponse */ - ExportUserEventsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ExportUserEventsResponse) + PredictResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.PredictResponse) return object; - var message = new $root.google.cloud.retail.v2beta.ExportUserEventsResponse(); - if (object.errorSamples) { - if (!Array.isArray(object.errorSamples)) - throw TypeError(".google.cloud.retail.v2beta.ExportUserEventsResponse.errorSamples: array expected"); - message.errorSamples = []; - for (var i = 0; i < object.errorSamples.length; ++i) { - if (typeof object.errorSamples[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.ExportUserEventsResponse.errorSamples: object expected"); - message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + var message = new $root.google.cloud.retail.v2beta.PredictResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.retail.v2beta.PredictResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.PredictResponse.results: object expected"); + message.results[i] = $root.google.cloud.retail.v2beta.PredictResponse.PredictionResult.fromObject(object.results[i]); } } - if (object.errorsConfig != null) { - if (typeof object.errorsConfig !== "object") - throw TypeError(".google.cloud.retail.v2beta.ExportUserEventsResponse.errorsConfig: object expected"); - message.errorsConfig = $root.google.cloud.retail.v2beta.ExportErrorsConfig.fromObject(object.errorsConfig); + if (object.attributionToken != null) + message.attributionToken = String(object.attributionToken); + if (object.missingIds) { + if (!Array.isArray(object.missingIds)) + throw TypeError(".google.cloud.retail.v2beta.PredictResponse.missingIds: array expected"); + message.missingIds = []; + for (var i = 0; i < object.missingIds.length; ++i) + message.missingIds[i] = String(object.missingIds[i]); } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from an ExportUserEventsResponse message. Also converts values to other types if specified. + * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse + * @memberof google.cloud.retail.v2beta.PredictResponse * @static - * @param {google.cloud.retail.v2beta.ExportUserEventsResponse} message ExportUserEventsResponse + * @param {google.cloud.retail.v2beta.PredictResponse} message PredictResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportUserEventsResponse.toObject = function toObject(message, options) { + PredictResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.errorSamples = []; - if (options.defaults) - object.errorsConfig = null; - if (message.errorSamples && message.errorSamples.length) { - object.errorSamples = []; - for (var j = 0; j < message.errorSamples.length; ++j) - object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + if (options.arrays || options.defaults) { + object.results = []; + object.missingIds = []; } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) - object.errorsConfig = $root.google.cloud.retail.v2beta.ExportErrorsConfig.toObject(message.errorsConfig, options); + if (options.defaults) { + object.attributionToken = ""; + object.validateOnly = false; + } + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.retail.v2beta.PredictResponse.PredictionResult.toObject(message.results[j], options); + } + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + object.attributionToken = message.attributionToken; + if (message.missingIds && message.missingIds.length) { + object.missingIds = []; + for (var j = 0; j < message.missingIds.length; ++j) + object.missingIds[j] = message.missingIds[j]; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this ExportUserEventsResponse to JSON. + * Converts this PredictResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.ExportUserEventsResponse + * @memberof google.cloud.retail.v2beta.PredictResponse * @instance * @returns {Object.} JSON object */ - ExportUserEventsResponse.prototype.toJSON = function toJSON() { + PredictResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportUserEventsResponse; + PredictResponse.PredictionResult = (function() { + + /** + * Properties of a PredictionResult. + * @memberof google.cloud.retail.v2beta.PredictResponse + * @interface IPredictionResult + * @property {string|null} [id] PredictionResult id + * @property {Object.|null} [metadata] PredictionResult metadata + */ + + /** + * Constructs a new PredictionResult. + * @memberof google.cloud.retail.v2beta.PredictResponse + * @classdesc Represents a PredictionResult. + * @implements IPredictionResult + * @constructor + * @param {google.cloud.retail.v2beta.PredictResponse.IPredictionResult=} [properties] Properties to set + */ + function PredictionResult(properties) { + this.metadata = {}; + 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]]; + } + + /** + * PredictionResult id. + * @member {string} id + * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult + * @instance + */ + PredictionResult.prototype.id = ""; + + /** + * PredictionResult metadata. + * @member {Object.} metadata + * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult + * @instance + */ + PredictionResult.prototype.metadata = $util.emptyObject; + + /** + * Creates a new PredictionResult instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult + * @static + * @param {google.cloud.retail.v2beta.PredictResponse.IPredictionResult=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.PredictResponse.PredictionResult} PredictionResult instance + */ + PredictionResult.create = function create(properties) { + return new PredictionResult(properties); + }; + + /** + * Encodes the specified PredictionResult message. Does not implicitly {@link google.cloud.retail.v2beta.PredictResponse.PredictionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult + * @static + * @param {google.cloud.retail.v2beta.PredictResponse.IPredictionResult} message PredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.metadata[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified PredictionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PredictResponse.PredictionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult + * @static + * @param {google.cloud.retail.v2beta.PredictResponse.IPredictionResult} message PredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PredictionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.PredictResponse.PredictionResult} PredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictionResult.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.v2beta.PredictResponse.PredictionResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.metadata[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PredictionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.PredictResponse.PredictionResult} PredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PredictionResult message. + * @function verify + * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PredictionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.metadata[key[i]]); + if (error) + return "metadata." + error; + } + } + return null; + }; + + /** + * Creates a PredictionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.PredictResponse.PredictionResult} PredictionResult + */ + PredictionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.PredictResponse.PredictionResult) + return object; + var message = new $root.google.cloud.retail.v2beta.PredictResponse.PredictionResult(); + if (object.id != null) + message.id = String(object.id); + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.retail.v2beta.PredictResponse.PredictionResult.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) { + if (typeof object.metadata[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2beta.PredictResponse.PredictionResult.metadata: object expected"); + message.metadata[keys[i]] = $root.google.protobuf.Value.fromObject(object.metadata[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a PredictionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult + * @static + * @param {google.cloud.retail.v2beta.PredictResponse.PredictionResult} message PredictionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PredictionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = $root.google.protobuf.Value.toObject(message.metadata[keys2[j]], options); + } + return object; + }; + + /** + * Converts this PredictionResult to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult + * @instance + * @returns {Object.} JSON object + */ + PredictionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PredictionResult; + })(); + + return PredictResponse; })(); - v2beta.PredictionService = (function() { + v2beta.ProductService = (function() { /** - * Constructs a new PredictionService service. + * Constructs a new ProductService service. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a PredictionService + * @classdesc Represents a ProductService * @extends $protobuf.rpc.Service * @constructor * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ - function PredictionService(rpcImpl, requestDelimited, responseDelimited) { + function ProductService(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - (PredictionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PredictionService; + (ProductService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ProductService; /** - * Creates new PredictionService service using the specified rpc implementation. + * Creates new ProductService service using the specified rpc implementation. * @function create - * @memberof google.cloud.retail.v2beta.PredictionService + * @memberof google.cloud.retail.v2beta.ProductService * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {PredictionService} RPC service. Useful where requests and/or responses are streamed. + * @returns {ProductService} RPC service. Useful where requests and/or responses are streamed. */ - PredictionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + ProductService.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Callback as used by {@link google.cloud.retail.v2beta.PredictionService#predict}. - * @memberof google.cloud.retail.v2beta.PredictionService - * @typedef PredictCallback + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#createProduct}. + * @memberof google.cloud.retail.v2beta.ProductService + * @typedef CreateProductCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2beta.PredictResponse} [response] PredictResponse + * @param {google.cloud.retail.v2beta.Product} [response] Product */ /** - * Calls Predict. - * @function predict - * @memberof google.cloud.retail.v2beta.PredictionService + * Calls CreateProduct. + * @function createProduct + * @memberof google.cloud.retail.v2beta.ProductService * @instance - * @param {google.cloud.retail.v2beta.IPredictRequest} request PredictRequest message or plain object - * @param {google.cloud.retail.v2beta.PredictionService.PredictCallback} callback Node-style callback called with the error, if any, and PredictResponse + * @param {google.cloud.retail.v2beta.ICreateProductRequest} request CreateProductRequest message or plain object + * @param {google.cloud.retail.v2beta.ProductService.CreateProductCallback} callback Node-style callback called with the error, if any, and Product * @returns {undefined} * @variation 1 */ - Object.defineProperty(PredictionService.prototype.predict = function predict(request, callback) { - return this.rpcCall(predict, $root.google.cloud.retail.v2beta.PredictRequest, $root.google.cloud.retail.v2beta.PredictResponse, request, callback); - }, "name", { value: "Predict" }); + Object.defineProperty(ProductService.prototype.createProduct = function createProduct(request, callback) { + return this.rpcCall(createProduct, $root.google.cloud.retail.v2beta.CreateProductRequest, $root.google.cloud.retail.v2beta.Product, request, callback); + }, "name", { value: "CreateProduct" }); /** - * Calls Predict. - * @function predict - * @memberof google.cloud.retail.v2beta.PredictionService + * Calls CreateProduct. + * @function createProduct + * @memberof google.cloud.retail.v2beta.ProductService * @instance - * @param {google.cloud.retail.v2beta.IPredictRequest} request PredictRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.retail.v2beta.ICreateProductRequest} request CreateProductRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ - return PredictionService; - })(); + /** + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#getProduct}. + * @memberof google.cloud.retail.v2beta.ProductService + * @typedef GetProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.Product} [response] Product + */ - v2beta.PredictRequest = (function() { + /** + * Calls GetProduct. + * @function getProduct + * @memberof google.cloud.retail.v2beta.ProductService + * @instance + * @param {google.cloud.retail.v2beta.IGetProductRequest} request GetProductRequest message or plain object + * @param {google.cloud.retail.v2beta.ProductService.GetProductCallback} callback Node-style callback called with the error, if any, and Product + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductService.prototype.getProduct = function getProduct(request, callback) { + return this.rpcCall(getProduct, $root.google.cloud.retail.v2beta.GetProductRequest, $root.google.cloud.retail.v2beta.Product, request, callback); + }, "name", { value: "GetProduct" }); /** - * Properties of a PredictRequest. - * @memberof google.cloud.retail.v2beta - * @interface IPredictRequest - * @property {string|null} [placement] PredictRequest placement - * @property {google.cloud.retail.v2beta.IUserEvent|null} [userEvent] PredictRequest userEvent - * @property {number|null} [pageSize] PredictRequest pageSize - * @property {string|null} [pageToken] PredictRequest pageToken - * @property {string|null} [filter] PredictRequest filter - * @property {boolean|null} [validateOnly] PredictRequest validateOnly - * @property {Object.|null} [params] PredictRequest params - * @property {Object.|null} [labels] PredictRequest labels + * Calls GetProduct. + * @function getProduct + * @memberof google.cloud.retail.v2beta.ProductService + * @instance + * @param {google.cloud.retail.v2beta.IGetProductRequest} request GetProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new PredictRequest. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a PredictRequest. - * @implements IPredictRequest - * @constructor - * @param {google.cloud.retail.v2beta.IPredictRequest=} [properties] Properties to set + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#listProducts}. + * @memberof google.cloud.retail.v2beta.ProductService + * @typedef ListProductsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.ListProductsResponse} [response] ListProductsResponse + */ + + /** + * Calls ListProducts. + * @function listProducts + * @memberof google.cloud.retail.v2beta.ProductService + * @instance + * @param {google.cloud.retail.v2beta.IListProductsRequest} request ListProductsRequest message or plain object + * @param {google.cloud.retail.v2beta.ProductService.ListProductsCallback} callback Node-style callback called with the error, if any, and ListProductsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductService.prototype.listProducts = function listProducts(request, callback) { + return this.rpcCall(listProducts, $root.google.cloud.retail.v2beta.ListProductsRequest, $root.google.cloud.retail.v2beta.ListProductsResponse, request, callback); + }, "name", { value: "ListProducts" }); + + /** + * Calls ListProducts. + * @function listProducts + * @memberof google.cloud.retail.v2beta.ProductService + * @instance + * @param {google.cloud.retail.v2beta.IListProductsRequest} request ListProductsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#updateProduct}. + * @memberof google.cloud.retail.v2beta.ProductService + * @typedef UpdateProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.Product} [response] Product + */ + + /** + * Calls UpdateProduct. + * @function updateProduct + * @memberof google.cloud.retail.v2beta.ProductService + * @instance + * @param {google.cloud.retail.v2beta.IUpdateProductRequest} request UpdateProductRequest message or plain object + * @param {google.cloud.retail.v2beta.ProductService.UpdateProductCallback} callback Node-style callback called with the error, if any, and Product + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductService.prototype.updateProduct = function updateProduct(request, callback) { + return this.rpcCall(updateProduct, $root.google.cloud.retail.v2beta.UpdateProductRequest, $root.google.cloud.retail.v2beta.Product, request, callback); + }, "name", { value: "UpdateProduct" }); + + /** + * Calls UpdateProduct. + * @function updateProduct + * @memberof google.cloud.retail.v2beta.ProductService + * @instance + * @param {google.cloud.retail.v2beta.IUpdateProductRequest} request UpdateProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#deleteProduct}. + * @memberof google.cloud.retail.v2beta.ProductService + * @typedef DeleteProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteProduct. + * @function deleteProduct + * @memberof google.cloud.retail.v2beta.ProductService + * @instance + * @param {google.cloud.retail.v2beta.IDeleteProductRequest} request DeleteProductRequest message or plain object + * @param {google.cloud.retail.v2beta.ProductService.DeleteProductCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductService.prototype.deleteProduct = function deleteProduct(request, callback) { + return this.rpcCall(deleteProduct, $root.google.cloud.retail.v2beta.DeleteProductRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteProduct" }); + + /** + * Calls DeleteProduct. + * @function deleteProduct + * @memberof google.cloud.retail.v2beta.ProductService + * @instance + * @param {google.cloud.retail.v2beta.IDeleteProductRequest} request DeleteProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#importProducts}. + * @memberof google.cloud.retail.v2beta.ProductService + * @typedef ImportProductsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - function PredictRequest(properties) { - this.params = {}; - this.labels = {}; - 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]]; - } /** - * PredictRequest placement. - * @member {string} placement - * @memberof google.cloud.retail.v2beta.PredictRequest + * Calls ImportProducts. + * @function importProducts + * @memberof google.cloud.retail.v2beta.ProductService * @instance + * @param {google.cloud.retail.v2beta.IImportProductsRequest} request ImportProductsRequest message or plain object + * @param {google.cloud.retail.v2beta.ProductService.ImportProductsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - PredictRequest.prototype.placement = ""; + Object.defineProperty(ProductService.prototype.importProducts = function importProducts(request, callback) { + return this.rpcCall(importProducts, $root.google.cloud.retail.v2beta.ImportProductsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportProducts" }); /** - * PredictRequest userEvent. - * @member {google.cloud.retail.v2beta.IUserEvent|null|undefined} userEvent - * @memberof google.cloud.retail.v2beta.PredictRequest + * Calls ImportProducts. + * @function importProducts + * @memberof google.cloud.retail.v2beta.ProductService * @instance + * @param {google.cloud.retail.v2beta.IImportProductsRequest} request ImportProductsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - PredictRequest.prototype.userEvent = null; /** - * PredictRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.retail.v2beta.PredictRequest - * @instance + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#setInventory}. + * @memberof google.cloud.retail.v2beta.ProductService + * @typedef SetInventoryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - PredictRequest.prototype.pageSize = 0; /** - * PredictRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.retail.v2beta.PredictRequest + * Calls SetInventory. + * @function setInventory + * @memberof google.cloud.retail.v2beta.ProductService * @instance + * @param {google.cloud.retail.v2beta.ISetInventoryRequest} request SetInventoryRequest message or plain object + * @param {google.cloud.retail.v2beta.ProductService.SetInventoryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - PredictRequest.prototype.pageToken = ""; + Object.defineProperty(ProductService.prototype.setInventory = function setInventory(request, callback) { + return this.rpcCall(setInventory, $root.google.cloud.retail.v2beta.SetInventoryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "SetInventory" }); /** - * PredictRequest filter. - * @member {string} filter - * @memberof google.cloud.retail.v2beta.PredictRequest + * Calls SetInventory. + * @function setInventory + * @memberof google.cloud.retail.v2beta.ProductService * @instance + * @param {google.cloud.retail.v2beta.ISetInventoryRequest} request SetInventoryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - PredictRequest.prototype.filter = ""; /** - * PredictRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.retail.v2beta.PredictRequest - * @instance + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#addFulfillmentPlaces}. + * @memberof google.cloud.retail.v2beta.ProductService + * @typedef AddFulfillmentPlacesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - PredictRequest.prototype.validateOnly = false; /** - * PredictRequest params. - * @member {Object.} params - * @memberof google.cloud.retail.v2beta.PredictRequest + * Calls AddFulfillmentPlaces. + * @function addFulfillmentPlaces + * @memberof google.cloud.retail.v2beta.ProductService * @instance + * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest} request AddFulfillmentPlacesRequest message or plain object + * @param {google.cloud.retail.v2beta.ProductService.AddFulfillmentPlacesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - PredictRequest.prototype.params = $util.emptyObject; + Object.defineProperty(ProductService.prototype.addFulfillmentPlaces = function addFulfillmentPlaces(request, callback) { + return this.rpcCall(addFulfillmentPlaces, $root.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AddFulfillmentPlaces" }); /** - * PredictRequest labels. - * @member {Object.} labels - * @memberof google.cloud.retail.v2beta.PredictRequest + * Calls AddFulfillmentPlaces. + * @function addFulfillmentPlaces + * @memberof google.cloud.retail.v2beta.ProductService * @instance + * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest} request AddFulfillmentPlacesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - PredictRequest.prototype.labels = $util.emptyObject; /** - * Creates a new PredictRequest instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.PredictRequest - * @static - * @param {google.cloud.retail.v2beta.IPredictRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.PredictRequest} PredictRequest instance + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#removeFulfillmentPlaces}. + * @memberof google.cloud.retail.v2beta.ProductService + * @typedef RemoveFulfillmentPlacesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - PredictRequest.create = function create(properties) { - return new PredictRequest(properties); - }; /** - * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.retail.v2beta.PredictRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.PredictRequest - * @static - * @param {google.cloud.retail.v2beta.IPredictRequest} message PredictRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls RemoveFulfillmentPlaces. + * @function removeFulfillmentPlaces + * @memberof google.cloud.retail.v2beta.ProductService + * @instance + * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesRequest} request RemoveFulfillmentPlacesRequest message or plain object + * @param {google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlacesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - PredictRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.placement); - if (message.userEvent != null && Object.hasOwnProperty.call(message, "userEvent")) - $root.google.cloud.retail.v2beta.UserEvent.encode(message.userEvent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.params[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - return writer; - }; + Object.defineProperty(ProductService.prototype.removeFulfillmentPlaces = function removeFulfillmentPlaces(request, callback) { + return this.rpcCall(removeFulfillmentPlaces, $root.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RemoveFulfillmentPlaces" }); /** - * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PredictRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.PredictRequest - * @static - * @param {google.cloud.retail.v2beta.IPredictRequest} message PredictRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls RemoveFulfillmentPlaces. + * @function removeFulfillmentPlaces + * @memberof google.cloud.retail.v2beta.ProductService + * @instance + * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesRequest} request RemoveFulfillmentPlacesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - PredictRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a PredictRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.PredictRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.PredictRequest} PredictRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#addLocalInventories}. + * @memberof google.cloud.retail.v2beta.ProductService + * @typedef AddLocalInventoriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - PredictRequest.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.v2beta.PredictRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.placement = reader.string(); - break; - case 2: - message.userEvent = $root.google.cloud.retail.v2beta.UserEvent.decode(reader, reader.uint32()); - break; - case 3: - message.pageSize = reader.int32(); - break; - case 4: - message.pageToken = reader.string(); - break; - case 5: - message.filter = reader.string(); - break; - case 6: - message.validateOnly = reader.bool(); - break; - case 7: - if (message.params === $util.emptyObject) - message.params = {}; - 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.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.params[key] = value; - break; - case 8: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a PredictRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.PredictRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.PredictRequest} PredictRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls AddLocalInventories. + * @function addLocalInventories + * @memberof google.cloud.retail.v2beta.ProductService + * @instance + * @param {google.cloud.retail.v2beta.IAddLocalInventoriesRequest} request AddLocalInventoriesRequest message or plain object + * @param {google.cloud.retail.v2beta.ProductService.AddLocalInventoriesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - PredictRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(ProductService.prototype.addLocalInventories = function addLocalInventories(request, callback) { + return this.rpcCall(addLocalInventories, $root.google.cloud.retail.v2beta.AddLocalInventoriesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AddLocalInventories" }); /** - * Verifies a PredictRequest message. - * @function verify - * @memberof google.cloud.retail.v2beta.PredictRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls AddLocalInventories. + * @function addLocalInventories + * @memberof google.cloud.retail.v2beta.ProductService + * @instance + * @param {google.cloud.retail.v2beta.IAddLocalInventoriesRequest} request AddLocalInventoriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - PredictRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.placement != null && message.hasOwnProperty("placement")) - if (!$util.isString(message.placement)) - return "placement: string expected"; - if (message.userEvent != null && message.hasOwnProperty("userEvent")) { - var error = $root.google.cloud.retail.v2beta.UserEvent.verify(message.userEvent); - if (error) - return "userEvent." + error; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.params != null && message.hasOwnProperty("params")) { - if (!$util.isObject(message.params)) - return "params: object expected"; - var key = Object.keys(message.params); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.params[key[i]]); - if (error) - return "params." + error; - } - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - return null; - }; /** - * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.PredictRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.PredictRequest} PredictRequest + * Callback as used by {@link google.cloud.retail.v2beta.ProductService#removeLocalInventories}. + * @memberof google.cloud.retail.v2beta.ProductService + * @typedef RemoveLocalInventoriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - PredictRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.PredictRequest) - return object; - var message = new $root.google.cloud.retail.v2beta.PredictRequest(); - if (object.placement != null) - message.placement = String(object.placement); - if (object.userEvent != null) { - if (typeof object.userEvent !== "object") - throw TypeError(".google.cloud.retail.v2beta.PredictRequest.userEvent: object expected"); - message.userEvent = $root.google.cloud.retail.v2beta.UserEvent.fromObject(object.userEvent); - } - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.params) { - if (typeof object.params !== "object") - throw TypeError(".google.cloud.retail.v2beta.PredictRequest.params: object expected"); - message.params = {}; - for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) { - if (typeof object.params[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2beta.PredictRequest.params: object expected"); - message.params[keys[i]] = $root.google.protobuf.Value.fromObject(object.params[keys[i]]); - } - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.retail.v2beta.PredictRequest.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - return message; - }; /** - * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.PredictRequest - * @static - * @param {google.cloud.retail.v2beta.PredictRequest} message PredictRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls RemoveLocalInventories. + * @function removeLocalInventories + * @memberof google.cloud.retail.v2beta.ProductService + * @instance + * @param {google.cloud.retail.v2beta.IRemoveLocalInventoriesRequest} request RemoveLocalInventoriesRequest message or plain object + * @param {google.cloud.retail.v2beta.ProductService.RemoveLocalInventoriesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - PredictRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.params = {}; - object.labels = {}; - } - if (options.defaults) { - object.placement = ""; - object.userEvent = null; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.validateOnly = false; - } - if (message.placement != null && message.hasOwnProperty("placement")) - object.placement = message.placement; - if (message.userEvent != null && message.hasOwnProperty("userEvent")) - object.userEvent = $root.google.cloud.retail.v2beta.UserEvent.toObject(message.userEvent, options); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - var keys2; - if (message.params && (keys2 = Object.keys(message.params)).length) { - object.params = {}; - for (var j = 0; j < keys2.length; ++j) - object.params[keys2[j]] = $root.google.protobuf.Value.toObject(message.params[keys2[j]], options); - } - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - return object; - }; + Object.defineProperty(ProductService.prototype.removeLocalInventories = function removeLocalInventories(request, callback) { + return this.rpcCall(removeLocalInventories, $root.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RemoveLocalInventories" }); /** - * Converts this PredictRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.PredictRequest + * Calls RemoveLocalInventories. + * @function removeLocalInventories + * @memberof google.cloud.retail.v2beta.ProductService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.retail.v2beta.IRemoveLocalInventoriesRequest} request RemoveLocalInventoriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - PredictRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return PredictRequest; + return ProductService; })(); - v2beta.PredictResponse = (function() { + v2beta.CreateProductRequest = (function() { /** - * Properties of a PredictResponse. + * Properties of a CreateProductRequest. * @memberof google.cloud.retail.v2beta - * @interface IPredictResponse - * @property {Array.|null} [results] PredictResponse results - * @property {string|null} [attributionToken] PredictResponse attributionToken - * @property {Array.|null} [missingIds] PredictResponse missingIds - * @property {boolean|null} [validateOnly] PredictResponse validateOnly + * @interface ICreateProductRequest + * @property {string|null} [parent] CreateProductRequest parent + * @property {google.cloud.retail.v2beta.IProduct|null} [product] CreateProductRequest product + * @property {string|null} [productId] CreateProductRequest productId */ /** - * Constructs a new PredictResponse. + * Constructs a new CreateProductRequest. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a PredictResponse. - * @implements IPredictResponse + * @classdesc Represents a CreateProductRequest. + * @implements ICreateProductRequest * @constructor - * @param {google.cloud.retail.v2beta.IPredictResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.ICreateProductRequest=} [properties] Properties to set */ - function PredictResponse(properties) { - this.results = []; - this.missingIds = []; + function CreateProductRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -69388,120 +82189,101 @@ } /** - * PredictResponse results. - * @member {Array.} results - * @memberof google.cloud.retail.v2beta.PredictResponse - * @instance - */ - PredictResponse.prototype.results = $util.emptyArray; - - /** - * PredictResponse attributionToken. - * @member {string} attributionToken - * @memberof google.cloud.retail.v2beta.PredictResponse + * CreateProductRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2beta.CreateProductRequest * @instance */ - PredictResponse.prototype.attributionToken = ""; + CreateProductRequest.prototype.parent = ""; /** - * PredictResponse missingIds. - * @member {Array.} missingIds - * @memberof google.cloud.retail.v2beta.PredictResponse + * CreateProductRequest product. + * @member {google.cloud.retail.v2beta.IProduct|null|undefined} product + * @memberof google.cloud.retail.v2beta.CreateProductRequest * @instance */ - PredictResponse.prototype.missingIds = $util.emptyArray; + CreateProductRequest.prototype.product = null; /** - * PredictResponse validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.retail.v2beta.PredictResponse + * CreateProductRequest productId. + * @member {string} productId + * @memberof google.cloud.retail.v2beta.CreateProductRequest * @instance */ - PredictResponse.prototype.validateOnly = false; + CreateProductRequest.prototype.productId = ""; /** - * Creates a new PredictResponse instance using the specified properties. + * Creates a new CreateProductRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.PredictResponse + * @memberof google.cloud.retail.v2beta.CreateProductRequest * @static - * @param {google.cloud.retail.v2beta.IPredictResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.PredictResponse} PredictResponse instance + * @param {google.cloud.retail.v2beta.ICreateProductRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.CreateProductRequest} CreateProductRequest instance */ - PredictResponse.create = function create(properties) { - return new PredictResponse(properties); + CreateProductRequest.create = function create(properties) { + return new CreateProductRequest(properties); }; /** - * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.retail.v2beta.PredictResponse.verify|verify} messages. + * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.retail.v2beta.CreateProductRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.PredictResponse + * @memberof google.cloud.retail.v2beta.CreateProductRequest * @static - * @param {google.cloud.retail.v2beta.IPredictResponse} message PredictResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.ICreateProductRequest} message CreateProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PredictResponse.encode = function encode(message, writer) { + CreateProductRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.results != null && message.results.length) - for (var i = 0; i < message.results.length; ++i) - $root.google.cloud.retail.v2beta.PredictResponse.PredictionResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributionToken); - if (message.missingIds != null && message.missingIds.length) - for (var i = 0; i < message.missingIds.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.missingIds[i]); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + $root.google.cloud.retail.v2beta.Product.encode(message.product, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.productId != null && Object.hasOwnProperty.call(message, "productId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.productId); return writer; }; /** - * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PredictResponse.verify|verify} messages. + * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CreateProductRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.PredictResponse + * @memberof google.cloud.retail.v2beta.CreateProductRequest * @static - * @param {google.cloud.retail.v2beta.IPredictResponse} message PredictResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.ICreateProductRequest} message CreateProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PredictResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PredictResponse message from the specified reader or buffer. + * Decodes a CreateProductRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.PredictResponse + * @memberof google.cloud.retail.v2beta.CreateProductRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.PredictResponse} PredictResponse + * @returns {google.cloud.retail.v2beta.CreateProductRequest} CreateProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PredictResponse.decode = function decode(reader, length) { + CreateProductRequest.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.v2beta.PredictResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.CreateProductRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.results && message.results.length)) - message.results = []; - message.results.push($root.google.cloud.retail.v2beta.PredictResponse.PredictionResult.decode(reader, reader.uint32())); + message.parent = reader.string(); break; case 2: - message.attributionToken = reader.string(); + message.product = $root.google.cloud.retail.v2beta.Product.decode(reader, reader.uint32()); break; case 3: - if (!(message.missingIds && message.missingIds.length)) - message.missingIds = []; - message.missingIds.push(reader.string()); - break; - case 4: - message.validateOnly = reader.bool(); + message.productId = reader.string(); break; default: reader.skipType(tag & 7); @@ -69512,749 +82294,558 @@ }; /** - * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.PredictResponse + * @memberof google.cloud.retail.v2beta.CreateProductRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.PredictResponse} PredictResponse + * @returns {google.cloud.retail.v2beta.CreateProductRequest} CreateProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PredictResponse.decodeDelimited = function decodeDelimited(reader) { + CreateProductRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PredictResponse message. + * Verifies a CreateProductRequest message. * @function verify - * @memberof google.cloud.retail.v2beta.PredictResponse + * @memberof google.cloud.retail.v2beta.CreateProductRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PredictResponse.verify = function verify(message) { + CreateProductRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.results != null && message.hasOwnProperty("results")) { - if (!Array.isArray(message.results)) - return "results: array expected"; - for (var i = 0; i < message.results.length; ++i) { - var error = $root.google.cloud.retail.v2beta.PredictResponse.PredictionResult.verify(message.results[i]); - if (error) - return "results." + error; - } - } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - if (!$util.isString(message.attributionToken)) - return "attributionToken: string expected"; - if (message.missingIds != null && message.hasOwnProperty("missingIds")) { - if (!Array.isArray(message.missingIds)) - return "missingIds: array expected"; - for (var i = 0; i < message.missingIds.length; ++i) - if (!$util.isString(message.missingIds[i])) - return "missingIds: string[] expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.retail.v2beta.Product.verify(message.product); + if (error) + return "product." + error; } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; + if (message.productId != null && message.hasOwnProperty("productId")) + if (!$util.isString(message.productId)) + return "productId: string expected"; return null; }; /** - * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateProductRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.PredictResponse + * @memberof google.cloud.retail.v2beta.CreateProductRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.PredictResponse} PredictResponse + * @returns {google.cloud.retail.v2beta.CreateProductRequest} CreateProductRequest */ - PredictResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.PredictResponse) + CreateProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.CreateProductRequest) return object; - var message = new $root.google.cloud.retail.v2beta.PredictResponse(); - if (object.results) { - if (!Array.isArray(object.results)) - throw TypeError(".google.cloud.retail.v2beta.PredictResponse.results: array expected"); - message.results = []; - for (var i = 0; i < object.results.length; ++i) { - if (typeof object.results[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.PredictResponse.results: object expected"); - message.results[i] = $root.google.cloud.retail.v2beta.PredictResponse.PredictionResult.fromObject(object.results[i]); - } - } - if (object.attributionToken != null) - message.attributionToken = String(object.attributionToken); - if (object.missingIds) { - if (!Array.isArray(object.missingIds)) - throw TypeError(".google.cloud.retail.v2beta.PredictResponse.missingIds: array expected"); - message.missingIds = []; - for (var i = 0; i < object.missingIds.length; ++i) - message.missingIds[i] = String(object.missingIds[i]); + var message = new $root.google.cloud.retail.v2beta.CreateProductRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.retail.v2beta.CreateProductRequest.product: object expected"); + message.product = $root.google.cloud.retail.v2beta.Product.fromObject(object.product); } - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); + if (object.productId != null) + message.productId = String(object.productId); return message; }; /** - * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.PredictResponse + * @memberof google.cloud.retail.v2beta.CreateProductRequest * @static - * @param {google.cloud.retail.v2beta.PredictResponse} message PredictResponse + * @param {google.cloud.retail.v2beta.CreateProductRequest} message CreateProductRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PredictResponse.toObject = function toObject(message, options) { + CreateProductRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.results = []; - object.missingIds = []; - } if (options.defaults) { - object.attributionToken = ""; - object.validateOnly = false; - } - if (message.results && message.results.length) { - object.results = []; - for (var j = 0; j < message.results.length; ++j) - object.results[j] = $root.google.cloud.retail.v2beta.PredictResponse.PredictionResult.toObject(message.results[j], options); - } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - object.attributionToken = message.attributionToken; - if (message.missingIds && message.missingIds.length) { - object.missingIds = []; - for (var j = 0; j < message.missingIds.length; ++j) - object.missingIds[j] = message.missingIds[j]; + object.parent = ""; + object.product = null; + object.productId = ""; } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.retail.v2beta.Product.toObject(message.product, options); + if (message.productId != null && message.hasOwnProperty("productId")) + object.productId = message.productId; return object; }; /** - * Converts this PredictResponse to JSON. + * Converts this CreateProductRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.PredictResponse + * @memberof google.cloud.retail.v2beta.CreateProductRequest * @instance * @returns {Object.} JSON object */ - PredictResponse.prototype.toJSON = function toJSON() { + CreateProductRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - PredictResponse.PredictionResult = (function() { - - /** - * Properties of a PredictionResult. - * @memberof google.cloud.retail.v2beta.PredictResponse - * @interface IPredictionResult - * @property {string|null} [id] PredictionResult id - * @property {Object.|null} [metadata] PredictionResult metadata - */ - - /** - * Constructs a new PredictionResult. - * @memberof google.cloud.retail.v2beta.PredictResponse - * @classdesc Represents a PredictionResult. - * @implements IPredictionResult - * @constructor - * @param {google.cloud.retail.v2beta.PredictResponse.IPredictionResult=} [properties] Properties to set - */ - function PredictionResult(properties) { - this.metadata = {}; - 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]]; - } - - /** - * PredictionResult id. - * @member {string} id - * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult - * @instance - */ - PredictionResult.prototype.id = ""; - - /** - * PredictionResult metadata. - * @member {Object.} metadata - * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult - * @instance - */ - PredictionResult.prototype.metadata = $util.emptyObject; - - /** - * Creates a new PredictionResult instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult - * @static - * @param {google.cloud.retail.v2beta.PredictResponse.IPredictionResult=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.PredictResponse.PredictionResult} PredictionResult instance - */ - PredictionResult.create = function create(properties) { - return new PredictionResult(properties); - }; - - /** - * Encodes the specified PredictionResult message. Does not implicitly {@link google.cloud.retail.v2beta.PredictResponse.PredictionResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult - * @static - * @param {google.cloud.retail.v2beta.PredictResponse.IPredictionResult} message PredictionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PredictionResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.metadata[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified PredictionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PredictResponse.PredictionResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult - * @static - * @param {google.cloud.retail.v2beta.PredictResponse.IPredictionResult} message PredictionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PredictionResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PredictionResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.PredictResponse.PredictionResult} PredictionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PredictionResult.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.v2beta.PredictResponse.PredictionResult(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - if (message.metadata === $util.emptyObject) - message.metadata = {}; - 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.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.metadata[key] = value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PredictionResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.PredictResponse.PredictionResult} PredictionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PredictionResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PredictionResult message. - * @function verify - * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PredictionResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - if (!$util.isObject(message.metadata)) - return "metadata: object expected"; - var key = Object.keys(message.metadata); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.metadata[key[i]]); - if (error) - return "metadata." + error; - } - } - return null; - }; - - /** - * Creates a PredictionResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.PredictResponse.PredictionResult} PredictionResult - */ - PredictionResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.PredictResponse.PredictionResult) - return object; - var message = new $root.google.cloud.retail.v2beta.PredictResponse.PredictionResult(); - if (object.id != null) - message.id = String(object.id); - if (object.metadata) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.retail.v2beta.PredictResponse.PredictionResult.metadata: object expected"); - message.metadata = {}; - for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) { - if (typeof object.metadata[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2beta.PredictResponse.PredictionResult.metadata: object expected"); - message.metadata[keys[i]] = $root.google.protobuf.Value.fromObject(object.metadata[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a PredictionResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult - * @static - * @param {google.cloud.retail.v2beta.PredictResponse.PredictionResult} message PredictionResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PredictionResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.metadata = {}; - if (options.defaults) - object.id = ""; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - var keys2; - if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { - object.metadata = {}; - for (var j = 0; j < keys2.length; ++j) - object.metadata[keys2[j]] = $root.google.protobuf.Value.toObject(message.metadata[keys2[j]], options); - } - return object; - }; - - /** - * Converts this PredictionResult to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.PredictResponse.PredictionResult - * @instance - * @returns {Object.} JSON object - */ - PredictionResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PredictionResult; - })(); - - return PredictResponse; + return CreateProductRequest; })(); - v2beta.ProductService = (function() { + v2beta.GetProductRequest = (function() { /** - * Constructs a new ProductService service. + * Properties of a GetProductRequest. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a ProductService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function ProductService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (ProductService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ProductService; - - /** - * Creates new ProductService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.retail.v2beta.ProductService - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {ProductService} RPC service. Useful where requests and/or responses are streamed. - */ - ProductService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#createProduct}. - * @memberof google.cloud.retail.v2beta.ProductService - * @typedef CreateProductCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2beta.Product} [response] Product - */ - - /** - * Calls CreateProduct. - * @function createProduct - * @memberof google.cloud.retail.v2beta.ProductService - * @instance - * @param {google.cloud.retail.v2beta.ICreateProductRequest} request CreateProductRequest message or plain object - * @param {google.cloud.retail.v2beta.ProductService.CreateProductCallback} callback Node-style callback called with the error, if any, and Product - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ProductService.prototype.createProduct = function createProduct(request, callback) { - return this.rpcCall(createProduct, $root.google.cloud.retail.v2beta.CreateProductRequest, $root.google.cloud.retail.v2beta.Product, request, callback); - }, "name", { value: "CreateProduct" }); - - /** - * Calls CreateProduct. - * @function createProduct - * @memberof google.cloud.retail.v2beta.ProductService - * @instance - * @param {google.cloud.retail.v2beta.ICreateProductRequest} request CreateProductRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @interface IGetProductRequest + * @property {string|null} [name] GetProductRequest name */ /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#getProduct}. - * @memberof google.cloud.retail.v2beta.ProductService - * @typedef GetProductCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2beta.Product} [response] Product + * Constructs a new GetProductRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a GetProductRequest. + * @implements IGetProductRequest + * @constructor + * @param {google.cloud.retail.v2beta.IGetProductRequest=} [properties] Properties to set */ + function GetProductRequest(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]]; + } /** - * Calls GetProduct. - * @function getProduct - * @memberof google.cloud.retail.v2beta.ProductService + * GetProductRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2beta.GetProductRequest * @instance - * @param {google.cloud.retail.v2beta.IGetProductRequest} request GetProductRequest message or plain object - * @param {google.cloud.retail.v2beta.ProductService.GetProductCallback} callback Node-style callback called with the error, if any, and Product - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(ProductService.prototype.getProduct = function getProduct(request, callback) { - return this.rpcCall(getProduct, $root.google.cloud.retail.v2beta.GetProductRequest, $root.google.cloud.retail.v2beta.Product, request, callback); - }, "name", { value: "GetProduct" }); + GetProductRequest.prototype.name = ""; /** - * Calls GetProduct. - * @function getProduct - * @memberof google.cloud.retail.v2beta.ProductService - * @instance - * @param {google.cloud.retail.v2beta.IGetProductRequest} request GetProductRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new GetProductRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.GetProductRequest + * @static + * @param {google.cloud.retail.v2beta.IGetProductRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.GetProductRequest} GetProductRequest instance */ + GetProductRequest.create = function create(properties) { + return new GetProductRequest(properties); + }; /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#listProducts}. - * @memberof google.cloud.retail.v2beta.ProductService - * @typedef ListProductsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2beta.ListProductsResponse} [response] ListProductsResponse + * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.retail.v2beta.GetProductRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.GetProductRequest + * @static + * @param {google.cloud.retail.v2beta.IGetProductRequest} message GetProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + GetProductRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; /** - * Calls ListProducts. - * @function listProducts - * @memberof google.cloud.retail.v2beta.ProductService - * @instance - * @param {google.cloud.retail.v2beta.IListProductsRequest} request ListProductsRequest message or plain object - * @param {google.cloud.retail.v2beta.ProductService.ListProductsCallback} callback Node-style callback called with the error, if any, and ListProductsResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetProductRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.GetProductRequest + * @static + * @param {google.cloud.retail.v2beta.IGetProductRequest} message GetProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(ProductService.prototype.listProducts = function listProducts(request, callback) { - return this.rpcCall(listProducts, $root.google.cloud.retail.v2beta.ListProductsRequest, $root.google.cloud.retail.v2beta.ListProductsResponse, request, callback); - }, "name", { value: "ListProducts" }); + GetProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls ListProducts. - * @function listProducts - * @memberof google.cloud.retail.v2beta.ProductService - * @instance - * @param {google.cloud.retail.v2beta.IListProductsRequest} request ListProductsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a GetProductRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.GetProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.GetProductRequest} GetProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetProductRequest.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.v2beta.GetProductRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#updateProduct}. - * @memberof google.cloud.retail.v2beta.ProductService - * @typedef UpdateProductCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2beta.Product} [response] Product + * Decodes a GetProductRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.GetProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.GetProductRequest} GetProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetProductRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls UpdateProduct. - * @function updateProduct - * @memberof google.cloud.retail.v2beta.ProductService - * @instance - * @param {google.cloud.retail.v2beta.IUpdateProductRequest} request UpdateProductRequest message or plain object - * @param {google.cloud.retail.v2beta.ProductService.UpdateProductCallback} callback Node-style callback called with the error, if any, and Product - * @returns {undefined} - * @variation 1 + * Verifies a GetProductRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.GetProductRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(ProductService.prototype.updateProduct = function updateProduct(request, callback) { - return this.rpcCall(updateProduct, $root.google.cloud.retail.v2beta.UpdateProductRequest, $root.google.cloud.retail.v2beta.Product, request, callback); - }, "name", { value: "UpdateProduct" }); + GetProductRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; /** - * Calls UpdateProduct. - * @function updateProduct - * @memberof google.cloud.retail.v2beta.ProductService - * @instance - * @param {google.cloud.retail.v2beta.IUpdateProductRequest} request UpdateProductRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a GetProductRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.GetProductRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.GetProductRequest} GetProductRequest */ + GetProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.GetProductRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.GetProductRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#deleteProduct}. - * @memberof google.cloud.retail.v2beta.ProductService - * @typedef DeleteProductCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.GetProductRequest + * @static + * @param {google.cloud.retail.v2beta.GetProductRequest} message GetProductRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + GetProductRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; /** - * Calls DeleteProduct. - * @function deleteProduct - * @memberof google.cloud.retail.v2beta.ProductService + * Converts this GetProductRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.GetProductRequest * @instance - * @param {google.cloud.retail.v2beta.IDeleteProductRequest} request DeleteProductRequest message or plain object - * @param {google.cloud.retail.v2beta.ProductService.DeleteProductCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(ProductService.prototype.deleteProduct = function deleteProduct(request, callback) { - return this.rpcCall(deleteProduct, $root.google.cloud.retail.v2beta.DeleteProductRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteProduct" }); + GetProductRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProductRequest; + })(); + + v2beta.UpdateProductRequest = (function() { /** - * Calls DeleteProduct. - * @function deleteProduct - * @memberof google.cloud.retail.v2beta.ProductService - * @instance - * @param {google.cloud.retail.v2beta.IDeleteProductRequest} request DeleteProductRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of an UpdateProductRequest. + * @memberof google.cloud.retail.v2beta + * @interface IUpdateProductRequest + * @property {google.cloud.retail.v2beta.IProduct|null} [product] UpdateProductRequest product + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProductRequest updateMask + * @property {boolean|null} [allowMissing] UpdateProductRequest allowMissing */ /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#importProducts}. - * @memberof google.cloud.retail.v2beta.ProductService - * @typedef ImportProductsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Constructs a new UpdateProductRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents an UpdateProductRequest. + * @implements IUpdateProductRequest + * @constructor + * @param {google.cloud.retail.v2beta.IUpdateProductRequest=} [properties] Properties to set */ + function UpdateProductRequest(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]]; + } /** - * Calls ImportProducts. - * @function importProducts - * @memberof google.cloud.retail.v2beta.ProductService + * UpdateProductRequest product. + * @member {google.cloud.retail.v2beta.IProduct|null|undefined} product + * @memberof google.cloud.retail.v2beta.UpdateProductRequest * @instance - * @param {google.cloud.retail.v2beta.IImportProductsRequest} request ImportProductsRequest message or plain object - * @param {google.cloud.retail.v2beta.ProductService.ImportProductsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(ProductService.prototype.importProducts = function importProducts(request, callback) { - return this.rpcCall(importProducts, $root.google.cloud.retail.v2beta.ImportProductsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportProducts" }); + UpdateProductRequest.prototype.product = null; /** - * Calls ImportProducts. - * @function importProducts - * @memberof google.cloud.retail.v2beta.ProductService + * UpdateProductRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2beta.UpdateProductRequest * @instance - * @param {google.cloud.retail.v2beta.IImportProductsRequest} request ImportProductsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + UpdateProductRequest.prototype.updateMask = null; /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#setInventory}. - * @memberof google.cloud.retail.v2beta.ProductService - * @typedef SetInventoryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * UpdateProductRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @instance */ + UpdateProductRequest.prototype.allowMissing = false; /** - * Calls SetInventory. - * @function setInventory - * @memberof google.cloud.retail.v2beta.ProductService - * @instance - * @param {google.cloud.retail.v2beta.ISetInventoryRequest} request SetInventoryRequest message or plain object - * @param {google.cloud.retail.v2beta.ProductService.SetInventoryCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Creates a new UpdateProductRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @static + * @param {google.cloud.retail.v2beta.IUpdateProductRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.UpdateProductRequest} UpdateProductRequest instance */ - Object.defineProperty(ProductService.prototype.setInventory = function setInventory(request, callback) { - return this.rpcCall(setInventory, $root.google.cloud.retail.v2beta.SetInventoryRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "SetInventory" }); + UpdateProductRequest.create = function create(properties) { + return new UpdateProductRequest(properties); + }; /** - * Calls SetInventory. - * @function setInventory - * @memberof google.cloud.retail.v2beta.ProductService - * @instance - * @param {google.cloud.retail.v2beta.ISetInventoryRequest} request SetInventoryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.retail.v2beta.UpdateProductRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @static + * @param {google.cloud.retail.v2beta.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + UpdateProductRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + $root.google.cloud.retail.v2beta.Product.encode(message.product, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + return writer; + }; /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#addFulfillmentPlaces}. - * @memberof google.cloud.retail.v2beta.ProductService - * @typedef AddFulfillmentPlacesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Encodes the specified UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UpdateProductRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @static + * @param {google.cloud.retail.v2beta.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + UpdateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls AddFulfillmentPlaces. - * @function addFulfillmentPlaces - * @memberof google.cloud.retail.v2beta.ProductService - * @instance - * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest} request AddFulfillmentPlacesRequest message or plain object - * @param {google.cloud.retail.v2beta.ProductService.AddFulfillmentPlacesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Decodes an UpdateProductRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.UpdateProductRequest} UpdateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(ProductService.prototype.addFulfillmentPlaces = function addFulfillmentPlaces(request, callback) { - return this.rpcCall(addFulfillmentPlaces, $root.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "AddFulfillmentPlaces" }); + UpdateProductRequest.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.v2beta.UpdateProductRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.product = $root.google.cloud.retail.v2beta.Product.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.allowMissing = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls AddFulfillmentPlaces. - * @function addFulfillmentPlaces - * @memberof google.cloud.retail.v2beta.ProductService - * @instance - * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest} request AddFulfillmentPlacesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.UpdateProductRequest} UpdateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + UpdateProductRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Callback as used by {@link google.cloud.retail.v2beta.ProductService#removeFulfillmentPlaces}. - * @memberof google.cloud.retail.v2beta.ProductService - * @typedef RemoveFulfillmentPlacesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Verifies an UpdateProductRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateProductRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.retail.v2beta.Product.verify(message.product); + if (error) + return "product." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateProductRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.UpdateProductRequest} UpdateProductRequest */ + UpdateProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.UpdateProductRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.UpdateProductRequest(); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.retail.v2beta.UpdateProductRequest.product: object expected"); + message.product = $root.google.cloud.retail.v2beta.Product.fromObject(object.product); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2beta.UpdateProductRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; /** - * Calls RemoveFulfillmentPlaces. - * @function removeFulfillmentPlaces - * @memberof google.cloud.retail.v2beta.ProductService - * @instance - * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesRequest} request RemoveFulfillmentPlacesRequest message or plain object - * @param {google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlacesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @static + * @param {google.cloud.retail.v2beta.UpdateProductRequest} message UpdateProductRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(ProductService.prototype.removeFulfillmentPlaces = function removeFulfillmentPlaces(request, callback) { - return this.rpcCall(removeFulfillmentPlaces, $root.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RemoveFulfillmentPlaces" }); + UpdateProductRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.product = null; + object.updateMask = null; + object.allowMissing = false; + } + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.retail.v2beta.Product.toObject(message.product, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; /** - * Calls RemoveFulfillmentPlaces. - * @function removeFulfillmentPlaces - * @memberof google.cloud.retail.v2beta.ProductService + * Converts this UpdateProductRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.UpdateProductRequest * @instance - * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesRequest} request RemoveFulfillmentPlacesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + UpdateProductRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ProductService; + return UpdateProductRequest; })(); - v2beta.CreateProductRequest = (function() { + v2beta.DeleteProductRequest = (function() { /** - * Properties of a CreateProductRequest. + * Properties of a DeleteProductRequest. * @memberof google.cloud.retail.v2beta - * @interface ICreateProductRequest - * @property {string|null} [parent] CreateProductRequest parent - * @property {google.cloud.retail.v2beta.IProduct|null} [product] CreateProductRequest product - * @property {string|null} [productId] CreateProductRequest productId + * @interface IDeleteProductRequest + * @property {string|null} [name] DeleteProductRequest name */ /** - * Constructs a new CreateProductRequest. + * Constructs a new DeleteProductRequest. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a CreateProductRequest. - * @implements ICreateProductRequest + * @classdesc Represents a DeleteProductRequest. + * @implements IDeleteProductRequest * @constructor - * @param {google.cloud.retail.v2beta.ICreateProductRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IDeleteProductRequest=} [properties] Properties to set */ - function CreateProductRequest(properties) { + function DeleteProductRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -70262,101 +82853,75 @@ } /** - * CreateProductRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2beta.CreateProductRequest - * @instance - */ - CreateProductRequest.prototype.parent = ""; - - /** - * CreateProductRequest product. - * @member {google.cloud.retail.v2beta.IProduct|null|undefined} product - * @memberof google.cloud.retail.v2beta.CreateProductRequest - * @instance - */ - CreateProductRequest.prototype.product = null; - - /** - * CreateProductRequest productId. - * @member {string} productId - * @memberof google.cloud.retail.v2beta.CreateProductRequest + * DeleteProductRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2beta.DeleteProductRequest * @instance */ - CreateProductRequest.prototype.productId = ""; + DeleteProductRequest.prototype.name = ""; /** - * Creates a new CreateProductRequest instance using the specified properties. + * Creates a new DeleteProductRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.CreateProductRequest + * @memberof google.cloud.retail.v2beta.DeleteProductRequest * @static - * @param {google.cloud.retail.v2beta.ICreateProductRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.CreateProductRequest} CreateProductRequest instance + * @param {google.cloud.retail.v2beta.IDeleteProductRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.DeleteProductRequest} DeleteProductRequest instance */ - CreateProductRequest.create = function create(properties) { - return new CreateProductRequest(properties); + DeleteProductRequest.create = function create(properties) { + return new DeleteProductRequest(properties); }; /** - * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.retail.v2beta.CreateProductRequest.verify|verify} messages. + * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.retail.v2beta.DeleteProductRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.CreateProductRequest + * @memberof google.cloud.retail.v2beta.DeleteProductRequest * @static - * @param {google.cloud.retail.v2beta.ICreateProductRequest} message CreateProductRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateProductRequest.encode = function encode(message, writer) { + DeleteProductRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - $root.google.cloud.retail.v2beta.Product.encode(message.product, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.productId != null && Object.hasOwnProperty.call(message, "productId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.productId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CreateProductRequest.verify|verify} messages. + * Encodes the specified DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.DeleteProductRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.CreateProductRequest + * @memberof google.cloud.retail.v2beta.DeleteProductRequest * @static - * @param {google.cloud.retail.v2beta.ICreateProductRequest} message CreateProductRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteProductRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateProductRequest message from the specified reader or buffer. + * Decodes a DeleteProductRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.CreateProductRequest + * @memberof google.cloud.retail.v2beta.DeleteProductRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.CreateProductRequest} CreateProductRequest + * @returns {google.cloud.retail.v2beta.DeleteProductRequest} DeleteProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateProductRequest.decode = function decode(reader, length) { + DeleteProductRequest.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.v2beta.CreateProductRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.DeleteProductRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.product = $root.google.cloud.retail.v2beta.Product.decode(reader, reader.uint32()); - break; - case 3: - message.productId = reader.string(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -70367,129 +82932,111 @@ }; /** - * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteProductRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.CreateProductRequest + * @memberof google.cloud.retail.v2beta.DeleteProductRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.CreateProductRequest} CreateProductRequest + * @returns {google.cloud.retail.v2beta.DeleteProductRequest} DeleteProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateProductRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteProductRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateProductRequest message. + * Verifies a DeleteProductRequest message. * @function verify - * @memberof google.cloud.retail.v2beta.CreateProductRequest + * @memberof google.cloud.retail.v2beta.DeleteProductRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateProductRequest.verify = function verify(message) { + DeleteProductRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.product != null && message.hasOwnProperty("product")) { - var error = $root.google.cloud.retail.v2beta.Product.verify(message.product); - if (error) - return "product." + error; - } - if (message.productId != null && message.hasOwnProperty("productId")) - if (!$util.isString(message.productId)) - return "productId: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteProductRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.CreateProductRequest + * @memberof google.cloud.retail.v2beta.DeleteProductRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.CreateProductRequest} CreateProductRequest + * @returns {google.cloud.retail.v2beta.DeleteProductRequest} DeleteProductRequest */ - CreateProductRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.CreateProductRequest) + DeleteProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.DeleteProductRequest) return object; - var message = new $root.google.cloud.retail.v2beta.CreateProductRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.product != null) { - if (typeof object.product !== "object") - throw TypeError(".google.cloud.retail.v2beta.CreateProductRequest.product: object expected"); - message.product = $root.google.cloud.retail.v2beta.Product.fromObject(object.product); - } - if (object.productId != null) - message.productId = String(object.productId); + var message = new $root.google.cloud.retail.v2beta.DeleteProductRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.CreateProductRequest + * @memberof google.cloud.retail.v2beta.DeleteProductRequest * @static - * @param {google.cloud.retail.v2beta.CreateProductRequest} message CreateProductRequest + * @param {google.cloud.retail.v2beta.DeleteProductRequest} message DeleteProductRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateProductRequest.toObject = function toObject(message, options) { + DeleteProductRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.product = null; - object.productId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.product != null && message.hasOwnProperty("product")) - object.product = $root.google.cloud.retail.v2beta.Product.toObject(message.product, options); - if (message.productId != null && message.hasOwnProperty("productId")) - object.productId = message.productId; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateProductRequest to JSON. + * Converts this DeleteProductRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.CreateProductRequest + * @memberof google.cloud.retail.v2beta.DeleteProductRequest * @instance * @returns {Object.} JSON object */ - CreateProductRequest.prototype.toJSON = function toJSON() { + DeleteProductRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateProductRequest; + return DeleteProductRequest; })(); - v2beta.GetProductRequest = (function() { + v2beta.ListProductsRequest = (function() { /** - * Properties of a GetProductRequest. + * Properties of a ListProductsRequest. * @memberof google.cloud.retail.v2beta - * @interface IGetProductRequest - * @property {string|null} [name] GetProductRequest name + * @interface IListProductsRequest + * @property {string|null} [parent] ListProductsRequest parent + * @property {number|null} [pageSize] ListProductsRequest pageSize + * @property {string|null} [pageToken] ListProductsRequest pageToken + * @property {string|null} [filter] ListProductsRequest filter + * @property {google.protobuf.IFieldMask|null} [readMask] ListProductsRequest readMask */ /** - * Constructs a new GetProductRequest. + * Constructs a new ListProductsRequest. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a GetProductRequest. - * @implements IGetProductRequest + * @classdesc Represents a ListProductsRequest. + * @implements IListProductsRequest * @constructor - * @param {google.cloud.retail.v2beta.IGetProductRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IListProductsRequest=} [properties] Properties to set */ - function GetProductRequest(properties) { + function ListProductsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -70497,75 +83044,127 @@ } /** - * GetProductRequest name. - * @member {string} name - * @memberof google.cloud.retail.v2beta.GetProductRequest + * ListProductsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2beta.ListProductsRequest * @instance */ - GetProductRequest.prototype.name = ""; + ListProductsRequest.prototype.parent = ""; /** - * Creates a new GetProductRequest instance using the specified properties. + * ListProductsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.retail.v2beta.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.pageSize = 0; + + /** + * ListProductsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.retail.v2beta.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.pageToken = ""; + + /** + * ListProductsRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2beta.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.filter = ""; + + /** + * ListProductsRequest readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.cloud.retail.v2beta.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.readMask = null; + + /** + * Creates a new ListProductsRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.GetProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsRequest * @static - * @param {google.cloud.retail.v2beta.IGetProductRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.GetProductRequest} GetProductRequest instance + * @param {google.cloud.retail.v2beta.IListProductsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ListProductsRequest} ListProductsRequest instance */ - GetProductRequest.create = function create(properties) { - return new GetProductRequest(properties); + ListProductsRequest.create = function create(properties) { + return new ListProductsRequest(properties); }; /** - * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.retail.v2beta.GetProductRequest.verify|verify} messages. + * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ListProductsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.GetProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsRequest * @static - * @param {google.cloud.retail.v2beta.IGetProductRequest} message GetProductRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IListProductsRequest} message ListProductsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetProductRequest.encode = function encode(message, writer) { + ListProductsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetProductRequest.verify|verify} messages. + * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListProductsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.GetProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsRequest * @static - * @param {google.cloud.retail.v2beta.IGetProductRequest} message GetProductRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IListProductsRequest} message ListProductsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetProductRequest message from the specified reader or buffer. + * Decodes a ListProductsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.GetProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.GetProductRequest} GetProductRequest + * @returns {google.cloud.retail.v2beta.ListProductsRequest} ListProductsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetProductRequest.decode = function decode(reader, length) { + ListProductsRequest.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.v2beta.GetProductRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.ListProductsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + case 5: + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -70576,109 +83175,147 @@ }; /** - * Decodes a GetProductRequest message from the specified reader or buffer, length delimited. + * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.GetProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.GetProductRequest} GetProductRequest + * @returns {google.cloud.retail.v2beta.ListProductsRequest} ListProductsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetProductRequest.decodeDelimited = function decodeDelimited(reader) { + ListProductsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetProductRequest message. + * Verifies a ListProductsRequest message. * @function verify - * @memberof google.cloud.retail.v2beta.GetProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetProductRequest.verify = function verify(message) { + ListProductsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.readMask != null && message.hasOwnProperty("readMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.readMask); + if (error) + return "readMask." + error; + } return null; }; /** - * Creates a GetProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListProductsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.GetProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.GetProductRequest} GetProductRequest + * @returns {google.cloud.retail.v2beta.ListProductsRequest} ListProductsRequest */ - GetProductRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.GetProductRequest) + ListProductsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ListProductsRequest) return object; - var message = new $root.google.cloud.retail.v2beta.GetProductRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.retail.v2beta.ListProductsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.cloud.retail.v2beta.ListProductsRequest.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + } return message; }; /** - * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.GetProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsRequest * @static - * @param {google.cloud.retail.v2beta.GetProductRequest} message GetProductRequest + * @param {google.cloud.retail.v2beta.ListProductsRequest} message ListProductsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetProductRequest.toObject = function toObject(message, options) { + ListProductsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.readMask = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.readMask != null && message.hasOwnProperty("readMask")) + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); return object; }; /** - * Converts this GetProductRequest to JSON. + * Converts this ListProductsRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.GetProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsRequest * @instance * @returns {Object.} JSON object */ - GetProductRequest.prototype.toJSON = function toJSON() { + ListProductsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetProductRequest; + return ListProductsRequest; })(); - v2beta.UpdateProductRequest = (function() { + v2beta.ListProductsResponse = (function() { /** - * Properties of an UpdateProductRequest. + * Properties of a ListProductsResponse. * @memberof google.cloud.retail.v2beta - * @interface IUpdateProductRequest - * @property {google.cloud.retail.v2beta.IProduct|null} [product] UpdateProductRequest product - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProductRequest updateMask - * @property {boolean|null} [allowMissing] UpdateProductRequest allowMissing + * @interface IListProductsResponse + * @property {Array.|null} [products] ListProductsResponse products + * @property {string|null} [nextPageToken] ListProductsResponse nextPageToken */ /** - * Constructs a new UpdateProductRequest. + * Constructs a new ListProductsResponse. * @memberof google.cloud.retail.v2beta - * @classdesc Represents an UpdateProductRequest. - * @implements IUpdateProductRequest + * @classdesc Represents a ListProductsResponse. + * @implements IListProductsResponse * @constructor - * @param {google.cloud.retail.v2beta.IUpdateProductRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IListProductsResponse=} [properties] Properties to set */ - function UpdateProductRequest(properties) { + function ListProductsResponse(properties) { + this.products = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -70686,101 +83323,91 @@ } /** - * UpdateProductRequest product. - * @member {google.cloud.retail.v2beta.IProduct|null|undefined} product - * @memberof google.cloud.retail.v2beta.UpdateProductRequest - * @instance - */ - UpdateProductRequest.prototype.product = null; - - /** - * UpdateProductRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * ListProductsResponse products. + * @member {Array.} products + * @memberof google.cloud.retail.v2beta.ListProductsResponse * @instance */ - UpdateProductRequest.prototype.updateMask = null; + ListProductsResponse.prototype.products = $util.emptyArray; /** - * UpdateProductRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * ListProductsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.retail.v2beta.ListProductsResponse * @instance */ - UpdateProductRequest.prototype.allowMissing = false; + ListProductsResponse.prototype.nextPageToken = ""; /** - * Creates a new UpdateProductRequest instance using the specified properties. + * Creates a new ListProductsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsResponse * @static - * @param {google.cloud.retail.v2beta.IUpdateProductRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.UpdateProductRequest} UpdateProductRequest instance + * @param {google.cloud.retail.v2beta.IListProductsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ListProductsResponse} ListProductsResponse instance */ - UpdateProductRequest.create = function create(properties) { - return new UpdateProductRequest(properties); + ListProductsResponse.create = function create(properties) { + return new ListProductsResponse(properties); }; /** - * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.retail.v2beta.UpdateProductRequest.verify|verify} messages. + * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ListProductsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsResponse * @static - * @param {google.cloud.retail.v2beta.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IListProductsResponse} message ListProductsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateProductRequest.encode = function encode(message, writer) { + ListProductsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - $root.google.cloud.retail.v2beta.Product.encode(message.product, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + if (message.products != null && message.products.length) + for (var i = 0; i < message.products.length; ++i) + $root.google.cloud.retail.v2beta.Product.encode(message.products[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UpdateProductRequest.verify|verify} messages. + * Encodes the specified ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListProductsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsResponse * @static - * @param {google.cloud.retail.v2beta.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IListProductsResponse} message ListProductsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateProductRequest message from the specified reader or buffer. + * Decodes a ListProductsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.UpdateProductRequest} UpdateProductRequest + * @returns {google.cloud.retail.v2beta.ListProductsResponse} ListProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateProductRequest.decode = function decode(reader, length) { + ListProductsResponse.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.v2beta.UpdateProductRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.ListProductsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.product = $root.google.cloud.retail.v2beta.Product.decode(reader, reader.uint32()); + if (!(message.products && message.products.length)) + message.products = []; + message.products.push($root.google.cloud.retail.v2beta.Product.decode(reader, reader.uint32())); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 3: - message.allowMissing = reader.bool(); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -70791,134 +83418,136 @@ }; /** - * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. + * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.UpdateProductRequest} UpdateProductRequest + * @returns {google.cloud.retail.v2beta.ListProductsResponse} ListProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateProductRequest.decodeDelimited = function decodeDelimited(reader) { + ListProductsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateProductRequest message. + * Verifies a ListProductsResponse message. * @function verify - * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateProductRequest.verify = function verify(message) { + ListProductsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.product != null && message.hasOwnProperty("product")) { - var error = $root.google.cloud.retail.v2beta.Product.verify(message.product); - if (error) - return "product." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.products != null && message.hasOwnProperty("products")) { + if (!Array.isArray(message.products)) + return "products: array expected"; + for (var i = 0; i < message.products.length; ++i) { + var error = $root.google.cloud.retail.v2beta.Product.verify(message.products[i]); + if (error) + return "products." + error; + } } - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an UpdateProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.UpdateProductRequest} UpdateProductRequest + * @returns {google.cloud.retail.v2beta.ListProductsResponse} ListProductsResponse */ - UpdateProductRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.UpdateProductRequest) + ListProductsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ListProductsResponse) return object; - var message = new $root.google.cloud.retail.v2beta.UpdateProductRequest(); - if (object.product != null) { - if (typeof object.product !== "object") - throw TypeError(".google.cloud.retail.v2beta.UpdateProductRequest.product: object expected"); - message.product = $root.google.cloud.retail.v2beta.Product.fromObject(object.product); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.retail.v2beta.UpdateProductRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.retail.v2beta.ListProductsResponse(); + if (object.products) { + if (!Array.isArray(object.products)) + throw TypeError(".google.cloud.retail.v2beta.ListProductsResponse.products: array expected"); + message.products = []; + for (var i = 0; i < object.products.length; ++i) { + if (typeof object.products[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.ListProductsResponse.products: object expected"); + message.products[i] = $root.google.cloud.retail.v2beta.Product.fromObject(object.products[i]); + } } - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsResponse * @static - * @param {google.cloud.retail.v2beta.UpdateProductRequest} message UpdateProductRequest + * @param {google.cloud.retail.v2beta.ListProductsResponse} message ListProductsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateProductRequest.toObject = function toObject(message, options) { + ListProductsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.product = null; - object.updateMask = null; - object.allowMissing = false; + if (options.arrays || options.defaults) + object.products = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.products && message.products.length) { + object.products = []; + for (var j = 0; j < message.products.length; ++j) + object.products[j] = $root.google.cloud.retail.v2beta.Product.toObject(message.products[j], options); } - if (message.product != null && message.hasOwnProperty("product")) - object.product = $root.google.cloud.retail.v2beta.Product.toObject(message.product, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this UpdateProductRequest to JSON. + * Converts this ListProductsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.UpdateProductRequest + * @memberof google.cloud.retail.v2beta.ListProductsResponse * @instance * @returns {Object.} JSON object */ - UpdateProductRequest.prototype.toJSON = function toJSON() { + ListProductsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateProductRequest; + return ListProductsResponse; })(); - v2beta.DeleteProductRequest = (function() { + v2beta.SetInventoryRequest = (function() { /** - * Properties of a DeleteProductRequest. + * Properties of a SetInventoryRequest. * @memberof google.cloud.retail.v2beta - * @interface IDeleteProductRequest - * @property {string|null} [name] DeleteProductRequest name + * @interface ISetInventoryRequest + * @property {google.cloud.retail.v2beta.IProduct|null} [inventory] SetInventoryRequest inventory + * @property {google.protobuf.IFieldMask|null} [setMask] SetInventoryRequest setMask + * @property {google.protobuf.ITimestamp|null} [setTime] SetInventoryRequest setTime + * @property {boolean|null} [allowMissing] SetInventoryRequest allowMissing */ /** - * Constructs a new DeleteProductRequest. + * Constructs a new SetInventoryRequest. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a DeleteProductRequest. - * @implements IDeleteProductRequest + * @classdesc Represents a SetInventoryRequest. + * @implements ISetInventoryRequest * @constructor - * @param {google.cloud.retail.v2beta.IDeleteProductRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.ISetInventoryRequest=} [properties] Properties to set */ - function DeleteProductRequest(properties) { + function SetInventoryRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -70926,75 +83555,114 @@ } /** - * DeleteProductRequest name. - * @member {string} name - * @memberof google.cloud.retail.v2beta.DeleteProductRequest + * SetInventoryRequest inventory. + * @member {google.cloud.retail.v2beta.IProduct|null|undefined} inventory + * @memberof google.cloud.retail.v2beta.SetInventoryRequest * @instance */ - DeleteProductRequest.prototype.name = ""; + SetInventoryRequest.prototype.inventory = null; /** - * Creates a new DeleteProductRequest instance using the specified properties. + * SetInventoryRequest setMask. + * @member {google.protobuf.IFieldMask|null|undefined} setMask + * @memberof google.cloud.retail.v2beta.SetInventoryRequest + * @instance + */ + SetInventoryRequest.prototype.setMask = null; + + /** + * SetInventoryRequest setTime. + * @member {google.protobuf.ITimestamp|null|undefined} setTime + * @memberof google.cloud.retail.v2beta.SetInventoryRequest + * @instance + */ + SetInventoryRequest.prototype.setTime = null; + + /** + * SetInventoryRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.retail.v2beta.SetInventoryRequest + * @instance + */ + SetInventoryRequest.prototype.allowMissing = false; + + /** + * Creates a new SetInventoryRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.DeleteProductRequest + * @memberof google.cloud.retail.v2beta.SetInventoryRequest * @static - * @param {google.cloud.retail.v2beta.IDeleteProductRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.DeleteProductRequest} DeleteProductRequest instance + * @param {google.cloud.retail.v2beta.ISetInventoryRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.SetInventoryRequest} SetInventoryRequest instance */ - DeleteProductRequest.create = function create(properties) { - return new DeleteProductRequest(properties); + SetInventoryRequest.create = function create(properties) { + return new SetInventoryRequest(properties); }; /** - * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.retail.v2beta.DeleteProductRequest.verify|verify} messages. + * Encodes the specified SetInventoryRequest message. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.DeleteProductRequest + * @memberof google.cloud.retail.v2beta.SetInventoryRequest * @static - * @param {google.cloud.retail.v2beta.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.ISetInventoryRequest} message SetInventoryRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteProductRequest.encode = function encode(message, writer) { + SetInventoryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inventory != null && Object.hasOwnProperty.call(message, "inventory")) + $root.google.cloud.retail.v2beta.Product.encode(message.inventory, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.setMask != null && Object.hasOwnProperty.call(message, "setMask")) + $root.google.protobuf.FieldMask.encode(message.setMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.setTime != null && Object.hasOwnProperty.call(message, "setTime")) + $root.google.protobuf.Timestamp.encode(message.setTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); return writer; }; /** - * Encodes the specified DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.DeleteProductRequest.verify|verify} messages. + * Encodes the specified SetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.DeleteProductRequest + * @memberof google.cloud.retail.v2beta.SetInventoryRequest * @static - * @param {google.cloud.retail.v2beta.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.ISetInventoryRequest} message SetInventoryRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + SetInventoryRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteProductRequest message from the specified reader or buffer. + * Decodes a SetInventoryRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.DeleteProductRequest + * @memberof google.cloud.retail.v2beta.SetInventoryRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.DeleteProductRequest} DeleteProductRequest + * @returns {google.cloud.retail.v2beta.SetInventoryRequest} SetInventoryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteProductRequest.decode = function decode(reader, length) { + SetInventoryRequest.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.v2beta.DeleteProductRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.SetInventoryRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.inventory = $root.google.cloud.retail.v2beta.Product.decode(reader, reader.uint32()); + break; + case 2: + message.setMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.setTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.allowMissing = reader.bool(); break; default: reader.skipType(tag & 7); @@ -71005,111 +83673,146 @@ }; /** - * Decodes a DeleteProductRequest message from the specified reader or buffer, length delimited. + * Decodes a SetInventoryRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.DeleteProductRequest + * @memberof google.cloud.retail.v2beta.SetInventoryRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.DeleteProductRequest} DeleteProductRequest + * @returns {google.cloud.retail.v2beta.SetInventoryRequest} SetInventoryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteProductRequest.decodeDelimited = function decodeDelimited(reader) { + SetInventoryRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteProductRequest message. + * Verifies a SetInventoryRequest message. * @function verify - * @memberof google.cloud.retail.v2beta.DeleteProductRequest + * @memberof google.cloud.retail.v2beta.SetInventoryRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteProductRequest.verify = function verify(message) { + SetInventoryRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.inventory != null && message.hasOwnProperty("inventory")) { + var error = $root.google.cloud.retail.v2beta.Product.verify(message.inventory); + if (error) + return "inventory." + error; + } + if (message.setMask != null && message.hasOwnProperty("setMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.setMask); + if (error) + return "setMask." + error; + } + if (message.setTime != null && message.hasOwnProperty("setTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.setTime); + if (error) + return "setTime." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a DeleteProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SetInventoryRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.DeleteProductRequest + * @memberof google.cloud.retail.v2beta.SetInventoryRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.DeleteProductRequest} DeleteProductRequest + * @returns {google.cloud.retail.v2beta.SetInventoryRequest} SetInventoryRequest */ - DeleteProductRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.DeleteProductRequest) + SetInventoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.SetInventoryRequest) return object; - var message = new $root.google.cloud.retail.v2beta.DeleteProductRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.retail.v2beta.SetInventoryRequest(); + if (object.inventory != null) { + if (typeof object.inventory !== "object") + throw TypeError(".google.cloud.retail.v2beta.SetInventoryRequest.inventory: object expected"); + message.inventory = $root.google.cloud.retail.v2beta.Product.fromObject(object.inventory); + } + if (object.setMask != null) { + if (typeof object.setMask !== "object") + throw TypeError(".google.cloud.retail.v2beta.SetInventoryRequest.setMask: object expected"); + message.setMask = $root.google.protobuf.FieldMask.fromObject(object.setMask); + } + if (object.setTime != null) { + if (typeof object.setTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.SetInventoryRequest.setTime: object expected"); + message.setTime = $root.google.protobuf.Timestamp.fromObject(object.setTime); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. + * Creates a plain object from a SetInventoryRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.DeleteProductRequest + * @memberof google.cloud.retail.v2beta.SetInventoryRequest * @static - * @param {google.cloud.retail.v2beta.DeleteProductRequest} message DeleteProductRequest + * @param {google.cloud.retail.v2beta.SetInventoryRequest} message SetInventoryRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteProductRequest.toObject = function toObject(message, options) { + SetInventoryRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.inventory = null; + object.setMask = null; + object.setTime = null; + object.allowMissing = false; + } + if (message.inventory != null && message.hasOwnProperty("inventory")) + object.inventory = $root.google.cloud.retail.v2beta.Product.toObject(message.inventory, options); + if (message.setMask != null && message.hasOwnProperty("setMask")) + object.setMask = $root.google.protobuf.FieldMask.toObject(message.setMask, options); + if (message.setTime != null && message.hasOwnProperty("setTime")) + object.setTime = $root.google.protobuf.Timestamp.toObject(message.setTime, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; return object; }; /** - * Converts this DeleteProductRequest to JSON. + * Converts this SetInventoryRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.DeleteProductRequest + * @memberof google.cloud.retail.v2beta.SetInventoryRequest * @instance * @returns {Object.} JSON object */ - DeleteProductRequest.prototype.toJSON = function toJSON() { + SetInventoryRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteProductRequest; + return SetInventoryRequest; })(); - v2beta.ListProductsRequest = (function() { + v2beta.SetInventoryMetadata = (function() { /** - * Properties of a ListProductsRequest. + * Properties of a SetInventoryMetadata. * @memberof google.cloud.retail.v2beta - * @interface IListProductsRequest - * @property {string|null} [parent] ListProductsRequest parent - * @property {number|null} [pageSize] ListProductsRequest pageSize - * @property {string|null} [pageToken] ListProductsRequest pageToken - * @property {string|null} [filter] ListProductsRequest filter - * @property {google.protobuf.IFieldMask|null} [readMask] ListProductsRequest readMask + * @interface ISetInventoryMetadata */ /** - * Constructs a new ListProductsRequest. + * Constructs a new SetInventoryMetadata. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a ListProductsRequest. - * @implements IListProductsRequest + * @classdesc Represents a SetInventoryMetadata. + * @implements ISetInventoryMetadata * @constructor - * @param {google.cloud.retail.v2beta.IListProductsRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.ISetInventoryMetadata=} [properties] Properties to set */ - function ListProductsRequest(properties) { + function SetInventoryMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -71117,128 +83820,63 @@ } /** - * ListProductsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2beta.ListProductsRequest - * @instance - */ - ListProductsRequest.prototype.parent = ""; - - /** - * ListProductsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.retail.v2beta.ListProductsRequest - * @instance - */ - ListProductsRequest.prototype.pageSize = 0; - - /** - * ListProductsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.retail.v2beta.ListProductsRequest - * @instance - */ - ListProductsRequest.prototype.pageToken = ""; - - /** - * ListProductsRequest filter. - * @member {string} filter - * @memberof google.cloud.retail.v2beta.ListProductsRequest - * @instance - */ - ListProductsRequest.prototype.filter = ""; - - /** - * ListProductsRequest readMask. - * @member {google.protobuf.IFieldMask|null|undefined} readMask - * @memberof google.cloud.retail.v2beta.ListProductsRequest - * @instance - */ - ListProductsRequest.prototype.readMask = null; - - /** - * Creates a new ListProductsRequest instance using the specified properties. + * Creates a new SetInventoryMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.ListProductsRequest + * @memberof google.cloud.retail.v2beta.SetInventoryMetadata * @static - * @param {google.cloud.retail.v2beta.IListProductsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ListProductsRequest} ListProductsRequest instance + * @param {google.cloud.retail.v2beta.ISetInventoryMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.SetInventoryMetadata} SetInventoryMetadata instance */ - ListProductsRequest.create = function create(properties) { - return new ListProductsRequest(properties); + SetInventoryMetadata.create = function create(properties) { + return new SetInventoryMetadata(properties); }; /** - * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ListProductsRequest.verify|verify} messages. + * Encodes the specified SetInventoryMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.ListProductsRequest + * @memberof google.cloud.retail.v2beta.SetInventoryMetadata * @static - * @param {google.cloud.retail.v2beta.IListProductsRequest} message ListProductsRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.ISetInventoryMetadata} message SetInventoryMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListProductsRequest.encode = function encode(message, writer) { + SetInventoryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) - $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListProductsRequest.verify|verify} messages. + * Encodes the specified SetInventoryMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ListProductsRequest + * @memberof google.cloud.retail.v2beta.SetInventoryMetadata * @static - * @param {google.cloud.retail.v2beta.IListProductsRequest} message ListProductsRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.ISetInventoryMetadata} message SetInventoryMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { + SetInventoryMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListProductsRequest message from the specified reader or buffer. + * Decodes a SetInventoryMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.ListProductsRequest + * @memberof google.cloud.retail.v2beta.SetInventoryMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ListProductsRequest} ListProductsRequest + * @returns {google.cloud.retail.v2beta.SetInventoryMetadata} SetInventoryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListProductsRequest.decode = function decode(reader, length) { + SetInventoryMetadata.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.v2beta.ListProductsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.SetInventoryMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - case 4: - message.filter = reader.string(); - break; - case 5: - message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -71248,147 +83886,93 @@ }; /** - * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. + * Decodes a SetInventoryMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ListProductsRequest + * @memberof google.cloud.retail.v2beta.SetInventoryMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ListProductsRequest} ListProductsRequest + * @returns {google.cloud.retail.v2beta.SetInventoryMetadata} SetInventoryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListProductsRequest.decodeDelimited = function decodeDelimited(reader) { + SetInventoryMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListProductsRequest message. + * Verifies a SetInventoryMetadata message. * @function verify - * @memberof google.cloud.retail.v2beta.ListProductsRequest + * @memberof google.cloud.retail.v2beta.SetInventoryMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListProductsRequest.verify = function verify(message) { + SetInventoryMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.readMask != null && message.hasOwnProperty("readMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.readMask); - if (error) - return "readMask." + error; - } return null; }; /** - * Creates a ListProductsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SetInventoryMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.ListProductsRequest + * @memberof google.cloud.retail.v2beta.SetInventoryMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ListProductsRequest} ListProductsRequest - */ - ListProductsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ListProductsRequest) - return object; - var message = new $root.google.cloud.retail.v2beta.ListProductsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.readMask != null) { - if (typeof object.readMask !== "object") - throw TypeError(".google.cloud.retail.v2beta.ListProductsRequest.readMask: object expected"); - message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); - } - return message; + * @returns {google.cloud.retail.v2beta.SetInventoryMetadata} SetInventoryMetadata + */ + SetInventoryMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.SetInventoryMetadata) + return object; + return new $root.google.cloud.retail.v2beta.SetInventoryMetadata(); }; /** - * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. + * Creates a plain object from a SetInventoryMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.ListProductsRequest + * @memberof google.cloud.retail.v2beta.SetInventoryMetadata * @static - * @param {google.cloud.retail.v2beta.ListProductsRequest} message ListProductsRequest + * @param {google.cloud.retail.v2beta.SetInventoryMetadata} message SetInventoryMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListProductsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.readMask = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.readMask != null && message.hasOwnProperty("readMask")) - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); - return object; + SetInventoryMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this ListProductsRequest to JSON. + * Converts this SetInventoryMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.ListProductsRequest + * @memberof google.cloud.retail.v2beta.SetInventoryMetadata * @instance * @returns {Object.} JSON object */ - ListProductsRequest.prototype.toJSON = function toJSON() { + SetInventoryMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListProductsRequest; + return SetInventoryMetadata; })(); - v2beta.ListProductsResponse = (function() { + v2beta.SetInventoryResponse = (function() { /** - * Properties of a ListProductsResponse. + * Properties of a SetInventoryResponse. * @memberof google.cloud.retail.v2beta - * @interface IListProductsResponse - * @property {Array.|null} [products] ListProductsResponse products - * @property {string|null} [nextPageToken] ListProductsResponse nextPageToken + * @interface ISetInventoryResponse */ /** - * Constructs a new ListProductsResponse. + * Constructs a new SetInventoryResponse. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a ListProductsResponse. - * @implements IListProductsResponse + * @classdesc Represents a SetInventoryResponse. + * @implements ISetInventoryResponse * @constructor - * @param {google.cloud.retail.v2beta.IListProductsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.ISetInventoryResponse=} [properties] Properties to set */ - function ListProductsResponse(properties) { - this.products = []; + function SetInventoryResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -71396,92 +83980,63 @@ } /** - * ListProductsResponse products. - * @member {Array.} products - * @memberof google.cloud.retail.v2beta.ListProductsResponse - * @instance - */ - ListProductsResponse.prototype.products = $util.emptyArray; - - /** - * ListProductsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.retail.v2beta.ListProductsResponse - * @instance - */ - ListProductsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListProductsResponse instance using the specified properties. + * Creates a new SetInventoryResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.ListProductsResponse + * @memberof google.cloud.retail.v2beta.SetInventoryResponse * @static - * @param {google.cloud.retail.v2beta.IListProductsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.ListProductsResponse} ListProductsResponse instance + * @param {google.cloud.retail.v2beta.ISetInventoryResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.SetInventoryResponse} SetInventoryResponse instance */ - ListProductsResponse.create = function create(properties) { - return new ListProductsResponse(properties); + SetInventoryResponse.create = function create(properties) { + return new SetInventoryResponse(properties); }; /** - * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ListProductsResponse.verify|verify} messages. + * Encodes the specified SetInventoryResponse message. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.ListProductsResponse + * @memberof google.cloud.retail.v2beta.SetInventoryResponse * @static - * @param {google.cloud.retail.v2beta.IListProductsResponse} message ListProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.ISetInventoryResponse} message SetInventoryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListProductsResponse.encode = function encode(message, writer) { + SetInventoryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.products != null && message.products.length) - for (var i = 0; i < message.products.length; ++i) - $root.google.cloud.retail.v2beta.Product.encode(message.products[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListProductsResponse.verify|verify} messages. + * Encodes the specified SetInventoryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.ListProductsResponse + * @memberof google.cloud.retail.v2beta.SetInventoryResponse * @static - * @param {google.cloud.retail.v2beta.IListProductsResponse} message ListProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.ISetInventoryResponse} message SetInventoryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { + SetInventoryResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListProductsResponse message from the specified reader or buffer. + * Decodes a SetInventoryResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.ListProductsResponse + * @memberof google.cloud.retail.v2beta.SetInventoryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.ListProductsResponse} ListProductsResponse + * @returns {google.cloud.retail.v2beta.SetInventoryResponse} SetInventoryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListProductsResponse.decode = function decode(reader, length) { + SetInventoryResponse.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.v2beta.ListProductsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.SetInventoryResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.products && message.products.length)) - message.products = []; - message.products.push($root.google.cloud.retail.v2beta.Product.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -71491,136 +84046,99 @@ }; /** - * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. + * Decodes a SetInventoryResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.ListProductsResponse + * @memberof google.cloud.retail.v2beta.SetInventoryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.ListProductsResponse} ListProductsResponse + * @returns {google.cloud.retail.v2beta.SetInventoryResponse} SetInventoryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListProductsResponse.decodeDelimited = function decodeDelimited(reader) { + SetInventoryResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListProductsResponse message. + * Verifies a SetInventoryResponse message. * @function verify - * @memberof google.cloud.retail.v2beta.ListProductsResponse + * @memberof google.cloud.retail.v2beta.SetInventoryResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListProductsResponse.verify = function verify(message) { + SetInventoryResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.products != null && message.hasOwnProperty("products")) { - if (!Array.isArray(message.products)) - return "products: array expected"; - for (var i = 0; i < message.products.length; ++i) { - var error = $root.google.cloud.retail.v2beta.Product.verify(message.products[i]); - if (error) - return "products." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SetInventoryResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.ListProductsResponse + * @memberof google.cloud.retail.v2beta.SetInventoryResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.ListProductsResponse} ListProductsResponse + * @returns {google.cloud.retail.v2beta.SetInventoryResponse} SetInventoryResponse */ - ListProductsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.ListProductsResponse) + SetInventoryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.SetInventoryResponse) return object; - var message = new $root.google.cloud.retail.v2beta.ListProductsResponse(); - if (object.products) { - if (!Array.isArray(object.products)) - throw TypeError(".google.cloud.retail.v2beta.ListProductsResponse.products: array expected"); - message.products = []; - for (var i = 0; i < object.products.length; ++i) { - if (typeof object.products[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.ListProductsResponse.products: object expected"); - message.products[i] = $root.google.cloud.retail.v2beta.Product.fromObject(object.products[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; + return new $root.google.cloud.retail.v2beta.SetInventoryResponse(); }; /** - * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. + * Creates a plain object from a SetInventoryResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.ListProductsResponse + * @memberof google.cloud.retail.v2beta.SetInventoryResponse * @static - * @param {google.cloud.retail.v2beta.ListProductsResponse} message ListProductsResponse + * @param {google.cloud.retail.v2beta.SetInventoryResponse} message SetInventoryResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListProductsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.products = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.products && message.products.length) { - object.products = []; - for (var j = 0; j < message.products.length; ++j) - object.products[j] = $root.google.cloud.retail.v2beta.Product.toObject(message.products[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; + SetInventoryResponse.toObject = function toObject() { + return {}; }; /** - * Converts this ListProductsResponse to JSON. + * Converts this SetInventoryResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.ListProductsResponse + * @memberof google.cloud.retail.v2beta.SetInventoryResponse * @instance * @returns {Object.} JSON object */ - ListProductsResponse.prototype.toJSON = function toJSON() { + SetInventoryResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListProductsResponse; + return SetInventoryResponse; })(); - v2beta.SetInventoryRequest = (function() { + v2beta.AddFulfillmentPlacesRequest = (function() { /** - * Properties of a SetInventoryRequest. + * Properties of an AddFulfillmentPlacesRequest. * @memberof google.cloud.retail.v2beta - * @interface ISetInventoryRequest - * @property {google.cloud.retail.v2beta.IProduct|null} [inventory] SetInventoryRequest inventory - * @property {google.protobuf.IFieldMask|null} [setMask] SetInventoryRequest setMask - * @property {google.protobuf.ITimestamp|null} [setTime] SetInventoryRequest setTime - * @property {boolean|null} [allowMissing] SetInventoryRequest allowMissing + * @interface IAddFulfillmentPlacesRequest + * @property {string|null} [product] AddFulfillmentPlacesRequest product + * @property {string|null} [type] AddFulfillmentPlacesRequest type + * @property {Array.|null} [placeIds] AddFulfillmentPlacesRequest placeIds + * @property {google.protobuf.ITimestamp|null} [addTime] AddFulfillmentPlacesRequest addTime + * @property {boolean|null} [allowMissing] AddFulfillmentPlacesRequest allowMissing */ /** - * Constructs a new SetInventoryRequest. + * Constructs a new AddFulfillmentPlacesRequest. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a SetInventoryRequest. - * @implements ISetInventoryRequest + * @classdesc Represents an AddFulfillmentPlacesRequest. + * @implements IAddFulfillmentPlacesRequest * @constructor - * @param {google.cloud.retail.v2beta.ISetInventoryRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest=} [properties] Properties to set */ - function SetInventoryRequest(properties) { + function AddFulfillmentPlacesRequest(properties) { + this.placeIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -71628,113 +84146,129 @@ } /** - * SetInventoryRequest inventory. - * @member {google.cloud.retail.v2beta.IProduct|null|undefined} inventory - * @memberof google.cloud.retail.v2beta.SetInventoryRequest + * AddFulfillmentPlacesRequest product. + * @member {string} product + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest * @instance */ - SetInventoryRequest.prototype.inventory = null; + AddFulfillmentPlacesRequest.prototype.product = ""; /** - * SetInventoryRequest setMask. - * @member {google.protobuf.IFieldMask|null|undefined} setMask - * @memberof google.cloud.retail.v2beta.SetInventoryRequest + * AddFulfillmentPlacesRequest type. + * @member {string} type + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest * @instance */ - SetInventoryRequest.prototype.setMask = null; + AddFulfillmentPlacesRequest.prototype.type = ""; /** - * SetInventoryRequest setTime. - * @member {google.protobuf.ITimestamp|null|undefined} setTime - * @memberof google.cloud.retail.v2beta.SetInventoryRequest + * AddFulfillmentPlacesRequest placeIds. + * @member {Array.} placeIds + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest * @instance */ - SetInventoryRequest.prototype.setTime = null; + AddFulfillmentPlacesRequest.prototype.placeIds = $util.emptyArray; /** - * SetInventoryRequest allowMissing. + * AddFulfillmentPlacesRequest addTime. + * @member {google.protobuf.ITimestamp|null|undefined} addTime + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest + * @instance + */ + AddFulfillmentPlacesRequest.prototype.addTime = null; + + /** + * AddFulfillmentPlacesRequest allowMissing. * @member {boolean} allowMissing - * @memberof google.cloud.retail.v2beta.SetInventoryRequest + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest * @instance */ - SetInventoryRequest.prototype.allowMissing = false; + AddFulfillmentPlacesRequest.prototype.allowMissing = false; /** - * Creates a new SetInventoryRequest instance using the specified properties. + * Creates a new AddFulfillmentPlacesRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.SetInventoryRequest + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2beta.ISetInventoryRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.SetInventoryRequest} SetInventoryRequest instance + * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest instance */ - SetInventoryRequest.create = function create(properties) { - return new SetInventoryRequest(properties); + AddFulfillmentPlacesRequest.create = function create(properties) { + return new AddFulfillmentPlacesRequest(properties); }; /** - * Encodes the specified SetInventoryRequest message. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryRequest.verify|verify} messages. + * Encodes the specified AddFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.SetInventoryRequest + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2beta.ISetInventoryRequest} message SetInventoryRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetInventoryRequest.encode = function encode(message, writer) { + AddFulfillmentPlacesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.inventory != null && Object.hasOwnProperty.call(message, "inventory")) - $root.google.cloud.retail.v2beta.Product.encode(message.inventory, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.setMask != null && Object.hasOwnProperty.call(message, "setMask")) - $root.google.protobuf.FieldMask.encode(message.setMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.setTime != null && Object.hasOwnProperty.call(message, "setTime")) - $root.google.protobuf.Timestamp.encode(message.setTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.placeIds != null && message.placeIds.length) + for (var i = 0; i < message.placeIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.placeIds[i]); + if (message.addTime != null && Object.hasOwnProperty.call(message, "addTime")) + $root.google.protobuf.Timestamp.encode(message.addTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); return writer; }; /** - * Encodes the specified SetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryRequest.verify|verify} messages. + * Encodes the specified AddFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.SetInventoryRequest + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2beta.ISetInventoryRequest} message SetInventoryRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetInventoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + AddFulfillmentPlacesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetInventoryRequest message from the specified reader or buffer. + * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.SetInventoryRequest + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.SetInventoryRequest} SetInventoryRequest + * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetInventoryRequest.decode = function decode(reader, length) { + AddFulfillmentPlacesRequest.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.v2beta.SetInventoryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.inventory = $root.google.cloud.retail.v2beta.Product.decode(reader, reader.uint32()); + message.product = reader.string(); break; case 2: - message.setMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.type = reader.string(); break; case 3: - message.setTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + if (!(message.placeIds && message.placeIds.length)) + message.placeIds = []; + message.placeIds.push(reader.string()); break; case 4: + message.addTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: message.allowMissing = reader.bool(); break; default: @@ -71746,46 +84280,49 @@ }; /** - * Decodes a SetInventoryRequest message from the specified reader or buffer, length delimited. + * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.SetInventoryRequest + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.SetInventoryRequest} SetInventoryRequest + * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetInventoryRequest.decodeDelimited = function decodeDelimited(reader) { + AddFulfillmentPlacesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetInventoryRequest message. + * Verifies an AddFulfillmentPlacesRequest message. * @function verify - * @memberof google.cloud.retail.v2beta.SetInventoryRequest + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetInventoryRequest.verify = function verify(message) { + AddFulfillmentPlacesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.inventory != null && message.hasOwnProperty("inventory")) { - var error = $root.google.cloud.retail.v2beta.Product.verify(message.inventory); - if (error) - return "inventory." + error; - } - if (message.setMask != null && message.hasOwnProperty("setMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.setMask); - if (error) - return "setMask." + error; + if (message.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.placeIds != null && message.hasOwnProperty("placeIds")) { + if (!Array.isArray(message.placeIds)) + return "placeIds: array expected"; + for (var i = 0; i < message.placeIds.length; ++i) + if (!$util.isString(message.placeIds[i])) + return "placeIds: string[] expected"; } - if (message.setTime != null && message.hasOwnProperty("setTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.setTime); + if (message.addTime != null && message.hasOwnProperty("addTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.addTime); if (error) - return "setTime." + error; + return "addTime." + error; } if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) if (typeof message.allowMissing !== "boolean") @@ -71794,31 +84331,32 @@ }; /** - * Creates a SetInventoryRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AddFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.SetInventoryRequest + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.SetInventoryRequest} SetInventoryRequest + * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest */ - SetInventoryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.SetInventoryRequest) + AddFulfillmentPlacesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest) return object; - var message = new $root.google.cloud.retail.v2beta.SetInventoryRequest(); - if (object.inventory != null) { - if (typeof object.inventory !== "object") - throw TypeError(".google.cloud.retail.v2beta.SetInventoryRequest.inventory: object expected"); - message.inventory = $root.google.cloud.retail.v2beta.Product.fromObject(object.inventory); - } - if (object.setMask != null) { - if (typeof object.setMask !== "object") - throw TypeError(".google.cloud.retail.v2beta.SetInventoryRequest.setMask: object expected"); - message.setMask = $root.google.protobuf.FieldMask.fromObject(object.setMask); + var message = new $root.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest(); + if (object.product != null) + message.product = String(object.product); + if (object.type != null) + message.type = String(object.type); + if (object.placeIds) { + if (!Array.isArray(object.placeIds)) + throw TypeError(".google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.placeIds: array expected"); + message.placeIds = []; + for (var i = 0; i < object.placeIds.length; ++i) + message.placeIds[i] = String(object.placeIds[i]); } - if (object.setTime != null) { - if (typeof object.setTime !== "object") - throw TypeError(".google.cloud.retail.v2beta.SetInventoryRequest.setTime: object expected"); - message.setTime = $root.google.protobuf.Timestamp.fromObject(object.setTime); + if (object.addTime != null) { + if (typeof object.addTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.addTime: object expected"); + message.addTime = $root.google.protobuf.Timestamp.fromObject(object.addTime); } if (object.allowMissing != null) message.allowMissing = Boolean(object.allowMissing); @@ -71826,66 +84364,73 @@ }; /** - * Creates a plain object from a SetInventoryRequest message. Also converts values to other types if specified. + * Creates a plain object from an AddFulfillmentPlacesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.SetInventoryRequest + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2beta.SetInventoryRequest} message SetInventoryRequest + * @param {google.cloud.retail.v2beta.AddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetInventoryRequest.toObject = function toObject(message, options) { + AddFulfillmentPlacesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.placeIds = []; if (options.defaults) { - object.inventory = null; - object.setMask = null; - object.setTime = null; + object.product = ""; + object.type = ""; + object.addTime = null; object.allowMissing = false; } - if (message.inventory != null && message.hasOwnProperty("inventory")) - object.inventory = $root.google.cloud.retail.v2beta.Product.toObject(message.inventory, options); - if (message.setMask != null && message.hasOwnProperty("setMask")) - object.setMask = $root.google.protobuf.FieldMask.toObject(message.setMask, options); - if (message.setTime != null && message.hasOwnProperty("setTime")) - object.setTime = $root.google.protobuf.Timestamp.toObject(message.setTime, options); + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.placeIds && message.placeIds.length) { + object.placeIds = []; + for (var j = 0; j < message.placeIds.length; ++j) + object.placeIds[j] = message.placeIds[j]; + } + if (message.addTime != null && message.hasOwnProperty("addTime")) + object.addTime = $root.google.protobuf.Timestamp.toObject(message.addTime, options); if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) object.allowMissing = message.allowMissing; return object; }; /** - * Converts this SetInventoryRequest to JSON. + * Converts this AddFulfillmentPlacesRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.SetInventoryRequest + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest * @instance * @returns {Object.} JSON object */ - SetInventoryRequest.prototype.toJSON = function toJSON() { + AddFulfillmentPlacesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SetInventoryRequest; + return AddFulfillmentPlacesRequest; })(); - v2beta.SetInventoryMetadata = (function() { + v2beta.AddFulfillmentPlacesMetadata = (function() { /** - * Properties of a SetInventoryMetadata. + * Properties of an AddFulfillmentPlacesMetadata. * @memberof google.cloud.retail.v2beta - * @interface ISetInventoryMetadata + * @interface IAddFulfillmentPlacesMetadata */ /** - * Constructs a new SetInventoryMetadata. + * Constructs a new AddFulfillmentPlacesMetadata. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a SetInventoryMetadata. - * @implements ISetInventoryMetadata + * @classdesc Represents an AddFulfillmentPlacesMetadata. + * @implements IAddFulfillmentPlacesMetadata * @constructor - * @param {google.cloud.retail.v2beta.ISetInventoryMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesMetadata=} [properties] Properties to set */ - function SetInventoryMetadata(properties) { + function AddFulfillmentPlacesMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -71893,60 +84438,60 @@ } /** - * Creates a new SetInventoryMetadata instance using the specified properties. + * Creates a new AddFulfillmentPlacesMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.SetInventoryMetadata + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2beta.ISetInventoryMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.SetInventoryMetadata} SetInventoryMetadata instance + * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata instance */ - SetInventoryMetadata.create = function create(properties) { - return new SetInventoryMetadata(properties); + AddFulfillmentPlacesMetadata.create = function create(properties) { + return new AddFulfillmentPlacesMetadata(properties); }; /** - * Encodes the specified SetInventoryMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryMetadata.verify|verify} messages. + * Encodes the specified AddFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.SetInventoryMetadata + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2beta.ISetInventoryMetadata} message SetInventoryMetadata message or plain object to encode + * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetInventoryMetadata.encode = function encode(message, writer) { + AddFulfillmentPlacesMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** - * Encodes the specified SetInventoryMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryMetadata.verify|verify} messages. + * Encodes the specified AddFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.SetInventoryMetadata + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2beta.ISetInventoryMetadata} message SetInventoryMetadata message or plain object to encode + * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetInventoryMetadata.encodeDelimited = function encodeDelimited(message, writer) { + AddFulfillmentPlacesMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetInventoryMetadata message from the specified reader or buffer. + * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.SetInventoryMetadata + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.SetInventoryMetadata} SetInventoryMetadata + * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetInventoryMetadata.decode = function decode(reader, length) { + AddFulfillmentPlacesMetadata.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.v2beta.SetInventoryMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -71959,93 +84504,93 @@ }; /** - * Decodes a SetInventoryMetadata message from the specified reader or buffer, length delimited. + * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.SetInventoryMetadata + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.SetInventoryMetadata} SetInventoryMetadata + * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetInventoryMetadata.decodeDelimited = function decodeDelimited(reader) { + AddFulfillmentPlacesMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetInventoryMetadata message. + * Verifies an AddFulfillmentPlacesMetadata message. * @function verify - * @memberof google.cloud.retail.v2beta.SetInventoryMetadata + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetInventoryMetadata.verify = function verify(message) { + AddFulfillmentPlacesMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** - * Creates a SetInventoryMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an AddFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.SetInventoryMetadata + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.SetInventoryMetadata} SetInventoryMetadata + * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata */ - SetInventoryMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.SetInventoryMetadata) + AddFulfillmentPlacesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata) return object; - return new $root.google.cloud.retail.v2beta.SetInventoryMetadata(); + return new $root.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata(); }; /** - * Creates a plain object from a SetInventoryMetadata message. Also converts values to other types if specified. + * Creates a plain object from an AddFulfillmentPlacesMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.SetInventoryMetadata + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2beta.SetInventoryMetadata} message SetInventoryMetadata + * @param {google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetInventoryMetadata.toObject = function toObject() { + AddFulfillmentPlacesMetadata.toObject = function toObject() { return {}; }; /** - * Converts this SetInventoryMetadata to JSON. + * Converts this AddFulfillmentPlacesMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.SetInventoryMetadata + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata * @instance * @returns {Object.} JSON object */ - SetInventoryMetadata.prototype.toJSON = function toJSON() { + AddFulfillmentPlacesMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SetInventoryMetadata; + return AddFulfillmentPlacesMetadata; })(); - v2beta.SetInventoryResponse = (function() { + v2beta.AddFulfillmentPlacesResponse = (function() { /** - * Properties of a SetInventoryResponse. + * Properties of an AddFulfillmentPlacesResponse. * @memberof google.cloud.retail.v2beta - * @interface ISetInventoryResponse + * @interface IAddFulfillmentPlacesResponse */ /** - * Constructs a new SetInventoryResponse. + * Constructs a new AddFulfillmentPlacesResponse. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a SetInventoryResponse. - * @implements ISetInventoryResponse + * @classdesc Represents an AddFulfillmentPlacesResponse. + * @implements IAddFulfillmentPlacesResponse * @constructor - * @param {google.cloud.retail.v2beta.ISetInventoryResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesResponse=} [properties] Properties to set */ - function SetInventoryResponse(properties) { + function AddFulfillmentPlacesResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -72053,60 +84598,60 @@ } /** - * Creates a new SetInventoryResponse instance using the specified properties. + * Creates a new AddFulfillmentPlacesResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.SetInventoryResponse + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse * @static - * @param {google.cloud.retail.v2beta.ISetInventoryResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.SetInventoryResponse} SetInventoryResponse instance + * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse instance */ - SetInventoryResponse.create = function create(properties) { - return new SetInventoryResponse(properties); + AddFulfillmentPlacesResponse.create = function create(properties) { + return new AddFulfillmentPlacesResponse(properties); }; /** - * Encodes the specified SetInventoryResponse message. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryResponse.verify|verify} messages. + * Encodes the specified AddFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.SetInventoryResponse + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse * @static - * @param {google.cloud.retail.v2beta.ISetInventoryResponse} message SetInventoryResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetInventoryResponse.encode = function encode(message, writer) { + AddFulfillmentPlacesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** - * Encodes the specified SetInventoryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SetInventoryResponse.verify|verify} messages. + * Encodes the specified AddFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.SetInventoryResponse + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse * @static - * @param {google.cloud.retail.v2beta.ISetInventoryResponse} message SetInventoryResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetInventoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + AddFulfillmentPlacesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetInventoryResponse message from the specified reader or buffer. + * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.SetInventoryResponse + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.SetInventoryResponse} SetInventoryResponse + * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetInventoryResponse.decode = function decode(reader, length) { + AddFulfillmentPlacesResponse.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.v2beta.SetInventoryResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -72119,99 +84664,99 @@ }; /** - * Decodes a SetInventoryResponse message from the specified reader or buffer, length delimited. + * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.SetInventoryResponse + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.SetInventoryResponse} SetInventoryResponse + * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetInventoryResponse.decodeDelimited = function decodeDelimited(reader) { + AddFulfillmentPlacesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetInventoryResponse message. + * Verifies an AddFulfillmentPlacesResponse message. * @function verify - * @memberof google.cloud.retail.v2beta.SetInventoryResponse + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetInventoryResponse.verify = function verify(message) { + AddFulfillmentPlacesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** - * Creates a SetInventoryResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AddFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.SetInventoryResponse + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.SetInventoryResponse} SetInventoryResponse + * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse */ - SetInventoryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.SetInventoryResponse) + AddFulfillmentPlacesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse) return object; - return new $root.google.cloud.retail.v2beta.SetInventoryResponse(); + return new $root.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse(); }; /** - * Creates a plain object from a SetInventoryResponse message. Also converts values to other types if specified. + * Creates a plain object from an AddFulfillmentPlacesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.SetInventoryResponse + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse * @static - * @param {google.cloud.retail.v2beta.SetInventoryResponse} message SetInventoryResponse + * @param {google.cloud.retail.v2beta.AddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetInventoryResponse.toObject = function toObject() { + AddFulfillmentPlacesResponse.toObject = function toObject() { return {}; }; /** - * Converts this SetInventoryResponse to JSON. + * Converts this AddFulfillmentPlacesResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.SetInventoryResponse + * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse * @instance * @returns {Object.} JSON object */ - SetInventoryResponse.prototype.toJSON = function toJSON() { + AddFulfillmentPlacesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SetInventoryResponse; + return AddFulfillmentPlacesResponse; })(); - v2beta.AddFulfillmentPlacesRequest = (function() { + v2beta.AddLocalInventoriesRequest = (function() { /** - * Properties of an AddFulfillmentPlacesRequest. + * Properties of an AddLocalInventoriesRequest. * @memberof google.cloud.retail.v2beta - * @interface IAddFulfillmentPlacesRequest - * @property {string|null} [product] AddFulfillmentPlacesRequest product - * @property {string|null} [type] AddFulfillmentPlacesRequest type - * @property {Array.|null} [placeIds] AddFulfillmentPlacesRequest placeIds - * @property {google.protobuf.ITimestamp|null} [addTime] AddFulfillmentPlacesRequest addTime - * @property {boolean|null} [allowMissing] AddFulfillmentPlacesRequest allowMissing + * @interface IAddLocalInventoriesRequest + * @property {string|null} [product] AddLocalInventoriesRequest product + * @property {Array.|null} [localInventories] AddLocalInventoriesRequest localInventories + * @property {google.protobuf.IFieldMask|null} [addMask] AddLocalInventoriesRequest addMask + * @property {google.protobuf.ITimestamp|null} [addTime] AddLocalInventoriesRequest addTime + * @property {boolean|null} [allowMissing] AddLocalInventoriesRequest allowMissing */ /** - * Constructs a new AddFulfillmentPlacesRequest. + * Constructs a new AddLocalInventoriesRequest. * @memberof google.cloud.retail.v2beta - * @classdesc Represents an AddFulfillmentPlacesRequest. - * @implements IAddFulfillmentPlacesRequest + * @classdesc Represents an AddLocalInventoriesRequest. + * @implements IAddLocalInventoriesRequest * @constructor - * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IAddLocalInventoriesRequest=} [properties] Properties to set */ - function AddFulfillmentPlacesRequest(properties) { - this.placeIds = []; + function AddLocalInventoriesRequest(properties) { + this.localInventories = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -72219,111 +84764,111 @@ } /** - * AddFulfillmentPlacesRequest product. + * AddLocalInventoriesRequest product. * @member {string} product - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesRequest * @instance */ - AddFulfillmentPlacesRequest.prototype.product = ""; + AddLocalInventoriesRequest.prototype.product = ""; /** - * AddFulfillmentPlacesRequest type. - * @member {string} type - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest + * AddLocalInventoriesRequest localInventories. + * @member {Array.} localInventories + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesRequest * @instance */ - AddFulfillmentPlacesRequest.prototype.type = ""; + AddLocalInventoriesRequest.prototype.localInventories = $util.emptyArray; /** - * AddFulfillmentPlacesRequest placeIds. - * @member {Array.} placeIds - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest + * AddLocalInventoriesRequest addMask. + * @member {google.protobuf.IFieldMask|null|undefined} addMask + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesRequest * @instance */ - AddFulfillmentPlacesRequest.prototype.placeIds = $util.emptyArray; + AddLocalInventoriesRequest.prototype.addMask = null; /** - * AddFulfillmentPlacesRequest addTime. + * AddLocalInventoriesRequest addTime. * @member {google.protobuf.ITimestamp|null|undefined} addTime - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesRequest * @instance */ - AddFulfillmentPlacesRequest.prototype.addTime = null; + AddLocalInventoriesRequest.prototype.addTime = null; /** - * AddFulfillmentPlacesRequest allowMissing. + * AddLocalInventoriesRequest allowMissing. * @member {boolean} allowMissing - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesRequest * @instance */ - AddFulfillmentPlacesRequest.prototype.allowMissing = false; + AddLocalInventoriesRequest.prototype.allowMissing = false; /** - * Creates a new AddFulfillmentPlacesRequest instance using the specified properties. + * Creates a new AddLocalInventoriesRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest instance + * @param {google.cloud.retail.v2beta.IAddLocalInventoriesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.AddLocalInventoriesRequest} AddLocalInventoriesRequest instance */ - AddFulfillmentPlacesRequest.create = function create(properties) { - return new AddFulfillmentPlacesRequest(properties); + AddLocalInventoriesRequest.create = function create(properties) { + return new AddLocalInventoriesRequest(properties); }; /** - * Encodes the specified AddFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.verify|verify} messages. + * Encodes the specified AddLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2beta.AddLocalInventoriesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IAddLocalInventoriesRequest} message AddLocalInventoriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddFulfillmentPlacesRequest.encode = function encode(message, writer) { + AddLocalInventoriesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.product != null && Object.hasOwnProperty.call(message, "product")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.placeIds != null && message.placeIds.length) - for (var i = 0; i < message.placeIds.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.placeIds[i]); + if (message.localInventories != null && message.localInventories.length) + for (var i = 0; i < message.localInventories.length; ++i) + $root.google.cloud.retail.v2beta.LocalInventory.encode(message.localInventories[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.addMask != null && Object.hasOwnProperty.call(message, "addMask")) + $root.google.protobuf.FieldMask.encode(message.addMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.addTime != null && Object.hasOwnProperty.call(message, "addTime")) - $root.google.protobuf.Timestamp.encode(message.addTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.addTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowMissing); return writer; }; /** - * Encodes the specified AddFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.verify|verify} messages. + * Encodes the specified AddLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddLocalInventoriesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IAddLocalInventoriesRequest} message AddLocalInventoriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddFulfillmentPlacesRequest.encodeDelimited = function encodeDelimited(message, writer) { + AddLocalInventoriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer. + * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2beta.AddLocalInventoriesRequest} AddLocalInventoriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddFulfillmentPlacesRequest.decode = function decode(reader, length) { + AddLocalInventoriesRequest.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.v2beta.AddFulfillmentPlacesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.AddLocalInventoriesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -72331,17 +84876,17 @@ message.product = reader.string(); break; case 2: - message.type = reader.string(); - break; - case 3: - if (!(message.placeIds && message.placeIds.length)) - message.placeIds = []; - message.placeIds.push(reader.string()); + if (!(message.localInventories && message.localInventories.length)) + message.localInventories = []; + message.localInventories.push($root.google.cloud.retail.v2beta.LocalInventory.decode(reader, reader.uint32())); break; case 4: - message.addTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.addMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; case 5: + message.addTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: message.allowMissing = reader.bool(); break; default: @@ -72353,44 +84898,48 @@ }; /** - * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. + * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2beta.AddLocalInventoriesRequest} AddLocalInventoriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddFulfillmentPlacesRequest.decodeDelimited = function decodeDelimited(reader) { + AddLocalInventoriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AddFulfillmentPlacesRequest message. + * Verifies an AddLocalInventoriesRequest message. * @function verify - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AddFulfillmentPlacesRequest.verify = function verify(message) { + AddLocalInventoriesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.product != null && message.hasOwnProperty("product")) if (!$util.isString(message.product)) return "product: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.placeIds != null && message.hasOwnProperty("placeIds")) { - if (!Array.isArray(message.placeIds)) - return "placeIds: array expected"; - for (var i = 0; i < message.placeIds.length; ++i) - if (!$util.isString(message.placeIds[i])) - return "placeIds: string[] expected"; + 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.v2beta.LocalInventory.verify(message.localInventories[i]); + if (error) + return "localInventories." + error; + } + } + if (message.addMask != null && message.hasOwnProperty("addMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.addMask); + if (error) + return "addMask." + error; } if (message.addTime != null && message.hasOwnProperty("addTime")) { var error = $root.google.protobuf.Timestamp.verify(message.addTime); @@ -72404,31 +84953,37 @@ }; /** - * Creates an AddFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AddLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2beta.AddLocalInventoriesRequest} AddLocalInventoriesRequest */ - AddFulfillmentPlacesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest) + AddLocalInventoriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.AddLocalInventoriesRequest) return object; - var message = new $root.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest(); + var message = new $root.google.cloud.retail.v2beta.AddLocalInventoriesRequest(); if (object.product != null) message.product = String(object.product); - if (object.type != null) - message.type = String(object.type); - if (object.placeIds) { - if (!Array.isArray(object.placeIds)) - throw TypeError(".google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.placeIds: array expected"); - message.placeIds = []; - for (var i = 0; i < object.placeIds.length; ++i) - message.placeIds[i] = String(object.placeIds[i]); + if (object.localInventories) { + if (!Array.isArray(object.localInventories)) + throw TypeError(".google.cloud.retail.v2beta.AddLocalInventoriesRequest.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.v2beta.AddLocalInventoriesRequest.localInventories: object expected"); + message.localInventories[i] = $root.google.cloud.retail.v2beta.LocalInventory.fromObject(object.localInventories[i]); + } + } + if (object.addMask != null) { + if (typeof object.addMask !== "object") + throw TypeError(".google.cloud.retail.v2beta.AddLocalInventoriesRequest.addMask: object expected"); + message.addMask = $root.google.protobuf.FieldMask.fromObject(object.addMask); } if (object.addTime != null) { if (typeof object.addTime !== "object") - throw TypeError(".google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.addTime: object expected"); + throw TypeError(".google.cloud.retail.v2beta.AddLocalInventoriesRequest.addTime: object expected"); message.addTime = $root.google.protobuf.Timestamp.fromObject(object.addTime); } if (object.allowMissing != null) @@ -72437,35 +84992,35 @@ }; /** - * Creates a plain object from an AddFulfillmentPlacesRequest message. Also converts values to other types if specified. + * Creates a plain object from an AddLocalInventoriesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2beta.AddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest + * @param {google.cloud.retail.v2beta.AddLocalInventoriesRequest} message AddLocalInventoriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddFulfillmentPlacesRequest.toObject = function toObject(message, options) { + AddLocalInventoriesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.placeIds = []; + object.localInventories = []; if (options.defaults) { object.product = ""; - object.type = ""; + object.addMask = null; object.addTime = null; object.allowMissing = false; } if (message.product != null && message.hasOwnProperty("product")) object.product = message.product; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.placeIds && message.placeIds.length) { - object.placeIds = []; - for (var j = 0; j < message.placeIds.length; ++j) - object.placeIds[j] = message.placeIds[j]; + if (message.localInventories && message.localInventories.length) { + object.localInventories = []; + for (var j = 0; j < message.localInventories.length; ++j) + object.localInventories[j] = $root.google.cloud.retail.v2beta.LocalInventory.toObject(message.localInventories[j], options); } + if (message.addMask != null && message.hasOwnProperty("addMask")) + object.addMask = $root.google.protobuf.FieldMask.toObject(message.addMask, options); if (message.addTime != null && message.hasOwnProperty("addTime")) object.addTime = $root.google.protobuf.Timestamp.toObject(message.addTime, options); if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) @@ -72474,36 +85029,36 @@ }; /** - * Converts this AddFulfillmentPlacesRequest to JSON. + * Converts this AddLocalInventoriesRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesRequest * @instance * @returns {Object.} JSON object */ - AddFulfillmentPlacesRequest.prototype.toJSON = function toJSON() { + AddLocalInventoriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AddFulfillmentPlacesRequest; + return AddLocalInventoriesRequest; })(); - v2beta.AddFulfillmentPlacesMetadata = (function() { + v2beta.AddLocalInventoriesMetadata = (function() { /** - * Properties of an AddFulfillmentPlacesMetadata. + * Properties of an AddLocalInventoriesMetadata. * @memberof google.cloud.retail.v2beta - * @interface IAddFulfillmentPlacesMetadata + * @interface IAddLocalInventoriesMetadata */ /** - * Constructs a new AddFulfillmentPlacesMetadata. + * Constructs a new AddLocalInventoriesMetadata. * @memberof google.cloud.retail.v2beta - * @classdesc Represents an AddFulfillmentPlacesMetadata. - * @implements IAddFulfillmentPlacesMetadata + * @classdesc Represents an AddLocalInventoriesMetadata. + * @implements IAddLocalInventoriesMetadata * @constructor - * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IAddLocalInventoriesMetadata=} [properties] Properties to set */ - function AddFulfillmentPlacesMetadata(properties) { + function AddLocalInventoriesMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -72511,60 +85066,60 @@ } /** - * Creates a new AddFulfillmentPlacesMetadata instance using the specified properties. + * Creates a new AddLocalInventoriesMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata instance + * @param {google.cloud.retail.v2beta.IAddLocalInventoriesMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata instance */ - AddFulfillmentPlacesMetadata.create = function create(properties) { - return new AddFulfillmentPlacesMetadata(properties); + AddLocalInventoriesMetadata.create = function create(properties) { + return new AddLocalInventoriesMetadata(properties); }; /** - * Encodes the specified AddFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata.verify|verify} messages. + * Encodes the specified AddLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.AddLocalInventoriesMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata message or plain object to encode + * @param {google.cloud.retail.v2beta.IAddLocalInventoriesMetadata} message AddLocalInventoriesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddFulfillmentPlacesMetadata.encode = function encode(message, writer) { + AddLocalInventoriesMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** - * Encodes the specified AddFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata.verify|verify} messages. + * Encodes the specified AddLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddLocalInventoriesMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata message or plain object to encode + * @param {google.cloud.retail.v2beta.IAddLocalInventoriesMetadata} message AddLocalInventoriesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddFulfillmentPlacesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + AddLocalInventoriesMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer. + * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2beta.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddFulfillmentPlacesMetadata.decode = function decode(reader, length) { + AddLocalInventoriesMetadata.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.v2beta.AddFulfillmentPlacesMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.AddLocalInventoriesMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -72577,93 +85132,93 @@ }; /** - * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. + * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2beta.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddFulfillmentPlacesMetadata.decodeDelimited = function decodeDelimited(reader) { + AddLocalInventoriesMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AddFulfillmentPlacesMetadata message. + * Verifies an AddLocalInventoriesMetadata message. * @function verify - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AddFulfillmentPlacesMetadata.verify = function verify(message) { + AddLocalInventoriesMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** - * Creates an AddFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an AddLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2beta.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata */ - AddFulfillmentPlacesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata) + AddLocalInventoriesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.AddLocalInventoriesMetadata) return object; - return new $root.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata(); + return new $root.google.cloud.retail.v2beta.AddLocalInventoriesMetadata(); }; /** - * Creates a plain object from an AddFulfillmentPlacesMetadata message. Also converts values to other types if specified. + * Creates a plain object from an AddLocalInventoriesMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata + * @param {google.cloud.retail.v2beta.AddLocalInventoriesMetadata} message AddLocalInventoriesMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddFulfillmentPlacesMetadata.toObject = function toObject() { + AddLocalInventoriesMetadata.toObject = function toObject() { return {}; }; /** - * Converts this AddFulfillmentPlacesMetadata to JSON. + * Converts this AddLocalInventoriesMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesMetadata * @instance * @returns {Object.} JSON object */ - AddFulfillmentPlacesMetadata.prototype.toJSON = function toJSON() { + AddLocalInventoriesMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AddFulfillmentPlacesMetadata; + return AddLocalInventoriesMetadata; })(); - v2beta.AddFulfillmentPlacesResponse = (function() { + v2beta.AddLocalInventoriesResponse = (function() { /** - * Properties of an AddFulfillmentPlacesResponse. + * Properties of an AddLocalInventoriesResponse. * @memberof google.cloud.retail.v2beta - * @interface IAddFulfillmentPlacesResponse + * @interface IAddLocalInventoriesResponse */ /** - * Constructs a new AddFulfillmentPlacesResponse. + * Constructs a new AddLocalInventoriesResponse. * @memberof google.cloud.retail.v2beta - * @classdesc Represents an AddFulfillmentPlacesResponse. - * @implements IAddFulfillmentPlacesResponse + * @classdesc Represents an AddLocalInventoriesResponse. + * @implements IAddLocalInventoriesResponse * @constructor - * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IAddLocalInventoriesResponse=} [properties] Properties to set */ - function AddFulfillmentPlacesResponse(properties) { + function AddLocalInventoriesResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -72671,60 +85226,60 @@ } /** - * Creates a new AddFulfillmentPlacesResponse instance using the specified properties. + * Creates a new AddLocalInventoriesResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse instance + * @param {google.cloud.retail.v2beta.IAddLocalInventoriesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.AddLocalInventoriesResponse} AddLocalInventoriesResponse instance */ - AddFulfillmentPlacesResponse.create = function create(properties) { - return new AddFulfillmentPlacesResponse(properties); + AddLocalInventoriesResponse.create = function create(properties) { + return new AddLocalInventoriesResponse(properties); }; /** - * Encodes the specified AddFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesResponse.verify|verify} messages. + * Encodes the specified AddLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2beta.AddLocalInventoriesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IAddLocalInventoriesResponse} message AddLocalInventoriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddFulfillmentPlacesResponse.encode = function encode(message, writer) { + AddLocalInventoriesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** - * Encodes the specified AddFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddFulfillmentPlacesResponse.verify|verify} messages. + * Encodes the specified AddLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddLocalInventoriesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2beta.IAddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IAddLocalInventoriesResponse} message AddLocalInventoriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddFulfillmentPlacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + AddLocalInventoriesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer. + * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2beta.AddLocalInventoriesResponse} AddLocalInventoriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddFulfillmentPlacesResponse.decode = function decode(reader, length) { + AddLocalInventoriesResponse.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.v2beta.AddFulfillmentPlacesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.AddLocalInventoriesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -72737,211 +85292,200 @@ }; /** - * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. + * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2beta.AddLocalInventoriesResponse} AddLocalInventoriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddFulfillmentPlacesResponse.decodeDelimited = function decodeDelimited(reader) { + AddLocalInventoriesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AddFulfillmentPlacesResponse message. + * Verifies an AddLocalInventoriesResponse message. * @function verify - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AddFulfillmentPlacesResponse.verify = function verify(message) { + AddLocalInventoriesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** - * Creates an AddFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AddLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2beta.AddLocalInventoriesResponse} AddLocalInventoriesResponse */ - AddFulfillmentPlacesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse) + AddLocalInventoriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.AddLocalInventoriesResponse) return object; - return new $root.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse(); + return new $root.google.cloud.retail.v2beta.AddLocalInventoriesResponse(); }; /** - * Creates a plain object from an AddFulfillmentPlacesResponse message. Also converts values to other types if specified. + * Creates a plain object from an AddLocalInventoriesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2beta.AddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse + * @param {google.cloud.retail.v2beta.AddLocalInventoriesResponse} message AddLocalInventoriesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddFulfillmentPlacesResponse.toObject = function toObject() { + AddLocalInventoriesResponse.toObject = function toObject() { return {}; }; /** - * Converts this AddFulfillmentPlacesResponse to JSON. + * Converts this AddLocalInventoriesResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.AddLocalInventoriesResponse * @instance * @returns {Object.} JSON object */ - AddFulfillmentPlacesResponse.prototype.toJSON = function toJSON() { + AddLocalInventoriesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AddFulfillmentPlacesResponse; + return AddLocalInventoriesResponse; })(); - v2beta.RemoveFulfillmentPlacesRequest = (function() { + v2beta.RemoveLocalInventoriesRequest = (function() { /** - * Properties of a RemoveFulfillmentPlacesRequest. + * Properties of a RemoveLocalInventoriesRequest. * @memberof google.cloud.retail.v2beta - * @interface IRemoveFulfillmentPlacesRequest - * @property {string|null} [product] RemoveFulfillmentPlacesRequest product - * @property {string|null} [type] RemoveFulfillmentPlacesRequest type - * @property {Array.|null} [placeIds] RemoveFulfillmentPlacesRequest placeIds - * @property {google.protobuf.ITimestamp|null} [removeTime] RemoveFulfillmentPlacesRequest removeTime - * @property {boolean|null} [allowMissing] RemoveFulfillmentPlacesRequest allowMissing + * @interface IRemoveLocalInventoriesRequest + * @property {string|null} [product] RemoveLocalInventoriesRequest product + * @property {Array.|null} [placeIds] RemoveLocalInventoriesRequest placeIds + * @property {google.protobuf.ITimestamp|null} [removeTime] RemoveLocalInventoriesRequest removeTime + * @property {boolean|null} [allowMissing] RemoveLocalInventoriesRequest allowMissing */ /** - * Constructs a new RemoveFulfillmentPlacesRequest. + * Constructs a new RemoveLocalInventoriesRequest. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a RemoveFulfillmentPlacesRequest. - * @implements IRemoveFulfillmentPlacesRequest + * @classdesc Represents a RemoveLocalInventoriesRequest. + * @implements IRemoveLocalInventoriesRequest * @constructor - * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IRemoveLocalInventoriesRequest=} [properties] Properties to set */ - function RemoveFulfillmentPlacesRequest(properties) { + function RemoveLocalInventoriesRequest(properties) { this.placeIds = []; 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]]; - } - - /** - * RemoveFulfillmentPlacesRequest product. - * @member {string} product - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest - * @instance - */ - RemoveFulfillmentPlacesRequest.prototype.product = ""; + } /** - * RemoveFulfillmentPlacesRequest type. - * @member {string} type - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest + * RemoveLocalInventoriesRequest product. + * @member {string} product + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesRequest * @instance */ - RemoveFulfillmentPlacesRequest.prototype.type = ""; + RemoveLocalInventoriesRequest.prototype.product = ""; /** - * RemoveFulfillmentPlacesRequest placeIds. + * RemoveLocalInventoriesRequest placeIds. * @member {Array.} placeIds - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesRequest * @instance */ - RemoveFulfillmentPlacesRequest.prototype.placeIds = $util.emptyArray; + RemoveLocalInventoriesRequest.prototype.placeIds = $util.emptyArray; /** - * RemoveFulfillmentPlacesRequest removeTime. + * RemoveLocalInventoriesRequest removeTime. * @member {google.protobuf.ITimestamp|null|undefined} removeTime - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesRequest * @instance */ - RemoveFulfillmentPlacesRequest.prototype.removeTime = null; + RemoveLocalInventoriesRequest.prototype.removeTime = null; /** - * RemoveFulfillmentPlacesRequest allowMissing. + * RemoveLocalInventoriesRequest allowMissing. * @member {boolean} allowMissing - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesRequest * @instance */ - RemoveFulfillmentPlacesRequest.prototype.allowMissing = false; + RemoveLocalInventoriesRequest.prototype.allowMissing = false; /** - * Creates a new RemoveFulfillmentPlacesRequest instance using the specified properties. + * Creates a new RemoveLocalInventoriesRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest instance + * @param {google.cloud.retail.v2beta.IRemoveLocalInventoriesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest instance */ - RemoveFulfillmentPlacesRequest.create = function create(properties) { - return new RemoveFulfillmentPlacesRequest(properties); + RemoveLocalInventoriesRequest.create = function create(properties) { + return new RemoveLocalInventoriesRequest(properties); }; /** - * Encodes the specified RemoveFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2beta.RemoveLocalInventoriesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IRemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesRequest.encode = function encode(message, writer) { + RemoveLocalInventoriesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.product != null && Object.hasOwnProperty.call(message, "product")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); if (message.placeIds != null && message.placeIds.length) for (var i = 0; i < message.placeIds.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.placeIds[i]); - if (message.removeTime != null && Object.hasOwnProperty.call(message, "removeTime")) - $root.google.protobuf.Timestamp.encode(message.removeTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + writer.uint32(/* id 2, wireType 2 =*/18).string(message.placeIds[i]); if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + if (message.removeTime != null && Object.hasOwnProperty.call(message, "removeTime")) + $root.google.protobuf.Timestamp.encode(message.removeTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified RemoveFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.RemoveLocalInventoriesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IRemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesRequest.encodeDelimited = function encodeDelimited(message, writer) { + RemoveLocalInventoriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2beta.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesRequest.decode = function decode(reader, length) { + RemoveLocalInventoriesRequest.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.v2beta.RemoveFulfillmentPlacesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -72949,17 +85493,14 @@ message.product = reader.string(); break; case 2: - message.type = reader.string(); - break; - case 3: if (!(message.placeIds && message.placeIds.length)) message.placeIds = []; message.placeIds.push(reader.string()); break; - case 4: + case 5: message.removeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; - case 5: + case 3: message.allowMissing = reader.bool(); break; default: @@ -72971,38 +85512,35 @@ }; /** - * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2beta.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesRequest.decodeDelimited = function decodeDelimited(reader) { + RemoveLocalInventoriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveFulfillmentPlacesRequest message. + * Verifies a RemoveLocalInventoriesRequest message. * @function verify - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveFulfillmentPlacesRequest.verify = function verify(message) { + RemoveLocalInventoriesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.product != null && message.hasOwnProperty("product")) if (!$util.isString(message.product)) return "product: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; if (message.placeIds != null && message.hasOwnProperty("placeIds")) { if (!Array.isArray(message.placeIds)) return "placeIds: array expected"; @@ -73022,31 +85560,29 @@ }; /** - * Creates a RemoveFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2beta.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest */ - RemoveFulfillmentPlacesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest) + RemoveLocalInventoriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest) return object; - var message = new $root.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest(); + var message = new $root.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest(); if (object.product != null) message.product = String(object.product); - if (object.type != null) - message.type = String(object.type); if (object.placeIds) { if (!Array.isArray(object.placeIds)) - throw TypeError(".google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.placeIds: array expected"); + throw TypeError(".google.cloud.retail.v2beta.RemoveLocalInventoriesRequest.placeIds: array expected"); message.placeIds = []; for (var i = 0; i < object.placeIds.length; ++i) message.placeIds[i] = String(object.placeIds[i]); } if (object.removeTime != null) { if (typeof object.removeTime !== "object") - throw TypeError(".google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.removeTime: object expected"); + throw TypeError(".google.cloud.retail.v2beta.RemoveLocalInventoriesRequest.removeTime: object expected"); message.removeTime = $root.google.protobuf.Timestamp.fromObject(object.removeTime); } if (object.allowMissing != null) @@ -73055,15 +85591,15 @@ }; /** - * Creates a plain object from a RemoveFulfillmentPlacesRequest message. Also converts values to other types if specified. + * Creates a plain object from a RemoveLocalInventoriesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest + * @param {google.cloud.retail.v2beta.RemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveFulfillmentPlacesRequest.toObject = function toObject(message, options) { + RemoveLocalInventoriesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -73071,57 +85607,54 @@ object.placeIds = []; if (options.defaults) { object.product = ""; - object.type = ""; - object.removeTime = null; object.allowMissing = false; + object.removeTime = null; } if (message.product != null && message.hasOwnProperty("product")) object.product = message.product; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; if (message.placeIds && message.placeIds.length) { object.placeIds = []; for (var j = 0; j < message.placeIds.length; ++j) object.placeIds[j] = message.placeIds[j]; } - if (message.removeTime != null && message.hasOwnProperty("removeTime")) - object.removeTime = $root.google.protobuf.Timestamp.toObject(message.removeTime, options); if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) object.allowMissing = message.allowMissing; + if (message.removeTime != null && message.hasOwnProperty("removeTime")) + object.removeTime = $root.google.protobuf.Timestamp.toObject(message.removeTime, options); return object; }; /** - * Converts this RemoveFulfillmentPlacesRequest to JSON. + * Converts this RemoveLocalInventoriesRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesRequest * @instance * @returns {Object.} JSON object */ - RemoveFulfillmentPlacesRequest.prototype.toJSON = function toJSON() { + RemoveLocalInventoriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RemoveFulfillmentPlacesRequest; + return RemoveLocalInventoriesRequest; })(); - v2beta.RemoveFulfillmentPlacesMetadata = (function() { + v2beta.RemoveLocalInventoriesMetadata = (function() { /** - * Properties of a RemoveFulfillmentPlacesMetadata. + * Properties of a RemoveLocalInventoriesMetadata. * @memberof google.cloud.retail.v2beta - * @interface IRemoveFulfillmentPlacesMetadata + * @interface IRemoveLocalInventoriesMetadata */ /** - * Constructs a new RemoveFulfillmentPlacesMetadata. + * Constructs a new RemoveLocalInventoriesMetadata. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a RemoveFulfillmentPlacesMetadata. - * @implements IRemoveFulfillmentPlacesMetadata + * @classdesc Represents a RemoveLocalInventoriesMetadata. + * @implements IRemoveLocalInventoriesMetadata * @constructor - * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IRemoveLocalInventoriesMetadata=} [properties] Properties to set */ - function RemoveFulfillmentPlacesMetadata(properties) { + function RemoveLocalInventoriesMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -73129,60 +85662,60 @@ } /** - * Creates a new RemoveFulfillmentPlacesMetadata instance using the specified properties. + * Creates a new RemoveLocalInventoriesMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata instance + * @param {google.cloud.retail.v2beta.IRemoveLocalInventoriesMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata instance */ - RemoveFulfillmentPlacesMetadata.create = function create(properties) { - return new RemoveFulfillmentPlacesMetadata(properties); + RemoveLocalInventoriesMetadata.create = function create(properties) { + return new RemoveLocalInventoriesMetadata(properties); }; /** - * Encodes the specified RemoveFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata message or plain object to encode + * @param {google.cloud.retail.v2beta.IRemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesMetadata.encode = function encode(message, writer) { + RemoveLocalInventoriesMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** - * Encodes the specified RemoveFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata message or plain object to encode + * @param {google.cloud.retail.v2beta.IRemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + RemoveLocalInventoriesMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesMetadata.decode = function decode(reader, length) { + RemoveLocalInventoriesMetadata.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.v2beta.RemoveFulfillmentPlacesMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -73195,93 +85728,93 @@ }; /** - * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesMetadata.decodeDelimited = function decodeDelimited(reader) { + RemoveLocalInventoriesMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveFulfillmentPlacesMetadata message. + * Verifies a RemoveLocalInventoriesMetadata message. * @function verify - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveFulfillmentPlacesMetadata.verify = function verify(message) { + RemoveLocalInventoriesMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** - * Creates a RemoveFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata */ - RemoveFulfillmentPlacesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata) + RemoveLocalInventoriesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata) return object; - return new $root.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata(); + return new $root.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata(); }; /** - * Creates a plain object from a RemoveFulfillmentPlacesMetadata message. Also converts values to other types if specified. + * Creates a plain object from a RemoveLocalInventoriesMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata + * @param {google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveFulfillmentPlacesMetadata.toObject = function toObject() { + RemoveLocalInventoriesMetadata.toObject = function toObject() { return {}; }; /** - * Converts this RemoveFulfillmentPlacesMetadata to JSON. + * Converts this RemoveLocalInventoriesMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata * @instance * @returns {Object.} JSON object */ - RemoveFulfillmentPlacesMetadata.prototype.toJSON = function toJSON() { + RemoveLocalInventoriesMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RemoveFulfillmentPlacesMetadata; + return RemoveLocalInventoriesMetadata; })(); - v2beta.RemoveFulfillmentPlacesResponse = (function() { + v2beta.RemoveLocalInventoriesResponse = (function() { /** - * Properties of a RemoveFulfillmentPlacesResponse. + * Properties of a RemoveLocalInventoriesResponse. * @memberof google.cloud.retail.v2beta - * @interface IRemoveFulfillmentPlacesResponse + * @interface IRemoveLocalInventoriesResponse */ /** - * Constructs a new RemoveFulfillmentPlacesResponse. + * Constructs a new RemoveLocalInventoriesResponse. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a RemoveFulfillmentPlacesResponse. - * @implements IRemoveFulfillmentPlacesResponse + * @classdesc Represents a RemoveLocalInventoriesResponse. + * @implements IRemoveLocalInventoriesResponse * @constructor - * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IRemoveLocalInventoriesResponse=} [properties] Properties to set */ - function RemoveFulfillmentPlacesResponse(properties) { + function RemoveLocalInventoriesResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -73289,60 +85822,60 @@ } /** - * Creates a new RemoveFulfillmentPlacesResponse instance using the specified properties. + * Creates a new RemoveLocalInventoriesResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse instance + * @param {google.cloud.retail.v2beta.IRemoveLocalInventoriesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse instance */ - RemoveFulfillmentPlacesResponse.create = function create(properties) { - return new RemoveFulfillmentPlacesResponse(properties); + RemoveLocalInventoriesResponse.create = function create(properties) { + return new RemoveLocalInventoriesResponse(properties); }; /** - * Encodes the specified RemoveFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2beta.RemoveLocalInventoriesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IRemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesResponse.encode = function encode(message, writer) { + RemoveLocalInventoriesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** - * Encodes the specified RemoveFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.RemoveLocalInventoriesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IRemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + RemoveLocalInventoriesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2beta.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesResponse.decode = function decode(reader, length) { + RemoveLocalInventoriesResponse.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.v2beta.RemoveFulfillmentPlacesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -73355,93 +85888,99 @@ }; /** - * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2beta.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesResponse.decodeDelimited = function decodeDelimited(reader) { + RemoveLocalInventoriesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveFulfillmentPlacesResponse message. + * Verifies a RemoveLocalInventoriesResponse message. * @function verify - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveFulfillmentPlacesResponse.verify = function verify(message) { + RemoveLocalInventoriesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** - * Creates a RemoveFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2beta.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse */ - RemoveFulfillmentPlacesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse) + RemoveLocalInventoriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse) return object; - return new $root.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse(); + return new $root.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse(); }; /** - * Creates a plain object from a RemoveFulfillmentPlacesResponse message. Also converts values to other types if specified. + * Creates a plain object from a RemoveLocalInventoriesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse + * @param {google.cloud.retail.v2beta.RemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveFulfillmentPlacesResponse.toObject = function toObject() { + RemoveLocalInventoriesResponse.toObject = function toObject() { return {}; }; /** - * Converts this RemoveFulfillmentPlacesResponse to JSON. + * Converts this RemoveLocalInventoriesResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2beta.RemoveLocalInventoriesResponse * @instance * @returns {Object.} JSON object */ - RemoveFulfillmentPlacesResponse.prototype.toJSON = function toJSON() { + RemoveLocalInventoriesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RemoveFulfillmentPlacesResponse; + return RemoveLocalInventoriesResponse; })(); - v2beta.PurgeMetadata = (function() { + v2beta.RemoveFulfillmentPlacesRequest = (function() { /** - * Properties of a PurgeMetadata. + * Properties of a RemoveFulfillmentPlacesRequest. * @memberof google.cloud.retail.v2beta - * @interface IPurgeMetadata + * @interface IRemoveFulfillmentPlacesRequest + * @property {string|null} [product] RemoveFulfillmentPlacesRequest product + * @property {string|null} [type] RemoveFulfillmentPlacesRequest type + * @property {Array.|null} [placeIds] RemoveFulfillmentPlacesRequest placeIds + * @property {google.protobuf.ITimestamp|null} [removeTime] RemoveFulfillmentPlacesRequest removeTime + * @property {boolean|null} [allowMissing] RemoveFulfillmentPlacesRequest allowMissing */ /** - * Constructs a new PurgeMetadata. + * Constructs a new RemoveFulfillmentPlacesRequest. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a PurgeMetadata. - * @implements IPurgeMetadata + * @classdesc Represents a RemoveFulfillmentPlacesRequest. + * @implements IRemoveFulfillmentPlacesRequest * @constructor - * @param {google.cloud.retail.v2beta.IPurgeMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesRequest=} [properties] Properties to set */ - function PurgeMetadata(properties) { + function RemoveFulfillmentPlacesRequest(properties) { + this.placeIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -73449,264 +85988,130 @@ } /** - * Creates a new PurgeMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.PurgeMetadata - * @static - * @param {google.cloud.retail.v2beta.IPurgeMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.PurgeMetadata} PurgeMetadata instance - */ - PurgeMetadata.create = function create(properties) { - return new PurgeMetadata(properties); - }; - - /** - * Encodes the specified PurgeMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.PurgeMetadata - * @static - * @param {google.cloud.retail.v2beta.IPurgeMetadata} message PurgeMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PurgeMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified PurgeMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.PurgeMetadata - * @static - * @param {google.cloud.retail.v2beta.IPurgeMetadata} message PurgeMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PurgeMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PurgeMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.PurgeMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.PurgeMetadata} PurgeMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PurgeMetadata.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.v2beta.PurgeMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PurgeMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.PurgeMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.PurgeMetadata} PurgeMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PurgeMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PurgeMetadata message. - * @function verify - * @memberof google.cloud.retail.v2beta.PurgeMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PurgeMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a PurgeMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.PurgeMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.PurgeMetadata} PurgeMetadata - */ - PurgeMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.PurgeMetadata) - return object; - return new $root.google.cloud.retail.v2beta.PurgeMetadata(); - }; - - /** - * Creates a plain object from a PurgeMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.PurgeMetadata - * @static - * @param {google.cloud.retail.v2beta.PurgeMetadata} message PurgeMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PurgeMetadata.toObject = function toObject() { - return {}; - }; - - /** - * Converts this PurgeMetadata to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.PurgeMetadata + * RemoveFulfillmentPlacesRequest product. + * @member {string} product + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest * @instance - * @returns {Object.} JSON object - */ - PurgeMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PurgeMetadata; - })(); - - v2beta.PurgeUserEventsRequest = (function() { - - /** - * Properties of a PurgeUserEventsRequest. - * @memberof google.cloud.retail.v2beta - * @interface IPurgeUserEventsRequest - * @property {string|null} [parent] PurgeUserEventsRequest parent - * @property {string|null} [filter] PurgeUserEventsRequest filter - * @property {boolean|null} [force] PurgeUserEventsRequest force */ + RemoveFulfillmentPlacesRequest.prototype.product = ""; /** - * Constructs a new PurgeUserEventsRequest. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a PurgeUserEventsRequest. - * @implements IPurgeUserEventsRequest - * @constructor - * @param {google.cloud.retail.v2beta.IPurgeUserEventsRequest=} [properties] Properties to set + * RemoveFulfillmentPlacesRequest type. + * @member {string} type + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest + * @instance */ - function PurgeUserEventsRequest(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]]; - } + RemoveFulfillmentPlacesRequest.prototype.type = ""; /** - * PurgeUserEventsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * RemoveFulfillmentPlacesRequest placeIds. + * @member {Array.} placeIds + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest * @instance */ - PurgeUserEventsRequest.prototype.parent = ""; + RemoveFulfillmentPlacesRequest.prototype.placeIds = $util.emptyArray; /** - * PurgeUserEventsRequest filter. - * @member {string} filter - * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * RemoveFulfillmentPlacesRequest removeTime. + * @member {google.protobuf.ITimestamp|null|undefined} removeTime + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest * @instance */ - PurgeUserEventsRequest.prototype.filter = ""; + RemoveFulfillmentPlacesRequest.prototype.removeTime = null; /** - * PurgeUserEventsRequest force. - * @member {boolean} force - * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * RemoveFulfillmentPlacesRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest * @instance */ - PurgeUserEventsRequest.prototype.force = false; + RemoveFulfillmentPlacesRequest.prototype.allowMissing = false; /** - * Creates a new PurgeUserEventsRequest instance using the specified properties. + * Creates a new RemoveFulfillmentPlacesRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2beta.IPurgeUserEventsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.PurgeUserEventsRequest} PurgeUserEventsRequest instance + * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest instance */ - PurgeUserEventsRequest.create = function create(properties) { - return new PurgeUserEventsRequest(properties); + RemoveFulfillmentPlacesRequest.create = function create(properties) { + return new RemoveFulfillmentPlacesRequest(properties); }; /** - * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeUserEventsRequest.verify|verify} messages. + * Encodes the specified RemoveFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2beta.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsRequest.encode = function encode(message, writer) { + RemoveFulfillmentPlacesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.placeIds != null && message.placeIds.length) + for (var i = 0; i < message.placeIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.placeIds[i]); + if (message.removeTime != null && Object.hasOwnProperty.call(message, "removeTime")) + $root.google.protobuf.Timestamp.encode(message.removeTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); return writer; }; /** - * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeUserEventsRequest.verify|verify} messages. + * Encodes the specified RemoveFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2beta.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + RemoveFulfillmentPlacesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. + * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.PurgeUserEventsRequest} PurgeUserEventsRequest + * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeUserEventsRequest.decode = function decode(reader, length) { + RemoveFulfillmentPlacesRequest.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.v2beta.PurgeUserEventsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.product = reader.string(); break; case 2: - message.filter = reader.string(); + message.type = reader.string(); break; case 3: - message.force = reader.bool(); + if (!(message.placeIds && message.placeIds.length)) + message.placeIds = []; + message.placeIds.push(reader.string()); + break; + case 4: + message.removeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.allowMissing = reader.bool(); break; default: reader.skipType(tag & 7); @@ -73717,124 +86122,157 @@ }; /** - * Decodes a PurgeUserEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.PurgeUserEventsRequest} PurgeUserEventsRequest + * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { + RemoveFulfillmentPlacesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PurgeUserEventsRequest message. + * Verifies a RemoveFulfillmentPlacesRequest message. * @function verify - * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PurgeUserEventsRequest.verify = function verify(message) { + RemoveFulfillmentPlacesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; + if (message.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.placeIds != null && message.hasOwnProperty("placeIds")) { + if (!Array.isArray(message.placeIds)) + return "placeIds: array expected"; + for (var i = 0; i < message.placeIds.length; ++i) + if (!$util.isString(message.placeIds[i])) + return "placeIds: string[] expected"; + } + if (message.removeTime != null && message.hasOwnProperty("removeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.removeTime); + if (error) + return "removeTime." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a PurgeUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.PurgeUserEventsRequest} PurgeUserEventsRequest + * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest */ - PurgeUserEventsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.PurgeUserEventsRequest) + RemoveFulfillmentPlacesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest) return object; - var message = new $root.google.cloud.retail.v2beta.PurgeUserEventsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.force != null) - message.force = Boolean(object.force); + var message = new $root.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest(); + if (object.product != null) + message.product = String(object.product); + if (object.type != null) + message.type = String(object.type); + if (object.placeIds) { + if (!Array.isArray(object.placeIds)) + throw TypeError(".google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.placeIds: array expected"); + message.placeIds = []; + for (var i = 0; i < object.placeIds.length; ++i) + message.placeIds[i] = String(object.placeIds[i]); + } + if (object.removeTime != null) { + if (typeof object.removeTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.removeTime: object expected"); + message.removeTime = $root.google.protobuf.Timestamp.fromObject(object.removeTime); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a PurgeUserEventsRequest message. Also converts values to other types if specified. + * Creates a plain object from a RemoveFulfillmentPlacesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2beta.PurgeUserEventsRequest} message PurgeUserEventsRequest + * @param {google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PurgeUserEventsRequest.toObject = function toObject(message, options) { + RemoveFulfillmentPlacesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.placeIds = []; if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.force = false; + object.product = ""; + object.type = ""; + object.removeTime = null; + object.allowMissing = false; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.placeIds && message.placeIds.length) { + object.placeIds = []; + for (var j = 0; j < message.placeIds.length; ++j) + object.placeIds[j] = message.placeIds[j]; + } + if (message.removeTime != null && message.hasOwnProperty("removeTime")) + object.removeTime = $root.google.protobuf.Timestamp.toObject(message.removeTime, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; return object; }; /** - * Converts this PurgeUserEventsRequest to JSON. + * Converts this RemoveFulfillmentPlacesRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest * @instance * @returns {Object.} JSON object */ - PurgeUserEventsRequest.prototype.toJSON = function toJSON() { + RemoveFulfillmentPlacesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PurgeUserEventsRequest; + return RemoveFulfillmentPlacesRequest; })(); - v2beta.PurgeUserEventsResponse = (function() { + v2beta.RemoveFulfillmentPlacesMetadata = (function() { /** - * Properties of a PurgeUserEventsResponse. + * Properties of a RemoveFulfillmentPlacesMetadata. * @memberof google.cloud.retail.v2beta - * @interface IPurgeUserEventsResponse - * @property {number|Long|null} [purgedEventsCount] PurgeUserEventsResponse purgedEventsCount + * @interface IRemoveFulfillmentPlacesMetadata */ /** - * Constructs a new PurgeUserEventsResponse. + * Constructs a new RemoveFulfillmentPlacesMetadata. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a PurgeUserEventsResponse. - * @implements IPurgeUserEventsResponse + * @classdesc Represents a RemoveFulfillmentPlacesMetadata. + * @implements IRemoveFulfillmentPlacesMetadata * @constructor - * @param {google.cloud.retail.v2beta.IPurgeUserEventsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesMetadata=} [properties] Properties to set */ - function PurgeUserEventsResponse(properties) { + function RemoveFulfillmentPlacesMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -73842,76 +86280,63 @@ } /** - * PurgeUserEventsResponse purgedEventsCount. - * @member {number|Long} purgedEventsCount - * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse - * @instance - */ - PurgeUserEventsResponse.prototype.purgedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new PurgeUserEventsResponse instance using the specified properties. + * Creates a new RemoveFulfillmentPlacesMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2beta.IPurgeUserEventsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.PurgeUserEventsResponse} PurgeUserEventsResponse instance + * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata instance */ - PurgeUserEventsResponse.create = function create(properties) { - return new PurgeUserEventsResponse(properties); + RemoveFulfillmentPlacesMetadata.create = function create(properties) { + return new RemoveFulfillmentPlacesMetadata(properties); }; /** - * Encodes the specified PurgeUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeUserEventsResponse.verify|verify} messages. + * Encodes the specified RemoveFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2beta.IPurgeUserEventsResponse} message PurgeUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsResponse.encode = function encode(message, writer) { + RemoveFulfillmentPlacesMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.purgedEventsCount != null && Object.hasOwnProperty.call(message, "purgedEventsCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.purgedEventsCount); return writer; }; /** - * Encodes the specified PurgeUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeUserEventsResponse.verify|verify} messages. + * Encodes the specified RemoveFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2beta.IPurgeUserEventsResponse} message PurgeUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + RemoveFulfillmentPlacesMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PurgeUserEventsResponse message from the specified reader or buffer. + * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.PurgeUserEventsResponse} PurgeUserEventsResponse + * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeUserEventsResponse.decode = function decode(reader, length) { + RemoveFulfillmentPlacesMetadata.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.v2beta.PurgeUserEventsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.purgedEventsCount = reader.int64(); - break; default: reader.skipType(tag & 7); break; @@ -73921,516 +86346,157 @@ }; /** - * Decodes a PurgeUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.PurgeUserEventsResponse} PurgeUserEventsResponse + * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { + RemoveFulfillmentPlacesMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PurgeUserEventsResponse message. + * Verifies a RemoveFulfillmentPlacesMetadata message. * @function verify - * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PurgeUserEventsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.purgedEventsCount != null && message.hasOwnProperty("purgedEventsCount")) - if (!$util.isInteger(message.purgedEventsCount) && !(message.purgedEventsCount && $util.isInteger(message.purgedEventsCount.low) && $util.isInteger(message.purgedEventsCount.high))) - return "purgedEventsCount: integer|Long expected"; - return null; - }; - - /** - * Creates a PurgeUserEventsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.PurgeUserEventsResponse} PurgeUserEventsResponse - */ - PurgeUserEventsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.PurgeUserEventsResponse) - return object; - var message = new $root.google.cloud.retail.v2beta.PurgeUserEventsResponse(); - if (object.purgedEventsCount != null) - if ($util.Long) - (message.purgedEventsCount = $util.Long.fromValue(object.purgedEventsCount)).unsigned = false; - else if (typeof object.purgedEventsCount === "string") - message.purgedEventsCount = parseInt(object.purgedEventsCount, 10); - else if (typeof object.purgedEventsCount === "number") - message.purgedEventsCount = object.purgedEventsCount; - else if (typeof object.purgedEventsCount === "object") - message.purgedEventsCount = new $util.LongBits(object.purgedEventsCount.low >>> 0, object.purgedEventsCount.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a PurgeUserEventsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse - * @static - * @param {google.cloud.retail.v2beta.PurgeUserEventsResponse} message PurgeUserEventsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PurgeUserEventsResponse.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.purgedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.purgedEventsCount = options.longs === String ? "0" : 0; - if (message.purgedEventsCount != null && message.hasOwnProperty("purgedEventsCount")) - if (typeof message.purgedEventsCount === "number") - object.purgedEventsCount = options.longs === String ? String(message.purgedEventsCount) : message.purgedEventsCount; - else - object.purgedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.purgedEventsCount) : options.longs === Number ? new $util.LongBits(message.purgedEventsCount.low >>> 0, message.purgedEventsCount.high >>> 0).toNumber() : message.purgedEventsCount; - return object; - }; - - /** - * Converts this PurgeUserEventsResponse to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse - * @instance - * @returns {Object.} JSON object - */ - PurgeUserEventsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PurgeUserEventsResponse; - })(); - - v2beta.SearchService = (function() { - - /** - * Constructs a new SearchService service. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a SearchService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function SearchService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (SearchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SearchService; - - /** - * Creates new SearchService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.retail.v2beta.SearchService + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {SearchService} RPC service. Useful where requests and/or responses are streamed. - */ - SearchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.retail.v2beta.SearchService#search}. - * @memberof google.cloud.retail.v2beta.SearchService - * @typedef SearchCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2beta.SearchResponse} [response] SearchResponse - */ - - /** - * Calls Search. - * @function search - * @memberof google.cloud.retail.v2beta.SearchService - * @instance - * @param {google.cloud.retail.v2beta.ISearchRequest} request SearchRequest message or plain object - * @param {google.cloud.retail.v2beta.SearchService.SearchCallback} callback Node-style callback called with the error, if any, and SearchResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SearchService.prototype.search = function search(request, callback) { - return this.rpcCall(search, $root.google.cloud.retail.v2beta.SearchRequest, $root.google.cloud.retail.v2beta.SearchResponse, request, callback); - }, "name", { value: "Search" }); - - /** - * Calls Search. - * @function search - * @memberof google.cloud.retail.v2beta.SearchService - * @instance - * @param {google.cloud.retail.v2beta.ISearchRequest} request SearchRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return SearchService; - })(); - - v2beta.SearchRequest = (function() { - - /** - * Properties of a SearchRequest. - * @memberof google.cloud.retail.v2beta - * @interface ISearchRequest - * @property {string|null} [placement] SearchRequest placement - * @property {string|null} [branch] SearchRequest branch - * @property {string|null} [query] SearchRequest query - * @property {string|null} [visitorId] SearchRequest visitorId - * @property {google.cloud.retail.v2beta.IUserInfo|null} [userInfo] SearchRequest userInfo - * @property {number|null} [pageSize] SearchRequest pageSize - * @property {string|null} [pageToken] SearchRequest pageToken - * @property {number|null} [offset] SearchRequest offset - * @property {string|null} [filter] SearchRequest filter - * @property {string|null} [canonicalFilter] SearchRequest canonicalFilter - * @property {string|null} [orderBy] SearchRequest orderBy - * @property {Array.|null} [facetSpecs] SearchRequest facetSpecs - * @property {google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec|null} [dynamicFacetSpec] SearchRequest dynamicFacetSpec - * @property {google.cloud.retail.v2beta.SearchRequest.IBoostSpec|null} [boostSpec] SearchRequest boostSpec - * @property {google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec|null} [queryExpansionSpec] SearchRequest queryExpansionSpec - * @property {Array.|null} [variantRollupKeys] SearchRequest variantRollupKeys - * @property {Array.|null} [pageCategories] SearchRequest pageCategories - * @property {google.cloud.retail.v2beta.SearchRequest.SearchMode|null} [searchMode] SearchRequest searchMode - */ - - /** - * Constructs a new SearchRequest. - * @memberof google.cloud.retail.v2beta - * @classdesc Represents a SearchRequest. - * @implements ISearchRequest - * @constructor - * @param {google.cloud.retail.v2beta.ISearchRequest=} [properties] Properties to set - */ - function SearchRequest(properties) { - this.facetSpecs = []; - this.variantRollupKeys = []; - this.pageCategories = []; - 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]]; - } - - /** - * SearchRequest placement. - * @member {string} placement - * @memberof google.cloud.retail.v2beta.SearchRequest - * @instance - */ - SearchRequest.prototype.placement = ""; - - /** - * SearchRequest branch. - * @member {string} branch - * @memberof google.cloud.retail.v2beta.SearchRequest - * @instance - */ - SearchRequest.prototype.branch = ""; - - /** - * SearchRequest query. - * @member {string} query - * @memberof google.cloud.retail.v2beta.SearchRequest - * @instance - */ - SearchRequest.prototype.query = ""; - - /** - * SearchRequest visitorId. - * @member {string} visitorId - * @memberof google.cloud.retail.v2beta.SearchRequest - * @instance - */ - SearchRequest.prototype.visitorId = ""; - - /** - * SearchRequest userInfo. - * @member {google.cloud.retail.v2beta.IUserInfo|null|undefined} userInfo - * @memberof google.cloud.retail.v2beta.SearchRequest - * @instance - */ - SearchRequest.prototype.userInfo = null; - - /** - * SearchRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.retail.v2beta.SearchRequest - * @instance - */ - SearchRequest.prototype.pageSize = 0; - - /** - * SearchRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.retail.v2beta.SearchRequest - * @instance - */ - SearchRequest.prototype.pageToken = ""; - - /** - * SearchRequest offset. - * @member {number} offset - * @memberof google.cloud.retail.v2beta.SearchRequest - * @instance - */ - SearchRequest.prototype.offset = 0; - - /** - * SearchRequest filter. - * @member {string} filter - * @memberof google.cloud.retail.v2beta.SearchRequest - * @instance - */ - SearchRequest.prototype.filter = ""; - - /** - * SearchRequest canonicalFilter. - * @member {string} canonicalFilter - * @memberof google.cloud.retail.v2beta.SearchRequest - * @instance - */ - SearchRequest.prototype.canonicalFilter = ""; - - /** - * SearchRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.retail.v2beta.SearchRequest - * @instance - */ - SearchRequest.prototype.orderBy = ""; - - /** - * SearchRequest facetSpecs. - * @member {Array.} facetSpecs - * @memberof google.cloud.retail.v2beta.SearchRequest - * @instance + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchRequest.prototype.facetSpecs = $util.emptyArray; + RemoveFulfillmentPlacesMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; /** - * SearchRequest dynamicFacetSpec. - * @member {google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec|null|undefined} dynamicFacetSpec - * @memberof google.cloud.retail.v2beta.SearchRequest - * @instance + * Creates a RemoveFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata */ - SearchRequest.prototype.dynamicFacetSpec = null; + RemoveFulfillmentPlacesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata) + return object; + return new $root.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata(); + }; /** - * SearchRequest boostSpec. - * @member {google.cloud.retail.v2beta.SearchRequest.IBoostSpec|null|undefined} boostSpec - * @memberof google.cloud.retail.v2beta.SearchRequest - * @instance + * Creates a plain object from a RemoveFulfillmentPlacesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata + * @static + * @param {google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - SearchRequest.prototype.boostSpec = null; + RemoveFulfillmentPlacesMetadata.toObject = function toObject() { + return {}; + }; /** - * SearchRequest queryExpansionSpec. - * @member {google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec|null|undefined} queryExpansionSpec - * @memberof google.cloud.retail.v2beta.SearchRequest + * Converts this RemoveFulfillmentPlacesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata * @instance + * @returns {Object.} JSON object */ - SearchRequest.prototype.queryExpansionSpec = null; + RemoveFulfillmentPlacesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * SearchRequest variantRollupKeys. - * @member {Array.} variantRollupKeys - * @memberof google.cloud.retail.v2beta.SearchRequest - * @instance - */ - SearchRequest.prototype.variantRollupKeys = $util.emptyArray; + return RemoveFulfillmentPlacesMetadata; + })(); + + v2beta.RemoveFulfillmentPlacesResponse = (function() { /** - * SearchRequest pageCategories. - * @member {Array.} pageCategories - * @memberof google.cloud.retail.v2beta.SearchRequest - * @instance + * Properties of a RemoveFulfillmentPlacesResponse. + * @memberof google.cloud.retail.v2beta + * @interface IRemoveFulfillmentPlacesResponse */ - SearchRequest.prototype.pageCategories = $util.emptyArray; /** - * SearchRequest searchMode. - * @member {google.cloud.retail.v2beta.SearchRequest.SearchMode} searchMode - * @memberof google.cloud.retail.v2beta.SearchRequest - * @instance + * Constructs a new RemoveFulfillmentPlacesResponse. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a RemoveFulfillmentPlacesResponse. + * @implements IRemoveFulfillmentPlacesResponse + * @constructor + * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesResponse=} [properties] Properties to set */ - SearchRequest.prototype.searchMode = 0; + function RemoveFulfillmentPlacesResponse(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]]; + } /** - * Creates a new SearchRequest instance using the specified properties. + * Creates a new RemoveFulfillmentPlacesResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.SearchRequest + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse * @static - * @param {google.cloud.retail.v2beta.ISearchRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.SearchRequest} SearchRequest instance + * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse instance */ - SearchRequest.create = function create(properties) { - return new SearchRequest(properties); + RemoveFulfillmentPlacesResponse.create = function create(properties) { + return new RemoveFulfillmentPlacesResponse(properties); }; /** - * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.verify|verify} messages. + * Encodes the specified RemoveFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.SearchRequest + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse * @static - * @param {google.cloud.retail.v2beta.ISearchRequest} message SearchRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchRequest.encode = function encode(message, writer) { + RemoveFulfillmentPlacesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.placement); - if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.branch); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); - if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.visitorId); - if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) - $root.google.cloud.retail.v2beta.UserInfo.encode(message.userInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.offset); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.orderBy); - if (message.facetSpecs != null && message.facetSpecs.length) - for (var i = 0; i < message.facetSpecs.length; ++i) - $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.encode(message.facetSpecs[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.boostSpec != null && Object.hasOwnProperty.call(message, "boostSpec")) - $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.encode(message.boostSpec, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.queryExpansionSpec != null && Object.hasOwnProperty.call(message, "queryExpansionSpec")) - $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.encode(message.queryExpansionSpec, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.variantRollupKeys != null && message.variantRollupKeys.length) - for (var i = 0; i < message.variantRollupKeys.length; ++i) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.variantRollupKeys[i]); - if (message.dynamicFacetSpec != null && Object.hasOwnProperty.call(message, "dynamicFacetSpec")) - $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.encode(message.dynamicFacetSpec, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.pageCategories != null && message.pageCategories.length) - for (var i = 0; i < message.pageCategories.length; ++i) - writer.uint32(/* id 23, wireType 2 =*/186).string(message.pageCategories[i]); - if (message.canonicalFilter != null && Object.hasOwnProperty.call(message, "canonicalFilter")) - writer.uint32(/* id 28, wireType 2 =*/226).string(message.canonicalFilter); - if (message.searchMode != null && Object.hasOwnProperty.call(message, "searchMode")) - writer.uint32(/* id 31, wireType 0 =*/248).int32(message.searchMode); return writer; }; /** - * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.verify|verify} messages. + * Encodes the specified RemoveFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.SearchRequest + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse * @static - * @param {google.cloud.retail.v2beta.ISearchRequest} message SearchRequest message or plain object to encode + * @param {google.cloud.retail.v2beta.IRemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchRequest.encodeDelimited = function encodeDelimited(message, writer) { + RemoveFulfillmentPlacesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchRequest message from the specified reader or buffer. + * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.SearchRequest + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.SearchRequest} SearchRequest + * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchRequest.decode = function decode(reader, length) { + RemoveFulfillmentPlacesResponse.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.v2beta.SearchRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.placement = reader.string(); - break; - case 2: - message.branch = reader.string(); - break; - case 3: - message.query = reader.string(); - break; - case 4: - message.visitorId = reader.string(); - break; - case 5: - message.userInfo = $root.google.cloud.retail.v2beta.UserInfo.decode(reader, reader.uint32()); - break; - case 7: - message.pageSize = reader.int32(); - break; - case 8: - message.pageToken = reader.string(); - break; - case 9: - message.offset = reader.int32(); - break; - case 10: - message.filter = reader.string(); - break; - case 28: - message.canonicalFilter = reader.string(); - break; - case 11: - message.orderBy = reader.string(); - break; - case 12: - if (!(message.facetSpecs && message.facetSpecs.length)) - message.facetSpecs = []; - message.facetSpecs.push($root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.decode(reader, reader.uint32())); - break; - case 21: - message.dynamicFacetSpec = $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.decode(reader, reader.uint32()); - break; - case 13: - message.boostSpec = $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.decode(reader, reader.uint32()); - break; - case 14: - message.queryExpansionSpec = $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.decode(reader, reader.uint32()); - break; - case 17: - if (!(message.variantRollupKeys && message.variantRollupKeys.length)) - message.variantRollupKeys = []; - message.variantRollupKeys.push(reader.string()); - break; - case 23: - if (!(message.pageCategories && message.pageCategories.length)) - message.pageCategories = []; - message.pageCategories.push(reader.string()); - break; - case 31: - message.searchMode = reader.int32(); - break; default: reader.skipType(tag & 7); break; @@ -74440,1902 +86506,1926 @@ }; /** - * Decodes a SearchRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.SearchRequest + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.SearchRequest} SearchRequest + * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchRequest.decodeDelimited = function decodeDelimited(reader) { + RemoveFulfillmentPlacesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchRequest message. + * Verifies a RemoveFulfillmentPlacesResponse message. * @function verify - * @memberof google.cloud.retail.v2beta.SearchRequest + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchRequest.verify = function verify(message) { + RemoveFulfillmentPlacesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.placement != null && message.hasOwnProperty("placement")) - if (!$util.isString(message.placement)) - return "placement: string expected"; - if (message.branch != null && message.hasOwnProperty("branch")) - if (!$util.isString(message.branch)) - return "branch: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: string expected"; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - if (!$util.isString(message.visitorId)) - return "visitorId: string expected"; - if (message.userInfo != null && message.hasOwnProperty("userInfo")) { - var error = $root.google.cloud.retail.v2beta.UserInfo.verify(message.userInfo); - if (error) - return "userInfo." + error; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset)) - return "offset: integer expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) - if (!$util.isString(message.canonicalFilter)) - return "canonicalFilter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.facetSpecs != null && message.hasOwnProperty("facetSpecs")) { - if (!Array.isArray(message.facetSpecs)) - return "facetSpecs: array expected"; - for (var i = 0; i < message.facetSpecs.length; ++i) { - var error = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.verify(message.facetSpecs[i]); - if (error) - return "facetSpecs." + error; - } - } - if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) { - var error = $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.verify(message.dynamicFacetSpec); - if (error) - return "dynamicFacetSpec." + error; - } - if (message.boostSpec != null && message.hasOwnProperty("boostSpec")) { - var error = $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.verify(message.boostSpec); - if (error) - return "boostSpec." + error; - } - if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) { - var error = $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.verify(message.queryExpansionSpec); - if (error) - return "queryExpansionSpec." + error; - } - if (message.variantRollupKeys != null && message.hasOwnProperty("variantRollupKeys")) { - if (!Array.isArray(message.variantRollupKeys)) - return "variantRollupKeys: array expected"; - for (var i = 0; i < message.variantRollupKeys.length; ++i) - if (!$util.isString(message.variantRollupKeys[i])) - return "variantRollupKeys: string[] expected"; - } - if (message.pageCategories != null && message.hasOwnProperty("pageCategories")) { - if (!Array.isArray(message.pageCategories)) - return "pageCategories: array expected"; - for (var i = 0; i < message.pageCategories.length; ++i) - if (!$util.isString(message.pageCategories[i])) - return "pageCategories: string[] expected"; - } - if (message.searchMode != null && message.hasOwnProperty("searchMode")) - switch (message.searchMode) { - default: - return "searchMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } return null; }; /** - * Creates a SearchRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.SearchRequest + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.SearchRequest} SearchRequest + * @returns {google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse */ - SearchRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.SearchRequest) + RemoveFulfillmentPlacesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse) return object; - var message = new $root.google.cloud.retail.v2beta.SearchRequest(); - if (object.placement != null) - message.placement = String(object.placement); - if (object.branch != null) - message.branch = String(object.branch); - if (object.query != null) - message.query = String(object.query); - if (object.visitorId != null) - message.visitorId = String(object.visitorId); - if (object.userInfo != null) { - if (typeof object.userInfo !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchRequest.userInfo: object expected"); - message.userInfo = $root.google.cloud.retail.v2beta.UserInfo.fromObject(object.userInfo); - } - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.offset != null) - message.offset = object.offset | 0; - if (object.filter != null) - message.filter = String(object.filter); - if (object.canonicalFilter != null) - message.canonicalFilter = String(object.canonicalFilter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.facetSpecs) { - if (!Array.isArray(object.facetSpecs)) - throw TypeError(".google.cloud.retail.v2beta.SearchRequest.facetSpecs: array expected"); - message.facetSpecs = []; - for (var i = 0; i < object.facetSpecs.length; ++i) { - if (typeof object.facetSpecs[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchRequest.facetSpecs: object expected"); - message.facetSpecs[i] = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.fromObject(object.facetSpecs[i]); - } - } - if (object.dynamicFacetSpec != null) { - if (typeof object.dynamicFacetSpec !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchRequest.dynamicFacetSpec: object expected"); - message.dynamicFacetSpec = $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.fromObject(object.dynamicFacetSpec); - } - if (object.boostSpec != null) { - if (typeof object.boostSpec !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchRequest.boostSpec: object expected"); - message.boostSpec = $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.fromObject(object.boostSpec); - } - if (object.queryExpansionSpec != null) { - if (typeof object.queryExpansionSpec !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchRequest.queryExpansionSpec: object expected"); - message.queryExpansionSpec = $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.fromObject(object.queryExpansionSpec); - } - if (object.variantRollupKeys) { - if (!Array.isArray(object.variantRollupKeys)) - throw TypeError(".google.cloud.retail.v2beta.SearchRequest.variantRollupKeys: array expected"); - message.variantRollupKeys = []; - for (var i = 0; i < object.variantRollupKeys.length; ++i) - message.variantRollupKeys[i] = String(object.variantRollupKeys[i]); - } - if (object.pageCategories) { - if (!Array.isArray(object.pageCategories)) - throw TypeError(".google.cloud.retail.v2beta.SearchRequest.pageCategories: array expected"); - message.pageCategories = []; - for (var i = 0; i < object.pageCategories.length; ++i) - message.pageCategories[i] = String(object.pageCategories[i]); - } - switch (object.searchMode) { - case "SEARCH_MODE_UNSPECIFIED": - case 0: - message.searchMode = 0; - break; - case "PRODUCT_SEARCH_ONLY": - case 1: - message.searchMode = 1; - break; - case "FACETED_SEARCH_ONLY": - case 2: - message.searchMode = 2; - break; + return new $root.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse(); + }; + + /** + * Creates a plain object from a RemoveFulfillmentPlacesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse + * @static + * @param {google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveFulfillmentPlacesResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RemoveFulfillmentPlacesResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse + * @instance + * @returns {Object.} JSON object + */ + RemoveFulfillmentPlacesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveFulfillmentPlacesResponse; + })(); + + v2beta.PurgeMetadata = (function() { + + /** + * Properties of a PurgeMetadata. + * @memberof google.cloud.retail.v2beta + * @interface IPurgeMetadata + */ + + /** + * Constructs a new PurgeMetadata. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a PurgeMetadata. + * @implements IPurgeMetadata + * @constructor + * @param {google.cloud.retail.v2beta.IPurgeMetadata=} [properties] Properties to set + */ + function PurgeMetadata(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]]; + } + + /** + * Creates a new PurgeMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.PurgeMetadata + * @static + * @param {google.cloud.retail.v2beta.IPurgeMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.PurgeMetadata} PurgeMetadata instance + */ + PurgeMetadata.create = function create(properties) { + return new PurgeMetadata(properties); + }; + + /** + * Encodes the specified PurgeMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.PurgeMetadata + * @static + * @param {google.cloud.retail.v2beta.IPurgeMetadata} message PurgeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified PurgeMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.PurgeMetadata + * @static + * @param {google.cloud.retail.v2beta.IPurgeMetadata} message PurgeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurgeMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.PurgeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.PurgeMetadata} PurgeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeMetadata.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.v2beta.PurgeMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } } return message; }; /** - * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. + * Decodes a PurgeMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.PurgeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.PurgeMetadata} PurgeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurgeMetadata message. + * @function verify + * @memberof google.cloud.retail.v2beta.PurgeMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurgeMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a PurgeMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.PurgeMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.PurgeMetadata} PurgeMetadata + */ + PurgeMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.PurgeMetadata) + return object; + return new $root.google.cloud.retail.v2beta.PurgeMetadata(); + }; + + /** + * Creates a plain object from a PurgeMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.SearchRequest + * @memberof google.cloud.retail.v2beta.PurgeMetadata * @static - * @param {google.cloud.retail.v2beta.SearchRequest} message SearchRequest + * @param {google.cloud.retail.v2beta.PurgeMetadata} message PurgeMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.facetSpecs = []; - object.variantRollupKeys = []; - object.pageCategories = []; - } - if (options.defaults) { - object.placement = ""; - object.branch = ""; - object.query = ""; - object.visitorId = ""; - object.userInfo = null; - object.pageSize = 0; - object.pageToken = ""; - object.offset = 0; - object.filter = ""; - object.orderBy = ""; - object.boostSpec = null; - object.queryExpansionSpec = null; - object.dynamicFacetSpec = null; - object.canonicalFilter = ""; - object.searchMode = options.enums === String ? "SEARCH_MODE_UNSPECIFIED" : 0; - } - if (message.placement != null && message.hasOwnProperty("placement")) - object.placement = message.placement; - if (message.branch != null && message.hasOwnProperty("branch")) - object.branch = message.branch; - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - object.visitorId = message.visitorId; - if (message.userInfo != null && message.hasOwnProperty("userInfo")) - object.userInfo = $root.google.cloud.retail.v2beta.UserInfo.toObject(message.userInfo, options); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = message.offset; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.facetSpecs && message.facetSpecs.length) { - object.facetSpecs = []; - for (var j = 0; j < message.facetSpecs.length; ++j) - object.facetSpecs[j] = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.toObject(message.facetSpecs[j], options); - } - if (message.boostSpec != null && message.hasOwnProperty("boostSpec")) - object.boostSpec = $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.toObject(message.boostSpec, options); - if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) - object.queryExpansionSpec = $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.toObject(message.queryExpansionSpec, options); - if (message.variantRollupKeys && message.variantRollupKeys.length) { - object.variantRollupKeys = []; - for (var j = 0; j < message.variantRollupKeys.length; ++j) - object.variantRollupKeys[j] = message.variantRollupKeys[j]; - } - if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) - object.dynamicFacetSpec = $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.toObject(message.dynamicFacetSpec, options); - if (message.pageCategories && message.pageCategories.length) { - object.pageCategories = []; - for (var j = 0; j < message.pageCategories.length; ++j) - object.pageCategories[j] = message.pageCategories[j]; - } - if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) - object.canonicalFilter = message.canonicalFilter; - if (message.searchMode != null && message.hasOwnProperty("searchMode")) - object.searchMode = options.enums === String ? $root.google.cloud.retail.v2beta.SearchRequest.SearchMode[message.searchMode] : message.searchMode; - return object; + PurgeMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this SearchRequest to JSON. + * Converts this PurgeMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.SearchRequest + * @memberof google.cloud.retail.v2beta.PurgeMetadata * @instance * @returns {Object.} JSON object */ - SearchRequest.prototype.toJSON = function toJSON() { + PurgeMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - SearchRequest.FacetSpec = (function() { + return PurgeMetadata; + })(); - /** - * Properties of a FacetSpec. - * @memberof google.cloud.retail.v2beta.SearchRequest - * @interface IFacetSpec - * @property {google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey|null} [facetKey] FacetSpec facetKey - * @property {number|null} [limit] FacetSpec limit - * @property {Array.|null} [excludedFilterKeys] FacetSpec excludedFilterKeys - * @property {boolean|null} [enableDynamicPosition] FacetSpec enableDynamicPosition - */ + v2beta.PurgeUserEventsRequest = (function() { - /** - * Constructs a new FacetSpec. - * @memberof google.cloud.retail.v2beta.SearchRequest - * @classdesc Represents a FacetSpec. - * @implements IFacetSpec - * @constructor - * @param {google.cloud.retail.v2beta.SearchRequest.IFacetSpec=} [properties] Properties to set - */ - function FacetSpec(properties) { - this.excludedFilterKeys = []; - 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]]; - } + /** + * Properties of a PurgeUserEventsRequest. + * @memberof google.cloud.retail.v2beta + * @interface IPurgeUserEventsRequest + * @property {string|null} [parent] PurgeUserEventsRequest parent + * @property {string|null} [filter] PurgeUserEventsRequest filter + * @property {boolean|null} [force] PurgeUserEventsRequest force + */ - /** - * FacetSpec facetKey. - * @member {google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey|null|undefined} facetKey - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec - * @instance - */ - FacetSpec.prototype.facetKey = null; + /** + * Constructs a new PurgeUserEventsRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a PurgeUserEventsRequest. + * @implements IPurgeUserEventsRequest + * @constructor + * @param {google.cloud.retail.v2beta.IPurgeUserEventsRequest=} [properties] Properties to set + */ + function PurgeUserEventsRequest(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]]; + } - /** - * FacetSpec limit. - * @member {number} limit - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec - * @instance - */ - FacetSpec.prototype.limit = 0; + /** + * PurgeUserEventsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @instance + */ + PurgeUserEventsRequest.prototype.parent = ""; - /** - * FacetSpec excludedFilterKeys. - * @member {Array.} excludedFilterKeys - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec - * @instance - */ - FacetSpec.prototype.excludedFilterKeys = $util.emptyArray; + /** + * PurgeUserEventsRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @instance + */ + PurgeUserEventsRequest.prototype.filter = ""; - /** - * FacetSpec enableDynamicPosition. - * @member {boolean} enableDynamicPosition - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec - * @instance - */ - FacetSpec.prototype.enableDynamicPosition = false; + /** + * PurgeUserEventsRequest force. + * @member {boolean} force + * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @instance + */ + PurgeUserEventsRequest.prototype.force = false; - /** - * Creates a new FacetSpec instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.IFacetSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.SearchRequest.FacetSpec} FacetSpec instance - */ - FacetSpec.create = function create(properties) { - return new FacetSpec(properties); - }; + /** + * Creates a new PurgeUserEventsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @static + * @param {google.cloud.retail.v2beta.IPurgeUserEventsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.PurgeUserEventsRequest} PurgeUserEventsRequest instance + */ + PurgeUserEventsRequest.create = function create(properties) { + return new PurgeUserEventsRequest(properties); + }; - /** - * Encodes the specified FacetSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.FacetSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.IFacetSpec} message FacetSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.facetKey != null && Object.hasOwnProperty.call(message, "facetKey")) - $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.encode(message.facetKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.limit); - if (message.excludedFilterKeys != null && message.excludedFilterKeys.length) - for (var i = 0; i < message.excludedFilterKeys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.excludedFilterKeys[i]); - if (message.enableDynamicPosition != null && Object.hasOwnProperty.call(message, "enableDynamicPosition")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableDynamicPosition); - return writer; - }; + /** + * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeUserEventsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @static + * @param {google.cloud.retail.v2beta.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeUserEventsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + return writer; + }; - /** - * Encodes the specified FacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.FacetSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.IFacetSpec} message FacetSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeUserEventsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @static + * @param {google.cloud.retail.v2beta.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a FacetSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.SearchRequest.FacetSpec} FacetSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetSpec.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.v2beta.SearchRequest.FacetSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.facetKey = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.decode(reader, reader.uint32()); - break; - case 2: - message.limit = reader.int32(); - break; - case 3: - if (!(message.excludedFilterKeys && message.excludedFilterKeys.length)) - message.excludedFilterKeys = []; - message.excludedFilterKeys.push(reader.string()); - break; - case 4: - message.enableDynamicPosition = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.PurgeUserEventsRequest} PurgeUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeUserEventsRequest.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.v2beta.PurgeUserEventsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.force = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a FacetSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.SearchRequest.FacetSpec} FacetSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a FacetSpec message. - * @function verify - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FacetSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.facetKey != null && message.hasOwnProperty("facetKey")) { - var error = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.verify(message.facetKey); - if (error) - return "facetKey." + error; - } - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit)) - return "limit: integer expected"; - if (message.excludedFilterKeys != null && message.hasOwnProperty("excludedFilterKeys")) { - if (!Array.isArray(message.excludedFilterKeys)) - return "excludedFilterKeys: array expected"; - for (var i = 0; i < message.excludedFilterKeys.length; ++i) - if (!$util.isString(message.excludedFilterKeys[i])) - return "excludedFilterKeys: string[] expected"; - } - if (message.enableDynamicPosition != null && message.hasOwnProperty("enableDynamicPosition")) - if (typeof message.enableDynamicPosition !== "boolean") - return "enableDynamicPosition: boolean expected"; - return null; - }; + /** + * Decodes a PurgeUserEventsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.PurgeUserEventsRequest} PurgeUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a FacetSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.SearchRequest.FacetSpec} FacetSpec - */ - FacetSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec) - return object; - var message = new $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec(); - if (object.facetKey != null) { - if (typeof object.facetKey !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchRequest.FacetSpec.facetKey: object expected"); - message.facetKey = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.fromObject(object.facetKey); - } - if (object.limit != null) - message.limit = object.limit | 0; - if (object.excludedFilterKeys) { - if (!Array.isArray(object.excludedFilterKeys)) - throw TypeError(".google.cloud.retail.v2beta.SearchRequest.FacetSpec.excludedFilterKeys: array expected"); - message.excludedFilterKeys = []; - for (var i = 0; i < object.excludedFilterKeys.length; ++i) - message.excludedFilterKeys[i] = String(object.excludedFilterKeys[i]); - } - if (object.enableDynamicPosition != null) - message.enableDynamicPosition = Boolean(object.enableDynamicPosition); - return message; - }; + /** + * Verifies a PurgeUserEventsRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurgeUserEventsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; - /** - * Creates a plain object from a FacetSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.FacetSpec} message FacetSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FacetSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.excludedFilterKeys = []; - if (options.defaults) { - object.facetKey = null; - object.limit = 0; - object.enableDynamicPosition = false; - } - if (message.facetKey != null && message.hasOwnProperty("facetKey")) - object.facetKey = $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.toObject(message.facetKey, options); - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = message.limit; - if (message.excludedFilterKeys && message.excludedFilterKeys.length) { - object.excludedFilterKeys = []; - for (var j = 0; j < message.excludedFilterKeys.length; ++j) - object.excludedFilterKeys[j] = message.excludedFilterKeys[j]; - } - if (message.enableDynamicPosition != null && message.hasOwnProperty("enableDynamicPosition")) - object.enableDynamicPosition = message.enableDynamicPosition; + /** + * Creates a PurgeUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.PurgeUserEventsRequest} PurgeUserEventsRequest + */ + PurgeUserEventsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.PurgeUserEventsRequest) return object; - }; + var message = new $root.google.cloud.retail.v2beta.PurgeUserEventsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; - /** - * Converts this FacetSpec to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec - * @instance - * @returns {Object.} JSON object - */ - FacetSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a PurgeUserEventsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @static + * @param {google.cloud.retail.v2beta.PurgeUserEventsRequest} message PurgeUserEventsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurgeUserEventsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.force = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; - FacetSpec.FacetKey = (function() { + /** + * Converts this PurgeUserEventsRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.PurgeUserEventsRequest + * @instance + * @returns {Object.} JSON object + */ + PurgeUserEventsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a FacetKey. - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec - * @interface IFacetKey - * @property {string|null} [key] FacetKey key - * @property {Array.|null} [intervals] FacetKey intervals - * @property {Array.|null} [restrictedValues] FacetKey restrictedValues - * @property {Array.|null} [prefixes] FacetKey prefixes - * @property {Array.|null} [contains] FacetKey contains - * @property {string|null} [orderBy] FacetKey orderBy - * @property {string|null} [query] FacetKey query - */ + return PurgeUserEventsRequest; + })(); - /** - * Constructs a new FacetKey. - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec - * @classdesc Represents a FacetKey. - * @implements IFacetKey - * @constructor - * @param {google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey=} [properties] Properties to set - */ - function FacetKey(properties) { - this.intervals = []; - this.restrictedValues = []; - this.prefixes = []; - this.contains = []; - 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]]; - } + v2beta.PurgeUserEventsResponse = (function() { - /** - * FacetKey key. - * @member {string} key - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.key = ""; + /** + * Properties of a PurgeUserEventsResponse. + * @memberof google.cloud.retail.v2beta + * @interface IPurgeUserEventsResponse + * @property {number|Long|null} [purgedEventsCount] PurgeUserEventsResponse purgedEventsCount + */ - /** - * FacetKey intervals. - * @member {Array.} intervals - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.intervals = $util.emptyArray; + /** + * Constructs a new PurgeUserEventsResponse. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a PurgeUserEventsResponse. + * @implements IPurgeUserEventsResponse + * @constructor + * @param {google.cloud.retail.v2beta.IPurgeUserEventsResponse=} [properties] Properties to set + */ + function PurgeUserEventsResponse(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]]; + } - /** - * FacetKey restrictedValues. - * @member {Array.} restrictedValues - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.restrictedValues = $util.emptyArray; + /** + * PurgeUserEventsResponse purgedEventsCount. + * @member {number|Long} purgedEventsCount + * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse + * @instance + */ + PurgeUserEventsResponse.prototype.purgedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * FacetKey prefixes. - * @member {Array.} prefixes - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.prefixes = $util.emptyArray; + /** + * Creates a new PurgeUserEventsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse + * @static + * @param {google.cloud.retail.v2beta.IPurgeUserEventsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.PurgeUserEventsResponse} PurgeUserEventsResponse instance + */ + PurgeUserEventsResponse.create = function create(properties) { + return new PurgeUserEventsResponse(properties); + }; - /** - * FacetKey contains. - * @member {Array.} contains - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.contains = $util.emptyArray; + /** + * Encodes the specified PurgeUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeUserEventsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse + * @static + * @param {google.cloud.retail.v2beta.IPurgeUserEventsResponse} message PurgeUserEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeUserEventsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.purgedEventsCount != null && Object.hasOwnProperty.call(message, "purgedEventsCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.purgedEventsCount); + return writer; + }; - /** - * FacetKey orderBy. - * @member {string} orderBy - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.orderBy = ""; + /** + * Encodes the specified PurgeUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeUserEventsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse + * @static + * @param {google.cloud.retail.v2beta.IPurgeUserEventsResponse} message PurgeUserEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * FacetKey query. - * @member {string} query - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.query = ""; + /** + * Decodes a PurgeUserEventsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.PurgeUserEventsResponse} PurgeUserEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeUserEventsResponse.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.v2beta.PurgeUserEventsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.purgedEventsCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new FacetKey instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey} FacetKey instance - */ - FacetKey.create = function create(properties) { - return new FacetKey(properties); - }; + /** + * Decodes a PurgeUserEventsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.PurgeUserEventsResponse} PurgeUserEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified FacetKey message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey} message FacetKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); - if (message.intervals != null && message.intervals.length) - for (var i = 0; i < message.intervals.length; ++i) - $root.google.cloud.retail.v2beta.Interval.encode(message.intervals[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.restrictedValues != null && message.restrictedValues.length) - for (var i = 0; i < message.restrictedValues.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.restrictedValues[i]); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.query); - if (message.prefixes != null && message.prefixes.length) - for (var i = 0; i < message.prefixes.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.prefixes[i]); - if (message.contains != null && message.contains.length) - for (var i = 0; i < message.contains.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.contains[i]); - return writer; - }; + /** + * Verifies a PurgeUserEventsResponse message. + * @function verify + * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurgeUserEventsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.purgedEventsCount != null && message.hasOwnProperty("purgedEventsCount")) + if (!$util.isInteger(message.purgedEventsCount) && !(message.purgedEventsCount && $util.isInteger(message.purgedEventsCount.low) && $util.isInteger(message.purgedEventsCount.high))) + return "purgedEventsCount: integer|Long expected"; + return null; + }; - /** - * Encodes the specified FacetKey message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.FacetSpec.IFacetKey} message FacetKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a PurgeUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.PurgeUserEventsResponse} PurgeUserEventsResponse + */ + PurgeUserEventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.PurgeUserEventsResponse) + return object; + var message = new $root.google.cloud.retail.v2beta.PurgeUserEventsResponse(); + if (object.purgedEventsCount != null) + if ($util.Long) + (message.purgedEventsCount = $util.Long.fromValue(object.purgedEventsCount)).unsigned = false; + else if (typeof object.purgedEventsCount === "string") + message.purgedEventsCount = parseInt(object.purgedEventsCount, 10); + else if (typeof object.purgedEventsCount === "number") + message.purgedEventsCount = object.purgedEventsCount; + else if (typeof object.purgedEventsCount === "object") + message.purgedEventsCount = new $util.LongBits(object.purgedEventsCount.low >>> 0, object.purgedEventsCount.high >>> 0).toNumber(); + return message; + }; - /** - * Decodes a FacetKey message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey} FacetKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetKey.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.v2beta.SearchRequest.FacetSpec.FacetKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - if (!(message.intervals && message.intervals.length)) - message.intervals = []; - message.intervals.push($root.google.cloud.retail.v2beta.Interval.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.restrictedValues && message.restrictedValues.length)) - message.restrictedValues = []; - message.restrictedValues.push(reader.string()); - break; - case 8: - if (!(message.prefixes && message.prefixes.length)) - message.prefixes = []; - message.prefixes.push(reader.string()); - break; - case 9: - if (!(message.contains && message.contains.length)) - message.contains = []; - message.contains.push(reader.string()); - break; - case 4: - message.orderBy = reader.string(); - break; - case 5: - message.query = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a plain object from a PurgeUserEventsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse + * @static + * @param {google.cloud.retail.v2beta.PurgeUserEventsResponse} message PurgeUserEventsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurgeUserEventsResponse.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.purgedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.purgedEventsCount = options.longs === String ? "0" : 0; + if (message.purgedEventsCount != null && message.hasOwnProperty("purgedEventsCount")) + if (typeof message.purgedEventsCount === "number") + object.purgedEventsCount = options.longs === String ? String(message.purgedEventsCount) : message.purgedEventsCount; + else + object.purgedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.purgedEventsCount) : options.longs === Number ? new $util.LongBits(message.purgedEventsCount.low >>> 0, message.purgedEventsCount.high >>> 0).toNumber() : message.purgedEventsCount; + return object; + }; - /** - * Decodes a FacetKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey} FacetKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this PurgeUserEventsResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.PurgeUserEventsResponse + * @instance + * @returns {Object.} JSON object + */ + PurgeUserEventsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PurgeUserEventsResponse; + })(); + + v2beta.ServingConfig = (function() { + + /** + * Properties of a ServingConfig. + * @memberof google.cloud.retail.v2beta + * @interface IServingConfig + * @property {string|null} [name] ServingConfig name + * @property {string|null} [displayName] ServingConfig displayName + * @property {string|null} [modelId] ServingConfig modelId + * @property {string|null} [priceRerankingLevel] ServingConfig priceRerankingLevel + * @property {Array.|null} [facetControlIds] ServingConfig facetControlIds + * @property {google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec|null} [dynamicFacetSpec] ServingConfig dynamicFacetSpec + * @property {Array.|null} [boostControlIds] ServingConfig boostControlIds + * @property {Array.|null} [filterControlIds] ServingConfig filterControlIds + * @property {Array.|null} [redirectControlIds] ServingConfig redirectControlIds + * @property {Array.|null} [twowaySynonymsControlIds] ServingConfig twowaySynonymsControlIds + * @property {Array.|null} [onewaySynonymsControlIds] ServingConfig onewaySynonymsControlIds + * @property {Array.|null} [doNotAssociateControlIds] ServingConfig doNotAssociateControlIds + * @property {Array.|null} [replacementControlIds] ServingConfig replacementControlIds + * @property {Array.|null} [ignoreControlIds] ServingConfig ignoreControlIds + * @property {string|null} [diversityLevel] ServingConfig diversityLevel + * @property {string|null} [enableCategoryFilterLevel] ServingConfig enableCategoryFilterLevel + * @property {Array.|null} [solutionTypes] ServingConfig solutionTypes + */ + + /** + * Constructs a new ServingConfig. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a ServingConfig. + * @implements IServingConfig + * @constructor + * @param {google.cloud.retail.v2beta.IServingConfig=} [properties] Properties to set + */ + function ServingConfig(properties) { + this.facetControlIds = []; + this.boostControlIds = []; + this.filterControlIds = []; + this.redirectControlIds = []; + this.twowaySynonymsControlIds = []; + this.onewaySynonymsControlIds = []; + this.doNotAssociateControlIds = []; + this.replacementControlIds = []; + this.ignoreControlIds = []; + this.solutionTypes = []; + 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]]; + } + + /** + * ServingConfig name. + * @member {string} name + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.name = ""; + + /** + * ServingConfig displayName. + * @member {string} displayName + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.displayName = ""; - /** - * Verifies a FacetKey message. - * @function verify - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FacetKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; - if (message.intervals != null && message.hasOwnProperty("intervals")) { - if (!Array.isArray(message.intervals)) - return "intervals: array expected"; - for (var i = 0; i < message.intervals.length; ++i) { - var error = $root.google.cloud.retail.v2beta.Interval.verify(message.intervals[i]); - if (error) - return "intervals." + error; - } - } - if (message.restrictedValues != null && message.hasOwnProperty("restrictedValues")) { - if (!Array.isArray(message.restrictedValues)) - return "restrictedValues: array expected"; - for (var i = 0; i < message.restrictedValues.length; ++i) - if (!$util.isString(message.restrictedValues[i])) - return "restrictedValues: string[] expected"; - } - if (message.prefixes != null && message.hasOwnProperty("prefixes")) { - if (!Array.isArray(message.prefixes)) - return "prefixes: array expected"; - for (var i = 0; i < message.prefixes.length; ++i) - if (!$util.isString(message.prefixes[i])) - return "prefixes: string[] expected"; - } - if (message.contains != null && message.hasOwnProperty("contains")) { - if (!Array.isArray(message.contains)) - return "contains: array expected"; - for (var i = 0; i < message.contains.length; ++i) - if (!$util.isString(message.contains[i])) - return "contains: string[] expected"; - } - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: string expected"; - return null; - }; + /** + * ServingConfig modelId. + * @member {string} modelId + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.modelId = ""; - /** - * Creates a FacetKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey} FacetKey - */ - FacetKey.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey) - return object; - var message = new $root.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey(); - if (object.key != null) - message.key = String(object.key); - if (object.intervals) { - if (!Array.isArray(object.intervals)) - throw TypeError(".google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.intervals: array expected"); - message.intervals = []; - for (var i = 0; i < object.intervals.length; ++i) { - if (typeof object.intervals[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.intervals: object expected"); - message.intervals[i] = $root.google.cloud.retail.v2beta.Interval.fromObject(object.intervals[i]); - } - } - if (object.restrictedValues) { - if (!Array.isArray(object.restrictedValues)) - throw TypeError(".google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.restrictedValues: array expected"); - message.restrictedValues = []; - for (var i = 0; i < object.restrictedValues.length; ++i) - message.restrictedValues[i] = String(object.restrictedValues[i]); - } - if (object.prefixes) { - if (!Array.isArray(object.prefixes)) - throw TypeError(".google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.prefixes: array expected"); - message.prefixes = []; - for (var i = 0; i < object.prefixes.length; ++i) - message.prefixes[i] = String(object.prefixes[i]); - } - if (object.contains) { - if (!Array.isArray(object.contains)) - throw TypeError(".google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.contains: array expected"); - message.contains = []; - for (var i = 0; i < object.contains.length; ++i) - message.contains[i] = String(object.contains[i]); - } - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.query != null) - message.query = String(object.query); - return message; - }; + /** + * ServingConfig priceRerankingLevel. + * @member {string} priceRerankingLevel + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.priceRerankingLevel = ""; - /** - * Creates a plain object from a FacetKey message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey} message FacetKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FacetKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.intervals = []; - object.restrictedValues = []; - object.prefixes = []; - object.contains = []; - } - if (options.defaults) { - object.key = ""; - object.orderBy = ""; - object.query = ""; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.intervals && message.intervals.length) { - object.intervals = []; - for (var j = 0; j < message.intervals.length; ++j) - object.intervals[j] = $root.google.cloud.retail.v2beta.Interval.toObject(message.intervals[j], options); - } - if (message.restrictedValues && message.restrictedValues.length) { - object.restrictedValues = []; - for (var j = 0; j < message.restrictedValues.length; ++j) - object.restrictedValues[j] = message.restrictedValues[j]; - } - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.prefixes && message.prefixes.length) { - object.prefixes = []; - for (var j = 0; j < message.prefixes.length; ++j) - object.prefixes[j] = message.prefixes[j]; - } - if (message.contains && message.contains.length) { - object.contains = []; - for (var j = 0; j < message.contains.length; ++j) - object.contains[j] = message.contains[j]; - } - return object; - }; + /** + * ServingConfig facetControlIds. + * @member {Array.} facetControlIds + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.facetControlIds = $util.emptyArray; - /** - * Converts this FacetKey to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey - * @instance - * @returns {Object.} JSON object - */ - FacetKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * ServingConfig dynamicFacetSpec. + * @member {google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec|null|undefined} dynamicFacetSpec + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.dynamicFacetSpec = null; - return FacetKey; - })(); + /** + * ServingConfig boostControlIds. + * @member {Array.} boostControlIds + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.boostControlIds = $util.emptyArray; - return FacetSpec; - })(); + /** + * ServingConfig filterControlIds. + * @member {Array.} filterControlIds + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.filterControlIds = $util.emptyArray; - SearchRequest.DynamicFacetSpec = (function() { + /** + * ServingConfig redirectControlIds. + * @member {Array.} redirectControlIds + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.redirectControlIds = $util.emptyArray; - /** - * Properties of a DynamicFacetSpec. - * @memberof google.cloud.retail.v2beta.SearchRequest - * @interface IDynamicFacetSpec - * @property {google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode|null} [mode] DynamicFacetSpec mode - */ + /** + * ServingConfig twowaySynonymsControlIds. + * @member {Array.} twowaySynonymsControlIds + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.twowaySynonymsControlIds = $util.emptyArray; - /** - * Constructs a new DynamicFacetSpec. - * @memberof google.cloud.retail.v2beta.SearchRequest - * @classdesc Represents a DynamicFacetSpec. - * @implements IDynamicFacetSpec - * @constructor - * @param {google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec=} [properties] Properties to set - */ - function DynamicFacetSpec(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]]; - } + /** + * ServingConfig onewaySynonymsControlIds. + * @member {Array.} onewaySynonymsControlIds + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.onewaySynonymsControlIds = $util.emptyArray; - /** - * DynamicFacetSpec mode. - * @member {google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode} mode - * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec - * @instance - */ - DynamicFacetSpec.prototype.mode = 0; + /** + * ServingConfig doNotAssociateControlIds. + * @member {Array.} doNotAssociateControlIds + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.doNotAssociateControlIds = $util.emptyArray; - /** - * Creates a new DynamicFacetSpec instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec} DynamicFacetSpec instance - */ - DynamicFacetSpec.create = function create(properties) { - return new DynamicFacetSpec(properties); - }; + /** + * ServingConfig replacementControlIds. + * @member {Array.} replacementControlIds + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.replacementControlIds = $util.emptyArray; - /** - * Encodes the specified DynamicFacetSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec} message DynamicFacetSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DynamicFacetSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); - return writer; - }; + /** + * ServingConfig ignoreControlIds. + * @member {Array.} ignoreControlIds + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.ignoreControlIds = $util.emptyArray; - /** - * Encodes the specified DynamicFacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.IDynamicFacetSpec} message DynamicFacetSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DynamicFacetSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ServingConfig diversityLevel. + * @member {string} diversityLevel + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.diversityLevel = ""; - /** - * Decodes a DynamicFacetSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec} DynamicFacetSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DynamicFacetSpec.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.v2beta.SearchRequest.DynamicFacetSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.mode = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ServingConfig enableCategoryFilterLevel. + * @member {string} enableCategoryFilterLevel + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.enableCategoryFilterLevel = ""; - /** - * Decodes a DynamicFacetSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec} DynamicFacetSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DynamicFacetSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * ServingConfig solutionTypes. + * @member {Array.} solutionTypes + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.solutionTypes = $util.emptyArray; - /** - * Verifies a DynamicFacetSpec message. - * @function verify - * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DynamicFacetSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mode != null && message.hasOwnProperty("mode")) - switch (message.mode) { - default: - return "mode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; + /** + * Creates a new ServingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.ServingConfig + * @static + * @param {google.cloud.retail.v2beta.IServingConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ServingConfig} ServingConfig instance + */ + ServingConfig.create = function create(properties) { + return new ServingConfig(properties); + }; - /** - * Creates a DynamicFacetSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec} DynamicFacetSpec - */ - DynamicFacetSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec) - return object; - var message = new $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec(); - switch (object.mode) { - case "MODE_UNSPECIFIED": - case 0: - message.mode = 0; - break; - case "DISABLED": + /** + * Encodes the specified ServingConfig message. Does not implicitly {@link google.cloud.retail.v2beta.ServingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ServingConfig + * @static + * @param {google.cloud.retail.v2beta.IServingConfig} message ServingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.modelId != null && Object.hasOwnProperty.call(message, "modelId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.modelId); + if (message.priceRerankingLevel != null && Object.hasOwnProperty.call(message, "priceRerankingLevel")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.priceRerankingLevel); + if (message.facetControlIds != null && message.facetControlIds.length) + for (var i = 0; i < message.facetControlIds.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.facetControlIds[i]); + if (message.dynamicFacetSpec != null && Object.hasOwnProperty.call(message, "dynamicFacetSpec")) + $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.encode(message.dynamicFacetSpec, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.boostControlIds != null && message.boostControlIds.length) + for (var i = 0; i < message.boostControlIds.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.boostControlIds[i]); + if (message.diversityLevel != null && Object.hasOwnProperty.call(message, "diversityLevel")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.diversityLevel); + if (message.filterControlIds != null && message.filterControlIds.length) + for (var i = 0; i < message.filterControlIds.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.filterControlIds[i]); + if (message.redirectControlIds != null && message.redirectControlIds.length) + for (var i = 0; i < message.redirectControlIds.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.redirectControlIds[i]); + if (message.onewaySynonymsControlIds != null && message.onewaySynonymsControlIds.length) + for (var i = 0; i < message.onewaySynonymsControlIds.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.onewaySynonymsControlIds[i]); + if (message.doNotAssociateControlIds != null && message.doNotAssociateControlIds.length) + for (var i = 0; i < message.doNotAssociateControlIds.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.doNotAssociateControlIds[i]); + if (message.replacementControlIds != null && message.replacementControlIds.length) + for (var i = 0; i < message.replacementControlIds.length; ++i) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.replacementControlIds[i]); + if (message.ignoreControlIds != null && message.ignoreControlIds.length) + for (var i = 0; i < message.ignoreControlIds.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.ignoreControlIds[i]); + if (message.enableCategoryFilterLevel != null && Object.hasOwnProperty.call(message, "enableCategoryFilterLevel")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.enableCategoryFilterLevel); + if (message.twowaySynonymsControlIds != null && message.twowaySynonymsControlIds.length) + for (var i = 0; i < message.twowaySynonymsControlIds.length; ++i) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.twowaySynonymsControlIds[i]); + if (message.solutionTypes != null && message.solutionTypes.length) { + writer.uint32(/* id 19, wireType 2 =*/154).fork(); + for (var i = 0; i < message.solutionTypes.length; ++i) + writer.int32(message.solutionTypes[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ServingConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ServingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ServingConfig + * @static + * @param {google.cloud.retail.v2beta.IServingConfig} message ServingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ServingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ServingConfig} ServingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServingConfig.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.v2beta.ServingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { case 1: - message.mode = 1; + message.name = reader.string(); break; - case "ENABLED": case 2: - message.mode = 2; + message.displayName = reader.string(); + break; + case 3: + message.modelId = reader.string(); + break; + case 4: + message.priceRerankingLevel = reader.string(); + break; + case 5: + if (!(message.facetControlIds && message.facetControlIds.length)) + message.facetControlIds = []; + message.facetControlIds.push(reader.string()); + break; + case 6: + message.dynamicFacetSpec = $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.decode(reader, reader.uint32()); + break; + case 7: + if (!(message.boostControlIds && message.boostControlIds.length)) + message.boostControlIds = []; + message.boostControlIds.push(reader.string()); + break; + case 9: + if (!(message.filterControlIds && message.filterControlIds.length)) + message.filterControlIds = []; + message.filterControlIds.push(reader.string()); + break; + case 10: + if (!(message.redirectControlIds && message.redirectControlIds.length)) + message.redirectControlIds = []; + message.redirectControlIds.push(reader.string()); + break; + case 18: + if (!(message.twowaySynonymsControlIds && message.twowaySynonymsControlIds.length)) + message.twowaySynonymsControlIds = []; + message.twowaySynonymsControlIds.push(reader.string()); + break; + case 12: + if (!(message.onewaySynonymsControlIds && message.onewaySynonymsControlIds.length)) + message.onewaySynonymsControlIds = []; + message.onewaySynonymsControlIds.push(reader.string()); + break; + case 13: + if (!(message.doNotAssociateControlIds && message.doNotAssociateControlIds.length)) + message.doNotAssociateControlIds = []; + message.doNotAssociateControlIds.push(reader.string()); + break; + case 14: + if (!(message.replacementControlIds && message.replacementControlIds.length)) + message.replacementControlIds = []; + message.replacementControlIds.push(reader.string()); + break; + case 15: + if (!(message.ignoreControlIds && message.ignoreControlIds.length)) + message.ignoreControlIds = []; + message.ignoreControlIds.push(reader.string()); + break; + case 8: + message.diversityLevel = reader.string(); + break; + case 16: + message.enableCategoryFilterLevel = reader.string(); + break; + case 19: + if (!(message.solutionTypes && message.solutionTypes.length)) + message.solutionTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.solutionTypes.push(reader.int32()); + } else + message.solutionTypes.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); break; } - return message; - }; - - /** - * Creates a plain object from a DynamicFacetSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec} message DynamicFacetSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DynamicFacetSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; - if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode[message.mode] : message.mode; - return object; - }; - - /** - * Converts this DynamicFacetSpec to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec - * @instance - * @returns {Object.} JSON object - */ - DynamicFacetSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Mode enum. - * @name google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode - * @enum {number} - * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value - * @property {number} DISABLED=1 DISABLED value - * @property {number} ENABLED=2 ENABLED value - */ - DynamicFacetSpec.Mode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DISABLED"] = 1; - values[valuesById[2] = "ENABLED"] = 2; - return values; - })(); + } + return message; + }; - return DynamicFacetSpec; - })(); + /** + * Decodes a ServingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ServingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ServingConfig} ServingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - SearchRequest.BoostSpec = (function() { + /** + * Verifies a ServingConfig message. + * @function verify + * @memberof google.cloud.retail.v2beta.ServingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.modelId != null && message.hasOwnProperty("modelId")) + if (!$util.isString(message.modelId)) + return "modelId: string expected"; + if (message.priceRerankingLevel != null && message.hasOwnProperty("priceRerankingLevel")) + if (!$util.isString(message.priceRerankingLevel)) + return "priceRerankingLevel: string expected"; + if (message.facetControlIds != null && message.hasOwnProperty("facetControlIds")) { + if (!Array.isArray(message.facetControlIds)) + return "facetControlIds: array expected"; + for (var i = 0; i < message.facetControlIds.length; ++i) + if (!$util.isString(message.facetControlIds[i])) + return "facetControlIds: string[] expected"; + } + if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) { + var error = $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.verify(message.dynamicFacetSpec); + if (error) + return "dynamicFacetSpec." + error; + } + if (message.boostControlIds != null && message.hasOwnProperty("boostControlIds")) { + if (!Array.isArray(message.boostControlIds)) + return "boostControlIds: array expected"; + for (var i = 0; i < message.boostControlIds.length; ++i) + if (!$util.isString(message.boostControlIds[i])) + return "boostControlIds: string[] expected"; + } + if (message.filterControlIds != null && message.hasOwnProperty("filterControlIds")) { + if (!Array.isArray(message.filterControlIds)) + return "filterControlIds: array expected"; + for (var i = 0; i < message.filterControlIds.length; ++i) + if (!$util.isString(message.filterControlIds[i])) + return "filterControlIds: string[] expected"; + } + if (message.redirectControlIds != null && message.hasOwnProperty("redirectControlIds")) { + if (!Array.isArray(message.redirectControlIds)) + return "redirectControlIds: array expected"; + for (var i = 0; i < message.redirectControlIds.length; ++i) + if (!$util.isString(message.redirectControlIds[i])) + return "redirectControlIds: string[] expected"; + } + if (message.twowaySynonymsControlIds != null && message.hasOwnProperty("twowaySynonymsControlIds")) { + if (!Array.isArray(message.twowaySynonymsControlIds)) + return "twowaySynonymsControlIds: array expected"; + for (var i = 0; i < message.twowaySynonymsControlIds.length; ++i) + if (!$util.isString(message.twowaySynonymsControlIds[i])) + return "twowaySynonymsControlIds: string[] expected"; + } + if (message.onewaySynonymsControlIds != null && message.hasOwnProperty("onewaySynonymsControlIds")) { + if (!Array.isArray(message.onewaySynonymsControlIds)) + return "onewaySynonymsControlIds: array expected"; + for (var i = 0; i < message.onewaySynonymsControlIds.length; ++i) + if (!$util.isString(message.onewaySynonymsControlIds[i])) + return "onewaySynonymsControlIds: string[] expected"; + } + if (message.doNotAssociateControlIds != null && message.hasOwnProperty("doNotAssociateControlIds")) { + if (!Array.isArray(message.doNotAssociateControlIds)) + return "doNotAssociateControlIds: array expected"; + for (var i = 0; i < message.doNotAssociateControlIds.length; ++i) + if (!$util.isString(message.doNotAssociateControlIds[i])) + return "doNotAssociateControlIds: string[] expected"; + } + if (message.replacementControlIds != null && message.hasOwnProperty("replacementControlIds")) { + if (!Array.isArray(message.replacementControlIds)) + return "replacementControlIds: array expected"; + for (var i = 0; i < message.replacementControlIds.length; ++i) + if (!$util.isString(message.replacementControlIds[i])) + return "replacementControlIds: string[] expected"; + } + if (message.ignoreControlIds != null && message.hasOwnProperty("ignoreControlIds")) { + if (!Array.isArray(message.ignoreControlIds)) + return "ignoreControlIds: array expected"; + for (var i = 0; i < message.ignoreControlIds.length; ++i) + if (!$util.isString(message.ignoreControlIds[i])) + return "ignoreControlIds: string[] expected"; + } + if (message.diversityLevel != null && message.hasOwnProperty("diversityLevel")) + if (!$util.isString(message.diversityLevel)) + return "diversityLevel: string expected"; + if (message.enableCategoryFilterLevel != null && message.hasOwnProperty("enableCategoryFilterLevel")) + if (!$util.isString(message.enableCategoryFilterLevel)) + return "enableCategoryFilterLevel: string expected"; + if (message.solutionTypes != null && message.hasOwnProperty("solutionTypes")) { + if (!Array.isArray(message.solutionTypes)) + return "solutionTypes: array expected"; + for (var i = 0; i < message.solutionTypes.length; ++i) + switch (message.solutionTypes[i]) { + default: + return "solutionTypes: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; - /** - * Properties of a BoostSpec. - * @memberof google.cloud.retail.v2beta.SearchRequest - * @interface IBoostSpec - * @property {Array.|null} [conditionBoostSpecs] BoostSpec conditionBoostSpecs - */ + /** + * Creates a ServingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ServingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ServingConfig} ServingConfig + */ + ServingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ServingConfig) + return object; + var message = new $root.google.cloud.retail.v2beta.ServingConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.modelId != null) + message.modelId = String(object.modelId); + if (object.priceRerankingLevel != null) + message.priceRerankingLevel = String(object.priceRerankingLevel); + if (object.facetControlIds) { + if (!Array.isArray(object.facetControlIds)) + throw TypeError(".google.cloud.retail.v2beta.ServingConfig.facetControlIds: array expected"); + message.facetControlIds = []; + for (var i = 0; i < object.facetControlIds.length; ++i) + message.facetControlIds[i] = String(object.facetControlIds[i]); + } + if (object.dynamicFacetSpec != null) { + if (typeof object.dynamicFacetSpec !== "object") + throw TypeError(".google.cloud.retail.v2beta.ServingConfig.dynamicFacetSpec: object expected"); + message.dynamicFacetSpec = $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.fromObject(object.dynamicFacetSpec); + } + if (object.boostControlIds) { + if (!Array.isArray(object.boostControlIds)) + throw TypeError(".google.cloud.retail.v2beta.ServingConfig.boostControlIds: array expected"); + message.boostControlIds = []; + for (var i = 0; i < object.boostControlIds.length; ++i) + message.boostControlIds[i] = String(object.boostControlIds[i]); + } + if (object.filterControlIds) { + if (!Array.isArray(object.filterControlIds)) + throw TypeError(".google.cloud.retail.v2beta.ServingConfig.filterControlIds: array expected"); + message.filterControlIds = []; + for (var i = 0; i < object.filterControlIds.length; ++i) + message.filterControlIds[i] = String(object.filterControlIds[i]); + } + if (object.redirectControlIds) { + if (!Array.isArray(object.redirectControlIds)) + throw TypeError(".google.cloud.retail.v2beta.ServingConfig.redirectControlIds: array expected"); + message.redirectControlIds = []; + for (var i = 0; i < object.redirectControlIds.length; ++i) + message.redirectControlIds[i] = String(object.redirectControlIds[i]); + } + if (object.twowaySynonymsControlIds) { + if (!Array.isArray(object.twowaySynonymsControlIds)) + throw TypeError(".google.cloud.retail.v2beta.ServingConfig.twowaySynonymsControlIds: array expected"); + message.twowaySynonymsControlIds = []; + for (var i = 0; i < object.twowaySynonymsControlIds.length; ++i) + message.twowaySynonymsControlIds[i] = String(object.twowaySynonymsControlIds[i]); + } + if (object.onewaySynonymsControlIds) { + if (!Array.isArray(object.onewaySynonymsControlIds)) + throw TypeError(".google.cloud.retail.v2beta.ServingConfig.onewaySynonymsControlIds: array expected"); + message.onewaySynonymsControlIds = []; + for (var i = 0; i < object.onewaySynonymsControlIds.length; ++i) + message.onewaySynonymsControlIds[i] = String(object.onewaySynonymsControlIds[i]); + } + if (object.doNotAssociateControlIds) { + if (!Array.isArray(object.doNotAssociateControlIds)) + throw TypeError(".google.cloud.retail.v2beta.ServingConfig.doNotAssociateControlIds: array expected"); + message.doNotAssociateControlIds = []; + for (var i = 0; i < object.doNotAssociateControlIds.length; ++i) + message.doNotAssociateControlIds[i] = String(object.doNotAssociateControlIds[i]); + } + if (object.replacementControlIds) { + if (!Array.isArray(object.replacementControlIds)) + throw TypeError(".google.cloud.retail.v2beta.ServingConfig.replacementControlIds: array expected"); + message.replacementControlIds = []; + for (var i = 0; i < object.replacementControlIds.length; ++i) + message.replacementControlIds[i] = String(object.replacementControlIds[i]); + } + if (object.ignoreControlIds) { + if (!Array.isArray(object.ignoreControlIds)) + throw TypeError(".google.cloud.retail.v2beta.ServingConfig.ignoreControlIds: array expected"); + message.ignoreControlIds = []; + for (var i = 0; i < object.ignoreControlIds.length; ++i) + message.ignoreControlIds[i] = String(object.ignoreControlIds[i]); + } + if (object.diversityLevel != null) + message.diversityLevel = String(object.diversityLevel); + if (object.enableCategoryFilterLevel != null) + message.enableCategoryFilterLevel = String(object.enableCategoryFilterLevel); + if (object.solutionTypes) { + if (!Array.isArray(object.solutionTypes)) + throw TypeError(".google.cloud.retail.v2beta.ServingConfig.solutionTypes: array expected"); + message.solutionTypes = []; + for (var i = 0; i < object.solutionTypes.length; ++i) + switch (object.solutionTypes[i]) { + default: + case "SOLUTION_TYPE_UNSPECIFIED": + case 0: + message.solutionTypes[i] = 0; + break; + case "SOLUTION_TYPE_RECOMMENDATION": + case 1: + message.solutionTypes[i] = 1; + break; + case "SOLUTION_TYPE_SEARCH": + case 2: + message.solutionTypes[i] = 2; + break; + } + } + return message; + }; - /** - * Constructs a new BoostSpec. - * @memberof google.cloud.retail.v2beta.SearchRequest - * @classdesc Represents a BoostSpec. - * @implements IBoostSpec - * @constructor - * @param {google.cloud.retail.v2beta.SearchRequest.IBoostSpec=} [properties] Properties to set - */ - function BoostSpec(properties) { - this.conditionBoostSpecs = []; - 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]]; + /** + * Creates a plain object from a ServingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ServingConfig + * @static + * @param {google.cloud.retail.v2beta.ServingConfig} message ServingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.facetControlIds = []; + object.boostControlIds = []; + object.filterControlIds = []; + object.redirectControlIds = []; + object.onewaySynonymsControlIds = []; + object.doNotAssociateControlIds = []; + object.replacementControlIds = []; + object.ignoreControlIds = []; + object.twowaySynonymsControlIds = []; + object.solutionTypes = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.modelId = ""; + object.priceRerankingLevel = ""; + object.dynamicFacetSpec = null; + object.diversityLevel = ""; + object.enableCategoryFilterLevel = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.modelId != null && message.hasOwnProperty("modelId")) + object.modelId = message.modelId; + if (message.priceRerankingLevel != null && message.hasOwnProperty("priceRerankingLevel")) + object.priceRerankingLevel = message.priceRerankingLevel; + if (message.facetControlIds && message.facetControlIds.length) { + object.facetControlIds = []; + for (var j = 0; j < message.facetControlIds.length; ++j) + object.facetControlIds[j] = message.facetControlIds[j]; + } + if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) + object.dynamicFacetSpec = $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.toObject(message.dynamicFacetSpec, options); + if (message.boostControlIds && message.boostControlIds.length) { + object.boostControlIds = []; + for (var j = 0; j < message.boostControlIds.length; ++j) + object.boostControlIds[j] = message.boostControlIds[j]; + } + if (message.diversityLevel != null && message.hasOwnProperty("diversityLevel")) + object.diversityLevel = message.diversityLevel; + if (message.filterControlIds && message.filterControlIds.length) { + object.filterControlIds = []; + for (var j = 0; j < message.filterControlIds.length; ++j) + object.filterControlIds[j] = message.filterControlIds[j]; + } + if (message.redirectControlIds && message.redirectControlIds.length) { + object.redirectControlIds = []; + for (var j = 0; j < message.redirectControlIds.length; ++j) + object.redirectControlIds[j] = message.redirectControlIds[j]; + } + if (message.onewaySynonymsControlIds && message.onewaySynonymsControlIds.length) { + object.onewaySynonymsControlIds = []; + for (var j = 0; j < message.onewaySynonymsControlIds.length; ++j) + object.onewaySynonymsControlIds[j] = message.onewaySynonymsControlIds[j]; + } + if (message.doNotAssociateControlIds && message.doNotAssociateControlIds.length) { + object.doNotAssociateControlIds = []; + for (var j = 0; j < message.doNotAssociateControlIds.length; ++j) + object.doNotAssociateControlIds[j] = message.doNotAssociateControlIds[j]; + } + if (message.replacementControlIds && message.replacementControlIds.length) { + object.replacementControlIds = []; + for (var j = 0; j < message.replacementControlIds.length; ++j) + object.replacementControlIds[j] = message.replacementControlIds[j]; + } + if (message.ignoreControlIds && message.ignoreControlIds.length) { + object.ignoreControlIds = []; + for (var j = 0; j < message.ignoreControlIds.length; ++j) + object.ignoreControlIds[j] = message.ignoreControlIds[j]; + } + if (message.enableCategoryFilterLevel != null && message.hasOwnProperty("enableCategoryFilterLevel")) + object.enableCategoryFilterLevel = message.enableCategoryFilterLevel; + if (message.twowaySynonymsControlIds && message.twowaySynonymsControlIds.length) { + object.twowaySynonymsControlIds = []; + for (var j = 0; j < message.twowaySynonymsControlIds.length; ++j) + object.twowaySynonymsControlIds[j] = message.twowaySynonymsControlIds[j]; + } + if (message.solutionTypes && message.solutionTypes.length) { + object.solutionTypes = []; + for (var j = 0; j < message.solutionTypes.length; ++j) + object.solutionTypes[j] = options.enums === String ? $root.google.cloud.retail.v2beta.SolutionType[message.solutionTypes[j]] : message.solutionTypes[j]; } + return object; + }; - /** - * BoostSpec conditionBoostSpecs. - * @member {Array.} conditionBoostSpecs - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec - * @instance - */ - BoostSpec.prototype.conditionBoostSpecs = $util.emptyArray; + /** + * Converts this ServingConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + * @returns {Object.} JSON object + */ + ServingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new BoostSpec instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.IBoostSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.SearchRequest.BoostSpec} BoostSpec instance - */ - BoostSpec.create = function create(properties) { - return new BoostSpec(properties); - }; + return ServingConfig; + })(); - /** - * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.BoostSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.IBoostSpec} message BoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.conditionBoostSpecs != null && message.conditionBoostSpecs.length) - for (var i = 0; i < message.conditionBoostSpecs.length; ++i) - $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.encode(message.conditionBoostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + v2beta.ServingConfigService = (function() { - /** - * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.BoostSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.IBoostSpec} message BoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Constructs a new ServingConfigService service. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a ServingConfigService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function ServingConfigService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * Decodes a BoostSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.SearchRequest.BoostSpec} BoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostSpec.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.v2beta.SearchRequest.BoostSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.conditionBoostSpecs && message.conditionBoostSpecs.length)) - message.conditionBoostSpecs = []; - message.conditionBoostSpecs.push($root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + (ServingConfigService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ServingConfigService; - /** - * Decodes a BoostSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.SearchRequest.BoostSpec} BoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates new ServingConfigService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {ServingConfigService} RPC service. Useful where requests and/or responses are streamed. + */ + ServingConfigService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * Verifies a BoostSpec message. - * @function verify - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoostSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.conditionBoostSpecs != null && message.hasOwnProperty("conditionBoostSpecs")) { - if (!Array.isArray(message.conditionBoostSpecs)) - return "conditionBoostSpecs: array expected"; - for (var i = 0; i < message.conditionBoostSpecs.length; ++i) { - var error = $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.verify(message.conditionBoostSpecs[i]); - if (error) - return "conditionBoostSpecs." + error; - } - } - return null; - }; + /** + * Callback as used by {@link google.cloud.retail.v2beta.ServingConfigService#createServingConfig}. + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @typedef CreateServingConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.ServingConfig} [response] ServingConfig + */ - /** - * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.SearchRequest.BoostSpec} BoostSpec - */ - BoostSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec) - return object; - var message = new $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec(); - if (object.conditionBoostSpecs) { - if (!Array.isArray(object.conditionBoostSpecs)) - throw TypeError(".google.cloud.retail.v2beta.SearchRequest.BoostSpec.conditionBoostSpecs: array expected"); - message.conditionBoostSpecs = []; - for (var i = 0; i < object.conditionBoostSpecs.length; ++i) { - if (typeof object.conditionBoostSpecs[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchRequest.BoostSpec.conditionBoostSpecs: object expected"); - message.conditionBoostSpecs[i] = $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.fromObject(object.conditionBoostSpecs[i]); - } - } - return message; - }; + /** + * Calls CreateServingConfig. + * @function createServingConfig + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @instance + * @param {google.cloud.retail.v2beta.ICreateServingConfigRequest} request CreateServingConfigRequest message or plain object + * @param {google.cloud.retail.v2beta.ServingConfigService.CreateServingConfigCallback} callback Node-style callback called with the error, if any, and ServingConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServingConfigService.prototype.createServingConfig = function createServingConfig(request, callback) { + return this.rpcCall(createServingConfig, $root.google.cloud.retail.v2beta.CreateServingConfigRequest, $root.google.cloud.retail.v2beta.ServingConfig, request, callback); + }, "name", { value: "CreateServingConfig" }); - /** - * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec} message BoostSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoostSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.conditionBoostSpecs = []; - if (message.conditionBoostSpecs && message.conditionBoostSpecs.length) { - object.conditionBoostSpecs = []; - for (var j = 0; j < message.conditionBoostSpecs.length; ++j) - object.conditionBoostSpecs[j] = $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.toObject(message.conditionBoostSpecs[j], options); - } - return object; - }; + /** + * Calls CreateServingConfig. + * @function createServingConfig + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @instance + * @param {google.cloud.retail.v2beta.ICreateServingConfigRequest} request CreateServingConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Converts this BoostSpec to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec - * @instance - * @returns {Object.} JSON object - */ - BoostSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Callback as used by {@link google.cloud.retail.v2beta.ServingConfigService#deleteServingConfig}. + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @typedef DeleteServingConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - BoostSpec.ConditionBoostSpec = (function() { + /** + * Calls DeleteServingConfig. + * @function deleteServingConfig + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @instance + * @param {google.cloud.retail.v2beta.IDeleteServingConfigRequest} request DeleteServingConfigRequest message or plain object + * @param {google.cloud.retail.v2beta.ServingConfigService.DeleteServingConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServingConfigService.prototype.deleteServingConfig = function deleteServingConfig(request, callback) { + return this.rpcCall(deleteServingConfig, $root.google.cloud.retail.v2beta.DeleteServingConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteServingConfig" }); - /** - * Properties of a ConditionBoostSpec. - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec - * @interface IConditionBoostSpec - * @property {string|null} [condition] ConditionBoostSpec condition - * @property {number|null} [boost] ConditionBoostSpec boost - */ + /** + * Calls DeleteServingConfig. + * @function deleteServingConfig + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @instance + * @param {google.cloud.retail.v2beta.IDeleteServingConfigRequest} request DeleteServingConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Constructs a new ConditionBoostSpec. - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec - * @classdesc Represents a ConditionBoostSpec. - * @implements IConditionBoostSpec - * @constructor - * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec=} [properties] Properties to set - */ - function ConditionBoostSpec(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]]; - } + /** + * Callback as used by {@link google.cloud.retail.v2beta.ServingConfigService#updateServingConfig}. + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @typedef UpdateServingConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.ServingConfig} [response] ServingConfig + */ - /** - * ConditionBoostSpec condition. - * @member {string} condition - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec - * @instance - */ - ConditionBoostSpec.prototype.condition = ""; + /** + * Calls UpdateServingConfig. + * @function updateServingConfig + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @instance + * @param {google.cloud.retail.v2beta.IUpdateServingConfigRequest} request UpdateServingConfigRequest message or plain object + * @param {google.cloud.retail.v2beta.ServingConfigService.UpdateServingConfigCallback} callback Node-style callback called with the error, if any, and ServingConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServingConfigService.prototype.updateServingConfig = function updateServingConfig(request, callback) { + return this.rpcCall(updateServingConfig, $root.google.cloud.retail.v2beta.UpdateServingConfigRequest, $root.google.cloud.retail.v2beta.ServingConfig, request, callback); + }, "name", { value: "UpdateServingConfig" }); - /** - * ConditionBoostSpec boost. - * @member {number} boost - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec - * @instance - */ - ConditionBoostSpec.prototype.boost = 0; + /** + * Calls UpdateServingConfig. + * @function updateServingConfig + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @instance + * @param {google.cloud.retail.v2beta.IUpdateServingConfigRequest} request UpdateServingConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a new ConditionBoostSpec instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec instance - */ - ConditionBoostSpec.create = function create(properties) { - return new ConditionBoostSpec(properties); - }; + /** + * Callback as used by {@link google.cloud.retail.v2beta.ServingConfigService#getServingConfig}. + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @typedef GetServingConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.ServingConfig} [response] ServingConfig + */ - /** - * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConditionBoostSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); - if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); - return writer; - }; + /** + * Calls GetServingConfig. + * @function getServingConfig + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @instance + * @param {google.cloud.retail.v2beta.IGetServingConfigRequest} request GetServingConfigRequest message or plain object + * @param {google.cloud.retail.v2beta.ServingConfigService.GetServingConfigCallback} callback Node-style callback called with the error, if any, and ServingConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServingConfigService.prototype.getServingConfig = function getServingConfig(request, callback) { + return this.rpcCall(getServingConfig, $root.google.cloud.retail.v2beta.GetServingConfigRequest, $root.google.cloud.retail.v2beta.ServingConfig, request, callback); + }, "name", { value: "GetServingConfig" }); - /** - * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConditionBoostSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Calls GetServingConfig. + * @function getServingConfig + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @instance + * @param {google.cloud.retail.v2beta.IGetServingConfigRequest} request GetServingConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConditionBoostSpec.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.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.condition = reader.string(); - break; - case 2: - message.boost = reader.float(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Callback as used by {@link google.cloud.retail.v2beta.ServingConfigService#listServingConfigs}. + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @typedef ListServingConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.ListServingConfigsResponse} [response] ListServingConfigsResponse + */ - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConditionBoostSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Calls ListServingConfigs. + * @function listServingConfigs + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @instance + * @param {google.cloud.retail.v2beta.IListServingConfigsRequest} request ListServingConfigsRequest message or plain object + * @param {google.cloud.retail.v2beta.ServingConfigService.ListServingConfigsCallback} callback Node-style callback called with the error, if any, and ListServingConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServingConfigService.prototype.listServingConfigs = function listServingConfigs(request, callback) { + return this.rpcCall(listServingConfigs, $root.google.cloud.retail.v2beta.ListServingConfigsRequest, $root.google.cloud.retail.v2beta.ListServingConfigsResponse, request, callback); + }, "name", { value: "ListServingConfigs" }); - /** - * Verifies a ConditionBoostSpec message. - * @function verify - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConditionBoostSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.condition != null && message.hasOwnProperty("condition")) - if (!$util.isString(message.condition)) - return "condition: string expected"; - if (message.boost != null && message.hasOwnProperty("boost")) - if (typeof message.boost !== "number") - return "boost: number expected"; - return null; - }; + /** + * Calls ListServingConfigs. + * @function listServingConfigs + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @instance + * @param {google.cloud.retail.v2beta.IListServingConfigsRequest} request ListServingConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec - */ - ConditionBoostSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec) - return object; - var message = new $root.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec(); - if (object.condition != null) - message.condition = String(object.condition); - if (object.boost != null) - message.boost = Number(object.boost); - return message; - }; + /** + * Callback as used by {@link google.cloud.retail.v2beta.ServingConfigService#addControl}. + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @typedef AddControlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.ServingConfig} [response] ServingConfig + */ - /** - * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec} message ConditionBoostSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConditionBoostSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.condition = ""; - object.boost = 0; - } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = message.condition; - if (message.boost != null && message.hasOwnProperty("boost")) - object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; - return object; - }; + /** + * Calls AddControl. + * @function addControl + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @instance + * @param {google.cloud.retail.v2beta.IAddControlRequest} request AddControlRequest message or plain object + * @param {google.cloud.retail.v2beta.ServingConfigService.AddControlCallback} callback Node-style callback called with the error, if any, and ServingConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServingConfigService.prototype.addControl = function addControl(request, callback) { + return this.rpcCall(addControl, $root.google.cloud.retail.v2beta.AddControlRequest, $root.google.cloud.retail.v2beta.ServingConfig, request, callback); + }, "name", { value: "AddControl" }); - /** - * Converts this ConditionBoostSpec to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec - * @instance - * @returns {Object.} JSON object - */ - ConditionBoostSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Calls AddControl. + * @function addControl + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @instance + * @param {google.cloud.retail.v2beta.IAddControlRequest} request AddControlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - return ConditionBoostSpec; - })(); + /** + * Callback as used by {@link google.cloud.retail.v2beta.ServingConfigService#removeControl}. + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @typedef RemoveControlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2beta.ServingConfig} [response] ServingConfig + */ - return BoostSpec; - })(); + /** + * Calls RemoveControl. + * @function removeControl + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @instance + * @param {google.cloud.retail.v2beta.IRemoveControlRequest} request RemoveControlRequest message or plain object + * @param {google.cloud.retail.v2beta.ServingConfigService.RemoveControlCallback} callback Node-style callback called with the error, if any, and ServingConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServingConfigService.prototype.removeControl = function removeControl(request, callback) { + return this.rpcCall(removeControl, $root.google.cloud.retail.v2beta.RemoveControlRequest, $root.google.cloud.retail.v2beta.ServingConfig, request, callback); + }, "name", { value: "RemoveControl" }); - SearchRequest.QueryExpansionSpec = (function() { + /** + * Calls RemoveControl. + * @function removeControl + * @memberof google.cloud.retail.v2beta.ServingConfigService + * @instance + * @param {google.cloud.retail.v2beta.IRemoveControlRequest} request RemoveControlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Properties of a QueryExpansionSpec. - * @memberof google.cloud.retail.v2beta.SearchRequest - * @interface IQueryExpansionSpec - * @property {google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition|null} [condition] QueryExpansionSpec condition - * @property {boolean|null} [pinUnexpandedResults] QueryExpansionSpec pinUnexpandedResults - */ + return ServingConfigService; + })(); - /** - * Constructs a new QueryExpansionSpec. - * @memberof google.cloud.retail.v2beta.SearchRequest - * @classdesc Represents a QueryExpansionSpec. - * @implements IQueryExpansionSpec - * @constructor - * @param {google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set - */ - function QueryExpansionSpec(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]]; - } + v2beta.CreateServingConfigRequest = (function() { - /** - * QueryExpansionSpec condition. - * @member {google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition} condition - * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec - * @instance - */ - QueryExpansionSpec.prototype.condition = 0; + /** + * Properties of a CreateServingConfigRequest. + * @memberof google.cloud.retail.v2beta + * @interface ICreateServingConfigRequest + * @property {string|null} [parent] CreateServingConfigRequest parent + * @property {google.cloud.retail.v2beta.IServingConfig|null} [servingConfig] CreateServingConfigRequest servingConfig + * @property {string|null} [servingConfigId] CreateServingConfigRequest servingConfigId + */ - /** - * QueryExpansionSpec pinUnexpandedResults. - * @member {boolean} pinUnexpandedResults - * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec - * @instance - */ - QueryExpansionSpec.prototype.pinUnexpandedResults = false; + /** + * Constructs a new CreateServingConfigRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a CreateServingConfigRequest. + * @implements ICreateServingConfigRequest + * @constructor + * @param {google.cloud.retail.v2beta.ICreateServingConfigRequest=} [properties] Properties to set + */ + function CreateServingConfigRequest(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]]; + } - /** - * Creates a new QueryExpansionSpec instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec} QueryExpansionSpec instance - */ - QueryExpansionSpec.create = function create(properties) { - return new QueryExpansionSpec(properties); - }; + /** + * CreateServingConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2beta.CreateServingConfigRequest + * @instance + */ + CreateServingConfigRequest.prototype.parent = ""; - /** - * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryExpansionSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.condition); - if (message.pinUnexpandedResults != null && Object.hasOwnProperty.call(message, "pinUnexpandedResults")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.pinUnexpandedResults); - return writer; - }; + /** + * CreateServingConfigRequest servingConfig. + * @member {google.cloud.retail.v2beta.IServingConfig|null|undefined} servingConfig + * @memberof google.cloud.retail.v2beta.CreateServingConfigRequest + * @instance + */ + CreateServingConfigRequest.prototype.servingConfig = null; - /** - * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryExpansionSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * CreateServingConfigRequest servingConfigId. + * @member {string} servingConfigId + * @memberof google.cloud.retail.v2beta.CreateServingConfigRequest + * @instance + */ + CreateServingConfigRequest.prototype.servingConfigId = ""; - /** - * Decodes a QueryExpansionSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec} QueryExpansionSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryExpansionSpec.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.v2beta.SearchRequest.QueryExpansionSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.condition = reader.int32(); - break; - case 2: - message.pinUnexpandedResults = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new CreateServingConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.CreateServingConfigRequest + * @static + * @param {google.cloud.retail.v2beta.ICreateServingConfigRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.CreateServingConfigRequest} CreateServingConfigRequest instance + */ + CreateServingConfigRequest.create = function create(properties) { + return new CreateServingConfigRequest(properties); + }; - /** - * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec} QueryExpansionSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryExpansionSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified CreateServingConfigRequest message. Does not implicitly {@link google.cloud.retail.v2beta.CreateServingConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.CreateServingConfigRequest + * @static + * @param {google.cloud.retail.v2beta.ICreateServingConfigRequest} message CreateServingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServingConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.servingConfig != null && Object.hasOwnProperty.call(message, "servingConfig")) + $root.google.cloud.retail.v2beta.ServingConfig.encode(message.servingConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.servingConfigId != null && Object.hasOwnProperty.call(message, "servingConfigId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.servingConfigId); + return writer; + }; - /** - * Verifies a QueryExpansionSpec message. - * @function verify - * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryExpansionSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.condition != null && message.hasOwnProperty("condition")) - switch (message.condition) { - default: - return "condition: enum value expected"; - case 0: - case 1: - case 3: - break; - } - if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) - if (typeof message.pinUnexpandedResults !== "boolean") - return "pinUnexpandedResults: boolean expected"; - return null; - }; + /** + * Encodes the specified CreateServingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CreateServingConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.CreateServingConfigRequest + * @static + * @param {google.cloud.retail.v2beta.ICreateServingConfigRequest} message CreateServingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServingConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec} QueryExpansionSpec - */ - QueryExpansionSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec) - return object; - var message = new $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec(); - switch (object.condition) { - case "CONDITION_UNSPECIFIED": - case 0: - message.condition = 0; - break; - case "DISABLED": + /** + * Decodes a CreateServingConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.CreateServingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.CreateServingConfigRequest} CreateServingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServingConfigRequest.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.v2beta.CreateServingConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { case 1: - message.condition = 1; + message.parent = reader.string(); + break; + case 2: + message.servingConfig = $root.google.cloud.retail.v2beta.ServingConfig.decode(reader, reader.uint32()); break; - case "AUTO": case 3: - message.condition = 3; + message.servingConfigId = reader.string(); + break; + default: + reader.skipType(tag & 7); break; } - if (object.pinUnexpandedResults != null) - message.pinUnexpandedResults = Boolean(object.pinUnexpandedResults); - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec - * @static - * @param {google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec} message QueryExpansionSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryExpansionSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.condition = options.enums === String ? "CONDITION_UNSPECIFIED" : 0; - object.pinUnexpandedResults = false; - } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = options.enums === String ? $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition[message.condition] : message.condition; - if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) - object.pinUnexpandedResults = message.pinUnexpandedResults; - return object; - }; + /** + * Decodes a CreateServingConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.CreateServingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.CreateServingConfigRequest} CreateServingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServingConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Converts this QueryExpansionSpec to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec - * @instance - * @returns {Object.} JSON object - */ - QueryExpansionSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Verifies a CreateServingConfigRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.CreateServingConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateServingConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.servingConfig != null && message.hasOwnProperty("servingConfig")) { + var error = $root.google.cloud.retail.v2beta.ServingConfig.verify(message.servingConfig); + if (error) + return "servingConfig." + error; + } + if (message.servingConfigId != null && message.hasOwnProperty("servingConfigId")) + if (!$util.isString(message.servingConfigId)) + return "servingConfigId: string expected"; + return null; + }; - /** - * Condition enum. - * @name google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition - * @enum {number} - * @property {number} CONDITION_UNSPECIFIED=0 CONDITION_UNSPECIFIED value - * @property {number} DISABLED=1 DISABLED value - * @property {number} AUTO=3 AUTO value - */ - QueryExpansionSpec.Condition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONDITION_UNSPECIFIED"] = 0; - values[valuesById[1] = "DISABLED"] = 1; - values[valuesById[3] = "AUTO"] = 3; - return values; - })(); + /** + * Creates a CreateServingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.CreateServingConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.CreateServingConfigRequest} CreateServingConfigRequest + */ + CreateServingConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.CreateServingConfigRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.CreateServingConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.servingConfig != null) { + if (typeof object.servingConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.CreateServingConfigRequest.servingConfig: object expected"); + message.servingConfig = $root.google.cloud.retail.v2beta.ServingConfig.fromObject(object.servingConfig); + } + if (object.servingConfigId != null) + message.servingConfigId = String(object.servingConfigId); + return message; + }; - return QueryExpansionSpec; - })(); + /** + * Creates a plain object from a CreateServingConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.CreateServingConfigRequest + * @static + * @param {google.cloud.retail.v2beta.CreateServingConfigRequest} message CreateServingConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateServingConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.servingConfig = null; + object.servingConfigId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.servingConfig != null && message.hasOwnProperty("servingConfig")) + object.servingConfig = $root.google.cloud.retail.v2beta.ServingConfig.toObject(message.servingConfig, options); + if (message.servingConfigId != null && message.hasOwnProperty("servingConfigId")) + object.servingConfigId = message.servingConfigId; + return object; + }; /** - * SearchMode enum. - * @name google.cloud.retail.v2beta.SearchRequest.SearchMode - * @enum {number} - * @property {number} SEARCH_MODE_UNSPECIFIED=0 SEARCH_MODE_UNSPECIFIED value - * @property {number} PRODUCT_SEARCH_ONLY=1 PRODUCT_SEARCH_ONLY value - * @property {number} FACETED_SEARCH_ONLY=2 FACETED_SEARCH_ONLY value + * Converts this CreateServingConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.CreateServingConfigRequest + * @instance + * @returns {Object.} JSON object */ - SearchRequest.SearchMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEARCH_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRODUCT_SEARCH_ONLY"] = 1; - values[valuesById[2] = "FACETED_SEARCH_ONLY"] = 2; - return values; - })(); + CreateServingConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return SearchRequest; + return CreateServingConfigRequest; })(); - v2beta.SearchResponse = (function() { + v2beta.UpdateServingConfigRequest = (function() { /** - * Properties of a SearchResponse. + * Properties of an UpdateServingConfigRequest. * @memberof google.cloud.retail.v2beta - * @interface ISearchResponse - * @property {Array.|null} [results] SearchResponse results - * @property {Array.|null} [facets] SearchResponse facets - * @property {number|null} [totalSize] SearchResponse totalSize - * @property {string|null} [correctedQuery] SearchResponse correctedQuery - * @property {string|null} [attributionToken] SearchResponse attributionToken - * @property {string|null} [nextPageToken] SearchResponse nextPageToken - * @property {google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo|null} [queryExpansionInfo] SearchResponse queryExpansionInfo - * @property {string|null} [redirectUri] SearchResponse redirectUri - * @property {Array.|null} [appliedControls] SearchResponse appliedControls + * @interface IUpdateServingConfigRequest + * @property {google.cloud.retail.v2beta.IServingConfig|null} [servingConfig] UpdateServingConfigRequest servingConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateServingConfigRequest updateMask */ /** - * Constructs a new SearchResponse. + * Constructs a new UpdateServingConfigRequest. * @memberof google.cloud.retail.v2beta - * @classdesc Represents a SearchResponse. - * @implements ISearchResponse + * @classdesc Represents an UpdateServingConfigRequest. + * @implements IUpdateServingConfigRequest * @constructor - * @param {google.cloud.retail.v2beta.ISearchResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2beta.IUpdateServingConfigRequest=} [properties] Properties to set */ - function SearchResponse(properties) { - this.results = []; - this.facets = []; - this.appliedControls = []; + function UpdateServingConfigRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -76343,188 +88433,294 @@ } /** - * SearchResponse results. - * @member {Array.} results - * @memberof google.cloud.retail.v2beta.SearchResponse + * UpdateServingConfigRequest servingConfig. + * @member {google.cloud.retail.v2beta.IServingConfig|null|undefined} servingConfig + * @memberof google.cloud.retail.v2beta.UpdateServingConfigRequest + * @instance + */ + UpdateServingConfigRequest.prototype.servingConfig = null; + + /** + * UpdateServingConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2beta.UpdateServingConfigRequest * @instance */ - SearchResponse.prototype.results = $util.emptyArray; + UpdateServingConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateServingConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.UpdateServingConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IUpdateServingConfigRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.UpdateServingConfigRequest} UpdateServingConfigRequest instance + */ + UpdateServingConfigRequest.create = function create(properties) { + return new UpdateServingConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateServingConfigRequest message. Does not implicitly {@link google.cloud.retail.v2beta.UpdateServingConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.UpdateServingConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IUpdateServingConfigRequest} message UpdateServingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateServingConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.servingConfig != null && Object.hasOwnProperty.call(message, "servingConfig")) + $root.google.cloud.retail.v2beta.ServingConfig.encode(message.servingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateServingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.UpdateServingConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.UpdateServingConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IUpdateServingConfigRequest} message UpdateServingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateServingConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateServingConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.UpdateServingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.UpdateServingConfigRequest} UpdateServingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateServingConfigRequest.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.v2beta.UpdateServingConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.servingConfig = $root.google.cloud.retail.v2beta.ServingConfig.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * SearchResponse facets. - * @member {Array.} facets - * @memberof google.cloud.retail.v2beta.SearchResponse - * @instance + * Decodes an UpdateServingConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.UpdateServingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.UpdateServingConfigRequest} UpdateServingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchResponse.prototype.facets = $util.emptyArray; + UpdateServingConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * SearchResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.retail.v2beta.SearchResponse - * @instance + * Verifies an UpdateServingConfigRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.UpdateServingConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchResponse.prototype.totalSize = 0; + UpdateServingConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.servingConfig != null && message.hasOwnProperty("servingConfig")) { + var error = $root.google.cloud.retail.v2beta.ServingConfig.verify(message.servingConfig); + if (error) + return "servingConfig." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; /** - * SearchResponse correctedQuery. - * @member {string} correctedQuery - * @memberof google.cloud.retail.v2beta.SearchResponse - * @instance + * Creates an UpdateServingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.UpdateServingConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.UpdateServingConfigRequest} UpdateServingConfigRequest */ - SearchResponse.prototype.correctedQuery = ""; + UpdateServingConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.UpdateServingConfigRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.UpdateServingConfigRequest(); + if (object.servingConfig != null) { + if (typeof object.servingConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.UpdateServingConfigRequest.servingConfig: object expected"); + message.servingConfig = $root.google.cloud.retail.v2beta.ServingConfig.fromObject(object.servingConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2beta.UpdateServingConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; /** - * SearchResponse attributionToken. - * @member {string} attributionToken - * @memberof google.cloud.retail.v2beta.SearchResponse - * @instance + * Creates a plain object from an UpdateServingConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.UpdateServingConfigRequest + * @static + * @param {google.cloud.retail.v2beta.UpdateServingConfigRequest} message UpdateServingConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - SearchResponse.prototype.attributionToken = ""; + UpdateServingConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.servingConfig = null; + object.updateMask = null; + } + if (message.servingConfig != null && message.hasOwnProperty("servingConfig")) + object.servingConfig = $root.google.cloud.retail.v2beta.ServingConfig.toObject(message.servingConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; /** - * SearchResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.retail.v2beta.SearchResponse + * Converts this UpdateServingConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.UpdateServingConfigRequest * @instance + * @returns {Object.} JSON object */ - SearchResponse.prototype.nextPageToken = ""; + UpdateServingConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateServingConfigRequest; + })(); + + v2beta.DeleteServingConfigRequest = (function() { /** - * SearchResponse queryExpansionInfo. - * @member {google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo|null|undefined} queryExpansionInfo - * @memberof google.cloud.retail.v2beta.SearchResponse - * @instance + * Properties of a DeleteServingConfigRequest. + * @memberof google.cloud.retail.v2beta + * @interface IDeleteServingConfigRequest + * @property {string|null} [name] DeleteServingConfigRequest name */ - SearchResponse.prototype.queryExpansionInfo = null; /** - * SearchResponse redirectUri. - * @member {string} redirectUri - * @memberof google.cloud.retail.v2beta.SearchResponse - * @instance + * Constructs a new DeleteServingConfigRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a DeleteServingConfigRequest. + * @implements IDeleteServingConfigRequest + * @constructor + * @param {google.cloud.retail.v2beta.IDeleteServingConfigRequest=} [properties] Properties to set */ - SearchResponse.prototype.redirectUri = ""; + function DeleteServingConfigRequest(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]]; + } /** - * SearchResponse appliedControls. - * @member {Array.} appliedControls - * @memberof google.cloud.retail.v2beta.SearchResponse + * DeleteServingConfigRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2beta.DeleteServingConfigRequest * @instance */ - SearchResponse.prototype.appliedControls = $util.emptyArray; + DeleteServingConfigRequest.prototype.name = ""; /** - * Creates a new SearchResponse instance using the specified properties. + * Creates a new DeleteServingConfigRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2beta.SearchResponse + * @memberof google.cloud.retail.v2beta.DeleteServingConfigRequest * @static - * @param {google.cloud.retail.v2beta.ISearchResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.SearchResponse} SearchResponse instance + * @param {google.cloud.retail.v2beta.IDeleteServingConfigRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.DeleteServingConfigRequest} DeleteServingConfigRequest instance */ - SearchResponse.create = function create(properties) { - return new SearchResponse(properties); + DeleteServingConfigRequest.create = function create(properties) { + return new DeleteServingConfigRequest(properties); }; /** - * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.verify|verify} messages. + * Encodes the specified DeleteServingConfigRequest message. Does not implicitly {@link google.cloud.retail.v2beta.DeleteServingConfigRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2beta.SearchResponse + * @memberof google.cloud.retail.v2beta.DeleteServingConfigRequest * @static - * @param {google.cloud.retail.v2beta.ISearchResponse} message SearchResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IDeleteServingConfigRequest} message DeleteServingConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchResponse.encode = function encode(message, writer) { + DeleteServingConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.results != null && message.results.length) - for (var i = 0; i < message.results.length; ++i) - $root.google.cloud.retail.v2beta.SearchResponse.SearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.facets != null && message.facets.length) - for (var i = 0; i < message.facets.length; ++i) - $root.google.cloud.retail.v2beta.SearchResponse.Facet.encode(message.facets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); - if (message.correctedQuery != null && Object.hasOwnProperty.call(message, "correctedQuery")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.correctedQuery); - if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.attributionToken); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.nextPageToken); - if (message.queryExpansionInfo != null && Object.hasOwnProperty.call(message, "queryExpansionInfo")) - $root.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.encode(message.queryExpansionInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.redirectUri != null && Object.hasOwnProperty.call(message, "redirectUri")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.redirectUri); - if (message.appliedControls != null && message.appliedControls.length) - for (var i = 0; i < message.appliedControls.length; ++i) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.appliedControls[i]); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified SearchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.verify|verify} messages. + * Encodes the specified DeleteServingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.DeleteServingConfigRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.SearchResponse + * @memberof google.cloud.retail.v2beta.DeleteServingConfigRequest * @static - * @param {google.cloud.retail.v2beta.ISearchResponse} message SearchResponse message or plain object to encode + * @param {google.cloud.retail.v2beta.IDeleteServingConfigRequest} message DeleteServingConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchResponse.encodeDelimited = function encodeDelimited(message, writer) { + DeleteServingConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchResponse message from the specified reader or buffer. + * Decodes a DeleteServingConfigRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2beta.SearchResponse + * @memberof google.cloud.retail.v2beta.DeleteServingConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.SearchResponse} SearchResponse + * @returns {google.cloud.retail.v2beta.DeleteServingConfigRequest} DeleteServingConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchResponse.decode = function decode(reader, length) { + DeleteServingConfigRequest.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.v2beta.SearchResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.DeleteServingConfigRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.results && message.results.length)) - message.results = []; - message.results.push($root.google.cloud.retail.v2beta.SearchResponse.SearchResult.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.facets && message.facets.length)) - message.facets = []; - message.facets.push($root.google.cloud.retail.v2beta.SearchResponse.Facet.decode(reader, reader.uint32())); - break; - case 3: - message.totalSize = reader.int32(); - break; - case 4: - message.correctedQuery = reader.string(); - break; - case 5: - message.attributionToken = reader.string(); - break; - case 6: - message.nextPageToken = reader.string(); - break; - case 7: - message.queryExpansionInfo = $root.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.decode(reader, reader.uint32()); - break; - case 10: - message.redirectUri = reader.string(); - break; - case 12: - if (!(message.appliedControls && message.appliedControls.length)) - message.appliedControls = []; - message.appliedControls.push(reader.string()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -76535,1325 +88731,1157 @@ }; /** - * Decodes a SearchResponse message from the specified reader or buffer, length delimited. + * Decodes a DeleteServingConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.SearchResponse + * @memberof google.cloud.retail.v2beta.DeleteServingConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.SearchResponse} SearchResponse + * @returns {google.cloud.retail.v2beta.DeleteServingConfigRequest} DeleteServingConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchResponse.decodeDelimited = function decodeDelimited(reader) { + DeleteServingConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchResponse message. + * Verifies a DeleteServingConfigRequest message. * @function verify - * @memberof google.cloud.retail.v2beta.SearchResponse + * @memberof google.cloud.retail.v2beta.DeleteServingConfigRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchResponse.verify = function verify(message) { + DeleteServingConfigRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.results != null && message.hasOwnProperty("results")) { - if (!Array.isArray(message.results)) - return "results: array expected"; - for (var i = 0; i < message.results.length; ++i) { - var error = $root.google.cloud.retail.v2beta.SearchResponse.SearchResult.verify(message.results[i]); - if (error) - return "results." + error; - } - } - if (message.facets != null && message.hasOwnProperty("facets")) { - if (!Array.isArray(message.facets)) - return "facets: array expected"; - for (var i = 0; i < message.facets.length; ++i) { - var error = $root.google.cloud.retail.v2beta.SearchResponse.Facet.verify(message.facets[i]); - if (error) - return "facets." + error; - } - } - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; - if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) - if (!$util.isString(message.correctedQuery)) - return "correctedQuery: string expected"; - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - if (!$util.isString(message.attributionToken)) - return "attributionToken: string expected"; - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.queryExpansionInfo != null && message.hasOwnProperty("queryExpansionInfo")) { - var error = $root.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.verify(message.queryExpansionInfo); - if (error) - return "queryExpansionInfo." + error; - } - if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) - if (!$util.isString(message.redirectUri)) - return "redirectUri: string expected"; - if (message.appliedControls != null && message.hasOwnProperty("appliedControls")) { - if (!Array.isArray(message.appliedControls)) - return "appliedControls: array expected"; - for (var i = 0; i < message.appliedControls.length; ++i) - if (!$util.isString(message.appliedControls[i])) - return "appliedControls: string[] expected"; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a SearchResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteServingConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2beta.SearchResponse + * @memberof google.cloud.retail.v2beta.DeleteServingConfigRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.SearchResponse} SearchResponse + * @returns {google.cloud.retail.v2beta.DeleteServingConfigRequest} DeleteServingConfigRequest */ - SearchResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.SearchResponse) + DeleteServingConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.DeleteServingConfigRequest) return object; - var message = new $root.google.cloud.retail.v2beta.SearchResponse(); - if (object.results) { - if (!Array.isArray(object.results)) - throw TypeError(".google.cloud.retail.v2beta.SearchResponse.results: array expected"); - message.results = []; - for (var i = 0; i < object.results.length; ++i) { - if (typeof object.results[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchResponse.results: object expected"); - message.results[i] = $root.google.cloud.retail.v2beta.SearchResponse.SearchResult.fromObject(object.results[i]); - } - } - if (object.facets) { - if (!Array.isArray(object.facets)) - throw TypeError(".google.cloud.retail.v2beta.SearchResponse.facets: array expected"); - message.facets = []; - for (var i = 0; i < object.facets.length; ++i) { - if (typeof object.facets[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchResponse.facets: object expected"); - message.facets[i] = $root.google.cloud.retail.v2beta.SearchResponse.Facet.fromObject(object.facets[i]); - } - } - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; - if (object.correctedQuery != null) - message.correctedQuery = String(object.correctedQuery); - if (object.attributionToken != null) - message.attributionToken = String(object.attributionToken); - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.queryExpansionInfo != null) { - if (typeof object.queryExpansionInfo !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchResponse.queryExpansionInfo: object expected"); - message.queryExpansionInfo = $root.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.fromObject(object.queryExpansionInfo); - } - if (object.redirectUri != null) - message.redirectUri = String(object.redirectUri); - if (object.appliedControls) { - if (!Array.isArray(object.appliedControls)) - throw TypeError(".google.cloud.retail.v2beta.SearchResponse.appliedControls: array expected"); - message.appliedControls = []; - for (var i = 0; i < object.appliedControls.length; ++i) - message.appliedControls[i] = String(object.appliedControls[i]); - } + var message = new $root.google.cloud.retail.v2beta.DeleteServingConfigRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. + * Creates a plain object from a DeleteServingConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2beta.SearchResponse + * @memberof google.cloud.retail.v2beta.DeleteServingConfigRequest * @static - * @param {google.cloud.retail.v2beta.SearchResponse} message SearchResponse + * @param {google.cloud.retail.v2beta.DeleteServingConfigRequest} message DeleteServingConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchResponse.toObject = function toObject(message, options) { + DeleteServingConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.results = []; - object.facets = []; - object.appliedControls = []; - } - if (options.defaults) { - object.totalSize = 0; - object.correctedQuery = ""; - object.attributionToken = ""; - object.nextPageToken = ""; - object.queryExpansionInfo = null; - object.redirectUri = ""; - } - if (message.results && message.results.length) { - object.results = []; - for (var j = 0; j < message.results.length; ++j) - object.results[j] = $root.google.cloud.retail.v2beta.SearchResponse.SearchResult.toObject(message.results[j], options); - } - if (message.facets && message.facets.length) { - object.facets = []; - for (var j = 0; j < message.facets.length; ++j) - object.facets[j] = $root.google.cloud.retail.v2beta.SearchResponse.Facet.toObject(message.facets[j], options); - } - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; - if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) - object.correctedQuery = message.correctedQuery; - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - object.attributionToken = message.attributionToken; - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.queryExpansionInfo != null && message.hasOwnProperty("queryExpansionInfo")) - object.queryExpansionInfo = $root.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.toObject(message.queryExpansionInfo, options); - if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) - object.redirectUri = message.redirectUri; - if (message.appliedControls && message.appliedControls.length) { - object.appliedControls = []; - for (var j = 0; j < message.appliedControls.length; ++j) - object.appliedControls[j] = message.appliedControls[j]; - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this SearchResponse to JSON. + * Converts this DeleteServingConfigRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2beta.SearchResponse + * @memberof google.cloud.retail.v2beta.DeleteServingConfigRequest * @instance * @returns {Object.} JSON object */ - SearchResponse.prototype.toJSON = function toJSON() { + DeleteServingConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - SearchResponse.SearchResult = (function() { + return DeleteServingConfigRequest; + })(); - /** - * Properties of a SearchResult. - * @memberof google.cloud.retail.v2beta.SearchResponse - * @interface ISearchResult - * @property {string|null} [id] SearchResult id - * @property {google.cloud.retail.v2beta.IProduct|null} [product] SearchResult product - * @property {number|null} [matchingVariantCount] SearchResult matchingVariantCount - * @property {Object.|null} [matchingVariantFields] SearchResult matchingVariantFields - * @property {Object.|null} [variantRollupValues] SearchResult variantRollupValues - */ + v2beta.GetServingConfigRequest = (function() { - /** - * Constructs a new SearchResult. - * @memberof google.cloud.retail.v2beta.SearchResponse - * @classdesc Represents a SearchResult. - * @implements ISearchResult - * @constructor - * @param {google.cloud.retail.v2beta.SearchResponse.ISearchResult=} [properties] Properties to set - */ - function SearchResult(properties) { - this.matchingVariantFields = {}; - this.variantRollupValues = {}; - 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]]; - } + /** + * Properties of a GetServingConfigRequest. + * @memberof google.cloud.retail.v2beta + * @interface IGetServingConfigRequest + * @property {string|null} [name] GetServingConfigRequest name + */ - /** - * SearchResult id. - * @member {string} id - * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult - * @instance - */ - SearchResult.prototype.id = ""; + /** + * Constructs a new GetServingConfigRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a GetServingConfigRequest. + * @implements IGetServingConfigRequest + * @constructor + * @param {google.cloud.retail.v2beta.IGetServingConfigRequest=} [properties] Properties to set + */ + function GetServingConfigRequest(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]]; + } - /** - * SearchResult product. - * @member {google.cloud.retail.v2beta.IProduct|null|undefined} product - * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult - * @instance - */ - SearchResult.prototype.product = null; + /** + * GetServingConfigRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2beta.GetServingConfigRequest + * @instance + */ + GetServingConfigRequest.prototype.name = ""; - /** - * SearchResult matchingVariantCount. - * @member {number} matchingVariantCount - * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult - * @instance - */ - SearchResult.prototype.matchingVariantCount = 0; + /** + * Creates a new GetServingConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.GetServingConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IGetServingConfigRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.GetServingConfigRequest} GetServingConfigRequest instance + */ + GetServingConfigRequest.create = function create(properties) { + return new GetServingConfigRequest(properties); + }; - /** - * SearchResult matchingVariantFields. - * @member {Object.} matchingVariantFields - * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult - * @instance - */ - SearchResult.prototype.matchingVariantFields = $util.emptyObject; + /** + * Encodes the specified GetServingConfigRequest message. Does not implicitly {@link google.cloud.retail.v2beta.GetServingConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.GetServingConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IGetServingConfigRequest} message GetServingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServingConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; - /** - * SearchResult variantRollupValues. - * @member {Object.} variantRollupValues - * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult - * @instance - */ - SearchResult.prototype.variantRollupValues = $util.emptyObject; + /** + * Encodes the specified GetServingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.GetServingConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.GetServingConfigRequest + * @static + * @param {google.cloud.retail.v2beta.IGetServingConfigRequest} message GetServingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServingConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new SearchResult instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult - * @static - * @param {google.cloud.retail.v2beta.SearchResponse.ISearchResult=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.SearchResponse.SearchResult} SearchResult instance - */ - SearchResult.create = function create(properties) { - return new SearchResult(properties); - }; + /** + * Decodes a GetServingConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.GetServingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.GetServingConfigRequest} GetServingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServingConfigRequest.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.v2beta.GetServingConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetServingConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.GetServingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.GetServingConfigRequest} GetServingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServingConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetServingConfigRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.GetServingConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetServingConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.SearchResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult - * @static - * @param {google.cloud.retail.v2beta.SearchResponse.ISearchResult} message SearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - $root.google.cloud.retail.v2beta.Product.encode(message.product, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.matchingVariantCount != null && Object.hasOwnProperty.call(message, "matchingVariantCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.matchingVariantCount); - if (message.matchingVariantFields != null && Object.hasOwnProperty.call(message, "matchingVariantFields")) - for (var keys = Object.keys(message.matchingVariantFields), 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.protobuf.FieldMask.encode(message.matchingVariantFields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.variantRollupValues != null && Object.hasOwnProperty.call(message, "variantRollupValues")) - for (var keys = Object.keys(message.variantRollupValues), i = 0; i < keys.length; ++i) { - 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(); - } - return writer; - }; + /** + * Creates a GetServingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.GetServingConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.GetServingConfigRequest} GetServingConfigRequest + */ + GetServingConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.GetServingConfigRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.GetServingConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.SearchResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult - * @static - * @param {google.cloud.retail.v2beta.SearchResponse.ISearchResult} message SearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a GetServingConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.GetServingConfigRequest + * @static + * @param {google.cloud.retail.v2beta.GetServingConfigRequest} message GetServingConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetServingConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * Decodes a SearchResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.SearchResponse.SearchResult} SearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResult.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.v2beta.SearchResponse.SearchResult(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - message.product = $root.google.cloud.retail.v2beta.Product.decode(reader, reader.uint32()); - break; - case 3: - message.matchingVariantCount = reader.int32(); - break; - case 4: - if (message.matchingVariantFields === $util.emptyObject) - message.matchingVariantFields = {}; - 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.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.matchingVariantFields[key] = value; - break; - case 5: - if (message.variantRollupValues === $util.emptyObject) - message.variantRollupValues = {}; - 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.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.variantRollupValues[key] = value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this GetServingConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.GetServingConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetServingConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a SearchResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.SearchResponse.SearchResult} SearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return GetServingConfigRequest; + })(); - /** - * Verifies a SearchResult message. - * @function verify - * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.product != null && message.hasOwnProperty("product")) { - var error = $root.google.cloud.retail.v2beta.Product.verify(message.product); - if (error) - return "product." + error; - } - if (message.matchingVariantCount != null && message.hasOwnProperty("matchingVariantCount")) - if (!$util.isInteger(message.matchingVariantCount)) - return "matchingVariantCount: integer expected"; - if (message.matchingVariantFields != null && message.hasOwnProperty("matchingVariantFields")) { - if (!$util.isObject(message.matchingVariantFields)) - return "matchingVariantFields: object expected"; - var key = Object.keys(message.matchingVariantFields); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.FieldMask.verify(message.matchingVariantFields[key[i]]); - if (error) - return "matchingVariantFields." + error; - } - } - if (message.variantRollupValues != null && message.hasOwnProperty("variantRollupValues")) { - if (!$util.isObject(message.variantRollupValues)) - return "variantRollupValues: object expected"; - var key = Object.keys(message.variantRollupValues); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.variantRollupValues[key[i]]); - if (error) - return "variantRollupValues." + error; - } - } - return null; - }; + v2beta.ListServingConfigsRequest = (function() { - /** - * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.SearchResponse.SearchResult} SearchResult - */ - SearchResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.SearchResponse.SearchResult) - return object; - var message = new $root.google.cloud.retail.v2beta.SearchResponse.SearchResult(); - if (object.id != null) - message.id = String(object.id); - if (object.product != null) { - if (typeof object.product !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchResponse.SearchResult.product: object expected"); - message.product = $root.google.cloud.retail.v2beta.Product.fromObject(object.product); - } - if (object.matchingVariantCount != null) - message.matchingVariantCount = object.matchingVariantCount | 0; - if (object.matchingVariantFields) { - if (typeof object.matchingVariantFields !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchResponse.SearchResult.matchingVariantFields: object expected"); - message.matchingVariantFields = {}; - for (var keys = Object.keys(object.matchingVariantFields), i = 0; i < keys.length; ++i) { - if (typeof object.matchingVariantFields[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchResponse.SearchResult.matchingVariantFields: object expected"); - message.matchingVariantFields[keys[i]] = $root.google.protobuf.FieldMask.fromObject(object.matchingVariantFields[keys[i]]); - } - } - if (object.variantRollupValues) { - if (typeof object.variantRollupValues !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchResponse.SearchResult.variantRollupValues: object expected"); - message.variantRollupValues = {}; - for (var keys = Object.keys(object.variantRollupValues), i = 0; i < keys.length; ++i) { - if (typeof object.variantRollupValues[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchResponse.SearchResult.variantRollupValues: object expected"); - message.variantRollupValues[keys[i]] = $root.google.protobuf.Value.fromObject(object.variantRollupValues[keys[i]]); - } - } - return message; - }; + /** + * Properties of a ListServingConfigsRequest. + * @memberof google.cloud.retail.v2beta + * @interface IListServingConfigsRequest + * @property {string|null} [parent] ListServingConfigsRequest parent + * @property {number|null} [pageSize] ListServingConfigsRequest pageSize + * @property {string|null} [pageToken] ListServingConfigsRequest pageToken + */ - /** - * Creates a plain object from a SearchResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult - * @static - * @param {google.cloud.retail.v2beta.SearchResponse.SearchResult} message SearchResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.matchingVariantFields = {}; - object.variantRollupValues = {}; - } - if (options.defaults) { - object.id = ""; - object.product = null; - object.matchingVariantCount = 0; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.product != null && message.hasOwnProperty("product")) - object.product = $root.google.cloud.retail.v2beta.Product.toObject(message.product, options); - if (message.matchingVariantCount != null && message.hasOwnProperty("matchingVariantCount")) - object.matchingVariantCount = message.matchingVariantCount; - var keys2; - if (message.matchingVariantFields && (keys2 = Object.keys(message.matchingVariantFields)).length) { - object.matchingVariantFields = {}; - for (var j = 0; j < keys2.length; ++j) - object.matchingVariantFields[keys2[j]] = $root.google.protobuf.FieldMask.toObject(message.matchingVariantFields[keys2[j]], options); - } - if (message.variantRollupValues && (keys2 = Object.keys(message.variantRollupValues)).length) { - object.variantRollupValues = {}; - for (var j = 0; j < keys2.length; ++j) - object.variantRollupValues[keys2[j]] = $root.google.protobuf.Value.toObject(message.variantRollupValues[keys2[j]], options); - } - return object; - }; + /** + * Constructs a new ListServingConfigsRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a ListServingConfigsRequest. + * @implements IListServingConfigsRequest + * @constructor + * @param {google.cloud.retail.v2beta.IListServingConfigsRequest=} [properties] Properties to set + */ + function ListServingConfigsRequest(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]]; + } - /** - * Converts this SearchResult to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.SearchResponse.SearchResult - * @instance - * @returns {Object.} JSON object - */ - SearchResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * ListServingConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2beta.ListServingConfigsRequest + * @instance + */ + ListServingConfigsRequest.prototype.parent = ""; - return SearchResult; - })(); + /** + * ListServingConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.retail.v2beta.ListServingConfigsRequest + * @instance + */ + ListServingConfigsRequest.prototype.pageSize = 0; - SearchResponse.Facet = (function() { + /** + * ListServingConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.retail.v2beta.ListServingConfigsRequest + * @instance + */ + ListServingConfigsRequest.prototype.pageToken = ""; - /** - * Properties of a Facet. - * @memberof google.cloud.retail.v2beta.SearchResponse - * @interface IFacet - * @property {string|null} [key] Facet key - * @property {Array.|null} [values] Facet values - * @property {boolean|null} [dynamicFacet] Facet dynamicFacet - */ + /** + * Creates a new ListServingConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.ListServingConfigsRequest + * @static + * @param {google.cloud.retail.v2beta.IListServingConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ListServingConfigsRequest} ListServingConfigsRequest instance + */ + ListServingConfigsRequest.create = function create(properties) { + return new ListServingConfigsRequest(properties); + }; - /** - * Constructs a new Facet. - * @memberof google.cloud.retail.v2beta.SearchResponse - * @classdesc Represents a Facet. - * @implements IFacet - * @constructor - * @param {google.cloud.retail.v2beta.SearchResponse.IFacet=} [properties] Properties to set - */ - function Facet(properties) { - this.values = []; - 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]]; - } + /** + * Encodes the specified ListServingConfigsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.ListServingConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ListServingConfigsRequest + * @static + * @param {google.cloud.retail.v2beta.IListServingConfigsRequest} message ListServingConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServingConfigsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; - /** - * Facet key. - * @member {string} key - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet - * @instance - */ - Facet.prototype.key = ""; + /** + * Encodes the specified ListServingConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListServingConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ListServingConfigsRequest + * @static + * @param {google.cloud.retail.v2beta.IListServingConfigsRequest} message ListServingConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServingConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Facet values. - * @member {Array.} values - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet - * @instance - */ - Facet.prototype.values = $util.emptyArray; + /** + * Decodes a ListServingConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ListServingConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ListServingConfigsRequest} ListServingConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServingConfigsRequest.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.v2beta.ListServingConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Facet dynamicFacet. - * @member {boolean} dynamicFacet - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet - * @instance - */ - Facet.prototype.dynamicFacet = false; + /** + * Decodes a ListServingConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ListServingConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ListServingConfigsRequest} ListServingConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServingConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new Facet instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet - * @static - * @param {google.cloud.retail.v2beta.SearchResponse.IFacet=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.SearchResponse.Facet} Facet instance - */ - Facet.create = function create(properties) { - return new Facet(properties); - }; + /** + * Verifies a ListServingConfigsRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.ListServingConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServingConfigsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; - /** - * Encodes the specified Facet message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.Facet.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet - * @static - * @param {google.cloud.retail.v2beta.SearchResponse.IFacet} message Facet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Facet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.encode(message.values[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.dynamicFacet != null && Object.hasOwnProperty.call(message, "dynamicFacet")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.dynamicFacet); - return writer; - }; + /** + * Creates a ListServingConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ListServingConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ListServingConfigsRequest} ListServingConfigsRequest + */ + ListServingConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ListServingConfigsRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.ListServingConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; - /** - * Encodes the specified Facet message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.Facet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet - * @static - * @param {google.cloud.retail.v2beta.SearchResponse.IFacet} message Facet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Facet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a ListServingConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ListServingConfigsRequest + * @static + * @param {google.cloud.retail.v2beta.ListServingConfigsRequest} message ListServingConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServingConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; - /** - * Decodes a Facet message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.SearchResponse.Facet} Facet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Facet.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.v2beta.SearchResponse.Facet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.decode(reader, reader.uint32())); - break; - case 3: - message.dynamicFacet = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this ListServingConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ListServingConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListServingConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a Facet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.SearchResponse.Facet} Facet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Facet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return ListServingConfigsRequest; + })(); - /** - * Verifies a Facet message. - * @function verify - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Facet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.verify(message.values[i]); - if (error) - return "values." + error; - } - } - if (message.dynamicFacet != null && message.hasOwnProperty("dynamicFacet")) - if (typeof message.dynamicFacet !== "boolean") - return "dynamicFacet: boolean expected"; - return null; - }; + v2beta.ListServingConfigsResponse = (function() { - /** - * Creates a Facet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.SearchResponse.Facet} Facet - */ - Facet.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.SearchResponse.Facet) - return object; - var message = new $root.google.cloud.retail.v2beta.SearchResponse.Facet(); - if (object.key != null) - message.key = String(object.key); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.retail.v2beta.SearchResponse.Facet.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchResponse.Facet.values: object expected"); - message.values[i] = $root.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.fromObject(object.values[i]); - } - } - if (object.dynamicFacet != null) - message.dynamicFacet = Boolean(object.dynamicFacet); - return message; - }; + /** + * Properties of a ListServingConfigsResponse. + * @memberof google.cloud.retail.v2beta + * @interface IListServingConfigsResponse + * @property {Array.|null} [servingConfigs] ListServingConfigsResponse servingConfigs + * @property {string|null} [nextPageToken] ListServingConfigsResponse nextPageToken + */ - /** - * Creates a plain object from a Facet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet - * @static - * @param {google.cloud.retail.v2beta.SearchResponse.Facet} message Facet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Facet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (options.defaults) { - object.key = ""; - object.dynamicFacet = false; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.toObject(message.values[j], options); - } - if (message.dynamicFacet != null && message.hasOwnProperty("dynamicFacet")) - object.dynamicFacet = message.dynamicFacet; - return object; - }; + /** + * Constructs a new ListServingConfigsResponse. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a ListServingConfigsResponse. + * @implements IListServingConfigsResponse + * @constructor + * @param {google.cloud.retail.v2beta.IListServingConfigsResponse=} [properties] Properties to set + */ + function ListServingConfigsResponse(properties) { + this.servingConfigs = []; + 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]]; + } - /** - * Converts this Facet to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet - * @instance - * @returns {Object.} JSON object - */ - Facet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * ListServingConfigsResponse servingConfigs. + * @member {Array.} servingConfigs + * @memberof google.cloud.retail.v2beta.ListServingConfigsResponse + * @instance + */ + ListServingConfigsResponse.prototype.servingConfigs = $util.emptyArray; - Facet.FacetValue = (function() { + /** + * ListServingConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.retail.v2beta.ListServingConfigsResponse + * @instance + */ + ListServingConfigsResponse.prototype.nextPageToken = ""; - /** - * Properties of a FacetValue. - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet - * @interface IFacetValue - * @property {string|null} [value] FacetValue value - * @property {google.cloud.retail.v2beta.IInterval|null} [interval] FacetValue interval - * @property {number|Long|null} [count] FacetValue count - */ + /** + * Creates a new ListServingConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.ListServingConfigsResponse + * @static + * @param {google.cloud.retail.v2beta.IListServingConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.ListServingConfigsResponse} ListServingConfigsResponse instance + */ + ListServingConfigsResponse.create = function create(properties) { + return new ListServingConfigsResponse(properties); + }; - /** - * Constructs a new FacetValue. - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet - * @classdesc Represents a FacetValue. - * @implements IFacetValue - * @constructor - * @param {google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue=} [properties] Properties to set - */ - function FacetValue(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]]; - } + /** + * Encodes the specified ListServingConfigsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.ListServingConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.ListServingConfigsResponse + * @static + * @param {google.cloud.retail.v2beta.IListServingConfigsResponse} message ListServingConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServingConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.servingConfigs != null && message.servingConfigs.length) + for (var i = 0; i < message.servingConfigs.length; ++i) + $root.google.cloud.retail.v2beta.ServingConfig.encode(message.servingConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; - /** - * FacetValue value. - * @member {string|null|undefined} value - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue - * @instance - */ - FacetValue.prototype.value = null; + /** + * Encodes the specified ListServingConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.ListServingConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.ListServingConfigsResponse + * @static + * @param {google.cloud.retail.v2beta.IListServingConfigsResponse} message ListServingConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServingConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * FacetValue interval. - * @member {google.cloud.retail.v2beta.IInterval|null|undefined} interval - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue - * @instance - */ - FacetValue.prototype.interval = null; + /** + * Decodes a ListServingConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.ListServingConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.ListServingConfigsResponse} ListServingConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServingConfigsResponse.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.v2beta.ListServingConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.servingConfigs && message.servingConfigs.length)) + message.servingConfigs = []; + message.servingConfigs.push($root.google.cloud.retail.v2beta.ServingConfig.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * FacetValue count. - * @member {number|Long} count - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue - * @instance - */ - FacetValue.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Decodes a ListServingConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.ListServingConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.ListServingConfigsResponse} ListServingConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServingConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Verifies a ListServingConfigsResponse message. + * @function verify + * @memberof google.cloud.retail.v2beta.ListServingConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServingConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.servingConfigs != null && message.hasOwnProperty("servingConfigs")) { + if (!Array.isArray(message.servingConfigs)) + return "servingConfigs: array expected"; + for (var i = 0; i < message.servingConfigs.length; ++i) { + var error = $root.google.cloud.retail.v2beta.ServingConfig.verify(message.servingConfigs[i]); + if (error) + return "servingConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; - /** - * FacetValue facetValue. - * @member {"value"|"interval"|undefined} facetValue - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue - * @instance - */ - Object.defineProperty(FacetValue.prototype, "facetValue", { - get: $util.oneOfGetter($oneOfFields = ["value", "interval"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Creates a ListServingConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.ListServingConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.ListServingConfigsResponse} ListServingConfigsResponse + */ + ListServingConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.ListServingConfigsResponse) + return object; + var message = new $root.google.cloud.retail.v2beta.ListServingConfigsResponse(); + if (object.servingConfigs) { + if (!Array.isArray(object.servingConfigs)) + throw TypeError(".google.cloud.retail.v2beta.ListServingConfigsResponse.servingConfigs: array expected"); + message.servingConfigs = []; + for (var i = 0; i < object.servingConfigs.length; ++i) { + if (typeof object.servingConfigs[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.ListServingConfigsResponse.servingConfigs: object expected"); + message.servingConfigs[i] = $root.google.cloud.retail.v2beta.ServingConfig.fromObject(object.servingConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * Creates a new FacetValue instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue - * @static - * @param {google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue} FacetValue instance - */ - FacetValue.create = function create(properties) { - return new FacetValue(properties); - }; + /** + * Creates a plain object from a ListServingConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.ListServingConfigsResponse + * @static + * @param {google.cloud.retail.v2beta.ListServingConfigsResponse} message ListServingConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServingConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.servingConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.servingConfigs && message.servingConfigs.length) { + object.servingConfigs = []; + for (var j = 0; j < message.servingConfigs.length; ++j) + object.servingConfigs[j] = $root.google.cloud.retail.v2beta.ServingConfig.toObject(message.servingConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - /** - * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue - * @static - * @param {google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue} message FacetValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) - $root.google.cloud.retail.v2beta.Interval.encode(message.interval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.count); - return writer; - }; + /** + * Converts this ListServingConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.ListServingConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListServingConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue - * @static - * @param {google.cloud.retail.v2beta.SearchResponse.Facet.IFacetValue} message FacetValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return ListServingConfigsResponse; + })(); - /** - * Decodes a FacetValue message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue} FacetValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetValue.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.v2beta.SearchResponse.Facet.FacetValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.string(); - break; - case 2: - message.interval = $root.google.cloud.retail.v2beta.Interval.decode(reader, reader.uint32()); - break; - case 3: - message.count = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + v2beta.AddControlRequest = (function() { - /** - * Decodes a FacetValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue} FacetValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Properties of an AddControlRequest. + * @memberof google.cloud.retail.v2beta + * @interface IAddControlRequest + * @property {string|null} [servingConfig] AddControlRequest servingConfig + * @property {string|null} [controlId] AddControlRequest controlId + */ - /** - * Verifies a FacetValue message. - * @function verify - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FacetValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.value != null && message.hasOwnProperty("value")) { - properties.facetValue = 1; - if (!$util.isString(message.value)) - return "value: string expected"; - } - if (message.interval != null && message.hasOwnProperty("interval")) { - if (properties.facetValue === 1) - return "facetValue: multiple values"; - properties.facetValue = 1; - { - var error = $root.google.cloud.retail.v2beta.Interval.verify(message.interval); - if (error) - return "interval." + error; - } - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; - return null; - }; + /** + * Constructs a new AddControlRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents an AddControlRequest. + * @implements IAddControlRequest + * @constructor + * @param {google.cloud.retail.v2beta.IAddControlRequest=} [properties] Properties to set + */ + function AddControlRequest(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]]; + } - /** - * Creates a FacetValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue} FacetValue - */ - FacetValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue) - return object; - var message = new $root.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue(); - if (object.value != null) - message.value = String(object.value); - if (object.interval != null) { - if (typeof object.interval !== "object") - throw TypeError(".google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.interval: object expected"); - message.interval = $root.google.cloud.retail.v2beta.Interval.fromObject(object.interval); - } - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); - return message; - }; + /** + * AddControlRequest servingConfig. + * @member {string} servingConfig + * @memberof google.cloud.retail.v2beta.AddControlRequest + * @instance + */ + AddControlRequest.prototype.servingConfig = ""; - /** - * Creates a plain object from a FacetValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue - * @static - * @param {google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue} message FacetValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FacetValue.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.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) { - object.value = message.value; - if (options.oneofs) - object.facetValue = "value"; - } - if (message.interval != null && message.hasOwnProperty("interval")) { - object.interval = $root.google.cloud.retail.v2beta.Interval.toObject(message.interval, options); - if (options.oneofs) - object.facetValue = "interval"; - } - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - return object; - }; + /** + * AddControlRequest controlId. + * @member {string} controlId + * @memberof google.cloud.retail.v2beta.AddControlRequest + * @instance + */ + AddControlRequest.prototype.controlId = ""; - /** - * Converts this FacetValue to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue - * @instance - * @returns {Object.} JSON object - */ - FacetValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new AddControlRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.AddControlRequest + * @static + * @param {google.cloud.retail.v2beta.IAddControlRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.AddControlRequest} AddControlRequest instance + */ + AddControlRequest.create = function create(properties) { + return new AddControlRequest(properties); + }; - return FacetValue; - })(); + /** + * Encodes the specified AddControlRequest message. Does not implicitly {@link google.cloud.retail.v2beta.AddControlRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.AddControlRequest + * @static + * @param {google.cloud.retail.v2beta.IAddControlRequest} message AddControlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddControlRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.servingConfig != null && Object.hasOwnProperty.call(message, "servingConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.servingConfig); + if (message.controlId != null && Object.hasOwnProperty.call(message, "controlId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.controlId); + return writer; + }; - return Facet; - })(); + /** + * Encodes the specified AddControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.AddControlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.AddControlRequest + * @static + * @param {google.cloud.retail.v2beta.IAddControlRequest} message AddControlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddControlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - SearchResponse.QueryExpansionInfo = (function() { + /** + * Decodes an AddControlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.AddControlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.AddControlRequest} AddControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddControlRequest.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.v2beta.AddControlRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.servingConfig = reader.string(); + break; + case 2: + message.controlId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a QueryExpansionInfo. - * @memberof google.cloud.retail.v2beta.SearchResponse - * @interface IQueryExpansionInfo - * @property {boolean|null} [expandedQuery] QueryExpansionInfo expandedQuery - * @property {number|Long|null} [pinnedResultCount] QueryExpansionInfo pinnedResultCount - */ + /** + * Decodes an AddControlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.AddControlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.AddControlRequest} AddControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddControlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new QueryExpansionInfo. - * @memberof google.cloud.retail.v2beta.SearchResponse - * @classdesc Represents a QueryExpansionInfo. - * @implements IQueryExpansionInfo - * @constructor - * @param {google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo=} [properties] Properties to set - */ - function QueryExpansionInfo(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]]; + /** + * Verifies an AddControlRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.AddControlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddControlRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.servingConfig != null && message.hasOwnProperty("servingConfig")) + if (!$util.isString(message.servingConfig)) + return "servingConfig: string expected"; + if (message.controlId != null && message.hasOwnProperty("controlId")) + if (!$util.isString(message.controlId)) + return "controlId: string expected"; + return null; + }; + + /** + * Creates an AddControlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.AddControlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.AddControlRequest} AddControlRequest + */ + AddControlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.AddControlRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.AddControlRequest(); + if (object.servingConfig != null) + message.servingConfig = String(object.servingConfig); + if (object.controlId != null) + message.controlId = String(object.controlId); + return message; + }; + + /** + * Creates a plain object from an AddControlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.AddControlRequest + * @static + * @param {google.cloud.retail.v2beta.AddControlRequest} message AddControlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddControlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.servingConfig = ""; + object.controlId = ""; } + if (message.servingConfig != null && message.hasOwnProperty("servingConfig")) + object.servingConfig = message.servingConfig; + if (message.controlId != null && message.hasOwnProperty("controlId")) + object.controlId = message.controlId; + return object; + }; - /** - * QueryExpansionInfo expandedQuery. - * @member {boolean} expandedQuery - * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo - * @instance - */ - QueryExpansionInfo.prototype.expandedQuery = false; + /** + * Converts this AddControlRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.AddControlRequest + * @instance + * @returns {Object.} JSON object + */ + AddControlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * QueryExpansionInfo pinnedResultCount. - * @member {number|Long} pinnedResultCount - * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo - * @instance - */ - QueryExpansionInfo.prototype.pinnedResultCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + return AddControlRequest; + })(); - /** - * Creates a new QueryExpansionInfo instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo - * @static - * @param {google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo=} [properties] Properties to set - * @returns {google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo} QueryExpansionInfo instance - */ - QueryExpansionInfo.create = function create(properties) { - return new QueryExpansionInfo(properties); - }; + v2beta.RemoveControlRequest = (function() { - /** - * Encodes the specified QueryExpansionInfo message. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo - * @static - * @param {google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo} message QueryExpansionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryExpansionInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expandedQuery != null && Object.hasOwnProperty.call(message, "expandedQuery")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandedQuery); - if (message.pinnedResultCount != null && Object.hasOwnProperty.call(message, "pinnedResultCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.pinnedResultCount); - return writer; - }; + /** + * Properties of a RemoveControlRequest. + * @memberof google.cloud.retail.v2beta + * @interface IRemoveControlRequest + * @property {string|null} [servingConfig] RemoveControlRequest servingConfig + * @property {string|null} [controlId] RemoveControlRequest controlId + */ - /** - * Encodes the specified QueryExpansionInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo - * @static - * @param {google.cloud.retail.v2beta.SearchResponse.IQueryExpansionInfo} message QueryExpansionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryExpansionInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Constructs a new RemoveControlRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a RemoveControlRequest. + * @implements IRemoveControlRequest + * @constructor + * @param {google.cloud.retail.v2beta.IRemoveControlRequest=} [properties] Properties to set + */ + function RemoveControlRequest(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]]; + } - /** - * Decodes a QueryExpansionInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo} QueryExpansionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryExpansionInfo.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.v2beta.SearchResponse.QueryExpansionInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.expandedQuery = reader.bool(); - break; - case 2: - message.pinnedResultCount = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * RemoveControlRequest servingConfig. + * @member {string} servingConfig + * @memberof google.cloud.retail.v2beta.RemoveControlRequest + * @instance + */ + RemoveControlRequest.prototype.servingConfig = ""; - /** - * Decodes a QueryExpansionInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo} QueryExpansionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryExpansionInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * RemoveControlRequest controlId. + * @member {string} controlId + * @memberof google.cloud.retail.v2beta.RemoveControlRequest + * @instance + */ + RemoveControlRequest.prototype.controlId = ""; - /** - * Verifies a QueryExpansionInfo message. - * @function verify - * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryExpansionInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expandedQuery != null && message.hasOwnProperty("expandedQuery")) - if (typeof message.expandedQuery !== "boolean") - return "expandedQuery: boolean expected"; - if (message.pinnedResultCount != null && message.hasOwnProperty("pinnedResultCount")) - if (!$util.isInteger(message.pinnedResultCount) && !(message.pinnedResultCount && $util.isInteger(message.pinnedResultCount.low) && $util.isInteger(message.pinnedResultCount.high))) - return "pinnedResultCount: integer|Long expected"; - return null; - }; + /** + * Creates a new RemoveControlRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.RemoveControlRequest + * @static + * @param {google.cloud.retail.v2beta.IRemoveControlRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.RemoveControlRequest} RemoveControlRequest instance + */ + RemoveControlRequest.create = function create(properties) { + return new RemoveControlRequest(properties); + }; - /** - * Creates a QueryExpansionInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo} QueryExpansionInfo - */ - QueryExpansionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo) - return object; - var message = new $root.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo(); - if (object.expandedQuery != null) - message.expandedQuery = Boolean(object.expandedQuery); - if (object.pinnedResultCount != null) - if ($util.Long) - (message.pinnedResultCount = $util.Long.fromValue(object.pinnedResultCount)).unsigned = false; - else if (typeof object.pinnedResultCount === "string") - message.pinnedResultCount = parseInt(object.pinnedResultCount, 10); - else if (typeof object.pinnedResultCount === "number") - message.pinnedResultCount = object.pinnedResultCount; - else if (typeof object.pinnedResultCount === "object") - message.pinnedResultCount = new $util.LongBits(object.pinnedResultCount.low >>> 0, object.pinnedResultCount.high >>> 0).toNumber(); - return message; - }; + /** + * Encodes the specified RemoveControlRequest message. Does not implicitly {@link google.cloud.retail.v2beta.RemoveControlRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.RemoveControlRequest + * @static + * @param {google.cloud.retail.v2beta.IRemoveControlRequest} message RemoveControlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveControlRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.servingConfig != null && Object.hasOwnProperty.call(message, "servingConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.servingConfig); + if (message.controlId != null && Object.hasOwnProperty.call(message, "controlId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.controlId); + return writer; + }; - /** - * Creates a plain object from a QueryExpansionInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo - * @static - * @param {google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo} message QueryExpansionInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryExpansionInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expandedQuery = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.pinnedResultCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.pinnedResultCount = options.longs === String ? "0" : 0; + /** + * Encodes the specified RemoveControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.RemoveControlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.RemoveControlRequest + * @static + * @param {google.cloud.retail.v2beta.IRemoveControlRequest} message RemoveControlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveControlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveControlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.RemoveControlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.RemoveControlRequest} RemoveControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveControlRequest.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.v2beta.RemoveControlRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.servingConfig = reader.string(); + break; + case 2: + message.controlId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.expandedQuery != null && message.hasOwnProperty("expandedQuery")) - object.expandedQuery = message.expandedQuery; - if (message.pinnedResultCount != null && message.hasOwnProperty("pinnedResultCount")) - if (typeof message.pinnedResultCount === "number") - object.pinnedResultCount = options.longs === String ? String(message.pinnedResultCount) : message.pinnedResultCount; - else - object.pinnedResultCount = options.longs === String ? $util.Long.prototype.toString.call(message.pinnedResultCount) : options.longs === Number ? new $util.LongBits(message.pinnedResultCount.low >>> 0, message.pinnedResultCount.high >>> 0).toNumber() : message.pinnedResultCount; + } + return message; + }; + + /** + * Decodes a RemoveControlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.RemoveControlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.RemoveControlRequest} RemoveControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveControlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveControlRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.RemoveControlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveControlRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.servingConfig != null && message.hasOwnProperty("servingConfig")) + if (!$util.isString(message.servingConfig)) + return "servingConfig: string expected"; + if (message.controlId != null && message.hasOwnProperty("controlId")) + if (!$util.isString(message.controlId)) + return "controlId: string expected"; + return null; + }; + + /** + * Creates a RemoveControlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.RemoveControlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.RemoveControlRequest} RemoveControlRequest + */ + RemoveControlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.RemoveControlRequest) return object; - }; + var message = new $root.google.cloud.retail.v2beta.RemoveControlRequest(); + if (object.servingConfig != null) + message.servingConfig = String(object.servingConfig); + if (object.controlId != null) + message.controlId = String(object.controlId); + return message; + }; - /** - * Converts this QueryExpansionInfo to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo - * @instance - * @returns {Object.} JSON object - */ - QueryExpansionInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a RemoveControlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.RemoveControlRequest + * @static + * @param {google.cloud.retail.v2beta.RemoveControlRequest} message RemoveControlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveControlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.servingConfig = ""; + object.controlId = ""; + } + if (message.servingConfig != null && message.hasOwnProperty("servingConfig")) + object.servingConfig = message.servingConfig; + if (message.controlId != null && message.hasOwnProperty("controlId")) + object.controlId = message.controlId; + return object; + }; - return QueryExpansionInfo; - })(); + /** + * Converts this RemoveControlRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.RemoveControlRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveControlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return SearchResponse; + return RemoveControlRequest; })(); v2beta.UserEventService = (function() { diff --git a/packages/google-cloud-retail/protos/protos.json b/packages/google-cloud-retail/protos/protos.json index 3017e50607c..bce4cdd8b67 100644 --- a/packages/google-cloud-retail/protos/protos.json +++ b/packages/google-cloud-retail/protos/protos.json @@ -212,6 +212,10 @@ "note": { "type": "string", "id": 3 + }, + "force": { + "type": "bool", + "id": 4 } } }, @@ -465,11 +469,28 @@ } } }, - "Promotion": { + "LocalInventory": { "fields": { - "promotionId": { + "placeId": { "type": "string", "id": 1 + }, + "priceInfo": { + "type": "PriceInfo", + "id": 2 + }, + "attributes": { + "keyType": "string", + "type": "CustomAttribute", + "id": 3 + }, + "fulfillmentTypes": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } } } }, @@ -708,7 +729,10 @@ }, "requestId": { "type": "string", - "id": 6 + "id": 6, + "options": { + "deprecated": true + } }, "inputConfig": { "type": "ProductInputConfig", @@ -887,7 +911,10 @@ }, "requestId": { "type": "string", - "id": 5 + "id": 5, + "options": { + "deprecated": true + } }, "notificationPubsubTopic": { "type": "string", @@ -1144,6 +1171,14 @@ } } }, + "Promotion": { + "fields": { + "promotionId": { + "type": "string", + "id": 1 + } + } + }, "UserEvent": { "fields": { "eventType": { @@ -1611,6 +1646,62 @@ } } ] + }, + "AddLocalInventories": { + "requestType": "AddLocalInventoriesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addLocalInventories", + "(google.api.http).body": "*", + "(google.api.method_signature)": "product", + "(google.longrunning.operation_info).response_type": "google.cloud.retail.v2.AddLocalInventoriesResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.retail.v2.AddLocalInventoriesMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addLocalInventories", + "body": "*" + } + }, + { + "(google.api.method_signature)": "product" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.retail.v2.AddLocalInventoriesResponse", + "metadata_type": "google.cloud.retail.v2.AddLocalInventoriesMetadata" + } + } + ] + }, + "RemoveLocalInventories": { + "requestType": "RemoveLocalInventoriesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeLocalInventories", + "(google.api.http).body": "*", + "(google.api.method_signature)": "product", + "(google.longrunning.operation_info).response_type": "google.cloud.retail.v2.RemoveLocalInventoriesResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.retail.v2.RemoveLocalInventoriesMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeLocalInventories", + "body": "*" + } + }, + { + "(google.api.method_signature)": "product" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.retail.v2.RemoveLocalInventoriesResponse", + "metadata_type": "google.cloud.retail.v2.RemoveLocalInventoriesMetadata" + } + } + ] } } }, @@ -1794,6 +1885,78 @@ "AddFulfillmentPlacesResponse": { "fields": {} }, + "AddLocalInventoriesRequest": { + "fields": { + "product": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Product" + } + }, + "localInventories": { + "rule": "repeated", + "type": "LocalInventory", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "addMask": { + "type": "google.protobuf.FieldMask", + "id": 4 + }, + "addTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "allowMissing": { + "type": "bool", + "id": 6 + } + } + }, + "AddLocalInventoriesMetadata": { + "fields": {} + }, + "AddLocalInventoriesResponse": { + "fields": {} + }, + "RemoveLocalInventoriesRequest": { + "fields": { + "product": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Product" + } + }, + "placeIds": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "removeTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "allowMissing": { + "type": "bool", + "id": 3 + } + } + }, + "RemoveLocalInventoriesMetadata": { + "fields": {} + }, + "RemoveLocalInventoriesResponse": { + "fields": {} + }, "RemoveFulfillmentPlacesRequest": { "fields": { "product": { @@ -1954,7 +2117,10 @@ }, "dynamicFacetSpec": { "type": "DynamicFacetSpec", - "id": 21 + "id": 21, + "options": { + "deprecated": true + } }, "boostSpec": { "type": "BoostSpec", @@ -1977,6 +2143,10 @@ "searchMode": { "type": "SearchMode", "id": 31 + }, + "personalizationSpec": { + "type": "PersonalizationSpec", + "id": 32 } }, "nested": { @@ -2063,11 +2233,25 @@ } }, "BoostSpec": { + "oneofs": { + "_skipBoostSpecValidation": { + "oneof": [ + "skipBoostSpecValidation" + ] + } + }, "fields": { "conditionBoostSpecs": { "rule": "repeated", "type": "ConditionBoostSpec", "id": 1 + }, + "skipBoostSpecValidation": { + "type": "bool", + "id": 2, + "options": { + "proto3_optional": true + } } }, "nested": { @@ -2106,6 +2290,23 @@ } } }, + "PersonalizationSpec": { + "fields": { + "mode": { + "type": "Mode", + "id": 1 + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "AUTO": 1, + "DISABLED": 2 + } + } + } + }, "SearchMode": { "values": { "SEARCH_MODE_UNSPECIFIED": 0, @@ -2150,6 +2351,16 @@ "redirectUri": { "type": "string", "id": 10 + }, + "appliedControls": { + "rule": "repeated", + "type": "string", + "id": 12 + }, + "invalidConditionBoostSpecs": { + "rule": "repeated", + "type": "SearchRequest.BoostSpec.ConditionBoostSpec", + "id": 14 } }, "nested": { @@ -5346,81 +5557,303 @@ } } }, - "Catalog": { - "options": { - "(google.api.resource).type": "retail.googleapis.com/Catalog", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/catalogs/{catalog}" - }, + "CatalogAttribute": { "fields": { - "name": { + "key": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "IMMUTABLE" + "(google.api.field_behavior)": "REQUIRED" } }, - "displayName": { - "type": "string", - "id": 2, + "inUse": { + "type": "bool", + "id": 9, "options": { - "(google.api.field_behavior)": "IMMUTABLE" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "productLevelConfig": { - "type": "ProductLevelConfig", - "id": 4, + "type": { + "type": "AttributeType", + "id": 10, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OUTPUT_ONLY" } - } - } - }, - "SolutionType": { - "values": { - "SOLUTION_TYPE_UNSPECIFIED": 0, - "SOLUTION_TYPE_RECOMMENDATION": 1, - "SOLUTION_TYPE_SEARCH": 2 - } - }, - "Condition": { - "fields": { - "queryTerms": { - "rule": "repeated", - "type": "QueryTerm", - "id": 1 }, - "activeTimeRange": { - "rule": "repeated", - "type": "TimeRange", - "id": 3 + "indexableOption": { + "type": "IndexableOption", + "id": 5 + }, + "dynamicFacetableOption": { + "type": "DynamicFacetableOption", + "id": 6 + }, + "searchableOption": { + "type": "SearchableOption", + "id": 7 } }, "nested": { - "QueryTerm": { - "fields": { - "value": { - "type": "string", - "id": 1 - }, - "fullMatch": { - "type": "bool", - "id": 2 - } + "AttributeType": { + "values": { + "UNKNOWN": 0, + "TEXTUAL": 1, + "NUMERICAL": 2 } }, - "TimeRange": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } + "IndexableOption": { + "values": { + "INDEXABLE_OPTION_UNSPECIFIED": 0, + "INDEXABLE_ENABLED": 1, + "INDEXABLE_DISABLED": 2 } - } - } + }, + "DynamicFacetableOption": { + "values": { + "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED": 0, + "DYNAMIC_FACETABLE_ENABLED": 1, + "DYNAMIC_FACETABLE_DISABLED": 2 + } + }, + "SearchableOption": { + "values": { + "SEARCHABLE_OPTION_UNSPECIFIED": 0, + "SEARCHABLE_ENABLED": 1, + "SEARCHABLE_DISABLED": 2 + } + } + } + }, + "AttributesConfig": { + "options": { + "(google.api.resource).type": "retail.googleapis.com/AttributesConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "catalogAttributes": { + "keyType": "string", + "type": "CatalogAttribute", + "id": 2 + }, + "attributeConfigLevel": { + "type": "AttributeConfigLevel", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CompletionConfig": { + "options": { + "(google.api.resource).type": "retail.googleapis.com/CompletionConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "matchingOrder": { + "type": "string", + "id": 2 + }, + "maxSuggestions": { + "type": "int32", + "id": 3 + }, + "minPrefixLength": { + "type": "int32", + "id": 4 + }, + "autoLearning": { + "type": "bool", + "id": 11 + }, + "suggestionsInputConfig": { + "type": "CompletionDataInputConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastSuggestionsImportOperation": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "denylistInputConfig": { + "type": "CompletionDataInputConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastDenylistImportOperation": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "allowlistInputConfig": { + "type": "CompletionDataInputConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastAllowlistImportOperation": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "MerchantCenterLink": { + "fields": { + "merchantCenterAccountId": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "branchId": { + "type": "string", + "id": 2 + }, + "destinations": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "regionCode": { + "type": "string", + "id": 4 + }, + "languageCode": { + "type": "string", + "id": 5 + } + } + }, + "MerchantCenterLinkingConfig": { + "fields": { + "links": { + "rule": "repeated", + "type": "MerchantCenterLink", + "id": 1 + } + } + }, + "Catalog": { + "options": { + "(google.api.resource).type": "retail.googleapis.com/Catalog", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/catalogs/{catalog}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "productLevelConfig": { + "type": "ProductLevelConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "merchantCenterLinkingConfig": { + "type": "MerchantCenterLinkingConfig", + "id": 6 + } + } + }, + "AttributeConfigLevel": { + "values": { + "ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED": 0, + "PRODUCT_LEVEL_ATTRIBUTE_CONFIG": 1, + "CATALOG_LEVEL_ATTRIBUTE_CONFIG": 2 + } + }, + "SolutionType": { + "values": { + "SOLUTION_TYPE_UNSPECIFIED": 0, + "SOLUTION_TYPE_RECOMMENDATION": 1, + "SOLUTION_TYPE_SEARCH": 2 + } + }, + "SearchSolutionUseCase": { + "values": { + "SEARCH_SOLUTION_USE_CASE_UNSPECIFIED": 0, + "SEARCH_SOLUTION_USE_CASE_SEARCH": 1, + "SEARCH_SOLUTION_USE_CASE_BROWSE": 2 + } + }, + "Condition": { + "fields": { + "queryTerms": { + "rule": "repeated", + "type": "QueryTerm", + "id": 1 + }, + "activeTimeRange": { + "rule": "repeated", + "type": "TimeRange", + "id": 3 + } + }, + "nested": { + "QueryTerm": { + "fields": { + "value": { + "type": "string", + "id": 1 + }, + "fullMatch": { + "type": "bool", + "id": 2 + } + } + }, + "TimeRange": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + } + } }, "Rule": { "oneofs": { @@ -5802,11 +6235,28 @@ } } }, - "Promotion": { + "LocalInventory": { "fields": { - "promotionId": { + "placeId": { "type": "string", "id": 1 + }, + "priceInfo": { + "type": "PriceInfo", + "id": 2 + }, + "attributes": { + "keyType": "string", + "type": "CustomAttribute", + "id": 3 + }, + "fulfillmentTypes": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } } } }, @@ -5918,7 +6368,10 @@ }, "requestId": { "type": "string", - "id": 6 + "id": 6, + "options": { + "deprecated": true + } }, "inputConfig": { "type": "ProductInputConfig", @@ -6097,7 +6550,10 @@ }, "requestId": { "type": "string", - "id": 5 + "id": 5, + "options": { + "deprecated": true + } }, "notificationPubsubTopic": { "type": "string", @@ -6354,6 +6810,14 @@ } } }, + "Promotion": { + "fields": { + "promotionId": { + "type": "string", + "id": 1 + } + } + }, "UserEvent": { "fields": { "eventType": { @@ -6590,18 +7054,142 @@ "(google.api.method_signature)": "catalog" } ] - } - } - }, - "ListCatalogsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "locations.googleapis.com/Location" - } + }, + "GetCompletionConfig": { + "requestType": "GetCompletionConfigRequest", + "responseType": "CompletionConfig", + "options": { + "(google.api.http).get": "/v2beta/{name=projects/*/locations/*/catalogs/*/completionConfig}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta/{name=projects/*/locations/*/catalogs/*/completionConfig}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateCompletionConfig": { + "requestType": "UpdateCompletionConfigRequest", + "responseType": "CompletionConfig", + "options": { + "(google.api.http).patch": "/v2beta/{completion_config.name=projects/*/locations/*/catalogs/*/completionConfig}", + "(google.api.http).body": "completion_config", + "(google.api.method_signature)": "completion_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2beta/{completion_config.name=projects/*/locations/*/catalogs/*/completionConfig}", + "body": "completion_config" + } + }, + { + "(google.api.method_signature)": "completion_config,update_mask" + } + ] + }, + "GetAttributesConfig": { + "requestType": "GetAttributesConfigRequest", + "responseType": "AttributesConfig", + "options": { + "(google.api.http).get": "/v2beta/{name=projects/*/locations/*/catalogs/*/attributesConfig}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta/{name=projects/*/locations/*/catalogs/*/attributesConfig}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateAttributesConfig": { + "requestType": "UpdateAttributesConfigRequest", + "responseType": "AttributesConfig", + "options": { + "(google.api.http).patch": "/v2beta/{attributes_config.name=projects/*/locations/*/catalogs/*/attributesConfig}", + "(google.api.http).body": "attributes_config", + "(google.api.method_signature)": "attributes_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2beta/{attributes_config.name=projects/*/locations/*/catalogs/*/attributesConfig}", + "body": "attributes_config" + } + }, + { + "(google.api.method_signature)": "attributes_config,update_mask" + } + ] + }, + "AddCatalogAttribute": { + "requestType": "AddCatalogAttributeRequest", + "responseType": "AttributesConfig", + "options": { + "(google.api.http).post": "/v2beta/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:addCatalogAttribute", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:addCatalogAttribute", + "body": "*" + } + } + ] + }, + "RemoveCatalogAttribute": { + "requestType": "RemoveCatalogAttributeRequest", + "responseType": "AttributesConfig", + "options": { + "(google.api.http).post": "/v2beta/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:removeCatalogAttribute", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:removeCatalogAttribute", + "body": "*" + } + } + ] + }, + "ReplaceCatalogAttribute": { + "requestType": "ReplaceCatalogAttributeRequest", + "responseType": "AttributesConfig", + "options": { + "(google.api.http).post": "/v2beta/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:replaceCatalogAttribute", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:replaceCatalogAttribute", + "body": "*" + } + } + ] + } + } + }, + "ListCatalogsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } }, "pageSize": { "type": "int32", @@ -6660,6 +7248,10 @@ "note": { "type": "string", "id": 3 + }, + "force": { + "type": "bool", + "id": 4 } } }, @@ -6693,6 +7285,121 @@ } } }, + "GetCompletionConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/CompletionConfig" + } + } + } + }, + "UpdateCompletionConfigRequest": { + "fields": { + "completionConfig": { + "type": "CompletionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "GetAttributesConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/AttributesConfig" + } + } + } + }, + "UpdateAttributesConfigRequest": { + "fields": { + "attributesConfig": { + "type": "AttributesConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "AddCatalogAttributeRequest": { + "fields": { + "attributesConfig": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/AttributesConfig" + } + }, + "catalogAttribute": { + "type": "CatalogAttribute", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RemoveCatalogAttributeRequest": { + "fields": { + "attributesConfig": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/AttributesConfig" + } + }, + "key": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ReplaceCatalogAttributeRequest": { + "fields": { + "attributesConfig": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/AttributesConfig" + } + }, + "catalogAttribute": { + "type": "CatalogAttribute", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, "CompletionService": { "options": { "(google.api.default_host)": "retail.googleapis.com", @@ -6820,76 +7527,77 @@ } } }, - "ExportErrorsConfig": { + "Control": { + "options": { + "(google.api.resource).type": "retail.googleapis.com/Control", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}" + }, "oneofs": { - "destination": { + "control": { "oneof": [ - "gcsPrefix" + "facetSpec", + "rule" ] } }, "fields": { - "gcsPrefix": { + "facetSpec": { + "type": "SearchRequest.FacetSpec", + "id": 3 + }, + "rule": { + "type": "Rule", + "id": 4 + }, + "name": { "type": "string", - "id": 1 - } - } - }, - "ExportMetadata": { - "fields": { - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - }, - "ExportProductsResponse": { - "fields": { - "errorSamples": { - "rule": "repeated", - "type": "google.rpc.Status", - "id": 1 + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "errorsConfig": { - "type": "ExportErrorsConfig", - "id": 2 - } - } - }, - "ExportUserEventsResponse": { - "fields": { - "errorSamples": { + "associatedServingConfigIds": { "rule": "repeated", - "type": "google.rpc.Status", - "id": 1 + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "errorsConfig": { - "type": "ExportErrorsConfig", - "id": 2 + "solutionTypes": { + "rule": "repeated", + "type": "SolutionType", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } } } }, - "PredictionService": { + "SearchService": { "options": { "(google.api.default_host)": "retail.googleapis.com", "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" }, "methods": { - "Predict": { - "requestType": "PredictRequest", - "responseType": "PredictResponse", + "Search": { + "requestType": "SearchRequest", + "responseType": "SearchResponse", "options": { - "(google.api.http).post": "/v2beta/{placement=projects/*/locations/*/catalogs/*/placements/*}:predict", + "(google.api.http).post": "/v2beta/{placement=projects/*/locations/*/catalogs/*/placements/*}:search", "(google.api.http).body": "*" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v2beta/{placement=projects/*/locations/*/catalogs/*/placements/*}:predict", + "post": "/v2beta/{placement=projects/*/locations/*/catalogs/*/placements/*}:search", "body": "*" } } @@ -6897,7 +7605,7 @@ } } }, - "PredictRequest": { + "SearchRequest": { "fields": { "placement": { "type": "string", @@ -6906,306 +7614,509 @@ "(google.api.field_behavior)": "REQUIRED" } }, - "userEvent": { - "type": "UserEvent", + "branch": { + "type": "string", "id": 2, + "options": { + "(google.api.resource_reference).type": "retail.googleapis.com/Branch" + } + }, + "query": { + "type": "string", + "id": 3 + }, + "visitorId": { + "type": "string", + "id": 4, "options": { "(google.api.field_behavior)": "REQUIRED" } }, + "userInfo": { + "type": "UserInfo", + "id": 5 + }, "pageSize": { "type": "int32", - "id": 3 + "id": 7 }, "pageToken": { "type": "string", - "id": 4 + "id": 8 + }, + "offset": { + "type": "int32", + "id": 9 }, "filter": { "type": "string", - "id": 5 - }, - "validateOnly": { - "type": "bool", - "id": 6 + "id": 10 }, - "params": { - "keyType": "string", - "type": "google.protobuf.Value", - "id": 7 + "canonicalFilter": { + "type": "string", + "id": 28 }, - "labels": { - "keyType": "string", + "orderBy": { "type": "string", - "id": 8 - } - } - }, - "PredictResponse": { - "fields": { - "results": { + "id": 11 + }, + "facetSpecs": { "rule": "repeated", - "type": "PredictionResult", - "id": 1 + "type": "FacetSpec", + "id": 12 }, - "attributionToken": { + "dynamicFacetSpec": { + "type": "DynamicFacetSpec", + "id": 21, + "options": { + "deprecated": true + } + }, + "boostSpec": { + "type": "BoostSpec", + "id": 13 + }, + "queryExpansionSpec": { + "type": "QueryExpansionSpec", + "id": 14 + }, + "variantRollupKeys": { + "rule": "repeated", "type": "string", - "id": 2 + "id": 17 }, - "missingIds": { + "pageCategories": { "rule": "repeated", "type": "string", - "id": 3 + "id": 23 }, - "validateOnly": { - "type": "bool", - "id": 4 + "searchMode": { + "type": "SearchMode", + "id": 31 + }, + "personalizationSpec": { + "type": "PersonalizationSpec", + "id": 32 } }, "nested": { - "PredictionResult": { + "FacetSpec": { "fields": { - "id": { - "type": "string", - "id": 1 + "facetKey": { + "type": "FacetKey", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "metadata": { - "keyType": "string", - "type": "google.protobuf.Value", + "limit": { + "type": "int32", "id": 2 - } - } - } - } - }, - "ProductService": { - "options": { - "(google.api.default_host)": "retail.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateProduct": { - "requestType": "CreateProductRequest", - "responseType": "Product", - "options": { - "(google.api.http).post": "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products", - "(google.api.http).body": "product", - "(google.api.method_signature)": "parent,product,product_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products", - "body": "product" - } }, - { - "(google.api.method_signature)": "parent,product,product_id" + "excludedFilterKeys": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "enableDynamicPosition": { + "type": "bool", + "id": 4 } - ] - }, - "GetProduct": { - "requestType": "GetProductRequest", - "responseType": "Product", - "options": { - "(google.api.http).get": "/v2beta/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}", - "(google.api.method_signature)": "name" }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}" + "nested": { + "FacetKey": { + "fields": { + "key": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "intervals": { + "rule": "repeated", + "type": "Interval", + "id": 2 + }, + "restrictedValues": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "prefixes": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "contains": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "orderBy": { + "type": "string", + "id": 4 + }, + "query": { + "type": "string", + "id": 5 + } } - }, - { - "(google.api.method_signature)": "name" } - ] + } }, - "ListProducts": { - "requestType": "ListProductsRequest", - "responseType": "ListProductsResponse", - "options": { - "(google.api.http).get": "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products", - "(google.api.method_signature)": "parent" + "DynamicFacetSpec": { + "fields": { + "mode": { + "type": "Mode", + "id": 1 + } }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products" + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "DISABLED": 1, + "ENABLED": 2 } - }, - { - "(google.api.method_signature)": "parent" } - ] + } }, - "UpdateProduct": { - "requestType": "UpdateProductRequest", - "responseType": "Product", - "options": { - "(google.api.http).patch": "/v2beta/{product.name=projects/*/locations/*/catalogs/*/branches/*/products/**}", - "(google.api.http).body": "product", - "(google.api.method_signature)": "product,update_mask" + "BoostSpec": { + "oneofs": { + "_skipBoostSpecValidation": { + "oneof": [ + "skipBoostSpecValidation" + ] + } }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2beta/{product.name=projects/*/locations/*/catalogs/*/branches/*/products/**}", - "body": "product" - } + "fields": { + "conditionBoostSpecs": { + "rule": "repeated", + "type": "ConditionBoostSpec", + "id": 1 }, - { - "(google.api.method_signature)": "product,update_mask" + "skipBoostSpecValidation": { + "type": "bool", + "id": 2, + "options": { + "proto3_optional": true + } } - ] + }, + "nested": { + "ConditionBoostSpec": { + "fields": { + "condition": { + "type": "string", + "id": 1 + }, + "boost": { + "type": "float", + "id": 2 + } + } + } + } }, - "DeleteProduct": { - "requestType": "DeleteProductRequest", - "responseType": "google.protobuf.Empty", + "QueryExpansionSpec": { + "fields": { + "condition": { + "type": "Condition", + "id": 1 + }, + "pinUnexpandedResults": { + "type": "bool", + "id": 2 + } + }, + "nested": { + "Condition": { + "values": { + "CONDITION_UNSPECIFIED": 0, + "DISABLED": 1, + "AUTO": 3 + } + } + } + }, + "PersonalizationSpec": { + "fields": { + "mode": { + "type": "Mode", + "id": 1 + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "AUTO": 1, + "DISABLED": 2 + } + } + } + }, + "SearchMode": { + "values": { + "SEARCH_MODE_UNSPECIFIED": 0, + "PRODUCT_SEARCH_ONLY": 1, + "FACETED_SEARCH_ONLY": 2 + } + } + } + }, + "SearchResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "SearchResult", + "id": 1 + }, + "facets": { + "rule": "repeated", + "type": "Facet", + "id": 2 + }, + "totalSize": { + "type": "int32", + "id": 3 + }, + "correctedQuery": { + "type": "string", + "id": 4 + }, + "attributionToken": { + "type": "string", + "id": 5 + }, + "nextPageToken": { + "type": "string", + "id": 6 + }, + "queryExpansionInfo": { + "type": "QueryExpansionInfo", + "id": 7 + }, + "redirectUri": { + "type": "string", + "id": 10 + }, + "appliedControls": { + "rule": "repeated", + "type": "string", + "id": 12 + }, + "invalidConditionBoostSpecs": { + "rule": "repeated", + "type": "SearchRequest.BoostSpec.ConditionBoostSpec", + "id": 14 + } + }, + "nested": { + "SearchResult": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "product": { + "type": "Product", + "id": 2 + }, + "matchingVariantCount": { + "type": "int32", + "id": 3 + }, + "matchingVariantFields": { + "keyType": "string", + "type": "google.protobuf.FieldMask", + "id": 4 + }, + "variantRollupValues": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 5 + } + } + }, + "Facet": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "values": { + "rule": "repeated", + "type": "FacetValue", + "id": 2 + }, + "dynamicFacet": { + "type": "bool", + "id": 3 + } + }, + "nested": { + "FacetValue": { + "oneofs": { + "facetValue": { + "oneof": [ + "value", + "interval" + ] + } + }, + "fields": { + "value": { + "type": "string", + "id": 1 + }, + "interval": { + "type": "Interval", + "id": 2 + }, + "count": { + "type": "int64", + "id": 3 + } + } + } + } + }, + "QueryExpansionInfo": { + "fields": { + "expandedQuery": { + "type": "bool", + "id": 1 + }, + "pinnedResultCount": { + "type": "int64", + "id": 2 + } + } + } + } + }, + "ControlService": { + "options": { + "(google.api.default_host)": "retail.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateControl": { + "requestType": "CreateControlRequest", + "responseType": "Control", "options": { - "(google.api.http).delete": "/v2beta/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}", - "(google.api.method_signature)": "name" + "(google.api.http).post": "/v2beta/{parent=projects/*/locations/*/catalogs/*}/controls", + "(google.api.http).body": "control", + "(google.api.method_signature)": "parent,control,control_id" }, "parsedOptions": [ { "(google.api.http)": { - "delete": "/v2beta/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}" + "post": "/v2beta/{parent=projects/*/locations/*/catalogs/*}/controls", + "body": "control" } }, { - "(google.api.method_signature)": "name" + "(google.api.method_signature)": "parent,control,control_id" } ] }, - "ImportProducts": { - "requestType": "ImportProductsRequest", - "responseType": "google.longrunning.Operation", + "DeleteControl": { + "requestType": "DeleteControlRequest", + "responseType": "google.protobuf.Empty", "options": { - "(google.api.http).post": "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:import", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "google.cloud.retail.v2beta.ImportProductsResponse", - "(google.longrunning.operation_info).metadata_type": "google.cloud.retail.v2beta.ImportMetadata" + "(google.api.http).delete": "/v2beta/{name=projects/*/locations/*/catalogs/*/controls/*}", + "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:import", - "body": "*" + "delete": "/v2beta/{name=projects/*/locations/*/catalogs/*/controls/*}" } }, { - "(google.longrunning.operation_info)": { - "response_type": "google.cloud.retail.v2beta.ImportProductsResponse", - "metadata_type": "google.cloud.retail.v2beta.ImportMetadata" - } + "(google.api.method_signature)": "name" } ] }, - "SetInventory": { - "requestType": "SetInventoryRequest", - "responseType": "google.longrunning.Operation", + "UpdateControl": { + "requestType": "UpdateControlRequest", + "responseType": "Control", "options": { - "(google.api.http).post": "/v2beta/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory", - "(google.api.http).body": "*", - "(google.api.method_signature)": "inventory,set_mask", - "(google.longrunning.operation_info).response_type": "google.cloud.retail.v2beta.SetInventoryResponse", - "(google.longrunning.operation_info).metadata_type": "google.cloud.retail.v2beta.SetInventoryMetadata" + "(google.api.http).patch": "/v2beta/{control.name=projects/*/locations/*/catalogs/*/controls/*}", + "(google.api.http).body": "control", + "(google.api.method_signature)": "control,update_mask" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v2beta/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory", - "body": "*" + "patch": "/v2beta/{control.name=projects/*/locations/*/catalogs/*/controls/*}", + "body": "control" } }, { - "(google.api.method_signature)": "inventory,set_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.cloud.retail.v2beta.SetInventoryResponse", - "metadata_type": "google.cloud.retail.v2beta.SetInventoryMetadata" - } + "(google.api.method_signature)": "control,update_mask" } ] }, - "AddFulfillmentPlaces": { - "requestType": "AddFulfillmentPlacesRequest", - "responseType": "google.longrunning.Operation", + "GetControl": { + "requestType": "GetControlRequest", + "responseType": "Control", "options": { - "(google.api.http).post": "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addFulfillmentPlaces", - "(google.api.http).body": "*", - "(google.api.method_signature)": "product", - "(google.longrunning.operation_info).response_type": "google.cloud.retail.v2beta.AddFulfillmentPlacesResponse", - "(google.longrunning.operation_info).metadata_type": "google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata" + "(google.api.http).get": "/v2beta/{name=projects/*/locations/*/catalogs/*/controls/*}", + "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addFulfillmentPlaces", - "body": "*" + "get": "/v2beta/{name=projects/*/locations/*/catalogs/*/controls/*}" } }, { - "(google.api.method_signature)": "product" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.cloud.retail.v2beta.AddFulfillmentPlacesResponse", - "metadata_type": "google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata" - } + "(google.api.method_signature)": "name" } ] }, - "RemoveFulfillmentPlaces": { - "requestType": "RemoveFulfillmentPlacesRequest", - "responseType": "google.longrunning.Operation", + "ListControls": { + "requestType": "ListControlsRequest", + "responseType": "ListControlsResponse", "options": { - "(google.api.http).post": "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeFulfillmentPlaces", - "(google.api.http).body": "*", - "(google.api.method_signature)": "product", - "(google.longrunning.operation_info).response_type": "google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse", - "(google.longrunning.operation_info).metadata_type": "google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata" + "(google.api.http).get": "/v2beta/{parent=projects/*/locations/*/catalogs/*}/controls", + "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeFulfillmentPlaces", - "body": "*" + "get": "/v2beta/{parent=projects/*/locations/*/catalogs/*}/controls" } }, { - "(google.api.method_signature)": "product" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse", - "metadata_type": "google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata" - } + "(google.api.method_signature)": "parent" } ] } } }, - "CreateProductRequest": { + "CreateControlRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Branch" + "(google.api.resource_reference).type": "retail.googleapis.com/Catalog" } }, - "product": { - "type": "Product", + "control": { + "type": "Control", "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "productId": { + "controlId": { "type": "string", "id": 3, "options": { @@ -7214,82 +8125,83 @@ } } }, - "GetProductRequest": { + "UpdateControlRequest": { "fields": { - "name": { - "type": "string", + "control": { + "type": "Control", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Product" + "(google.api.field_behavior)": "REQUIRED" } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 } } }, - "UpdateProductRequest": { + "DeleteControlRequest": { "fields": { - "product": { - "type": "Product", + "name": { + "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Control" } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - }, - "allowMissing": { - "type": "bool", - "id": 3 } } }, - "DeleteProductRequest": { + "GetControlRequest": { "fields": { "name": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Product" + "(google.api.resource_reference).type": "retail.googleapis.com/Control" } } } }, - "ListProductsRequest": { + "ListControlsRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Branch" + "(google.api.resource_reference).type": "retail.googleapis.com/Catalog" } }, "pageSize": { "type": "int32", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "pageToken": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "filter": { "type": "string", - "id": 4 - }, - "readMask": { - "type": "google.protobuf.FieldMask", - "id": 5 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, - "ListProductsResponse": { + "ListControlsResponse": { "fields": { - "products": { + "controls": { "rule": "repeated", - "type": "Product", + "type": "Control", "id": 1 }, "nextPageToken": { @@ -7298,167 +8210,76 @@ } } }, - "SetInventoryRequest": { - "fields": { - "inventory": { - "type": "Product", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "setMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - }, - "setTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "allowMissing": { - "type": "bool", - "id": 4 + "ExportErrorsConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsPrefix" + ] } - } - }, - "SetInventoryMetadata": { - "fields": {} - }, - "SetInventoryResponse": { - "fields": {} - }, - "AddFulfillmentPlacesRequest": { + }, "fields": { - "product": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Product" - } - }, - "type": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "placeIds": { - "rule": "repeated", + "gcsPrefix": { "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "addTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "allowMissing": { - "type": "bool", - "id": 5 + "id": 1 } } }, - "AddFulfillmentPlacesMetadata": { - "fields": {} - }, - "AddFulfillmentPlacesResponse": { - "fields": {} - }, - "RemoveFulfillmentPlacesRequest": { + "ExportMetadata": { "fields": { - "product": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Product" - } - }, - "type": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "placeIds": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "removeTime": { + "createTime": { "type": "google.protobuf.Timestamp", - "id": 4 + "id": 1 }, - "allowMissing": { - "type": "bool", - "id": 5 + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 } } }, - "RemoveFulfillmentPlacesMetadata": { - "fields": {} - }, - "RemoveFulfillmentPlacesResponse": { - "fields": {} - }, - "PurgeMetadata": { - "fields": {} - }, - "PurgeUserEventsRequest": { + "ExportProductsResponse": { "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "filter": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "errorSamples": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 1 }, - "force": { - "type": "bool", - "id": 3 + "errorsConfig": { + "type": "ExportErrorsConfig", + "id": 2 } } }, - "PurgeUserEventsResponse": { + "ExportUserEventsResponse": { "fields": { - "purgedEventsCount": { - "type": "int64", + "errorSamples": { + "rule": "repeated", + "type": "google.rpc.Status", "id": 1 + }, + "errorsConfig": { + "type": "ExportErrorsConfig", + "id": 2 } } }, - "SearchService": { + "PredictionService": { "options": { "(google.api.default_host)": "retail.googleapis.com", "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" }, "methods": { - "Search": { - "requestType": "SearchRequest", - "responseType": "SearchResponse", + "Predict": { + "requestType": "PredictRequest", + "responseType": "PredictResponse", "options": { - "(google.api.http).post": "/v2beta/{placement=projects/*/locations/*/catalogs/*/placements/*}:search", + "(google.api.http).post": "/v2beta/{placement=projects/*/locations/*/catalogs/*/placements/*}:predict", "(google.api.http).body": "*" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v2beta/{placement=projects/*/locations/*/catalogs/*/placements/*}:search", + "post": "/v2beta/{placement=projects/*/locations/*/catalogs/*/placements/*}:predict", "body": "*" } } @@ -7466,7 +8287,7 @@ } } }, - "SearchRequest": { + "PredictRequest": { "fields": { "placement": { "type": "string", @@ -7475,342 +8296,1045 @@ "(google.api.field_behavior)": "REQUIRED" } }, - "branch": { - "type": "string", + "userEvent": { + "type": "UserEvent", "id": 2, "options": { - "(google.api.resource_reference).type": "retail.googleapis.com/Branch" + "(google.api.field_behavior)": "REQUIRED" } }, - "query": { - "type": "string", + "pageSize": { + "type": "int32", "id": 3 }, - "visitorId": { + "pageToken": { "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "id": 4 }, - "userInfo": { - "type": "UserInfo", + "filter": { + "type": "string", "id": 5 }, - "pageSize": { - "type": "int32", + "validateOnly": { + "type": "bool", + "id": 6 + }, + "params": { + "keyType": "string", + "type": "google.protobuf.Value", "id": 7 }, - "pageToken": { + "labels": { + "keyType": "string", "type": "string", "id": 8 - }, - "offset": { - "type": "int32", - "id": 9 - }, - "filter": { - "type": "string", - "id": 10 - }, - "canonicalFilter": { - "type": "string", - "id": 28 - }, - "orderBy": { - "type": "string", - "id": 11 - }, - "facetSpecs": { + } + } + }, + "PredictResponse": { + "fields": { + "results": { "rule": "repeated", - "type": "FacetSpec", - "id": 12 - }, - "dynamicFacetSpec": { - "type": "DynamicFacetSpec", - "id": 21 - }, - "boostSpec": { - "type": "BoostSpec", - "id": 13 - }, - "queryExpansionSpec": { - "type": "QueryExpansionSpec", - "id": 14 + "type": "PredictionResult", + "id": 1 }, - "variantRollupKeys": { - "rule": "repeated", + "attributionToken": { "type": "string", - "id": 17 + "id": 2 }, - "pageCategories": { + "missingIds": { "rule": "repeated", "type": "string", - "id": 23 + "id": 3 }, - "searchMode": { - "type": "SearchMode", - "id": 31 + "validateOnly": { + "type": "bool", + "id": 4 } }, "nested": { - "FacetSpec": { + "PredictionResult": { "fields": { - "facetKey": { - "type": "FacetKey", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "limit": { - "type": "int32", - "id": 2 - }, - "excludedFilterKeys": { - "rule": "repeated", + "id": { "type": "string", - "id": 3 + "id": 1 }, - "enableDynamicPosition": { - "type": "bool", - "id": 4 + "metadata": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 2 } + } + } + } + }, + "ProductService": { + "options": { + "(google.api.default_host)": "retail.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateProduct": { + "requestType": "CreateProductRequest", + "responseType": "Product", + "options": { + "(google.api.http).post": "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products", + "(google.api.http).body": "product", + "(google.api.method_signature)": "parent,product,product_id" }, - "nested": { - "FacetKey": { - "fields": { - "key": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "intervals": { - "rule": "repeated", - "type": "Interval", - "id": 2 - }, - "restrictedValues": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "prefixes": { - "rule": "repeated", - "type": "string", - "id": 8 - }, - "contains": { - "rule": "repeated", - "type": "string", - "id": 9 - }, - "orderBy": { - "type": "string", - "id": 4 - }, - "query": { - "type": "string", - "id": 5 - } + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products", + "body": "product" } + }, + { + "(google.api.method_signature)": "parent,product,product_id" } - } + ] }, - "DynamicFacetSpec": { - "fields": { - "mode": { - "type": "Mode", - "id": 1 - } + "GetProduct": { + "requestType": "GetProductRequest", + "responseType": "Product", + "options": { + "(google.api.http).get": "/v2beta/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}", + "(google.api.method_signature)": "name" }, - "nested": { - "Mode": { - "values": { - "MODE_UNSPECIFIED": 0, - "DISABLED": 1, - "ENABLED": 2 + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}" } + }, + { + "(google.api.method_signature)": "name" } - } + ] }, - "BoostSpec": { - "fields": { - "conditionBoostSpecs": { - "rule": "repeated", - "type": "ConditionBoostSpec", - "id": 1 - } + "ListProducts": { + "requestType": "ListProductsRequest", + "responseType": "ListProductsResponse", + "options": { + "(google.api.http).get": "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products", + "(google.api.method_signature)": "parent" }, - "nested": { - "ConditionBoostSpec": { - "fields": { - "condition": { - "type": "string", - "id": 1 - }, - "boost": { - "type": "float", - "id": 2 - } + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products" } - } - } - }, - "QueryExpansionSpec": { - "fields": { - "condition": { - "type": "Condition", - "id": 1 }, - "pinUnexpandedResults": { - "type": "bool", - "id": 2 + { + "(google.api.method_signature)": "parent" } + ] + }, + "UpdateProduct": { + "requestType": "UpdateProductRequest", + "responseType": "Product", + "options": { + "(google.api.http).patch": "/v2beta/{product.name=projects/*/locations/*/catalogs/*/branches/*/products/**}", + "(google.api.http).body": "product", + "(google.api.method_signature)": "product,update_mask" }, - "nested": { - "Condition": { - "values": { - "CONDITION_UNSPECIFIED": 0, - "DISABLED": 1, - "AUTO": 3 + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2beta/{product.name=projects/*/locations/*/catalogs/*/branches/*/products/**}", + "body": "product" } + }, + { + "(google.api.method_signature)": "product,update_mask" } - } + ] }, - "SearchMode": { - "values": { - "SEARCH_MODE_UNSPECIFIED": 0, - "PRODUCT_SEARCH_ONLY": 1, - "FACETED_SEARCH_ONLY": 2 + "DeleteProduct": { + "requestType": "DeleteProductRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2beta/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2beta/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ImportProducts": { + "requestType": "ImportProductsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:import", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.retail.v2beta.ImportProductsResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.retail.v2beta.ImportMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:import", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.retail.v2beta.ImportProductsResponse", + "metadata_type": "google.cloud.retail.v2beta.ImportMetadata" + } + } + ] + }, + "SetInventory": { + "requestType": "SetInventoryRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory", + "(google.api.http).body": "*", + "(google.api.method_signature)": "inventory,set_mask", + "(google.longrunning.operation_info).response_type": "google.cloud.retail.v2beta.SetInventoryResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.retail.v2beta.SetInventoryMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory", + "body": "*" + } + }, + { + "(google.api.method_signature)": "inventory,set_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.retail.v2beta.SetInventoryResponse", + "metadata_type": "google.cloud.retail.v2beta.SetInventoryMetadata" + } + } + ] + }, + "AddFulfillmentPlaces": { + "requestType": "AddFulfillmentPlacesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addFulfillmentPlaces", + "(google.api.http).body": "*", + "(google.api.method_signature)": "product", + "(google.longrunning.operation_info).response_type": "google.cloud.retail.v2beta.AddFulfillmentPlacesResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addFulfillmentPlaces", + "body": "*" + } + }, + { + "(google.api.method_signature)": "product" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.retail.v2beta.AddFulfillmentPlacesResponse", + "metadata_type": "google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata" + } + } + ] + }, + "RemoveFulfillmentPlaces": { + "requestType": "RemoveFulfillmentPlacesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeFulfillmentPlaces", + "(google.api.http).body": "*", + "(google.api.method_signature)": "product", + "(google.longrunning.operation_info).response_type": "google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeFulfillmentPlaces", + "body": "*" + } + }, + { + "(google.api.method_signature)": "product" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse", + "metadata_type": "google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata" + } + } + ] + }, + "AddLocalInventories": { + "requestType": "AddLocalInventoriesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addLocalInventories", + "(google.api.http).body": "*", + "(google.api.method_signature)": "product", + "(google.longrunning.operation_info).response_type": "google.cloud.retail.v2beta.AddLocalInventoriesResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.retail.v2beta.AddLocalInventoriesMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addLocalInventories", + "body": "*" + } + }, + { + "(google.api.method_signature)": "product" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.retail.v2beta.AddLocalInventoriesResponse", + "metadata_type": "google.cloud.retail.v2beta.AddLocalInventoriesMetadata" + } + } + ] + }, + "RemoveLocalInventories": { + "requestType": "RemoveLocalInventoriesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeLocalInventories", + "(google.api.http).body": "*", + "(google.api.method_signature)": "product", + "(google.longrunning.operation_info).response_type": "google.cloud.retail.v2beta.RemoveLocalInventoriesResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeLocalInventories", + "body": "*" + } + }, + { + "(google.api.method_signature)": "product" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.retail.v2beta.RemoveLocalInventoriesResponse", + "metadata_type": "google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata" + } + } + ] + } + } + }, + "CreateProductRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Branch" + } + }, + "product": { + "type": "Product", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "productId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetProductRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Product" + } + } + } + }, + "UpdateProductRequest": { + "fields": { + "product": { + "type": "Product", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "allowMissing": { + "type": "bool", + "id": 3 + } + } + }, + "DeleteProductRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Product" + } + } + } + }, + "ListProductsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Branch" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "readMask": { + "type": "google.protobuf.FieldMask", + "id": 5 + } + } + }, + "ListProductsResponse": { + "fields": { + "products": { + "rule": "repeated", + "type": "Product", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SetInventoryRequest": { + "fields": { + "inventory": { + "type": "Product", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "setMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "setTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "allowMissing": { + "type": "bool", + "id": 4 + } + } + }, + "SetInventoryMetadata": { + "fields": {} + }, + "SetInventoryResponse": { + "fields": {} + }, + "AddFulfillmentPlacesRequest": { + "fields": { + "product": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Product" + } + }, + "type": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "placeIds": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "addTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "allowMissing": { + "type": "bool", + "id": 5 + } + } + }, + "AddFulfillmentPlacesMetadata": { + "fields": {} + }, + "AddFulfillmentPlacesResponse": { + "fields": {} + }, + "AddLocalInventoriesRequest": { + "fields": { + "product": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Product" + } + }, + "localInventories": { + "rule": "repeated", + "type": "LocalInventory", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "addMask": { + "type": "google.protobuf.FieldMask", + "id": 4 + }, + "addTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "allowMissing": { + "type": "bool", + "id": 6 + } + } + }, + "AddLocalInventoriesMetadata": { + "fields": {} + }, + "AddLocalInventoriesResponse": { + "fields": {} + }, + "RemoveLocalInventoriesRequest": { + "fields": { + "product": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Product" + } + }, + "placeIds": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "removeTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "allowMissing": { + "type": "bool", + "id": 3 + } + } + }, + "RemoveLocalInventoriesMetadata": { + "fields": {} + }, + "RemoveLocalInventoriesResponse": { + "fields": {} + }, + "RemoveFulfillmentPlacesRequest": { + "fields": { + "product": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Product" + } + }, + "type": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "placeIds": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "removeTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "allowMissing": { + "type": "bool", + "id": 5 + } + } + }, + "RemoveFulfillmentPlacesMetadata": { + "fields": {} + }, + "RemoveFulfillmentPlacesResponse": { + "fields": {} + }, + "PurgeMetadata": { + "fields": {} + }, + "PurgeUserEventsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "force": { + "type": "bool", + "id": 3 + } + } + }, + "PurgeUserEventsResponse": { + "fields": { + "purgedEventsCount": { + "type": "int64", + "id": 1 + } + } + }, + "ServingConfig": { + "options": { + "(google.api.resource).type": "retail.googleapis.com/ServingConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "modelId": { + "type": "string", + "id": 3 + }, + "priceRerankingLevel": { + "type": "string", + "id": 4 + }, + "facetControlIds": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "dynamicFacetSpec": { + "type": "SearchRequest.DynamicFacetSpec", + "id": 6 + }, + "boostControlIds": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "filterControlIds": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "redirectControlIds": { + "rule": "repeated", + "type": "string", + "id": 10 + }, + "twowaySynonymsControlIds": { + "rule": "repeated", + "type": "string", + "id": 18 + }, + "onewaySynonymsControlIds": { + "rule": "repeated", + "type": "string", + "id": 12 + }, + "doNotAssociateControlIds": { + "rule": "repeated", + "type": "string", + "id": 13 + }, + "replacementControlIds": { + "rule": "repeated", + "type": "string", + "id": 14 + }, + "ignoreControlIds": { + "rule": "repeated", + "type": "string", + "id": 15 + }, + "diversityLevel": { + "type": "string", + "id": 8 + }, + "enableCategoryFilterLevel": { + "type": "string", + "id": 16 + }, + "solutionTypes": { + "rule": "repeated", + "type": "SolutionType", + "id": 19, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" } } } }, - "SearchResponse": { + "ServingConfigService": { + "options": { + "(google.api.default_host)": "retail.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateServingConfig": { + "requestType": "CreateServingConfigRequest", + "responseType": "ServingConfig", + "options": { + "(google.api.http).post": "/v2beta/{parent=projects/*/locations/*/catalogs/*}/servingConfigs", + "(google.api.http).body": "serving_config", + "(google.api.method_signature)": "parent,serving_config,serving_config_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{parent=projects/*/locations/*/catalogs/*}/servingConfigs", + "body": "serving_config" + } + }, + { + "(google.api.method_signature)": "parent,serving_config,serving_config_id" + } + ] + }, + "DeleteServingConfig": { + "requestType": "DeleteServingConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2beta/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2beta/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateServingConfig": { + "requestType": "UpdateServingConfigRequest", + "responseType": "ServingConfig", + "options": { + "(google.api.http).patch": "/v2beta/{serving_config.name=projects/*/locations/*/catalogs/*/servingConfigs/*}", + "(google.api.http).body": "serving_config", + "(google.api.method_signature)": "serving_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2beta/{serving_config.name=projects/*/locations/*/catalogs/*/servingConfigs/*}", + "body": "serving_config" + } + }, + { + "(google.api.method_signature)": "serving_config,update_mask" + } + ] + }, + "GetServingConfig": { + "requestType": "GetServingConfigRequest", + "responseType": "ServingConfig", + "options": { + "(google.api.http).get": "/v2beta/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListServingConfigs": { + "requestType": "ListServingConfigsRequest", + "responseType": "ListServingConfigsResponse", + "options": { + "(google.api.http).get": "/v2beta/{parent=projects/*/locations/*/catalogs/*}/servingConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta/{parent=projects/*/locations/*/catalogs/*}/servingConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "AddControl": { + "requestType": "AddControlRequest", + "responseType": "ServingConfig", + "options": { + "(google.api.http).post": "/v2beta/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:addControl", + "(google.api.http).body": "*", + "(google.api.method_signature)": "serving_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:addControl", + "body": "*" + } + }, + { + "(google.api.method_signature)": "serving_config" + } + ] + }, + "RemoveControl": { + "requestType": "RemoveControlRequest", + "responseType": "ServingConfig", + "options": { + "(google.api.http).post": "/v2beta/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:removeControl", + "(google.api.http).body": "*", + "(google.api.method_signature)": "serving_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:removeControl", + "body": "*" + } + }, + { + "(google.api.method_signature)": "serving_config" + } + ] + } + } + }, + "CreateServingConfigRequest": { "fields": { - "results": { - "rule": "repeated", - "type": "SearchResult", - "id": 1 - }, - "facets": { - "rule": "repeated", - "type": "Facet", - "id": 2 + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Catalog" + } }, - "totalSize": { - "type": "int32", - "id": 3 + "servingConfig": { + "type": "ServingConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "correctedQuery": { + "servingConfigId": { "type": "string", - "id": 4 + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateServingConfigRequest": { + "fields": { + "servingConfig": { + "type": "ServingConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "attributionToken": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteServingConfigRequest": { + "fields": { + "name": { "type": "string", - "id": 5 - }, - "nextPageToken": { + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/ServingConfig" + } + } + } + }, + "GetServingConfigRequest": { + "fields": { + "name": { "type": "string", - "id": 6 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/ServingConfig" + } + } + } + }, + "ListServingConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Catalog" + } }, - "queryExpansionInfo": { - "type": "QueryExpansionInfo", - "id": 7 + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "redirectUri": { + "pageToken": { "type": "string", - "id": 10 - }, - "appliedControls": { + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListServingConfigsResponse": { + "fields": { + "servingConfigs": { "rule": "repeated", + "type": "ServingConfig", + "id": 1 + }, + "nextPageToken": { "type": "string", - "id": 12 + "id": 2 } - }, - "nested": { - "SearchResult": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "product": { - "type": "Product", - "id": 2 - }, - "matchingVariantCount": { - "type": "int32", - "id": 3 - }, - "matchingVariantFields": { - "keyType": "string", - "type": "google.protobuf.FieldMask", - "id": 4 - }, - "variantRollupValues": { - "keyType": "string", - "type": "google.protobuf.Value", - "id": 5 - } + } + }, + "AddControlRequest": { + "fields": { + "servingConfig": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/ServingConfig" } }, - "Facet": { - "fields": { - "key": { - "type": "string", - "id": 1 - }, - "values": { - "rule": "repeated", - "type": "FacetValue", - "id": 2 - }, - "dynamicFacet": { - "type": "bool", - "id": 3 - } - }, - "nested": { - "FacetValue": { - "oneofs": { - "facetValue": { - "oneof": [ - "value", - "interval" - ] - } - }, - "fields": { - "value": { - "type": "string", - "id": 1 - }, - "interval": { - "type": "Interval", - "id": 2 - }, - "count": { - "type": "int64", - "id": 3 - } - } - } + "controlId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RemoveControlRequest": { + "fields": { + "servingConfig": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/ServingConfig" } }, - "QueryExpansionInfo": { - "fields": { - "expandedQuery": { - "type": "bool", - "id": 1 - }, - "pinnedResultCount": { - "type": "int64", - "id": 2 - } + "controlId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" } } } diff --git a/packages/google-cloud-retail/samples/generated/v2/catalog_service.set_default_branch.js b/packages/google-cloud-retail/samples/generated/v2/catalog_service.set_default_branch.js index 6e1fb716d07..f03f4c360a4 100644 --- a/packages/google-cloud-retail/samples/generated/v2/catalog_service.set_default_branch.js +++ b/packages/google-cloud-retail/samples/generated/v2/catalog_service.set_default_branch.js @@ -34,6 +34,9 @@ function main() { * The final component of the resource name of a branch. * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT * error is returned. + * If there are no sufficient active products in the targeted branch and + * force google.cloud.retail.v2.SetDefaultBranchRequest.force is not set, a + * FAILED_PRECONDITION error is returned. */ // const branchId = 'abc123' /** @@ -44,6 +47,12 @@ function main() { * characters. Otherwise, an INVALID_ARGUMENT error is returned. */ // const note = 'abc123' + /** + * If set to true, it permits switching to a branch with + * branch_id google.cloud.retail.v2.SetDefaultBranchRequest.branch_id even + * if it has no sufficient active products. + */ + // const force = true // Imports the Retail library const {CatalogServiceClient} = require('@google-cloud/retail').v2; diff --git a/packages/google-cloud-retail/samples/generated/v2/completion_service.complete_query.js b/packages/google-cloud-retail/samples/generated/v2/completion_service.complete_query.js index 1ed48516ef4..738d1b40bfa 100644 --- a/packages/google-cloud-retail/samples/generated/v2/completion_service.complete_query.js +++ b/packages/google-cloud-retail/samples/generated/v2/completion_service.complete_query.js @@ -37,21 +37,21 @@ function main(catalog, query) { */ // const query = 'abc123' /** - * A unique identifier for tracking visitors. For example, this could be - * implemented with an HTTP cookie, which should be able to uniquely identify - * a visitor on a single device. This unique identifier should not change if - * the visitor logs in or out of the website. + * Required field. A unique identifier for tracking visitors. For example, + * this could be implemented with an HTTP cookie, which should be able to + * uniquely identify a visitor on a single device. This unique identifier + * should not change if the visitor logs in or out of the website. * The field must be a UTF-8 encoded string with a length limit of 128 * characters. Otherwise, an INVALID_ARGUMENT error is returned. */ // const visitorId = 'abc123' /** - * The list of languages of the query. This is - * the BCP-47 language code, such as "en-US" or "sr-Latn". - * For more information, see - * Tags for Identifying Languages (https://tools.ietf.org/html/bcp47). - * The maximum number of allowed characters is 255. - * Only "en-US" is currently supported. + * The language filters applied to the output suggestions. If set, it should + * contain the language of the query. If not set, suggestions are returned + * without considering language restrictions. This is the BCP-47 language + * code, such as "en-US" or "sr-Latn". For more information, see Tags for + * Identifying Languages (https://tools.ietf.org/html/bcp47). The maximum + * number of language codes is 3. */ // const languageCodes = 'abc123' /** diff --git a/packages/google-cloud-retail/samples/generated/v2/prediction_service.predict.js b/packages/google-cloud-retail/samples/generated/v2/prediction_service.predict.js index 7f93a971926..af3de61999a 100644 --- a/packages/google-cloud-retail/samples/generated/v2/prediction_service.predict.js +++ b/packages/google-cloud-retail/samples/generated/v2/prediction_service.predict.js @@ -72,9 +72,12 @@ 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, nothing will be returned. If - * you want generic (unfiltered) popular products to be returned instead, set - * `strictFiltering` to false in `PredictRequest.params`. + * 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. */ // const filter = 'abc123' /** diff --git a/packages/google-cloud-retail/samples/generated/v2/product_service.add_local_inventories.js b/packages/google-cloud-retail/samples/generated/v2/product_service.add_local_inventories.js new file mode 100644 index 00000000000..f0598e366d4 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2/product_service.add_local_inventories.js @@ -0,0 +1,99 @@ +// 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(product, localInventories) { + // [START retail_v2_generated_ProductService_AddLocalInventories_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full resource name of Product google.cloud.retail.v2.Product, + * such as + * `projects/* /locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * Product google.cloud.retail.v2.Product, regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + */ + // const product = 'abc123' + /** + * Required. A list of inventory information at difference places. Each place + * is identified by its place ID. At most 3000 inventories are allowed per + * request. + */ + // const localInventories = 1234 + /** + * Indicates which inventory fields in the provided list of + * LocalInventory google.cloud.retail.v2.LocalInventory to update. The + * field is updated to the provided value. + * If a field is set while the place does not have a previous local inventory, + * the local inventory at that store is created. + * If a field is set while the value of that field is not provided, the + * original field value, if it exists, is deleted. + * If the mask is not set or set with empty paths, all inventory fields will + * be updated. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned and the entire update will be ignored. + */ + // const addMask = {} + /** + * The time when the inventory updates are issued. Used to prevent + * out-of-order updates on local inventory fields. If not provided, the + * internal system time will be used. + */ + // const addTime = {} + /** + * If set to true, and the Product google.cloud.retail.v2.Product is not + * found, the local inventory will still be processed and retained for at most + * 1 day and processed once the Product google.cloud.retail.v2.Product is + * created. If set to false, a NOT_FOUND error is returned if the + * Product google.cloud.retail.v2.Product is not found. + */ + // const allowMissing = true + + // Imports the Retail library + const {ProductServiceClient} = require('@google-cloud/retail').v2; + + // Instantiates a client + const retailClient = new ProductServiceClient(); + + async function callAddLocalInventories() { + // Construct request + const request = { + product, + localInventories, + }; + + // Run request + const [operation] = await retailClient.addLocalInventories(request); + const [response] = await operation.promise(); + console.log(response); + } + + callAddLocalInventories(); + // [END retail_v2_generated_ProductService_AddLocalInventories_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/v2/product_service.import_products.js b/packages/google-cloud-retail/samples/generated/v2/product_service.import_products.js index 3cf71650c5c..39cc5522cea 100644 --- a/packages/google-cloud-retail/samples/generated/v2/product_service.import_products.js +++ b/packages/google-cloud-retail/samples/generated/v2/product_service.import_products.js @@ -32,17 +32,6 @@ function main(parent, inputConfig) { * If updateMask is specified, requires products.update permission. */ // const parent = 'abc123' - /** - * Unique identifier provided by client, within the ancestor - * dataset scope. Ensures idempotency and used for request deduplication. - * Server-generated if unspecified. Up to 128 characters long and must match - * the pattern: `[a-zA-Z0-9_]+`. This is returned as [Operation.name][] in - * ImportMetadata google.cloud.retail.v2.ImportMetadata. - * Only supported when - * ImportProductsRequest.reconciliation_mode google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode - * is set to `FULL`. - */ - // const requestId = 'abc123' /** * Required. The desired input location of the data. */ diff --git a/packages/google-cloud-retail/samples/generated/v2/product_service.remove_local_inventories.js b/packages/google-cloud-retail/samples/generated/v2/product_service.remove_local_inventories.js new file mode 100644 index 00000000000..6332ed05df9 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2/product_service.remove_local_inventories.js @@ -0,0 +1,85 @@ +// 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(product, placeIds) { + // [START retail_v2_generated_ProductService_RemoveLocalInventories_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full resource name of Product google.cloud.retail.v2.Product, + * such as + * `projects/* /locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * Product google.cloud.retail.v2.Product, regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + */ + // const product = 'abc123' + /** + * Required. A list of place IDs to have their inventory deleted. + * At most 3000 place IDs are allowed per request. + */ + // const placeIds = 'abc123' + /** + * The time when the inventory deletions are issued. Used to prevent + * out-of-order updates and deletions on local inventory fields. If not + * provided, the internal system time will be used. + */ + // const removeTime = {} + /** + * If set to true, and the Product google.cloud.retail.v2.Product is not + * found, the local inventory removal request will still be processed and + * retained for at most 1 day and processed once the + * Product google.cloud.retail.v2.Product is created. If set to false, a + * NOT_FOUND error is returned if the + * Product google.cloud.retail.v2.Product is not found. + */ + // const allowMissing = true + + // Imports the Retail library + const {ProductServiceClient} = require('@google-cloud/retail').v2; + + // Instantiates a client + const retailClient = new ProductServiceClient(); + + async function callRemoveLocalInventories() { + // Construct request + const request = { + product, + placeIds, + }; + + // Run request + const [operation] = await retailClient.removeLocalInventories(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRemoveLocalInventories(); + // [END retail_v2_generated_ProductService_RemoveLocalInventories_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/v2/product_service.set_inventory.js b/packages/google-cloud-retail/samples/generated/v2/product_service.set_inventory.js index 85b8419df49..4f35c54e91c 100644 --- a/packages/google-cloud-retail/samples/generated/v2/product_service.set_inventory.js +++ b/packages/google-cloud-retail/samples/generated/v2/product_service.set_inventory.js @@ -48,6 +48,20 @@ function main(inventory) { * while respecting the last update time for each inventory field, using the * provided or default value for * SetInventoryRequest.set_time google.cloud.retail.v2.SetInventoryRequest.set_time. + * The caller can replace place IDs for a subset of fulfillment types in the + * following ways: + * * Adds "fulfillment_info" in + * SetInventoryRequest.set_mask google.cloud.retail.v2.SetInventoryRequest.set_mask + * * Specifies only the desired fulfillment types and corresponding place IDs + * to update in SetInventoryRequest.inventory.fulfillment_info + * The caller can clear all place IDs from a subset of fulfillment types in + * the following ways: + * * Adds "fulfillment_info" in + * SetInventoryRequest.set_mask google.cloud.retail.v2.SetInventoryRequest.set_mask + * * Specifies only the desired fulfillment types to clear in + * SetInventoryRequest.inventory.fulfillment_info + * * Checks that only the desired fulfillment info types have empty + * SetInventoryRequest.inventory.fulfillment_info.place_ids * The last update time is recorded for the following inventory fields: * * Product.price_info google.cloud.retail.v2.Product.price_info * * Product.availability google.cloud.retail.v2.Product.availability @@ -59,8 +73,8 @@ function main(inventory) { // const inventory = {} /** * Indicates which inventory fields in the provided - * Product google.cloud.retail.v2.Product to update. If not set or set with - * empty paths, all inventory fields will be updated. + * Product google.cloud.retail.v2.Product to update. + * At least one field must be provided. * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error * is returned and the entire update will be ignored. */ diff --git a/packages/google-cloud-retail/samples/generated/v2/search_service.search.js b/packages/google-cloud-retail/samples/generated/v2/search_service.search.js index e95b1561193..2083811f7be 100644 --- a/packages/google-cloud-retail/samples/generated/v2/search_service.search.js +++ b/packages/google-cloud-retail/samples/generated/v2/search_service.search.js @@ -27,7 +27,7 @@ function main(placement, visitorId) { */ /** * Required. The resource name of the search engine placement, such as - * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. + * `projects/* /locations/global/catalogs/default_catalog/placements/default_search` * This field is used to identify the serving configuration name and the set * of models that will be used to make the search. */ @@ -48,6 +48,8 @@ function main(placement, visitorId) { * could be implemented with an HTTP cookie, which should be able to uniquely * identify a visitor on a single device. This unique identifier should not * change if the visitor logs in or out of the website. + * This should be the same identifier as + * UserEvent.visitor_id google.cloud.retail.v2.UserEvent.visitor_id. * The field must be a UTF-8 encoded string with a length limit of 128 * characters. Otherwise, an INVALID_ARGUMENT error is returned. */ @@ -93,6 +95,8 @@ function main(placement, visitorId) { */ // const filter = 'abc123' /** + * The default filter that is applied when a user performs a search without + * checking any filters on the search page. * The filter applied to every search request when quality improvement such as * query expansion is needed. For example, if a query does not have enough * results, an expanded query with @@ -118,13 +122,6 @@ function main(placement, visitorId) { * is returned. */ // const facetSpecs = 1234 - /** - * The specification for dynamically generated facets. Notice that only - * textual facets can be dynamically generated. - * This feature requires additional allowlisting. Contact Retail Search - * support team if you are interested in using dynamic facet feature. - */ - // const dynamicFacetSpec = {} /** * Boost specification to boost certain products. See more details at this * user guide (https://cloud.google.com/retail/docs/boosting). @@ -144,12 +141,15 @@ function main(placement, visitorId) { /** * The keys to fetch and rollup the matching * variant google.cloud.retail.v2.Product.Type.VARIANT - * Product google.cloud.retail.v2.Product s attributes. The attributes from - * all the matching variant google.cloud.retail.v2.Product.Type.VARIANT - * Product google.cloud.retail.v2.Product s are merged and de-duplicated. - * Notice that rollup variant google.cloud.retail.v2.Product.Type.VARIANT - * Product google.cloud.retail.v2.Product s attributes will lead to extra - * query latency. Maximum number of keys is 10. + * Product google.cloud.retail.v2.Product s attributes, + * FulfillmentInfo google.cloud.retail.v2.FulfillmentInfo or + * LocalInventory google.cloud.retail.v2.LocalInventory s attributes. The + * attributes from all the matching + * variant google.cloud.retail.v2.Product.Type.VARIANT + * Product google.cloud.retail.v2.Product s or + * LocalInventory google.cloud.retail.v2.LocalInventory s are merged and + * de-duplicated. Notice that rollup attributes will lead to extra query + * latency. Maximum number of keys is 30. * For FulfillmentInfo google.cloud.retail.v2.FulfillmentInfo, a * fulfillment type and a fulfillment ID must be provided in the format of * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", @@ -161,6 +161,7 @@ function main(placement, visitorId) { * * discount * * variantId * * inventory(place_id,price) + * * inventory(place_id,original_price) * * inventory(place_id,attributes.key), where key is any key in the * Product.inventories.attributes map. * * attributes.key, where key is any key in the @@ -223,6 +224,10 @@ function main(placement, visitorId) { * request triggers both product search and faceted search. */ // const searchMode = {} + /** + * The specification for personalization. + */ + // const personalizationSpec = {} // Imports the Retail library const {SearchServiceClient} = require('@google-cloud/retail').v2; diff --git a/packages/google-cloud-retail/samples/generated/v2/snippet_metadata.google.cloud.retail.v2.json b/packages/google-cloud-retail/samples/generated/v2/snippet_metadata.google.cloud.retail.v2.json index bb8b2fe4abd..6dbcb2633bf 100644 --- a/packages/google-cloud-retail/samples/generated/v2/snippet_metadata.google.cloud.retail.v2.json +++ b/packages/google-cloud-retail/samples/generated/v2/snippet_metadata.google.cloud.retail.v2.json @@ -107,14 +107,14 @@ "regionTag": "retail_v2_generated_CatalogService_SetDefaultBranch_async", "title": "CatalogService setDefaultBranch Sample", "origin": "API_DEFINITION", - "description": " Set a specified branch id as default branch. API methods such as [SearchService.Search][google.cloud.retail.v2.SearchService.Search], [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct], [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] will treat requests using \"default_branch\" to the actual branch id set as default. For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as default, setting [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent to setting [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to `projects/*/locations/*/catalogs/*/branches/1`. Using multiple branches can be useful when developers would like to have a staging branch to test and verify for future usage. When it becomes ready, developers switch on the staging branch using this API while keeping using `projects/*/locations/*/catalogs/*/branches/default_branch` as [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to route the traffic to this staging branch. CAUTION: If you have live predict/search traffic, switching the default branch could potentially cause outages if the ID space of the new branch is very different from the old one. More specifically: * PredictionService will only return product IDs from branch {newBranch}. * SearchService will only return product IDs from branch {newBranch} (if branch is not explicitly set). * UserEventService will only join events with products from branch {newBranch}. This feature is only available for users who have Retail Search enabled. Please submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.", + "description": " Set a specified branch id as default branch. API methods such as [SearchService.Search][google.cloud.retail.v2.SearchService.Search], [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct], [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] will treat requests using \"default_branch\" to the actual branch id set as default. For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as default, setting [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent to setting [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to `projects/*/locations/*/catalogs/*/branches/1`. Using multiple branches can be useful when developers would like to have a staging branch to test and verify for future usage. When it becomes ready, developers switch on the staging branch using this API while keeping using `projects/*/locations/*/catalogs/*/branches/default_branch` as [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to route the traffic to this staging branch. CAUTION: If you have live predict/search traffic, switching the default branch could potentially cause outages if the ID space of the new branch is very different from the old one. More specifically: * PredictionService will only return product IDs from branch {newBranch}. * SearchService will only return product IDs from branch {newBranch} (if branch is not explicitly set). * UserEventService will only join events with products from branch {newBranch}.", "canonical": true, "file": "catalog_service.set_default_branch.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 64, + "end": 73, "type": "FULL" } ], @@ -134,6 +134,10 @@ { "name": "note", "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" } ], "resultType": ".google.protobuf.Empty", @@ -155,7 +159,7 @@ "regionTag": "retail_v2_generated_CatalogService_GetDefaultBranch_async", "title": "CatalogService getDefaultBranch Sample", "origin": "API_DEFINITION", - "description": " Get which branch is currently default branch set by [CatalogService.SetDefaultBranch][google.cloud.retail.v2.CatalogService.SetDefaultBranch] method under a specified parent catalog. This feature is only available for users who have Retail Search enabled. Please submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.", + "description": " Get which branch is currently default branch set by [CatalogService.SetDefaultBranch][google.cloud.retail.v2.CatalogService.SetDefaultBranch] method under a specified parent catalog.", "canonical": true, "file": "catalog_service.get_default_branch.js", "language": "JAVASCRIPT", @@ -195,7 +199,7 @@ "regionTag": "retail_v2_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 submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.", + "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.", "canonical": true, "file": "completion_service.complete_query.js", "language": "JAVASCRIPT", @@ -259,7 +263,7 @@ "regionTag": "retail_v2_generated_CompletionService_ImportCompletionData_async", "title": "CatalogService importCompletionData Sample", "origin": "API_DEFINITION", - "description": " Bulk import of processed completion dataset. Request processing may be synchronous. Partial updating is not supported. This feature is only available for users who have Retail Search enabled. Please submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.", + "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.", "canonical": true, "file": "completion_service.import_completion_data.js", "language": "JAVASCRIPT", @@ -314,7 +318,7 @@ "segments": [ { "start": 25, - "end": 150, + "end": 153, "type": "FULL" } ], @@ -614,7 +618,7 @@ "segments": [ { "start": 25, - "end": 96, + "end": 85, "type": "FULL" } ], @@ -671,14 +675,14 @@ "regionTag": "retail_v2_generated_ProductService_SetInventory_async", "title": "CatalogService setInventory Sample", "origin": "API_DEFINITION", - "description": " Updates inventory information for a [Product][google.cloud.retail.v2.Product] while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the [Product][google.cloud.retail.v2.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.v2.Product] queried by [GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. When inventory is updated with [CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [UpdateProduct][google.cloud.retail.v2.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 [CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] or [UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] request. If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2.CreateProductRequest.product], then any pre-existing inventory information for this product will be used. If no inventory fields are set in [UpdateProductRequest.set_mask][], then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with [SetInventory][google.cloud.retail.v2.ProductService.SetInventory], [AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces], and [RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]. This feature is only available for users who have Retail Search enabled. Please submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.", + "description": " Updates inventory information for a [Product][google.cloud.retail.v2.Product] while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the [Product][google.cloud.retail.v2.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.v2.Product] queried by [GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. When inventory is updated with [CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [UpdateProduct][google.cloud.retail.v2.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 [CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] or [UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] request. If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2.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.v2.SetInventoryRequest.set_mask], then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with [SetInventory][google.cloud.retail.v2.ProductService.SetInventory], [AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces], and [RemoveFulfillmentPlaces][google.cloud.retail.v2.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.", "canonical": true, "file": "product_service.set_inventory.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 102, + "end": 116, "type": "FULL" } ], @@ -723,7 +727,7 @@ "regionTag": "retail_v2_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.v2.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2.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.v2.Product] queried by [GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. This feature is only available for users who have Retail Search enabled. Please submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.", + "description": " Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2.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.v2.Product] queried by [GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ListProducts][google.cloud.retail.v2.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.", "canonical": true, "file": "product_service.add_fulfillment_places.js", "language": "JAVASCRIPT", @@ -779,7 +783,7 @@ "regionTag": "retail_v2_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.v2.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2.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.v2.Product] queried by [GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. This feature is only available for users who have Retail Search enabled. Please submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.", + "description": " Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2.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.v2.Product] queried by [GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ListProducts][google.cloud.retail.v2.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.", "canonical": true, "file": "product_service.remove_fulfillment_places.js", "language": "JAVASCRIPT", @@ -831,18 +835,126 @@ } } }, + { + "regionTag": "retail_v2_generated_ProductService_AddLocalInventories_async", + "title": "CatalogService addLocalInventories Sample", + "origin": "API_DEFINITION", + "description": " Updates local inventory information for a [Product][google.cloud.retail.v2.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.v2.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.v2.Product] queried by [GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. Local inventory information can only be modified using this method. [CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [UpdateProduct][google.cloud.retail.v2.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.", + "canonical": true, + "file": "product_service.add_local_inventories.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 91, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AddLocalInventories", + "fullName": "google.cloud.retail.v2.ProductService.AddLocalInventories", + "async": true, + "parameters": [ + { + "name": "product", + "type": "TYPE_STRING" + }, + { + "name": "local_inventories", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "add_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "add_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProductServiceClient", + "fullName": "google.cloud.retail.v2.ProductServiceClient" + }, + "method": { + "shortName": "AddLocalInventories", + "fullName": "google.cloud.retail.v2.ProductService.AddLocalInventories", + "service": { + "shortName": "ProductService", + "fullName": "google.cloud.retail.v2.ProductService" + } + } + } + }, + { + "regionTag": "retail_v2_generated_ProductService_RemoveLocalInventories_async", + "title": "CatalogService removeLocalInventories Sample", + "origin": "API_DEFINITION", + "description": " Remove local inventory information for a [Product][google.cloud.retail.v2.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.v2.Product] queried by [GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. Local inventory information can only be removed using this method. [CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [UpdateProduct][google.cloud.retail.v2.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.", + "canonical": true, + "file": "product_service.remove_local_inventories.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RemoveLocalInventories", + "fullName": "google.cloud.retail.v2.ProductService.RemoveLocalInventories", + "async": true, + "parameters": [ + { + "name": "product", + "type": "TYPE_STRING" + }, + { + "name": "place_ids", + "type": "TYPE_STRING[]" + }, + { + "name": "remove_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProductServiceClient", + "fullName": "google.cloud.retail.v2.ProductServiceClient" + }, + "method": { + "shortName": "RemoveLocalInventories", + "fullName": "google.cloud.retail.v2.ProductService.RemoveLocalInventories", + "service": { + "shortName": "ProductService", + "fullName": "google.cloud.retail.v2.ProductService" + } + } + } + }, { "regionTag": "retail_v2_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 submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.", + "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.", "canonical": true, "file": "search_service.search.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 247, + "end": 252, "type": "FULL" } ], @@ -922,6 +1034,10 @@ { "name": "search_mode", "type": ".google.cloud.retail.v2.SearchRequest.SearchMode" + }, + { + "name": "personalization_spec", + "type": ".google.cloud.retail.v2.SearchRequest.PersonalizationSpec" } ], "resultType": ".google.cloud.retail.v2.SearchResponse", @@ -1135,7 +1251,7 @@ "regionTag": "retail_v2_generated_UserEventService_RejoinUserEvents_async", "title": "CatalogService rejoinUserEvents Sample", "origin": "API_DEFINITION", - "description": " Triggers a user event rejoin operation with latest product catalog. Events will not be annotated with detailed product information if product is missing from the catalog at the time the user event is ingested, and these events are stored as unjoined events with a limited usage on training and serving. This API can be used to trigger a 'join' operation on specified events with latest version of product catalog. It can also be used to correct events joined with wrong product catalog.", + "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.", "canonical": true, "file": "user_event_service.rejoin_user_events.js", "language": "JAVASCRIPT", diff --git a/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.add_catalog_attribute.js b/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.add_catalog_attribute.js new file mode 100644 index 00000000000..553e710302f --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.add_catalog_attribute.js @@ -0,0 +1,65 @@ +// 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, catalogAttribute) { + // [START retail_v2beta_generated_CatalogService_AddCatalogAttribute_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full AttributesConfig resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig + */ + // const attributesConfig = 'abc123' + /** + * Required. The + * CatalogAttribute google.cloud.retail.v2beta.CatalogAttribute to add. + */ + // const catalogAttribute = {} + + // Imports the Retail library + const {CatalogServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new CatalogServiceClient(); + + async function callAddCatalogAttribute() { + // Construct request + const request = { + attributesConfig, + catalogAttribute, + }; + + // Run request + const response = await retailClient.addCatalogAttribute(request); + console.log(response); + } + + callAddCatalogAttribute(); + // [END retail_v2beta_generated_CatalogService_AddCatalogAttribute_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/v2beta/catalog_service.get_attributes_config.js b/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.get_attributes_config.js new file mode 100644 index 00000000000..b6c393bd9e7 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.get_attributes_config.js @@ -0,0 +1,59 @@ +// 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(name) { + // [START retail_v2beta_generated_CatalogService_GetAttributesConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full AttributesConfig resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig + */ + // const name = 'abc123' + + // Imports the Retail library + const {CatalogServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new CatalogServiceClient(); + + async function callGetAttributesConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await retailClient.getAttributesConfig(request); + console.log(response); + } + + callGetAttributesConfig(); + // [END retail_v2beta_generated_CatalogService_GetAttributesConfig_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/v2beta/catalog_service.get_completion_config.js b/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.get_completion_config.js new file mode 100644 index 00000000000..886e118a824 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.get_completion_config.js @@ -0,0 +1,59 @@ +// 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(name) { + // [START retail_v2beta_generated_CatalogService_GetCompletionConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full CompletionConfig resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig + */ + // const name = 'abc123' + + // Imports the Retail library + const {CatalogServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new CatalogServiceClient(); + + async function callGetCompletionConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await retailClient.getCompletionConfig(request); + console.log(response); + } + + callGetCompletionConfig(); + // [END retail_v2beta_generated_CatalogService_GetCompletionConfig_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/v2beta/catalog_service.remove_catalog_attribute.js b/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.remove_catalog_attribute.js new file mode 100644 index 00000000000..b6d4473a671 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.remove_catalog_attribute.js @@ -0,0 +1,65 @@ +// 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, key) { + // [START retail_v2beta_generated_CatalogService_RemoveCatalogAttribute_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full AttributesConfig resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig + */ + // const attributesConfig = 'abc123' + /** + * Required. The attribute name key of the + * CatalogAttribute google.cloud.retail.v2beta.CatalogAttribute to remove. + */ + // const key = 'abc123' + + // Imports the Retail library + const {CatalogServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new CatalogServiceClient(); + + async function callRemoveCatalogAttribute() { + // Construct request + const request = { + attributesConfig, + key, + }; + + // Run request + const response = await retailClient.removeCatalogAttribute(request); + console.log(response); + } + + callRemoveCatalogAttribute(); + // [END retail_v2beta_generated_CatalogService_RemoveCatalogAttribute_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/v2beta/catalog_service.replace_catalog_attribute.js b/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.replace_catalog_attribute.js new file mode 100644 index 00000000000..42548549680 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.replace_catalog_attribute.js @@ -0,0 +1,73 @@ +// 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, catalogAttribute) { + // [START retail_v2beta_generated_CatalogService_ReplaceCatalogAttribute_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full AttributesConfig resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig + */ + // const attributesConfig = 'abc123' + /** + * Required. The updated + * CatalogAttribute google.cloud.retail.v2beta.CatalogAttribute. + */ + // const catalogAttribute = {} + /** + * Indicates which fields in the provided + * CatalogAttribute google.cloud.retail.v2beta.CatalogAttribute to update. + * The following are NOT supported: + * * CatalogAttribute.key google.cloud.retail.v2beta.CatalogAttribute.key + * If not set, all supported fields are updated. + */ + // const updateMask = {} + + // Imports the Retail library + const {CatalogServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new CatalogServiceClient(); + + async function callReplaceCatalogAttribute() { + // Construct request + const request = { + attributesConfig, + catalogAttribute, + }; + + // Run request + const response = await retailClient.replaceCatalogAttribute(request); + console.log(response); + } + + callReplaceCatalogAttribute(); + // [END retail_v2beta_generated_CatalogService_ReplaceCatalogAttribute_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/v2beta/catalog_service.set_default_branch.js b/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.set_default_branch.js index ea0695ceaf5..11f667df09c 100644 --- a/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.set_default_branch.js +++ b/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.set_default_branch.js @@ -34,6 +34,9 @@ function main() { * The final component of the resource name of a branch. * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT * error is returned. + * If there are no sufficient active products in the targeted branch and + * force google.cloud.retail.v2beta.SetDefaultBranchRequest.force is not + * set, a FAILED_PRECONDITION error is returned. */ // const branchId = 'abc123' /** @@ -44,6 +47,12 @@ function main() { * characters. Otherwise, an INVALID_ARGUMENT error is returned. */ // const note = 'abc123' + /** + * If set to true, it permits switching to a branch with + * branch_id google.cloud.retail.v2beta.SetDefaultBranchRequest.branch_id + * even if it has no sufficient active products. + */ + // const force = true // Imports the Retail library const {CatalogServiceClient} = require('@google-cloud/retail').v2beta; diff --git a/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.update_attributes_config.js b/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.update_attributes_config.js new file mode 100644 index 00000000000..dee9a094edf --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.update_attributes_config.js @@ -0,0 +1,67 @@ +// 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) { + // [START retail_v2beta_generated_CatalogService_UpdateAttributesConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The + * AttributesConfig google.cloud.retail.v2beta.AttributesConfig to update. + */ + // const attributesConfig = {} + /** + * Indicates which fields in the provided + * AttributesConfig google.cloud.retail.v2beta.AttributesConfig to update. + * The following is the only supported field: + * * AttributesConfig.catalog_attributes google.cloud.retail.v2beta.AttributesConfig.catalog_attributes + * If not set, all supported fields are updated. + */ + // const updateMask = {} + + // Imports the Retail library + const {CatalogServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new CatalogServiceClient(); + + async function callUpdateAttributesConfig() { + // Construct request + const request = { + attributesConfig, + }; + + // Run request + const response = await retailClient.updateAttributesConfig(request); + console.log(response); + } + + callUpdateAttributesConfig(); + // [END retail_v2beta_generated_CatalogService_UpdateAttributesConfig_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/v2beta/catalog_service.update_completion_config.js b/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.update_completion_config.js new file mode 100644 index 00000000000..d3c451f3211 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/catalog_service.update_completion_config.js @@ -0,0 +1,75 @@ +// 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(completionConfig) { + // [START retail_v2beta_generated_CatalogService_UpdateCompletionConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The + * CompletionConfig google.cloud.retail.v2beta.CompletionConfig to update. + * If the caller does not have permission to update the + * CompletionConfig google.cloud.retail.v2beta.CompletionConfig, then a + * PERMISSION_DENIED error is returned. + * If the CompletionConfig google.cloud.retail.v2beta.CompletionConfig to + * update does not exist, a NOT_FOUND error is returned. + */ + // const completionConfig = {} + /** + * Indicates which fields in the provided + * CompletionConfig google.cloud.retail.v2beta.CompletionConfig to update. + * The following are the only supported fields: + * * CompletionConfig.matching_order google.cloud.retail.v2beta.CompletionConfig.matching_order + * * CompletionConfig.max_suggestions google.cloud.retail.v2beta.CompletionConfig.max_suggestions + * * CompletionConfig.min_prefix_length google.cloud.retail.v2beta.CompletionConfig.min_prefix_length + * * CompletionConfig.auto_learning google.cloud.retail.v2beta.CompletionConfig.auto_learning + * If not set, all supported fields are updated. + */ + // const updateMask = {} + + // Imports the Retail library + const {CatalogServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new CatalogServiceClient(); + + async function callUpdateCompletionConfig() { + // Construct request + const request = { + completionConfig, + }; + + // Run request + const response = await retailClient.updateCompletionConfig(request); + console.log(response); + } + + callUpdateCompletionConfig(); + // [END retail_v2beta_generated_CatalogService_UpdateCompletionConfig_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/v2beta/completion_service.complete_query.js b/packages/google-cloud-retail/samples/generated/v2beta/completion_service.complete_query.js index 3dc80166d9c..28957ff1dec 100644 --- a/packages/google-cloud-retail/samples/generated/v2beta/completion_service.complete_query.js +++ b/packages/google-cloud-retail/samples/generated/v2beta/completion_service.complete_query.js @@ -37,21 +37,21 @@ function main(catalog, query) { */ // const query = 'abc123' /** - * A unique identifier for tracking visitors. For example, this could be - * implemented with an HTTP cookie, which should be able to uniquely identify - * a visitor on a single device. This unique identifier should not change if - * the visitor logs in or out of the website. + * Required field. A unique identifier for tracking visitors. For example, + * this could be implemented with an HTTP cookie, which should be able to + * uniquely identify a visitor on a single device. This unique identifier + * should not change if the visitor logs in or out of the website. * The field must be a UTF-8 encoded string with a length limit of 128 * characters. Otherwise, an INVALID_ARGUMENT error is returned. */ // const visitorId = 'abc123' /** - * The list of languages of the query. This is - * the BCP-47 language code, such as "en-US" or "sr-Latn". - * For more information, see - * Tags for Identifying Languages (https://tools.ietf.org/html/bcp47). - * The maximum number of allowed characters is 255. - * Only "en-US" is currently supported. + * The language filters applied to the output suggestions. If set, it should + * contain the language of the query. If not set, suggestions are returned + * without considering language restrictions. This is the BCP-47 language + * code, such as "en-US" or "sr-Latn". For more information, see Tags for + * Identifying Languages (https://tools.ietf.org/html/bcp47). The maximum + * number of language codes is 3. */ // const languageCodes = 'abc123' /** @@ -81,7 +81,8 @@ function main(catalog, query) { // const dataset = 'abc123' /** * Completion max suggestions. If left unset or set to 0, then will fallback - * to the configured value CompletionConfig.max_suggestions . + * to the configured value + * CompletionConfig.max_suggestions google.cloud.retail.v2beta.CompletionConfig.max_suggestions. * The maximum allowed max suggestions is 20. If it is set higher, it will be * capped by 20. */ diff --git a/packages/google-cloud-retail/samples/generated/v2beta/control_service.create_control.js b/packages/google-cloud-retail/samples/generated/v2beta/control_service.create_control.js new file mode 100644 index 00000000000..670ed9d8a67 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/control_service.create_control.js @@ -0,0 +1,72 @@ +// 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(parent, control, controlId) { + // [START retail_v2beta_generated_ControlService_CreateControl_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full resource name of parent catalog. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + */ + // const parent = 'abc123' + /** + * Required. The Control to create. + */ + // const control = {} + /** + * Required. The ID to use for the Control, which will become the final + * component of the Control's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-_/. + */ + // const controlId = 'abc123' + + // Imports the Retail library + const {ControlServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new ControlServiceClient(); + + async function callCreateControl() { + // Construct request + const request = { + parent, + control, + controlId, + }; + + // Run request + const response = await retailClient.createControl(request); + console.log(response); + } + + callCreateControl(); + // [END retail_v2beta_generated_ControlService_CreateControl_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/v2beta/control_service.delete_control.js b/packages/google-cloud-retail/samples/generated/v2beta/control_service.delete_control.js new file mode 100644 index 00000000000..fa6173821d2 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/control_service.delete_control.js @@ -0,0 +1,59 @@ +// 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(name) { + // [START retail_v2beta_generated_ControlService_DeleteControl_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Control to delete. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id} + */ + // const name = 'abc123' + + // Imports the Retail library + const {ControlServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new ControlServiceClient(); + + async function callDeleteControl() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await retailClient.deleteControl(request); + console.log(response); + } + + callDeleteControl(); + // [END retail_v2beta_generated_ControlService_DeleteControl_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/v2beta/control_service.get_control.js b/packages/google-cloud-retail/samples/generated/v2beta/control_service.get_control.js new file mode 100644 index 00000000000..dcc21c72055 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/control_service.get_control.js @@ -0,0 +1,59 @@ +// 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(name) { + // [START retail_v2beta_generated_ControlService_GetControl_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Control to delete. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id} + */ + // const name = 'abc123' + + // Imports the Retail library + const {ControlServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new ControlServiceClient(); + + async function callGetControl() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await retailClient.getControl(request); + console.log(response); + } + + callGetControl(); + // [END retail_v2beta_generated_ControlService_GetControl_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/v2beta/control_service.list_controls.js b/packages/google-cloud-retail/samples/generated/v2beta/control_service.list_controls.js new file mode 100644 index 00000000000..5de3859ca7a --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/control_service.list_controls.js @@ -0,0 +1,79 @@ +// 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(parent) { + // [START retail_v2beta_generated_ControlService_ListControls_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The catalog resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListControls` call. + * Provide this to retrieve the subsequent page. + */ + // const pageToken = 'abc123' + /** + * Optional. A filter to apply on the list results. Supported features: + * * List all the products under the parent branch if + * filter google.cloud.retail.v2beta.ListControlsRequest.filter is unset. + * * List controls that are used in a single ServingConfig: + * 'serving_config = "boosted_home_page_cvr"' + */ + // const filter = 'abc123' + + // Imports the Retail library + const {ControlServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new ControlServiceClient(); + + async function callListControls() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await retailClient.listControlsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListControls(); + // [END retail_v2beta_generated_ControlService_ListControls_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/v2beta/control_service.update_control.js b/packages/google-cloud-retail/samples/generated/v2beta/control_service.update_control.js new file mode 100644 index 00000000000..3bc73051e23 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/control_service.update_control.js @@ -0,0 +1,66 @@ +// 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(control) { + // [START retail_v2beta_generated_ControlService_UpdateControl_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Control to update. + */ + // const control = {} + /** + * Indicates which fields in the provided + * Control google.cloud.retail.v2beta.Control to update. The following are + * NOT supported: + * * Control.name google.cloud.retail.v2beta.Control.name + * If not set or empty, all supported fields are updated. + */ + // const updateMask = {} + + // Imports the Retail library + const {ControlServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new ControlServiceClient(); + + async function callUpdateControl() { + // Construct request + const request = { + control, + }; + + // Run request + const response = await retailClient.updateControl(request); + console.log(response); + } + + callUpdateControl(); + // [END retail_v2beta_generated_ControlService_UpdateControl_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/v2beta/prediction_service.predict.js b/packages/google-cloud-retail/samples/generated/v2beta/prediction_service.predict.js index cd878f44770..38b9394ccae 100644 --- a/packages/google-cloud-retail/samples/generated/v2beta/prediction_service.predict.js +++ b/packages/google-cloud-retail/samples/generated/v2beta/prediction_service.predict.js @@ -72,9 +72,12 @@ 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, nothing will be returned. If - * you want generic (unfiltered) popular products to be returned instead, set - * `strictFiltering` to false in `PredictRequest.params`. + * 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. */ // const filter = 'abc123' /** diff --git a/packages/google-cloud-retail/samples/generated/v2beta/product_service.add_local_inventories.js b/packages/google-cloud-retail/samples/generated/v2beta/product_service.add_local_inventories.js new file mode 100644 index 00000000000..827fb0fe8b9 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/product_service.add_local_inventories.js @@ -0,0 +1,100 @@ +// 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(product, localInventories) { + // [START retail_v2beta_generated_ProductService_AddLocalInventories_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full resource name of + * Product google.cloud.retail.v2beta.Product, such as + * `projects/* /locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * Product google.cloud.retail.v2beta.Product, regardless of whether or not + * it exists, a PERMISSION_DENIED error is returned. + */ + // const product = 'abc123' + /** + * Required. A list of inventory information at difference places. Each place + * is identified by its place ID. At most 3000 inventories are allowed per + * request. + */ + // const localInventories = 1234 + /** + * Indicates which inventory fields in the provided list of + * LocalInventory google.cloud.retail.v2beta.LocalInventory to update. The + * field is updated to the provided value. + * If a field is set while the place does not have a previous local inventory, + * the local inventory at that store is created. + * If a field is set while the value of that field is not provided, the + * original field value, if it exists, is deleted. + * If the mask is not set or set with empty paths, all inventory fields will + * be updated. + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned and the entire update will be ignored. + */ + // const addMask = {} + /** + * The time when the inventory updates are issued. Used to prevent + * out-of-order updates on local inventory fields. If not provided, the + * internal system time will be used. + */ + // const addTime = {} + /** + * If set to true, and the Product google.cloud.retail.v2beta.Product is + * not found, the local inventory will still be processed and retained for at + * most 1 day and processed once the + * Product google.cloud.retail.v2beta.Product is created. If set to false, + * a NOT_FOUND error is returned if the + * Product google.cloud.retail.v2beta.Product is not found. + */ + // const allowMissing = true + + // Imports the Retail library + const {ProductServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new ProductServiceClient(); + + async function callAddLocalInventories() { + // Construct request + const request = { + product, + localInventories, + }; + + // Run request + const [operation] = await retailClient.addLocalInventories(request); + const [response] = await operation.promise(); + console.log(response); + } + + callAddLocalInventories(); + // [END retail_v2beta_generated_ProductService_AddLocalInventories_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/v2beta/product_service.import_products.js b/packages/google-cloud-retail/samples/generated/v2beta/product_service.import_products.js index f57e330bd80..f7fe86da064 100644 --- a/packages/google-cloud-retail/samples/generated/v2beta/product_service.import_products.js +++ b/packages/google-cloud-retail/samples/generated/v2beta/product_service.import_products.js @@ -32,17 +32,6 @@ function main(parent, inputConfig) { * If updateMask is specified, requires products.update permission. */ // const parent = 'abc123' - /** - * Unique identifier provided by client, within the ancestor - * dataset scope. Ensures idempotency and used for request deduplication. - * Server-generated if unspecified. Up to 128 characters long and must match - * the pattern: `[a-zA-Z0-9_]+`. This is returned as [Operation.name][] in - * ImportMetadata google.cloud.retail.v2beta.ImportMetadata. - * Only supported when - * ImportProductsRequest.reconciliation_mode google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode - * is set to `FULL`. - */ - // const requestId = 'abc123' /** * Required. The desired input location of the data. */ diff --git a/packages/google-cloud-retail/samples/generated/v2beta/product_service.remove_local_inventories.js b/packages/google-cloud-retail/samples/generated/v2beta/product_service.remove_local_inventories.js new file mode 100644 index 00000000000..a61bac1d185 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/product_service.remove_local_inventories.js @@ -0,0 +1,85 @@ +// 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(product, placeIds) { + // [START retail_v2beta_generated_ProductService_RemoveLocalInventories_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full resource name of + * Product google.cloud.retail.v2beta.Product, such as + * `projects/* /locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * If the caller does not have permission to access the + * Product google.cloud.retail.v2beta.Product, regardless of whether or not + * it exists, a PERMISSION_DENIED error is returned. + */ + // const product = 'abc123' + /** + * Required. A list of place IDs to have their inventory deleted. + * At most 3000 place IDs are allowed per request. + */ + // const placeIds = 'abc123' + /** + * The time when the inventory deletions are issued. Used to prevent + * out-of-order updates and deletions on local inventory fields. If not + * provided, the internal system time will be used. + */ + // const removeTime = {} + /** + * If set to true, and the Product google.cloud.retail.v2beta.Product is + * not found, the local inventory removal request will still be processed and + * retained for at most 1 day and processed once the + * Product google.cloud.retail.v2beta.Product is created. If set to false, + * a NOT_FOUND error is returned if the + * Product google.cloud.retail.v2beta.Product is not found. + */ + // const allowMissing = true + + // Imports the Retail library + const {ProductServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new ProductServiceClient(); + + async function callRemoveLocalInventories() { + // Construct request + const request = { + product, + placeIds, + }; + + // Run request + const [operation] = await retailClient.removeLocalInventories(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRemoveLocalInventories(); + // [END retail_v2beta_generated_ProductService_RemoveLocalInventories_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/v2beta/product_service.set_inventory.js b/packages/google-cloud-retail/samples/generated/v2beta/product_service.set_inventory.js index b7fb846e6e9..ac7ceefff47 100644 --- a/packages/google-cloud-retail/samples/generated/v2beta/product_service.set_inventory.js +++ b/packages/google-cloud-retail/samples/generated/v2beta/product_service.set_inventory.js @@ -48,6 +48,20 @@ function main(inventory) { * while respecting the last update time for each inventory field, using the * provided or default value for * SetInventoryRequest.set_time google.cloud.retail.v2beta.SetInventoryRequest.set_time. + * The caller can replace place IDs for a subset of fulfillment types in the + * following ways: + * * Adds "fulfillment_info" in + * SetInventoryRequest.set_mask google.cloud.retail.v2beta.SetInventoryRequest.set_mask + * * Specifies only the desired fulfillment types and corresponding place IDs + * to update in SetInventoryRequest.inventory.fulfillment_info + * The caller can clear all place IDs from a subset of fulfillment types in + * the following ways: + * * Adds "fulfillment_info" in + * SetInventoryRequest.set_mask google.cloud.retail.v2beta.SetInventoryRequest.set_mask + * * Specifies only the desired fulfillment types to clear in + * SetInventoryRequest.inventory.fulfillment_info + * * Checks that only the desired fulfillment info types have empty + * SetInventoryRequest.inventory.fulfillment_info.place_ids * The last update time is recorded for the following inventory fields: * * Product.price_info google.cloud.retail.v2beta.Product.price_info * * Product.availability google.cloud.retail.v2beta.Product.availability diff --git a/packages/google-cloud-retail/samples/generated/v2beta/search_service.search.js b/packages/google-cloud-retail/samples/generated/v2beta/search_service.search.js index d5b74ef8ab1..62f1df1e9be 100644 --- a/packages/google-cloud-retail/samples/generated/v2beta/search_service.search.js +++ b/packages/google-cloud-retail/samples/generated/v2beta/search_service.search.js @@ -27,7 +27,7 @@ function main(placement, visitorId) { */ /** * Required. The resource name of the search engine placement, such as - * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. + * `projects/* /locations/global/catalogs/default_catalog/placements/default_search` * This field is used to identify the serving configuration name and the set * of models that will be used to make the search. */ @@ -95,6 +95,8 @@ function main(placement, visitorId) { */ // const filter = 'abc123' /** + * The default filter that is applied when a user performs a search without + * checking any filters on the search page. * The filter applied to every search request when quality improvement such as * query expansion is needed. For example, if a query does not have enough * results, an expanded query with @@ -120,13 +122,6 @@ function main(placement, visitorId) { * is returned. */ // const facetSpecs = 1234 - /** - * The specification for dynamically generated facets. Notice that only - * textual facets can be dynamically generated. - * This feature requires additional allowlisting. Contact Retail Search - * support team if you are interested in using dynamic facet feature. - */ - // const dynamicFacetSpec = {} /** * Boost specification to boost certain products. See more details at this * user guide (https://cloud.google.com/retail/docs/boosting). @@ -149,11 +144,13 @@ function main(placement, visitorId) { * variant google.cloud.retail.v2beta.Product.Type.VARIANT * Product google.cloud.retail.v2beta.Product s attributes, * FulfillmentInfo google.cloud.retail.v2beta.FulfillmentInfo or - * LocalInventory s attributes. The attributes from all the matching + * LocalInventory google.cloud.retail.v2beta.LocalInventory s attributes. + * The attributes from all the matching * variant google.cloud.retail.v2beta.Product.Type.VARIANT - * Product google.cloud.retail.v2beta.Product s or LocalInventory s are - * merged and de-duplicated. Notice that rollup attributes will lead to extra - * query latency. Maximum number of keys is 30. + * Product google.cloud.retail.v2beta.Product s or + * LocalInventory google.cloud.retail.v2beta.LocalInventory s are merged and + * de-duplicated. Notice that rollup attributes will lead to extra query + * latency. Maximum number of keys is 30. * For FulfillmentInfo google.cloud.retail.v2beta.FulfillmentInfo, a * fulfillment type and a fulfillment ID must be provided in the format of * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", @@ -228,6 +225,10 @@ function main(placement, visitorId) { * request triggers both product search and faceted search. */ // const searchMode = {} + /** + * The specification for personalization. + */ + // const personalizationSpec = {} // Imports the Retail library const {SearchServiceClient} = require('@google-cloud/retail').v2beta; diff --git a/packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.add_control.js b/packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.add_control.js new file mode 100644 index 00000000000..9086bb910bf --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.add_control.js @@ -0,0 +1,65 @@ +// 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(servingConfig, controlId) { + // [START retail_v2beta_generated_ServingConfigService_AddControl_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The source ServingConfig resource name . Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + */ + // const servingConfig = 'abc123' + /** + * 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. + */ + // const controlId = 'abc123' + + // Imports the Retail library + const {ServingConfigServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new ServingConfigServiceClient(); + + async function callAddControl() { + // Construct request + const request = { + servingConfig, + controlId, + }; + + // Run request + const response = await retailClient.addControl(request); + console.log(response); + } + + callAddControl(); + // [END retail_v2beta_generated_ServingConfigService_AddControl_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/v2beta/serving_config_service.create_serving_config.js b/packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.create_serving_config.js new file mode 100644 index 00000000000..fc8ba733c16 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.create_serving_config.js @@ -0,0 +1,72 @@ +// 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(parent, servingConfig, servingConfigId) { + // [START retail_v2beta_generated_ServingConfigService_CreateServingConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full resource name of parent. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + */ + // const parent = 'abc123' + /** + * Required. The ServingConfig to create. + */ + // const servingConfig = {} + /** + * Required. The ID to use for the ServingConfig, which will become the final + * component of the ServingConfig's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-_/. + */ + // const servingConfigId = 'abc123' + + // Imports the Retail library + const {ServingConfigServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new ServingConfigServiceClient(); + + async function callCreateServingConfig() { + // Construct request + const request = { + parent, + servingConfig, + servingConfigId, + }; + + // Run request + const response = await retailClient.createServingConfig(request); + console.log(response); + } + + callCreateServingConfig(); + // [END retail_v2beta_generated_ServingConfigService_CreateServingConfig_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/v2beta/serving_config_service.delete_serving_config.js b/packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.delete_serving_config.js new file mode 100644 index 00000000000..c9202725c12 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.delete_serving_config.js @@ -0,0 +1,59 @@ +// 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(name) { + // [START retail_v2beta_generated_ServingConfigService_DeleteServingConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the ServingConfig to delete. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + */ + // const name = 'abc123' + + // Imports the Retail library + const {ServingConfigServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new ServingConfigServiceClient(); + + async function callDeleteServingConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await retailClient.deleteServingConfig(request); + console.log(response); + } + + callDeleteServingConfig(); + // [END retail_v2beta_generated_ServingConfigService_DeleteServingConfig_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/v2beta/serving_config_service.get_serving_config.js b/packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.get_serving_config.js new file mode 100644 index 00000000000..be98fd45251 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.get_serving_config.js @@ -0,0 +1,59 @@ +// 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(name) { + // [START retail_v2beta_generated_ServingConfigService_GetServingConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the ServingConfig to get. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + */ + // const name = 'abc123' + + // Imports the Retail library + const {ServingConfigServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new ServingConfigServiceClient(); + + async function callGetServingConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await retailClient.getServingConfig(request); + console.log(response); + } + + callGetServingConfig(); + // [END retail_v2beta_generated_ServingConfigService_GetServingConfig_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/v2beta/serving_config_service.list_serving_configs.js b/packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.list_serving_configs.js new file mode 100644 index 00000000000..7a517f3e12b --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.list_serving_configs.js @@ -0,0 +1,72 @@ +// 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(parent) { + // [START retail_v2beta_generated_ServingConfigService_ListServingConfigs_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The catalog resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + */ + // const parent = 'abc123' + /** + * 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 + * returned. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListServingConfigs` call. + * Provide this to retrieve the subsequent page. + */ + // const pageToken = 'abc123' + + // Imports the Retail library + const {ServingConfigServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new ServingConfigServiceClient(); + + async function callListServingConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await retailClient.listServingConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListServingConfigs(); + // [END retail_v2beta_generated_ServingConfigService_ListServingConfigs_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/v2beta/serving_config_service.remove_control.js b/packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.remove_control.js new file mode 100644 index 00000000000..314b82f9e4c --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.remove_control.js @@ -0,0 +1,65 @@ +// 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(servingConfig, controlId) { + // [START retail_v2beta_generated_ServingConfigService_RemoveControl_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The source ServingConfig resource name . Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + */ + // const servingConfig = 'abc123' + /** + * Required. The id of the control to apply. Assumed to be in the same catalog + * as the serving config. + */ + // const controlId = 'abc123' + + // Imports the Retail library + const {ServingConfigServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new ServingConfigServiceClient(); + + async function callRemoveControl() { + // Construct request + const request = { + servingConfig, + controlId, + }; + + // Run request + const response = await retailClient.removeControl(request); + console.log(response); + } + + callRemoveControl(); + // [END retail_v2beta_generated_ServingConfigService_RemoveControl_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/v2beta/serving_config_service.update_serving_config.js b/packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.update_serving_config.js new file mode 100644 index 00000000000..f948464a8a8 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/serving_config_service.update_serving_config.js @@ -0,0 +1,66 @@ +// 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(servingConfig) { + // [START retail_v2beta_generated_ServingConfigService_UpdateServingConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ServingConfig to update. + */ + // const servingConfig = {} + /** + * Indicates which fields in the provided + * ServingConfig google.cloud.retail.v2beta.ServingConfig to update. The + * following are NOT supported: + * * ServingConfig.name google.cloud.retail.v2beta.ServingConfig.name + * If not set, all supported fields are updated. + */ + // const updateMask = {} + + // Imports the Retail library + const {ServingConfigServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new ServingConfigServiceClient(); + + async function callUpdateServingConfig() { + // Construct request + const request = { + servingConfig, + }; + + // Run request + const response = await retailClient.updateServingConfig(request); + console.log(response); + } + + callUpdateServingConfig(); + // [END retail_v2beta_generated_ServingConfigService_UpdateServingConfig_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/v2beta/snippet_metadata.google.cloud.retail.v2beta.json b/packages/google-cloud-retail/samples/generated/v2beta/snippet_metadata.google.cloud.retail.v2beta.json index 732ea9469d3..8e89b650252 100644 --- a/packages/google-cloud-retail/samples/generated/v2beta/snippet_metadata.google.cloud.retail.v2beta.json +++ b/packages/google-cloud-retail/samples/generated/v2beta/snippet_metadata.google.cloud.retail.v2beta.json @@ -107,14 +107,14 @@ "regionTag": "retail_v2beta_generated_CatalogService_SetDefaultBranch_async", "title": "CatalogService setDefaultBranch Sample", "origin": "API_DEFINITION", - "description": " Set a specified branch id as default branch. API methods such as [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct], [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts] will treat requests using \"default_branch\" to the actual branch id set as default. For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as default, setting [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent to setting [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to `projects/*/locations/*/catalogs/*/branches/1`. Using multiple branches can be useful when developers would like to have a staging branch to test and verify for future usage. When it becomes ready, developers switch on the staging branch using this API while keeping using `projects/*/locations/*/catalogs/*/branches/default_branch` as [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to route the traffic to this staging branch. CAUTION: If you have live predict/search traffic, switching the default branch could potentially cause outages if the ID space of the new branch is very different from the old one. More specifically: * PredictionService will only return product IDs from branch {newBranch}. * SearchService will only return product IDs from branch {newBranch} (if branch is not explicitly set). * UserEventService will only join events with products from branch {newBranch}. This feature is only available for users who have Retail Search enabled. Please submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.", + "description": " Set a specified branch id as default branch. API methods such as [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct], [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts] will treat requests using \"default_branch\" to the actual branch id set as default. For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as default, setting [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent to setting [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to `projects/*/locations/*/catalogs/*/branches/1`. Using multiple branches can be useful when developers would like to have a staging branch to test and verify for future usage. When it becomes ready, developers switch on the staging branch using this API while keeping using `projects/*/locations/*/catalogs/*/branches/default_branch` as [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to route the traffic to this staging branch. CAUTION: If you have live predict/search traffic, switching the default branch could potentially cause outages if the ID space of the new branch is very different from the old one. More specifically: * PredictionService will only return product IDs from branch {newBranch}. * SearchService will only return product IDs from branch {newBranch} (if branch is not explicitly set). * UserEventService will only join events with products from branch {newBranch}.", "canonical": true, "file": "catalog_service.set_default_branch.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 64, + "end": 73, "type": "FULL" } ], @@ -134,6 +134,10 @@ { "name": "note", "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" } ], "resultType": ".google.protobuf.Empty", @@ -155,7 +159,7 @@ "regionTag": "retail_v2beta_generated_CatalogService_GetDefaultBranch_async", "title": "CatalogService getDefaultBranch Sample", "origin": "API_DEFINITION", - "description": " Get which branch is currently default branch set by [CatalogService.SetDefaultBranch][google.cloud.retail.v2beta.CatalogService.SetDefaultBranch] method under a specified parent catalog. This feature is only available for users who have Retail Search enabled. Please submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.", + "description": " Get which branch is currently default branch set by [CatalogService.SetDefaultBranch][google.cloud.retail.v2beta.CatalogService.SetDefaultBranch] method under a specified parent catalog.", "canonical": true, "file": "catalog_service.get_default_branch.js", "language": "JAVASCRIPT", @@ -192,240 +196,180 @@ } }, { - "regionTag": "retail_v2beta_generated_CompletionService_CompleteQuery_async", - "title": "CatalogService completeQuery Sample", + "regionTag": "retail_v2beta_generated_CatalogService_GetCompletionConfig_async", + "title": "CatalogService getCompletionConfig 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 submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.", + "description": " Gets a [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig].", "canonical": true, - "file": "completion_service.complete_query.js", + "file": "catalog_service.get_completion_config.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 108, + "end": 51, "type": "FULL" } ], "clientMethod": { - "shortName": "CompleteQuery", - "fullName": "google.cloud.retail.v2beta.CompletionService.CompleteQuery", + "shortName": "GetCompletionConfig", + "fullName": "google.cloud.retail.v2beta.CatalogService.GetCompletionConfig", "async": true, "parameters": [ { - "name": "catalog", - "type": "TYPE_STRING" - }, - { - "name": "query", - "type": "TYPE_STRING" - }, - { - "name": "visitor_id", - "type": "TYPE_STRING" - }, - { - "name": "language_codes", - "type": "TYPE_STRING[]" - }, - { - "name": "device_type", - "type": "TYPE_STRING" - }, - { - "name": "dataset", + "name": "name", "type": "TYPE_STRING" - }, - { - "name": "max_suggestions", - "type": "TYPE_INT32" } ], - "resultType": ".google.cloud.retail.v2beta.CompleteQueryResponse", + "resultType": ".google.cloud.retail.v2beta.CompletionConfig", "client": { - "shortName": "CompletionServiceClient", - "fullName": "google.cloud.retail.v2beta.CompletionServiceClient" + "shortName": "CatalogServiceClient", + "fullName": "google.cloud.retail.v2beta.CatalogServiceClient" }, "method": { - "shortName": "CompleteQuery", - "fullName": "google.cloud.retail.v2beta.CompletionService.CompleteQuery", + "shortName": "GetCompletionConfig", + "fullName": "google.cloud.retail.v2beta.CatalogService.GetCompletionConfig", "service": { - "shortName": "CompletionService", - "fullName": "google.cloud.retail.v2beta.CompletionService" + "shortName": "CatalogService", + "fullName": "google.cloud.retail.v2beta.CatalogService" } } } }, { - "regionTag": "retail_v2beta_generated_CompletionService_ImportCompletionData_async", - "title": "CatalogService importCompletionData Sample", + "regionTag": "retail_v2beta_generated_CatalogService_UpdateCompletionConfig_async", + "title": "CatalogService updateCompletionConfig Sample", "origin": "API_DEFINITION", - "description": " Bulk import of processed completion dataset. Request processing may be synchronous. Partial updating is not supported. This feature is only available for users who have Retail Search enabled. Please submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.", + "description": " Updates the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]s.", "canonical": true, - "file": "completion_service.import_completion_data.js", + "file": "catalog_service.update_completion_config.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 65, + "end": 67, "type": "FULL" } ], "clientMethod": { - "shortName": "ImportCompletionData", - "fullName": "google.cloud.retail.v2beta.CompletionService.ImportCompletionData", + "shortName": "UpdateCompletionConfig", + "fullName": "google.cloud.retail.v2beta.CatalogService.UpdateCompletionConfig", "async": true, "parameters": [ { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "input_config", - "type": ".google.cloud.retail.v2beta.CompletionDataInputConfig" + "name": "completion_config", + "type": ".google.cloud.retail.v2beta.CompletionConfig" }, { - "name": "notification_pubsub_topic", - "type": "TYPE_STRING" + "name": "update_mask", + "type": ".google.protobuf.FieldMask" } ], - "resultType": ".google.longrunning.Operation", + "resultType": ".google.cloud.retail.v2beta.CompletionConfig", "client": { - "shortName": "CompletionServiceClient", - "fullName": "google.cloud.retail.v2beta.CompletionServiceClient" + "shortName": "CatalogServiceClient", + "fullName": "google.cloud.retail.v2beta.CatalogServiceClient" }, "method": { - "shortName": "ImportCompletionData", - "fullName": "google.cloud.retail.v2beta.CompletionService.ImportCompletionData", + "shortName": "UpdateCompletionConfig", + "fullName": "google.cloud.retail.v2beta.CatalogService.UpdateCompletionConfig", "service": { - "shortName": "CompletionService", - "fullName": "google.cloud.retail.v2beta.CompletionService" + "shortName": "CatalogService", + "fullName": "google.cloud.retail.v2beta.CatalogService" } } } }, { - "regionTag": "retail_v2beta_generated_PredictionService_Predict_async", - "title": "CatalogService predict Sample", + "regionTag": "retail_v2beta_generated_CatalogService_GetAttributesConfig_async", + "title": "CatalogService getAttributesConfig Sample", "origin": "API_DEFINITION", - "description": " Makes a recommendation prediction.", + "description": " Gets an [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].", "canonical": true, - "file": "prediction_service.predict.js", + "file": "catalog_service.get_attributes_config.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 150, + "end": 51, "type": "FULL" } ], "clientMethod": { - "shortName": "Predict", - "fullName": "google.cloud.retail.v2beta.PredictionService.Predict", + "shortName": "GetAttributesConfig", + "fullName": "google.cloud.retail.v2beta.CatalogService.GetAttributesConfig", "async": true, "parameters": [ { - "name": "placement", - "type": "TYPE_STRING" - }, - { - "name": "user_event", - "type": ".google.cloud.retail.v2beta.UserEvent" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", + "name": "name", "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "params", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "labels", - "type": "TYPE_MESSAGE[]" } ], - "resultType": ".google.cloud.retail.v2beta.PredictResponse", + "resultType": ".google.cloud.retail.v2beta.AttributesConfig", "client": { - "shortName": "PredictionServiceClient", - "fullName": "google.cloud.retail.v2beta.PredictionServiceClient" + "shortName": "CatalogServiceClient", + "fullName": "google.cloud.retail.v2beta.CatalogServiceClient" }, "method": { - "shortName": "Predict", - "fullName": "google.cloud.retail.v2beta.PredictionService.Predict", + "shortName": "GetAttributesConfig", + "fullName": "google.cloud.retail.v2beta.CatalogService.GetAttributesConfig", "service": { - "shortName": "PredictionService", - "fullName": "google.cloud.retail.v2beta.PredictionService" + "shortName": "CatalogService", + "fullName": "google.cloud.retail.v2beta.CatalogService" } } } }, { - "regionTag": "retail_v2beta_generated_ProductService_CreateProduct_async", - "title": "CatalogService createProduct Sample", + "regionTag": "retail_v2beta_generated_CatalogService_UpdateAttributesConfig_async", + "title": "CatalogService updateAttributesConfig Sample", "origin": "API_DEFINITION", - "description": " Creates a [Product][google.cloud.retail.v2beta.Product].", + "description": " Updates the [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. The catalog attributes in the request will be updated in the catalog, or inserted if they do not exist. Existing catalog attributes not included in the request will remain unchanged. Attributes that are assigned to products, but do not exist at the catalog level, are always included in the response. The product attribute is assigned default values for missing catalog attribute fields, e.g., searchable and dynamic facetable options.", "canonical": true, - "file": "product_service.create_product.js", + "file": "catalog_service.update_attributes_config.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 72, + "end": 59, "type": "FULL" } ], "clientMethod": { - "shortName": "CreateProduct", - "fullName": "google.cloud.retail.v2beta.ProductService.CreateProduct", + "shortName": "UpdateAttributesConfig", + "fullName": "google.cloud.retail.v2beta.CatalogService.UpdateAttributesConfig", "async": true, "parameters": [ { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "product", - "type": ".google.cloud.retail.v2beta.Product" + "name": "attributes_config", + "type": ".google.cloud.retail.v2beta.AttributesConfig" }, { - "name": "product_id", - "type": "TYPE_STRING" + "name": "update_mask", + "type": ".google.protobuf.FieldMask" } ], - "resultType": ".google.cloud.retail.v2beta.Product", + "resultType": ".google.cloud.retail.v2beta.AttributesConfig", "client": { - "shortName": "ProductServiceClient", - "fullName": "google.cloud.retail.v2beta.ProductServiceClient" + "shortName": "CatalogServiceClient", + "fullName": "google.cloud.retail.v2beta.CatalogServiceClient" }, "method": { - "shortName": "CreateProduct", - "fullName": "google.cloud.retail.v2beta.ProductService.CreateProduct", + "shortName": "UpdateAttributesConfig", + "fullName": "google.cloud.retail.v2beta.CatalogService.UpdateAttributesConfig", "service": { - "shortName": "ProductService", - "fullName": "google.cloud.retail.v2beta.ProductService" + "shortName": "CatalogService", + "fullName": "google.cloud.retail.v2beta.CatalogService" } } } }, { - "regionTag": "retail_v2beta_generated_ProductService_GetProduct_async", - "title": "CatalogService getProduct Sample", + "regionTag": "retail_v2beta_generated_CatalogService_AddCatalogAttribute_async", + "title": "CatalogService addCatalogAttribute Sample", "origin": "API_DEFINITION", - "description": " Gets a [Product][google.cloud.retail.v2beta.Product].", + "description": " Adds the specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to the [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add already exists, an ALREADY_EXISTS error is returned.", "canonical": true, - "file": "product_service.get_product.js", + "file": "catalog_service.add_catalog_attribute.js", "language": "JAVASCRIPT", "segments": [ { @@ -435,167 +379,755 @@ } ], "clientMethod": { - "shortName": "GetProduct", - "fullName": "google.cloud.retail.v2beta.ProductService.GetProduct", + "shortName": "AddCatalogAttribute", + "fullName": "google.cloud.retail.v2beta.CatalogService.AddCatalogAttribute", "async": true, "parameters": [ { - "name": "name", + "name": "attributes_config", "type": "TYPE_STRING" + }, + { + "name": "catalog_attribute", + "type": ".google.cloud.retail.v2beta.CatalogAttribute" } ], - "resultType": ".google.cloud.retail.v2beta.Product", + "resultType": ".google.cloud.retail.v2beta.AttributesConfig", "client": { - "shortName": "ProductServiceClient", - "fullName": "google.cloud.retail.v2beta.ProductServiceClient" + "shortName": "CatalogServiceClient", + "fullName": "google.cloud.retail.v2beta.CatalogServiceClient" }, "method": { - "shortName": "GetProduct", - "fullName": "google.cloud.retail.v2beta.ProductService.GetProduct", + "shortName": "AddCatalogAttribute", + "fullName": "google.cloud.retail.v2beta.CatalogService.AddCatalogAttribute", "service": { - "shortName": "ProductService", - "fullName": "google.cloud.retail.v2beta.ProductService" + "shortName": "CatalogService", + "fullName": "google.cloud.retail.v2beta.CatalogService" } } } }, { - "regionTag": "retail_v2beta_generated_ProductService_ListProducts_async", - "title": "CatalogService listProducts Sample", + "regionTag": "retail_v2beta_generated_CatalogService_RemoveCatalogAttribute_async", + "title": "CatalogService removeCatalogAttribute Sample", "origin": "API_DEFINITION", - "description": " Gets a list of [Product][google.cloud.retail.v2beta.Product]s.", + "description": " Removes the specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] from the [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to remove does not exist, a NOT_FOUND error is returned.", "canonical": true, - "file": "product_service.list_products.js", + "file": "catalog_service.remove_catalog_attribute.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 124, + "end": 57, "type": "FULL" } ], "clientMethod": { - "shortName": "ListProducts", - "fullName": "google.cloud.retail.v2beta.ProductService.ListProducts", + "shortName": "RemoveCatalogAttribute", + "fullName": "google.cloud.retail.v2beta.CatalogService.RemoveCatalogAttribute", "async": true, "parameters": [ { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", + "name": "attributes_config", "type": "TYPE_STRING" }, { - "name": "filter", + "name": "key", "type": "TYPE_STRING" - }, - { - "name": "read_mask", - "type": ".google.protobuf.FieldMask" } ], - "resultType": ".google.cloud.retail.v2beta.ListProductsResponse", + "resultType": ".google.cloud.retail.v2beta.AttributesConfig", "client": { - "shortName": "ProductServiceClient", - "fullName": "google.cloud.retail.v2beta.ProductServiceClient" + "shortName": "CatalogServiceClient", + "fullName": "google.cloud.retail.v2beta.CatalogServiceClient" }, "method": { - "shortName": "ListProducts", - "fullName": "google.cloud.retail.v2beta.ProductService.ListProducts", + "shortName": "RemoveCatalogAttribute", + "fullName": "google.cloud.retail.v2beta.CatalogService.RemoveCatalogAttribute", "service": { - "shortName": "ProductService", - "fullName": "google.cloud.retail.v2beta.ProductService" + "shortName": "CatalogService", + "fullName": "google.cloud.retail.v2beta.CatalogService" } } } }, { - "regionTag": "retail_v2beta_generated_ProductService_UpdateProduct_async", - "title": "CatalogService updateProduct Sample", + "regionTag": "retail_v2beta_generated_CatalogService_ReplaceCatalogAttribute_async", + "title": "CatalogService replaceCatalogAttribute Sample", "origin": "API_DEFINITION", - "description": " Updates a [Product][google.cloud.retail.v2beta.Product].", + "description": " Replaces the specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] in the [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] by updating the catalog attribute with the same [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]. If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to replace does not exist, a NOT_FOUND error is returned.", "canonical": true, - "file": "product_service.update_product.js", + "file": "catalog_service.replace_catalog_attribute.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 72, + "end": 65, "type": "FULL" } ], "clientMethod": { - "shortName": "UpdateProduct", - "fullName": "google.cloud.retail.v2beta.ProductService.UpdateProduct", + "shortName": "ReplaceCatalogAttribute", + "fullName": "google.cloud.retail.v2beta.CatalogService.ReplaceCatalogAttribute", "async": true, "parameters": [ { - "name": "product", - "type": ".google.cloud.retail.v2beta.Product" + "name": "attributes_config", + "type": "TYPE_STRING" }, { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" + "name": "catalog_attribute", + "type": ".google.cloud.retail.v2beta.CatalogAttribute" }, { - "name": "allow_missing", - "type": "TYPE_BOOL" + "name": "update_mask", + "type": ".google.protobuf.FieldMask" } ], - "resultType": ".google.cloud.retail.v2beta.Product", + "resultType": ".google.cloud.retail.v2beta.AttributesConfig", "client": { - "shortName": "ProductServiceClient", - "fullName": "google.cloud.retail.v2beta.ProductServiceClient" + "shortName": "CatalogServiceClient", + "fullName": "google.cloud.retail.v2beta.CatalogServiceClient" }, "method": { - "shortName": "UpdateProduct", - "fullName": "google.cloud.retail.v2beta.ProductService.UpdateProduct", + "shortName": "ReplaceCatalogAttribute", + "fullName": "google.cloud.retail.v2beta.CatalogService.ReplaceCatalogAttribute", "service": { - "shortName": "ProductService", - "fullName": "google.cloud.retail.v2beta.ProductService" + "shortName": "CatalogService", + "fullName": "google.cloud.retail.v2beta.CatalogService" } } } }, { - "regionTag": "retail_v2beta_generated_ProductService_DeleteProduct_async", - "title": "CatalogService deleteProduct Sample", + "regionTag": "retail_v2beta_generated_CompletionService_CompleteQuery_async", + "title": "CatalogService completeQuery Sample", "origin": "API_DEFINITION", - "description": " Deletes a [Product][google.cloud.retail.v2beta.Product].", + "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.", "canonical": true, - "file": "product_service.delete_product.js", + "file": "completion_service.complete_query.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 67, + "end": 109, "type": "FULL" } ], "clientMethod": { - "shortName": "DeleteProduct", - "fullName": "google.cloud.retail.v2beta.ProductService.DeleteProduct", + "shortName": "CompleteQuery", + "fullName": "google.cloud.retail.v2beta.CompletionService.CompleteQuery", "async": true, "parameters": [ { - "name": "name", + "name": "catalog", "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ProductServiceClient", - "fullName": "google.cloud.retail.v2beta.ProductServiceClient" - }, - "method": { - "shortName": "DeleteProduct", - "fullName": "google.cloud.retail.v2beta.ProductService.DeleteProduct", + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "visitor_id", + "type": "TYPE_STRING" + }, + { + "name": "language_codes", + "type": "TYPE_STRING[]" + }, + { + "name": "device_type", + "type": "TYPE_STRING" + }, + { + "name": "dataset", + "type": "TYPE_STRING" + }, + { + "name": "max_suggestions", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.retail.v2beta.CompleteQueryResponse", + "client": { + "shortName": "CompletionServiceClient", + "fullName": "google.cloud.retail.v2beta.CompletionServiceClient" + }, + "method": { + "shortName": "CompleteQuery", + "fullName": "google.cloud.retail.v2beta.CompletionService.CompleteQuery", + "service": { + "shortName": "CompletionService", + "fullName": "google.cloud.retail.v2beta.CompletionService" + } + } + } + }, + { + "regionTag": "retail_v2beta_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.", + "canonical": true, + "file": "completion_service.import_completion_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportCompletionData", + "fullName": "google.cloud.retail.v2beta.CompletionService.ImportCompletionData", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.retail.v2beta.CompletionDataInputConfig" + }, + { + "name": "notification_pubsub_topic", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CompletionServiceClient", + "fullName": "google.cloud.retail.v2beta.CompletionServiceClient" + }, + "method": { + "shortName": "ImportCompletionData", + "fullName": "google.cloud.retail.v2beta.CompletionService.ImportCompletionData", + "service": { + "shortName": "CompletionService", + "fullName": "google.cloud.retail.v2beta.CompletionService" + } + } + } + }, + { + "regionTag": "retail_v2beta_generated_ControlService_CreateControl_async", + "title": "CatalogService createControl Sample", + "origin": "API_DEFINITION", + "description": " Creates a Control. If the [Control][google.cloud.retail.v2beta.Control] to create already exists, an ALREADY_EXISTS error is returned.", + "canonical": true, + "file": "control_service.create_control.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateControl", + "fullName": "google.cloud.retail.v2beta.ControlService.CreateControl", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "control", + "type": ".google.cloud.retail.v2beta.Control" + }, + { + "name": "control_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.retail.v2beta.Control", + "client": { + "shortName": "ControlServiceClient", + "fullName": "google.cloud.retail.v2beta.ControlServiceClient" + }, + "method": { + "shortName": "CreateControl", + "fullName": "google.cloud.retail.v2beta.ControlService.CreateControl", + "service": { + "shortName": "ControlService", + "fullName": "google.cloud.retail.v2beta.ControlService" + } + } + } + }, + { + "regionTag": "retail_v2beta_generated_ControlService_DeleteControl_async", + "title": "CatalogService deleteControl Sample", + "origin": "API_DEFINITION", + "description": " Deletes a Control. If the [Control][google.cloud.retail.v2beta.Control] to delete does not exist, a NOT_FOUND error is returned.", + "canonical": true, + "file": "control_service.delete_control.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteControl", + "fullName": "google.cloud.retail.v2beta.ControlService.DeleteControl", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ControlServiceClient", + "fullName": "google.cloud.retail.v2beta.ControlServiceClient" + }, + "method": { + "shortName": "DeleteControl", + "fullName": "google.cloud.retail.v2beta.ControlService.DeleteControl", + "service": { + "shortName": "ControlService", + "fullName": "google.cloud.retail.v2beta.ControlService" + } + } + } + }, + { + "regionTag": "retail_v2beta_generated_ControlService_UpdateControl_async", + "title": "CatalogService updateControl Sample", + "origin": "API_DEFINITION", + "description": " Updates a Control. [Control][google.cloud.retail.v2beta.Control] cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the [Control][google.cloud.retail.v2beta.Control] to delete does not exist, a NOT_FOUND error is returned.", + "canonical": true, + "file": "control_service.update_control.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateControl", + "fullName": "google.cloud.retail.v2beta.ControlService.UpdateControl", + "async": true, + "parameters": [ + { + "name": "control", + "type": ".google.cloud.retail.v2beta.Control" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.retail.v2beta.Control", + "client": { + "shortName": "ControlServiceClient", + "fullName": "google.cloud.retail.v2beta.ControlServiceClient" + }, + "method": { + "shortName": "UpdateControl", + "fullName": "google.cloud.retail.v2beta.ControlService.UpdateControl", + "service": { + "shortName": "ControlService", + "fullName": "google.cloud.retail.v2beta.ControlService" + } + } + } + }, + { + "regionTag": "retail_v2beta_generated_ControlService_GetControl_async", + "title": "CatalogService getControl Sample", + "origin": "API_DEFINITION", + "description": " Gets a Control.", + "canonical": true, + "file": "control_service.get_control.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetControl", + "fullName": "google.cloud.retail.v2beta.ControlService.GetControl", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.retail.v2beta.Control", + "client": { + "shortName": "ControlServiceClient", + "fullName": "google.cloud.retail.v2beta.ControlServiceClient" + }, + "method": { + "shortName": "GetControl", + "fullName": "google.cloud.retail.v2beta.ControlService.GetControl", + "service": { + "shortName": "ControlService", + "fullName": "google.cloud.retail.v2beta.ControlService" + } + } + } + }, + { + "regionTag": "retail_v2beta_generated_ControlService_ListControls_async", + "title": "CatalogService listControls Sample", + "origin": "API_DEFINITION", + "description": " Lists all Controls linked to this catalog.", + "canonical": true, + "file": "control_service.list_controls.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListControls", + "fullName": "google.cloud.retail.v2beta.ControlService.ListControls", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.retail.v2beta.ListControlsResponse", + "client": { + "shortName": "ControlServiceClient", + "fullName": "google.cloud.retail.v2beta.ControlServiceClient" + }, + "method": { + "shortName": "ListControls", + "fullName": "google.cloud.retail.v2beta.ControlService.ListControls", + "service": { + "shortName": "ControlService", + "fullName": "google.cloud.retail.v2beta.ControlService" + } + } + } + }, + { + "regionTag": "retail_v2beta_generated_PredictionService_Predict_async", + "title": "CatalogService predict Sample", + "origin": "API_DEFINITION", + "description": " Makes a recommendation prediction.", + "canonical": true, + "file": "prediction_service.predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 153, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Predict", + "fullName": "google.cloud.retail.v2beta.PredictionService.Predict", + "async": true, + "parameters": [ + { + "name": "placement", + "type": "TYPE_STRING" + }, + { + "name": "user_event", + "type": ".google.cloud.retail.v2beta.UserEvent" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.retail.v2beta.PredictResponse", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.retail.v2beta.PredictionServiceClient" + }, + "method": { + "shortName": "Predict", + "fullName": "google.cloud.retail.v2beta.PredictionService.Predict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.retail.v2beta.PredictionService" + } + } + } + }, + { + "regionTag": "retail_v2beta_generated_ProductService_CreateProduct_async", + "title": "CatalogService createProduct Sample", + "origin": "API_DEFINITION", + "description": " Creates a [Product][google.cloud.retail.v2beta.Product].", + "canonical": true, + "file": "product_service.create_product.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateProduct", + "fullName": "google.cloud.retail.v2beta.ProductService.CreateProduct", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "product", + "type": ".google.cloud.retail.v2beta.Product" + }, + { + "name": "product_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.retail.v2beta.Product", + "client": { + "shortName": "ProductServiceClient", + "fullName": "google.cloud.retail.v2beta.ProductServiceClient" + }, + "method": { + "shortName": "CreateProduct", + "fullName": "google.cloud.retail.v2beta.ProductService.CreateProduct", + "service": { + "shortName": "ProductService", + "fullName": "google.cloud.retail.v2beta.ProductService" + } + } + } + }, + { + "regionTag": "retail_v2beta_generated_ProductService_GetProduct_async", + "title": "CatalogService getProduct Sample", + "origin": "API_DEFINITION", + "description": " Gets a [Product][google.cloud.retail.v2beta.Product].", + "canonical": true, + "file": "product_service.get_product.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetProduct", + "fullName": "google.cloud.retail.v2beta.ProductService.GetProduct", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.retail.v2beta.Product", + "client": { + "shortName": "ProductServiceClient", + "fullName": "google.cloud.retail.v2beta.ProductServiceClient" + }, + "method": { + "shortName": "GetProduct", + "fullName": "google.cloud.retail.v2beta.ProductService.GetProduct", + "service": { + "shortName": "ProductService", + "fullName": "google.cloud.retail.v2beta.ProductService" + } + } + } + }, + { + "regionTag": "retail_v2beta_generated_ProductService_ListProducts_async", + "title": "CatalogService listProducts Sample", + "origin": "API_DEFINITION", + "description": " Gets a list of [Product][google.cloud.retail.v2beta.Product]s.", + "canonical": true, + "file": "product_service.list_products.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 124, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListProducts", + "fullName": "google.cloud.retail.v2beta.ProductService.ListProducts", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "read_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.retail.v2beta.ListProductsResponse", + "client": { + "shortName": "ProductServiceClient", + "fullName": "google.cloud.retail.v2beta.ProductServiceClient" + }, + "method": { + "shortName": "ListProducts", + "fullName": "google.cloud.retail.v2beta.ProductService.ListProducts", + "service": { + "shortName": "ProductService", + "fullName": "google.cloud.retail.v2beta.ProductService" + } + } + } + }, + { + "regionTag": "retail_v2beta_generated_ProductService_UpdateProduct_async", + "title": "CatalogService updateProduct Sample", + "origin": "API_DEFINITION", + "description": " Updates a [Product][google.cloud.retail.v2beta.Product].", + "canonical": true, + "file": "product_service.update_product.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateProduct", + "fullName": "google.cloud.retail.v2beta.ProductService.UpdateProduct", + "async": true, + "parameters": [ + { + "name": "product", + "type": ".google.cloud.retail.v2beta.Product" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.retail.v2beta.Product", + "client": { + "shortName": "ProductServiceClient", + "fullName": "google.cloud.retail.v2beta.ProductServiceClient" + }, + "method": { + "shortName": "UpdateProduct", + "fullName": "google.cloud.retail.v2beta.ProductService.UpdateProduct", + "service": { + "shortName": "ProductService", + "fullName": "google.cloud.retail.v2beta.ProductService" + } + } + } + }, + { + "regionTag": "retail_v2beta_generated_ProductService_DeleteProduct_async", + "title": "CatalogService deleteProduct Sample", + "origin": "API_DEFINITION", + "description": " Deletes a [Product][google.cloud.retail.v2beta.Product].", + "canonical": true, + "file": "product_service.delete_product.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteProduct", + "fullName": "google.cloud.retail.v2beta.ProductService.DeleteProduct", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ProductServiceClient", + "fullName": "google.cloud.retail.v2beta.ProductServiceClient" + }, + "method": { + "shortName": "DeleteProduct", + "fullName": "google.cloud.retail.v2beta.ProductService.DeleteProduct", "service": { "shortName": "ProductService", "fullName": "google.cloud.retail.v2beta.ProductService" @@ -614,7 +1146,7 @@ "segments": [ { "start": 25, - "end": 96, + "end": 85, "type": "FULL" } ], @@ -671,32 +1203,144 @@ "regionTag": "retail_v2beta_generated_ProductService_SetInventory_async", "title": "CatalogService setInventory Sample", "origin": "API_DEFINITION", - "description": " Updates inventory information for a [Product][google.cloud.retail.v2beta.Product] while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the [Product][google.cloud.retail.v2beta.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.v2beta.Product] queried by [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. When inventory is updated with [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and [UpdateProduct][google.cloud.retail.v2beta.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 [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] or [UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] request. If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2beta.CreateProductRequest.product], then any pre-existing inventory information for this product will be used. If no inventory fields are set in [UpdateProductRequest.set_mask][], then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with [SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory], [AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces], and [RemoveFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces]. This feature is only available for users who have Retail Search enabled. Please submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.", + "description": " Updates inventory information for a [Product][google.cloud.retail.v2beta.Product] while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the [Product][google.cloud.retail.v2beta.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.v2beta.Product] queried by [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. When inventory is updated with [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and [UpdateProduct][google.cloud.retail.v2beta.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 [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] or [UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] request. If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2beta.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.v2beta.SetInventoryRequest.set_mask], then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with [SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory], [AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces], and [RemoveFulfillmentPlaces][google.cloud.retail.v2beta.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.", "canonical": true, "file": "product_service.set_inventory.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 102, + "end": 116, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetInventory", + "fullName": "google.cloud.retail.v2beta.ProductService.SetInventory", + "async": true, + "parameters": [ + { + "name": "inventory", + "type": ".google.cloud.retail.v2beta.Product" + }, + { + "name": "set_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "set_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProductServiceClient", + "fullName": "google.cloud.retail.v2beta.ProductServiceClient" + }, + "method": { + "shortName": "SetInventory", + "fullName": "google.cloud.retail.v2beta.ProductService.SetInventory", + "service": { + "shortName": "ProductService", + "fullName": "google.cloud.retail.v2beta.ProductService" + } + } + } + }, + { + "regionTag": "retail_v2beta_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.v2beta.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2beta.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.v2beta.Product] queried by [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ListProducts][google.cloud.retail.v2beta.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.", + "canonical": true, + "file": "product_service.add_fulfillment_places.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 107, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AddFulfillmentPlaces", + "fullName": "google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces", + "async": true, + "parameters": [ + { + "name": "product", + "type": "TYPE_STRING" + }, + { + "name": "type", + "type": "TYPE_STRING" + }, + { + "name": "place_ids", + "type": "TYPE_STRING[]" + }, + { + "name": "add_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProductServiceClient", + "fullName": "google.cloud.retail.v2beta.ProductServiceClient" + }, + "method": { + "shortName": "AddFulfillmentPlaces", + "fullName": "google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces", + "service": { + "shortName": "ProductService", + "fullName": "google.cloud.retail.v2beta.ProductService" + } + } + } + }, + { + "regionTag": "retail_v2beta_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.v2beta.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2beta.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.v2beta.Product] queried by [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ListProducts][google.cloud.retail.v2beta.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.", + "canonical": true, + "file": "product_service.remove_fulfillment_places.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 103, "type": "FULL" } ], "clientMethod": { - "shortName": "SetInventory", - "fullName": "google.cloud.retail.v2beta.ProductService.SetInventory", + "shortName": "RemoveFulfillmentPlaces", + "fullName": "google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces", "async": true, "parameters": [ { - "name": "inventory", - "type": ".google.cloud.retail.v2beta.Product" + "name": "product", + "type": "TYPE_STRING" }, { - "name": "set_mask", - "type": ".google.protobuf.FieldMask" + "name": "type", + "type": "TYPE_STRING" }, { - "name": "set_time", + "name": "place_ids", + "type": "TYPE_STRING[]" + }, + { + "name": "remove_time", "type": ".google.protobuf.Timestamp" }, { @@ -710,8 +1354,8 @@ "fullName": "google.cloud.retail.v2beta.ProductServiceClient" }, "method": { - "shortName": "SetInventory", - "fullName": "google.cloud.retail.v2beta.ProductService.SetInventory", + "shortName": "RemoveFulfillmentPlaces", + "fullName": "google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces", "service": { "shortName": "ProductService", "fullName": "google.cloud.retail.v2beta.ProductService" @@ -720,23 +1364,23 @@ } }, { - "regionTag": "retail_v2beta_generated_ProductService_AddFulfillmentPlaces_async", - "title": "CatalogService addFulfillmentPlaces Sample", + "regionTag": "retail_v2beta_generated_ProductService_AddLocalInventories_async", + "title": "CatalogService addLocalInventories Sample", "origin": "API_DEFINITION", - "description": " Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2beta.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.v2beta.Product] queried by [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. This feature is only available for users who have Retail Search enabled. Please submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.", + "description": " Updates local inventory information for a [Product][google.cloud.retail.v2beta.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.v2beta.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.v2beta.Product] queried by [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. Local inventory information can only be modified using this method. [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and [UpdateProduct][google.cloud.retail.v2beta.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.", "canonical": true, - "file": "product_service.add_fulfillment_places.js", + "file": "product_service.add_local_inventories.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 107, + "end": 92, "type": "FULL" } ], "clientMethod": { - "shortName": "AddFulfillmentPlaces", - "fullName": "google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces", + "shortName": "AddLocalInventories", + "fullName": "google.cloud.retail.v2beta.ProductService.AddLocalInventories", "async": true, "parameters": [ { @@ -744,12 +1388,12 @@ "type": "TYPE_STRING" }, { - "name": "type", - "type": "TYPE_STRING" + "name": "local_inventories", + "type": "TYPE_MESSAGE[]" }, { - "name": "place_ids", - "type": "TYPE_STRING[]" + "name": "add_mask", + "type": ".google.protobuf.FieldMask" }, { "name": "add_time", @@ -766,8 +1410,8 @@ "fullName": "google.cloud.retail.v2beta.ProductServiceClient" }, "method": { - "shortName": "AddFulfillmentPlaces", - "fullName": "google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces", + "shortName": "AddLocalInventories", + "fullName": "google.cloud.retail.v2beta.ProductService.AddLocalInventories", "service": { "shortName": "ProductService", "fullName": "google.cloud.retail.v2beta.ProductService" @@ -776,33 +1420,29 @@ } }, { - "regionTag": "retail_v2beta_generated_ProductService_RemoveFulfillmentPlaces_async", - "title": "CatalogService removeFulfillmentPlaces Sample", + "regionTag": "retail_v2beta_generated_ProductService_RemoveLocalInventories_async", + "title": "CatalogService removeLocalInventories Sample", "origin": "API_DEFINITION", - "description": " Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2beta.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.v2beta.Product] queried by [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. This feature is only available for users who have Retail Search enabled. Please submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.", + "description": " Remove local inventory information for a [Product][google.cloud.retail.v2beta.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.v2beta.Product] queried by [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. Local inventory information can only be removed using this method. [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and [UpdateProduct][google.cloud.retail.v2beta.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.", "canonical": true, - "file": "product_service.remove_fulfillment_places.js", + "file": "product_service.remove_local_inventories.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 103, + "end": 77, "type": "FULL" } ], "clientMethod": { - "shortName": "RemoveFulfillmentPlaces", - "fullName": "google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces", + "shortName": "RemoveLocalInventories", + "fullName": "google.cloud.retail.v2beta.ProductService.RemoveLocalInventories", "async": true, "parameters": [ { "name": "product", "type": "TYPE_STRING" }, - { - "name": "type", - "type": "TYPE_STRING" - }, { "name": "place_ids", "type": "TYPE_STRING[]" @@ -822,8 +1462,8 @@ "fullName": "google.cloud.retail.v2beta.ProductServiceClient" }, "method": { - "shortName": "RemoveFulfillmentPlaces", - "fullName": "google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces", + "shortName": "RemoveLocalInventories", + "fullName": "google.cloud.retail.v2beta.ProductService.RemoveLocalInventories", "service": { "shortName": "ProductService", "fullName": "google.cloud.retail.v2beta.ProductService" @@ -835,14 +1475,14 @@ "regionTag": "retail_v2beta_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 submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.", + "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.", "canonical": true, "file": "search_service.search.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 252, + "end": 253, "type": "FULL" } ], @@ -922,6 +1562,10 @@ { "name": "search_mode", "type": ".google.cloud.retail.v2beta.SearchRequest.SearchMode" + }, + { + "name": "personalization_spec", + "type": ".google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec" } ], "resultType": ".google.cloud.retail.v2beta.SearchResponse", @@ -939,6 +1583,314 @@ } } }, + { + "regionTag": "retail_v2beta_generated_ServingConfigService_CreateServingConfig_async", + "title": "CatalogService createServingConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a ServingConfig. A maximum of 100 [ServingConfig][google.cloud.retail.v2beta.ServingConfig]s are allowed in a [Catalog][google.cloud.retail.v2beta.Catalog], otherwise a FAILED_PRECONDITION error is returned.", + "canonical": true, + "file": "serving_config_service.create_serving_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateServingConfig", + "fullName": "google.cloud.retail.v2beta.ServingConfigService.CreateServingConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "serving_config", + "type": ".google.cloud.retail.v2beta.ServingConfig" + }, + { + "name": "serving_config_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.retail.v2beta.ServingConfig", + "client": { + "shortName": "ServingConfigServiceClient", + "fullName": "google.cloud.retail.v2beta.ServingConfigServiceClient" + }, + "method": { + "shortName": "CreateServingConfig", + "fullName": "google.cloud.retail.v2beta.ServingConfigService.CreateServingConfig", + "service": { + "shortName": "ServingConfigService", + "fullName": "google.cloud.retail.v2beta.ServingConfigService" + } + } + } + }, + { + "regionTag": "retail_v2beta_generated_ServingConfigService_DeleteServingConfig_async", + "title": "CatalogService deleteServingConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes a ServingConfig. Returns a NotFound error if the ServingConfig does not exist.", + "canonical": true, + "file": "serving_config_service.delete_serving_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteServingConfig", + "fullName": "google.cloud.retail.v2beta.ServingConfigService.DeleteServingConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ServingConfigServiceClient", + "fullName": "google.cloud.retail.v2beta.ServingConfigServiceClient" + }, + "method": { + "shortName": "DeleteServingConfig", + "fullName": "google.cloud.retail.v2beta.ServingConfigService.DeleteServingConfig", + "service": { + "shortName": "ServingConfigService", + "fullName": "google.cloud.retail.v2beta.ServingConfigService" + } + } + } + }, + { + "regionTag": "retail_v2beta_generated_ServingConfigService_UpdateServingConfig_async", + "title": "CatalogService updateServingConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a ServingConfig.", + "canonical": true, + "file": "serving_config_service.update_serving_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateServingConfig", + "fullName": "google.cloud.retail.v2beta.ServingConfigService.UpdateServingConfig", + "async": true, + "parameters": [ + { + "name": "serving_config", + "type": ".google.cloud.retail.v2beta.ServingConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.retail.v2beta.ServingConfig", + "client": { + "shortName": "ServingConfigServiceClient", + "fullName": "google.cloud.retail.v2beta.ServingConfigServiceClient" + }, + "method": { + "shortName": "UpdateServingConfig", + "fullName": "google.cloud.retail.v2beta.ServingConfigService.UpdateServingConfig", + "service": { + "shortName": "ServingConfigService", + "fullName": "google.cloud.retail.v2beta.ServingConfigService" + } + } + } + }, + { + "regionTag": "retail_v2beta_generated_ServingConfigService_GetServingConfig_async", + "title": "CatalogService getServingConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets a ServingConfig. Returns a NotFound error if the ServingConfig does not exist.", + "canonical": true, + "file": "serving_config_service.get_serving_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetServingConfig", + "fullName": "google.cloud.retail.v2beta.ServingConfigService.GetServingConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.retail.v2beta.ServingConfig", + "client": { + "shortName": "ServingConfigServiceClient", + "fullName": "google.cloud.retail.v2beta.ServingConfigServiceClient" + }, + "method": { + "shortName": "GetServingConfig", + "fullName": "google.cloud.retail.v2beta.ServingConfigService.GetServingConfig", + "service": { + "shortName": "ServingConfigService", + "fullName": "google.cloud.retail.v2beta.ServingConfigService" + } + } + } + }, + { + "regionTag": "retail_v2beta_generated_ServingConfigService_ListServingConfigs_async", + "title": "CatalogService listServingConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists all ServingConfigs linked to this catalog.", + "canonical": true, + "file": "serving_config_service.list_serving_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListServingConfigs", + "fullName": "google.cloud.retail.v2beta.ServingConfigService.ListServingConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.retail.v2beta.ListServingConfigsResponse", + "client": { + "shortName": "ServingConfigServiceClient", + "fullName": "google.cloud.retail.v2beta.ServingConfigServiceClient" + }, + "method": { + "shortName": "ListServingConfigs", + "fullName": "google.cloud.retail.v2beta.ServingConfigService.ListServingConfigs", + "service": { + "shortName": "ServingConfigService", + "fullName": "google.cloud.retail.v2beta.ServingConfigService" + } + } + } + }, + { + "regionTag": "retail_v2beta_generated_ServingConfigService_AddControl_async", + "title": "CatalogService addControl Sample", + "origin": "API_DEFINITION", + "description": " Enables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum number of control allowed for that type of control.", + "canonical": true, + "file": "serving_config_service.add_control.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AddControl", + "fullName": "google.cloud.retail.v2beta.ServingConfigService.AddControl", + "async": true, + "parameters": [ + { + "name": "serving_config", + "type": "TYPE_STRING" + }, + { + "name": "control_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.retail.v2beta.ServingConfig", + "client": { + "shortName": "ServingConfigServiceClient", + "fullName": "google.cloud.retail.v2beta.ServingConfigServiceClient" + }, + "method": { + "shortName": "AddControl", + "fullName": "google.cloud.retail.v2beta.ServingConfigService.AddControl", + "service": { + "shortName": "ServingConfigService", + "fullName": "google.cloud.retail.v2beta.ServingConfigService" + } + } + } + }, + { + "regionTag": "retail_v2beta_generated_ServingConfigService_RemoveControl_async", + "title": "CatalogService removeControl Sample", + "origin": "API_DEFINITION", + "description": " Disables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.", + "canonical": true, + "file": "serving_config_service.remove_control.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RemoveControl", + "fullName": "google.cloud.retail.v2beta.ServingConfigService.RemoveControl", + "async": true, + "parameters": [ + { + "name": "serving_config", + "type": "TYPE_STRING" + }, + { + "name": "control_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.retail.v2beta.ServingConfig", + "client": { + "shortName": "ServingConfigServiceClient", + "fullName": "google.cloud.retail.v2beta.ServingConfigServiceClient" + }, + "method": { + "shortName": "RemoveControl", + "fullName": "google.cloud.retail.v2beta.ServingConfigService.RemoveControl", + "service": { + "shortName": "ServingConfigService", + "fullName": "google.cloud.retail.v2beta.ServingConfigService" + } + } + } + }, { "regionTag": "retail_v2beta_generated_UserEventService_WriteUserEvent_async", "title": "CatalogService writeUserEvent Sample", @@ -1135,7 +2087,7 @@ "regionTag": "retail_v2beta_generated_UserEventService_RejoinUserEvents_async", "title": "CatalogService rejoinUserEvents Sample", "origin": "API_DEFINITION", - "description": " Triggers a user event rejoin operation with latest product catalog. Events will not be annotated with detailed product information if product is missing from the catalog at the time the user event is ingested, and these events are stored as unjoined events with a limited usage on training and serving. This API can be used to trigger a 'join' operation on specified events with latest version of product catalog. It can also be used to correct events joined with wrong product catalog.", + "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.", "canonical": true, "file": "user_event_service.rejoin_user_events.js", "language": "JAVASCRIPT", diff --git a/packages/google-cloud-retail/src/index.ts b/packages/google-cloud-retail/src/index.ts index de1b68b3218..7fb6963744a 100644 --- a/packages/google-cloud-retail/src/index.ts +++ b/packages/google-cloud-retail/src/index.ts @@ -24,12 +24,16 @@ const CatalogServiceClient = v2beta.CatalogServiceClient; type CatalogServiceClient = v2beta.CatalogServiceClient; const CompletionServiceClient = v2beta.CompletionServiceClient; type CompletionServiceClient = v2beta.CompletionServiceClient; +const ControlServiceClient = v2beta.ControlServiceClient; +type ControlServiceClient = v2beta.ControlServiceClient; const PredictionServiceClient = v2beta.PredictionServiceClient; type PredictionServiceClient = v2beta.PredictionServiceClient; const ProductServiceClient = v2beta.ProductServiceClient; type ProductServiceClient = v2beta.ProductServiceClient; const SearchServiceClient = v2beta.SearchServiceClient; type SearchServiceClient = v2beta.SearchServiceClient; +const ServingConfigServiceClient = v2beta.ServingConfigServiceClient; +type ServingConfigServiceClient = v2beta.ServingConfigServiceClient; const UserEventServiceClient = v2beta.UserEventServiceClient; type UserEventServiceClient = v2beta.UserEventServiceClient; @@ -39,9 +43,11 @@ export { v2beta, CatalogServiceClient, CompletionServiceClient, + ControlServiceClient, PredictionServiceClient, ProductServiceClient, SearchServiceClient, + ServingConfigServiceClient, UserEventServiceClient, }; export default { @@ -50,9 +56,11 @@ export default { v2beta, CatalogServiceClient, CompletionServiceClient, + ControlServiceClient, PredictionServiceClient, ProductServiceClient, SearchServiceClient, + ServingConfigServiceClient, UserEventServiceClient, }; import * as protos from '../protos/protos'; 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 74a0fc48d76..a6efcec5f60 100644 --- a/packages/google-cloud-retail/src/v2/catalog_service_client.ts +++ b/packages/google-cloud-retail/src/v2/catalog_service_client.ts @@ -458,10 +458,6 @@ export class CatalogServiceClient { * * UserEventService will only join events with products from branch * {newBranch}. * - * This feature is only available for users who have Retail Search enabled. - * Please submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. - * * @param {Object} request * The request object that will be sent. * @param {string} request.catalog @@ -472,6 +468,10 @@ export class CatalogServiceClient { * * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT * error is returned. + * + * If there are no sufficient active products in the targeted branch and + * {@link google.cloud.retail.v2.SetDefaultBranchRequest.force|force} is not set, a + * FAILED_PRECONDITION error is returned. * @param {string} request.note * Some note on this request, this can be retrieved by * {@link google.cloud.retail.v2.CatalogService.GetDefaultBranch|CatalogService.GetDefaultBranch} @@ -479,6 +479,10 @@ export class CatalogServiceClient { * * This field must be a UTF-8 encoded string with a length limit of 1,000 * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * @param {boolean} request.force + * If set to true, it permits switching to a branch with + * {@link google.cloud.retail.v2.SetDefaultBranchRequest.branch_id|branch_id} even + * if it has no sufficient active products. * @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. @@ -562,10 +566,6 @@ export class CatalogServiceClient { * {@link google.cloud.retail.v2.CatalogService.SetDefaultBranch|CatalogService.SetDefaultBranch} * method under a specified parent catalog. * - * This feature is only available for users who have Retail Search enabled. - * Please submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. - * * @param {Object} request * The request object that will be sent. * @param {string} request.catalog diff --git a/packages/google-cloud-retail/src/v2/catalog_service_proto_list.json b/packages/google-cloud-retail/src/v2/catalog_service_proto_list.json index 4db248503a9..dd7dfb7a71b 100644 --- a/packages/google-cloud-retail/src/v2/catalog_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2/catalog_service_proto_list.json @@ -7,6 +7,7 @@ "../../protos/google/cloud/retail/v2/prediction_service.proto", "../../protos/google/cloud/retail/v2/product.proto", "../../protos/google/cloud/retail/v2/product_service.proto", + "../../protos/google/cloud/retail/v2/promotion.proto", "../../protos/google/cloud/retail/v2/purge_config.proto", "../../protos/google/cloud/retail/v2/search_service.proto", "../../protos/google/cloud/retail/v2/user_event.proto", 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 365893fa40f..ceec448c353 100644 --- a/packages/google-cloud-retail/src/v2/completion_service_client.ts +++ b/packages/google-cloud-retail/src/v2/completion_service_client.ts @@ -41,8 +41,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 submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * Please enable Retail Search on Cloud Console before using this feature. * @class * @memberof v2 */ @@ -339,8 +338,7 @@ export class CompletionServiceClient { * Completes the specified prefix with keyword suggestions. * * This feature is only available for users who have Retail Search enabled. - * Please submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * Please enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. @@ -354,21 +352,20 @@ export class CompletionServiceClient { * * The maximum number of allowed characters is 255. * @param {string} request.visitorId - * A unique identifier for tracking visitors. For example, this could be - * implemented with an HTTP cookie, which should be able to uniquely identify - * a visitor on a single device. This unique identifier should not change if - * the visitor logs in or out of the website. + * Required field. A unique identifier for tracking visitors. For example, + * this could be implemented with an HTTP cookie, which should be able to + * uniquely identify a visitor on a single device. This unique identifier + * should not change if the visitor logs in or out of the website. * * The field must be a UTF-8 encoded string with a length limit of 128 * characters. Otherwise, an INVALID_ARGUMENT error is returned. * @param {string[]} request.languageCodes - * The list of languages of the query. This is - * the BCP-47 language code, such as "en-US" or "sr-Latn". - * For more information, see - * [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - * - * The maximum number of allowed characters is 255. - * Only "en-US" is currently supported. + * The language filters applied to the output suggestions. If set, it should + * contain the language of the query. If not set, suggestions are returned + * without considering language restrictions. This is the BCP-47 language + * code, such as "en-US" or "sr-Latn". For more information, see [Tags for + * 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. @@ -486,11 +483,13 @@ export class CompletionServiceClient { /** * Bulk import of processed completion dataset. * - * Request processing may be synchronous. Partial updating is not supported. + * 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 submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * Please 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/v2/completion_service_proto_list.json b/packages/google-cloud-retail/src/v2/completion_service_proto_list.json index 4db248503a9..dd7dfb7a71b 100644 --- a/packages/google-cloud-retail/src/v2/completion_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2/completion_service_proto_list.json @@ -7,6 +7,7 @@ "../../protos/google/cloud/retail/v2/prediction_service.proto", "../../protos/google/cloud/retail/v2/product.proto", "../../protos/google/cloud/retail/v2/product_service.proto", + "../../protos/google/cloud/retail/v2/promotion.proto", "../../protos/google/cloud/retail/v2/purge_config.proto", "../../protos/google/cloud/retail/v2/search_service.proto", "../../protos/google/cloud/retail/v2/user_event.proto", diff --git a/packages/google-cloud-retail/src/v2/gapic_metadata.json b/packages/google-cloud-retail/src/v2/gapic_metadata.json index 064eddd9b6d..e2fe1b36649 100644 --- a/packages/google-cloud-retail/src/v2/gapic_metadata.json +++ b/packages/google-cloud-retail/src/v2/gapic_metadata.json @@ -166,6 +166,16 @@ "removeFulfillmentPlaces" ] }, + "AddLocalInventories": { + "methods": [ + "addLocalInventories" + ] + }, + "RemoveLocalInventories": { + "methods": [ + "removeLocalInventories" + ] + }, "ListProducts": { "methods": [ "listProducts", @@ -218,6 +228,16 @@ "removeFulfillmentPlaces" ] }, + "AddLocalInventories": { + "methods": [ + "addLocalInventories" + ] + }, + "RemoveLocalInventories": { + "methods": [ + "removeLocalInventories" + ] + }, "ListProducts": { "methods": [ "listProducts", 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 5f81bbc6219..436b568e8ad 100644 --- a/packages/google-cloud-retail/src/v2/prediction_service_client.ts +++ b/packages/google-cloud-retail/src/v2/prediction_service_client.ts @@ -345,9 +345,12 @@ export class PredictionServiceClient { * * filterOutOfStockItems tag=(-"promotional") * * filterOutOfStockItems * - * If your filter blocks all prediction results, nothing will be returned. If - * you want generic (unfiltered) popular products to be returned instead, set - * `strictFiltering` to false in `PredictRequest.params`. + * 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. * @param {boolean} request.validateOnly * Use validate only mode for this prediction query. If set to true, a * dummy model will be used that returns arbitrary products. diff --git a/packages/google-cloud-retail/src/v2/prediction_service_proto_list.json b/packages/google-cloud-retail/src/v2/prediction_service_proto_list.json index 4db248503a9..dd7dfb7a71b 100644 --- a/packages/google-cloud-retail/src/v2/prediction_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2/prediction_service_proto_list.json @@ -7,6 +7,7 @@ "../../protos/google/cloud/retail/v2/prediction_service.proto", "../../protos/google/cloud/retail/v2/product.proto", "../../protos/google/cloud/retail/v2/product_service.proto", + "../../protos/google/cloud/retail/v2/promotion.proto", "../../protos/google/cloud/retail/v2/purge_config.proto", "../../protos/google/cloud/retail/v2/search_service.proto", "../../protos/google/cloud/retail/v2/user_event.proto", 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 741291525ae..5c4d892aed9 100644 --- a/packages/google-cloud-retail/src/v2/product_service_client.ts +++ b/packages/google-cloud-retail/src/v2/product_service_client.ts @@ -225,6 +225,18 @@ export class ProductServiceClient { const removeFulfillmentPlacesMetadata = protoFilesRoot.lookup( '.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata' ) as gax.protobuf.Type; + const addLocalInventoriesResponse = protoFilesRoot.lookup( + '.google.cloud.retail.v2.AddLocalInventoriesResponse' + ) as gax.protobuf.Type; + const addLocalInventoriesMetadata = protoFilesRoot.lookup( + '.google.cloud.retail.v2.AddLocalInventoriesMetadata' + ) as gax.protobuf.Type; + const removeLocalInventoriesResponse = protoFilesRoot.lookup( + '.google.cloud.retail.v2.RemoveLocalInventoriesResponse' + ) as gax.protobuf.Type; + const removeLocalInventoriesMetadata = protoFilesRoot.lookup( + '.google.cloud.retail.v2.RemoveLocalInventoriesMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { importProducts: new this._gaxModule.LongrunningDescriptor( @@ -251,6 +263,20 @@ export class ProductServiceClient { removeFulfillmentPlacesMetadata ) ), + addLocalInventories: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + addLocalInventoriesResponse.decode.bind(addLocalInventoriesResponse), + addLocalInventoriesMetadata.decode.bind(addLocalInventoriesMetadata) + ), + removeLocalInventories: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + removeLocalInventoriesResponse.decode.bind( + removeLocalInventoriesResponse + ), + removeLocalInventoriesMetadata.decode.bind( + removeLocalInventoriesMetadata + ) + ), }; // Put together the default options sent with requests. @@ -312,6 +338,8 @@ export class ProductServiceClient { 'setInventory', 'addFulfillmentPlaces', 'removeFulfillmentPlaces', + 'addLocalInventories', + 'removeLocalInventories', ]; for (const methodName of productServiceStubMethods) { const callPromise = this.productServiceStub.then( @@ -823,15 +851,7 @@ export class ProductServiceClient { * If no updateMask is specified, requires products.create permission. * If updateMask is specified, requires products.update permission. * @param {string} request.requestId - * Unique identifier provided by client, within the ancestor - * dataset scope. Ensures idempotency and used for request deduplication. - * Server-generated if unspecified. Up to 128 characters long and must match - * the pattern: `{@link |a-zA-Z0-9_]+`. This is returned as [Operation.name} in - * {@link google.cloud.retail.v2.ImportMetadata|ImportMetadata}. - * - * Only supported when - * {@link google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode|ImportProductsRequest.reconciliation_mode} - * is set to `FULL`. + * Deprecated. This field has no effect. * @param {google.cloud.retail.v2.ProductInputConfig} request.inputConfig * Required. The desired input location of the data. * @param {google.cloud.retail.v2.ImportErrorsConfig} request.errorsConfig @@ -1012,7 +1032,8 @@ export class ProductServiceClient { * {@link google.cloud.retail.v2.CreateProductRequest.product|CreateProductRequest.product}, * then any pre-existing inventory information for this product will be used. * - * If no inventory fields are set in {@link |UpdateProductRequest.set_mask}, + * If no inventory fields are set in + * {@link google.cloud.retail.v2.SetInventoryRequest.set_mask|SetInventoryRequest.set_mask}, * then any existing inventory information will be preserved. * * Pre-existing inventory information can only be updated with @@ -1022,8 +1043,7 @@ export class ProductServiceClient { * {@link google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces|RemoveFulfillmentPlaces}. * * This feature is only available for users who have Retail Search enabled. - * Please submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * Please enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. @@ -1055,6 +1075,24 @@ export class ProductServiceClient { * provided or default value for * {@link google.cloud.retail.v2.SetInventoryRequest.set_time|SetInventoryRequest.set_time}. * + * The caller can replace place IDs for a subset of fulfillment types in the + * following ways: + * + * * Adds "fulfillment_info" in + * {@link google.cloud.retail.v2.SetInventoryRequest.set_mask|SetInventoryRequest.set_mask} + * * Specifies only the desired fulfillment types and corresponding place IDs + * to update in {@link |SetInventoryRequest.inventory.fulfillment_info} + * + * The caller can clear all place IDs from a subset of fulfillment types in + * the following ways: + * + * * Adds "fulfillment_info" in + * {@link google.cloud.retail.v2.SetInventoryRequest.set_mask|SetInventoryRequest.set_mask} + * * Specifies only the desired fulfillment types to clear in + * {@link |SetInventoryRequest.inventory.fulfillment_info} + * * Checks that only the desired fulfillment info types have empty + * {@link |SetInventoryRequest.inventory.fulfillment_info.place_ids} + * * The last update time is recorded for the following inventory fields: * * {@link google.cloud.retail.v2.Product.price_info|Product.price_info} * * {@link google.cloud.retail.v2.Product.availability|Product.availability} @@ -1065,8 +1103,9 @@ export class ProductServiceClient { * needed, {@link |UpdateProduct} should be invoked instead. * @param {google.protobuf.FieldMask} request.setMask * Indicates which inventory fields in the provided - * {@link google.cloud.retail.v2.Product|Product} to update. If not set or set with - * empty paths, all inventory fields will be updated. + * {@link google.cloud.retail.v2.Product|Product} to update. + * + * At least one field must be provided. * * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error * is returned and the entire update will be ignored. @@ -1225,8 +1264,7 @@ export class ProductServiceClient { * {@link google.cloud.retail.v2.ProductService.ListProducts|ListProducts}. * * This feature is only available for users who have Retail Search enabled. - * Please submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * Please enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. @@ -1429,8 +1467,7 @@ export class ProductServiceClient { * {@link google.cloud.retail.v2.ProductService.ListProducts|ListProducts}. * * This feature is only available for users who have Retail Search enabled. - * Please submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * Please enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. @@ -1618,6 +1655,376 @@ export class ProductServiceClient { protos.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata >; } + /** + * Updates local inventory information for a + * {@link google.cloud.retail.v2.Product|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 + * {@link google.cloud.retail.v2.Product|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 + * {@link google.cloud.retail.v2.Product|Product} queried by + * {@link google.cloud.retail.v2.ProductService.GetProduct|GetProduct} or + * {@link google.cloud.retail.v2.ProductService.ListProducts|ListProducts}. + * + * Local inventory information can only be modified using this method. + * {@link google.cloud.retail.v2.ProductService.CreateProduct|CreateProduct} and + * {@link google.cloud.retail.v2.ProductService.UpdateProduct|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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.product + * Required. Full resource name of {@link google.cloud.retail.v2.Product|Product}, + * such as + * `projects/* /locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * + * If the caller does not have permission to access the + * {@link google.cloud.retail.v2.Product|Product}, regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * @param {number[]} request.localInventories + * Required. A list of inventory information at difference places. Each place + * is identified by its place ID. At most 3000 inventories are allowed per + * request. + * @param {google.protobuf.FieldMask} request.addMask + * Indicates which inventory fields in the provided list of + * {@link google.cloud.retail.v2.LocalInventory|LocalInventory} to update. The + * field is updated to the provided value. + * + * If a field is set while the place does not have a previous local inventory, + * the local inventory at that store is created. + * + * If a field is set while the value of that field is not provided, the + * original field value, if it exists, is deleted. + * + * If the mask is not set or set with empty paths, all inventory fields will + * be updated. + * + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned and the entire update will be ignored. + * @param {google.protobuf.Timestamp} request.addTime + * The time when the inventory updates are issued. Used to prevent + * out-of-order updates on local inventory fields. If not provided, the + * internal system time will be used. + * @param {boolean} request.allowMissing + * If set to true, and the {@link google.cloud.retail.v2.Product|Product} is not + * found, the local inventory will still be processed and retained for at most + * 1 day and processed once the {@link google.cloud.retail.v2.Product|Product} is + * created. If set to false, a NOT_FOUND error is returned if the + * {@link google.cloud.retail.v2.Product|Product} is not found. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2/product_service.add_local_inventories.js + * region_tag:retail_v2_generated_ProductService_AddLocalInventories_async + */ + addLocalInventories( + request?: protos.google.cloud.retail.v2.IAddLocalInventoriesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.retail.v2.IAddLocalInventoriesResponse, + protos.google.cloud.retail.v2.IAddLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + addLocalInventories( + request: protos.google.cloud.retail.v2.IAddLocalInventoriesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.retail.v2.IAddLocalInventoriesResponse, + protos.google.cloud.retail.v2.IAddLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + addLocalInventories( + request: protos.google.cloud.retail.v2.IAddLocalInventoriesRequest, + callback: Callback< + LROperation< + protos.google.cloud.retail.v2.IAddLocalInventoriesResponse, + protos.google.cloud.retail.v2.IAddLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + addLocalInventories( + request?: protos.google.cloud.retail.v2.IAddLocalInventoriesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.retail.v2.IAddLocalInventoriesResponse, + protos.google.cloud.retail.v2.IAddLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.retail.v2.IAddLocalInventoriesResponse, + protos.google.cloud.retail.v2.IAddLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.retail.v2.IAddLocalInventoriesResponse, + protos.google.cloud.retail.v2.IAddLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | 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'] = + gax.routingHeader.fromParams({ + product: request.product || '', + }); + this.initialize(); + return this.innerApiCalls.addLocalInventories(request, options, callback); + } + /** + * Check the status of the long running operation returned by `addLocalInventories()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2/product_service.add_local_inventories.js + * region_tag:retail_v2_generated_ProductService_AddLocalInventories_async + */ + async checkAddLocalInventoriesProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.retail.v2.AddLocalInventoriesResponse, + protos.google.cloud.retail.v2.AddLocalInventoriesMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.addLocalInventories, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.retail.v2.AddLocalInventoriesResponse, + protos.google.cloud.retail.v2.AddLocalInventoriesMetadata + >; + } + /** + * Remove local inventory information for a + * {@link google.cloud.retail.v2.Product|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 + * {@link google.cloud.retail.v2.Product|Product} queried by + * {@link google.cloud.retail.v2.ProductService.GetProduct|GetProduct} or + * {@link google.cloud.retail.v2.ProductService.ListProducts|ListProducts}. + * + * Local inventory information can only be removed using this method. + * {@link google.cloud.retail.v2.ProductService.CreateProduct|CreateProduct} and + * {@link google.cloud.retail.v2.ProductService.UpdateProduct|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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.product + * Required. Full resource name of {@link google.cloud.retail.v2.Product|Product}, + * such as + * `projects/* /locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * + * If the caller does not have permission to access the + * {@link google.cloud.retail.v2.Product|Product}, regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + * @param {string[]} request.placeIds + * Required. A list of place IDs to have their inventory deleted. + * At most 3000 place IDs are allowed per request. + * @param {google.protobuf.Timestamp} request.removeTime + * The time when the inventory deletions are issued. Used to prevent + * out-of-order updates and deletions on local inventory fields. If not + * provided, the internal system time will be used. + * @param {boolean} request.allowMissing + * If set to true, and the {@link google.cloud.retail.v2.Product|Product} is not + * found, the local inventory removal request will still be processed and + * retained for at most 1 day and processed once the + * {@link google.cloud.retail.v2.Product|Product} is created. If set to false, a + * NOT_FOUND error is returned if the + * {@link google.cloud.retail.v2.Product|Product} is not found. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2/product_service.remove_local_inventories.js + * region_tag:retail_v2_generated_ProductService_RemoveLocalInventories_async + */ + removeLocalInventories( + request?: protos.google.cloud.retail.v2.IRemoveLocalInventoriesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.retail.v2.IRemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2.IRemoveLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + removeLocalInventories( + request: protos.google.cloud.retail.v2.IRemoveLocalInventoriesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.retail.v2.IRemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2.IRemoveLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + removeLocalInventories( + request: protos.google.cloud.retail.v2.IRemoveLocalInventoriesRequest, + callback: Callback< + LROperation< + protos.google.cloud.retail.v2.IRemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2.IRemoveLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + removeLocalInventories( + request?: protos.google.cloud.retail.v2.IRemoveLocalInventoriesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.retail.v2.IRemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2.IRemoveLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.retail.v2.IRemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2.IRemoveLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.retail.v2.IRemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2.IRemoveLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | 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'] = + gax.routingHeader.fromParams({ + product: request.product || '', + }); + this.initialize(); + return this.innerApiCalls.removeLocalInventories( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `removeLocalInventories()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2/product_service.remove_local_inventories.js + * region_tag:retail_v2_generated_ProductService_RemoveLocalInventories_async + */ + async checkRemoveLocalInventoriesProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.retail.v2.RemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2.RemoveLocalInventoriesMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.removeLocalInventories, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.retail.v2.RemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2.RemoveLocalInventoriesMetadata + >; + } /** * Gets a list of {@link google.cloud.retail.v2.Product|Product}s. * diff --git a/packages/google-cloud-retail/src/v2/product_service_client_config.json b/packages/google-cloud-retail/src/v2/product_service_client_config.json index 40550466926..32245ac6134 100644 --- a/packages/google-cloud-retail/src/v2/product_service_client_config.json +++ b/packages/google-cloud-retail/src/v2/product_service_client_config.json @@ -82,6 +82,16 @@ "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "AddLocalInventories": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "RemoveLocalInventories": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" } } } diff --git a/packages/google-cloud-retail/src/v2/product_service_proto_list.json b/packages/google-cloud-retail/src/v2/product_service_proto_list.json index 4db248503a9..dd7dfb7a71b 100644 --- a/packages/google-cloud-retail/src/v2/product_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2/product_service_proto_list.json @@ -7,6 +7,7 @@ "../../protos/google/cloud/retail/v2/prediction_service.proto", "../../protos/google/cloud/retail/v2/product.proto", "../../protos/google/cloud/retail/v2/product_service.proto", + "../../protos/google/cloud/retail/v2/promotion.proto", "../../protos/google/cloud/retail/v2/purge_config.proto", "../../protos/google/cloud/retail/v2/search_service.proto", "../../protos/google/cloud/retail/v2/user_event.proto", 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 e676995b5bc..cf269f4497d 100644 --- a/packages/google-cloud-retail/src/v2/search_service_client.ts +++ b/packages/google-cloud-retail/src/v2/search_service_client.ts @@ -44,8 +44,7 @@ const version = require('../../../package.json').version; * Service for search. * * This feature is only available for users who have Retail Search enabled. - * Please submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * Please enable Retail Search on Cloud Console before using this feature. * @class * @memberof v2 */ @@ -326,14 +325,13 @@ export class SearchServiceClient { * Performs a search. * * This feature is only available for users who have Retail Search enabled. - * Please submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * Please enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. * @param {string} request.placement * Required. The resource name of the search engine placement, such as - * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. + * `projects/* /locations/global/catalogs/default_catalog/placements/default_search` * This field is used to identify the serving configuration name and the set * of models that will be used to make the search. * @param {string} request.branch @@ -350,6 +348,9 @@ export class SearchServiceClient { * identify a visitor on a single device. This unique identifier should not * change if the visitor logs in or out of the website. * + * This should be the same identifier as + * {@link google.cloud.retail.v2.UserEvent.visitor_id|UserEvent.visitor_id}. + * * The field must be a UTF-8 encoded string with a length limit of 128 * characters. Otherwise, an INVALID_ARGUMENT error is returned. * @param {google.cloud.retail.v2.UserInfo} request.userInfo @@ -387,6 +388,9 @@ export class SearchServiceClient { * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {string} request.canonicalFilter + * The default filter that is applied when a user performs a search without + * checking any filters on the search page. + * * The filter applied to every search request when quality improvement such as * query expansion is needed. For example, if a query does not have enough * results, an expanded query with @@ -410,11 +414,11 @@ export class SearchServiceClient { * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error * is returned. * @param {google.cloud.retail.v2.SearchRequest.DynamicFacetSpec} request.dynamicFacetSpec + * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic + * to enable dynamic facets. Do not set this field. + * * The specification for dynamically generated facets. Notice that only * textual facets can be dynamically generated. - * - * This feature requires additional allowlisting. Contact Retail Search - * support team if you are interested in using dynamic facet feature. * @param {google.cloud.retail.v2.SearchRequest.BoostSpec} request.boostSpec * Boost specification to boost certain products. See more details at this * [user guide](https://cloud.google.com/retail/docs/boosting). @@ -431,12 +435,15 @@ export class SearchServiceClient { * @param {string[]} request.variantRollupKeys * The keys to fetch and rollup the matching * {@link google.cloud.retail.v2.Product.Type.VARIANT|variant} - * {@link google.cloud.retail.v2.Product|Product}s attributes. The attributes from - * all the matching {@link google.cloud.retail.v2.Product.Type.VARIANT|variant} - * {@link google.cloud.retail.v2.Product|Product}s are merged and de-duplicated. - * Notice that rollup {@link google.cloud.retail.v2.Product.Type.VARIANT|variant} - * {@link google.cloud.retail.v2.Product|Product}s attributes will lead to extra - * query latency. Maximum number of keys is 10. + * {@link google.cloud.retail.v2.Product|Product}s attributes, + * {@link google.cloud.retail.v2.FulfillmentInfo|FulfillmentInfo} or + * {@link google.cloud.retail.v2.LocalInventory|LocalInventory}s attributes. The + * attributes from all the matching + * {@link google.cloud.retail.v2.Product.Type.VARIANT|variant} + * {@link google.cloud.retail.v2.Product|Product}s or + * {@link google.cloud.retail.v2.LocalInventory|LocalInventory}s are merged and + * de-duplicated. Notice that rollup attributes will lead to extra query + * latency. Maximum number of keys is 30. * * For {@link google.cloud.retail.v2.FulfillmentInfo|FulfillmentInfo}, a * fulfillment type and a fulfillment ID must be provided in the format of @@ -451,6 +458,7 @@ export class SearchServiceClient { * * discount * * variantId * * inventory(place_id,price) + * * inventory(place_id,original_price) * * inventory(place_id,attributes.key), where key is any key in the * {@link |Product.inventories.attributes} map. * * attributes.key, where key is any key in the @@ -510,6 +518,8 @@ export class SearchServiceClient { * @param {google.cloud.retail.v2.SearchRequest.SearchMode} request.searchMode * The search mode of the search request. If not specified, a single search * request triggers both product search and faceted search. + * @param {google.cloud.retail.v2.SearchRequest.PersonalizationSpec} request.personalizationSpec + * The specification for personalization. * @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. @@ -596,7 +606,7 @@ export class SearchServiceClient { * The request object that will be sent. * @param {string} request.placement * Required. The resource name of the search engine placement, such as - * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. + * `projects/* /locations/global/catalogs/default_catalog/placements/default_search` * This field is used to identify the serving configuration name and the set * of models that will be used to make the search. * @param {string} request.branch @@ -613,6 +623,9 @@ export class SearchServiceClient { * identify a visitor on a single device. This unique identifier should not * change if the visitor logs in or out of the website. * + * This should be the same identifier as + * {@link google.cloud.retail.v2.UserEvent.visitor_id|UserEvent.visitor_id}. + * * The field must be a UTF-8 encoded string with a length limit of 128 * characters. Otherwise, an INVALID_ARGUMENT error is returned. * @param {google.cloud.retail.v2.UserInfo} request.userInfo @@ -650,6 +663,9 @@ export class SearchServiceClient { * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {string} request.canonicalFilter + * The default filter that is applied when a user performs a search without + * checking any filters on the search page. + * * The filter applied to every search request when quality improvement such as * query expansion is needed. For example, if a query does not have enough * results, an expanded query with @@ -673,11 +689,11 @@ export class SearchServiceClient { * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error * is returned. * @param {google.cloud.retail.v2.SearchRequest.DynamicFacetSpec} request.dynamicFacetSpec + * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic + * to enable dynamic facets. Do not set this field. + * * The specification for dynamically generated facets. Notice that only * textual facets can be dynamically generated. - * - * This feature requires additional allowlisting. Contact Retail Search - * support team if you are interested in using dynamic facet feature. * @param {google.cloud.retail.v2.SearchRequest.BoostSpec} request.boostSpec * Boost specification to boost certain products. See more details at this * [user guide](https://cloud.google.com/retail/docs/boosting). @@ -694,12 +710,15 @@ export class SearchServiceClient { * @param {string[]} request.variantRollupKeys * The keys to fetch and rollup the matching * {@link google.cloud.retail.v2.Product.Type.VARIANT|variant} - * {@link google.cloud.retail.v2.Product|Product}s attributes. The attributes from - * all the matching {@link google.cloud.retail.v2.Product.Type.VARIANT|variant} - * {@link google.cloud.retail.v2.Product|Product}s are merged and de-duplicated. - * Notice that rollup {@link google.cloud.retail.v2.Product.Type.VARIANT|variant} - * {@link google.cloud.retail.v2.Product|Product}s attributes will lead to extra - * query latency. Maximum number of keys is 10. + * {@link google.cloud.retail.v2.Product|Product}s attributes, + * {@link google.cloud.retail.v2.FulfillmentInfo|FulfillmentInfo} or + * {@link google.cloud.retail.v2.LocalInventory|LocalInventory}s attributes. The + * attributes from all the matching + * {@link google.cloud.retail.v2.Product.Type.VARIANT|variant} + * {@link google.cloud.retail.v2.Product|Product}s or + * {@link google.cloud.retail.v2.LocalInventory|LocalInventory}s are merged and + * de-duplicated. Notice that rollup attributes will lead to extra query + * latency. Maximum number of keys is 30. * * For {@link google.cloud.retail.v2.FulfillmentInfo|FulfillmentInfo}, a * fulfillment type and a fulfillment ID must be provided in the format of @@ -714,6 +733,7 @@ export class SearchServiceClient { * * discount * * variantId * * inventory(place_id,price) + * * inventory(place_id,original_price) * * inventory(place_id,attributes.key), where key is any key in the * {@link |Product.inventories.attributes} map. * * attributes.key, where key is any key in the @@ -773,6 +793,8 @@ export class SearchServiceClient { * @param {google.cloud.retail.v2.SearchRequest.SearchMode} request.searchMode * The search mode of the search request. If not specified, a single search * request triggers both product search and faceted search. + * @param {google.cloud.retail.v2.SearchRequest.PersonalizationSpec} request.personalizationSpec + * The specification for personalization. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -815,7 +837,7 @@ export class SearchServiceClient { * The request object that will be sent. * @param {string} request.placement * Required. The resource name of the search engine placement, such as - * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. + * `projects/* /locations/global/catalogs/default_catalog/placements/default_search` * This field is used to identify the serving configuration name and the set * of models that will be used to make the search. * @param {string} request.branch @@ -832,6 +854,9 @@ export class SearchServiceClient { * identify a visitor on a single device. This unique identifier should not * change if the visitor logs in or out of the website. * + * This should be the same identifier as + * {@link google.cloud.retail.v2.UserEvent.visitor_id|UserEvent.visitor_id}. + * * The field must be a UTF-8 encoded string with a length limit of 128 * characters. Otherwise, an INVALID_ARGUMENT error is returned. * @param {google.cloud.retail.v2.UserInfo} request.userInfo @@ -869,6 +894,9 @@ export class SearchServiceClient { * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {string} request.canonicalFilter + * The default filter that is applied when a user performs a search without + * checking any filters on the search page. + * * The filter applied to every search request when quality improvement such as * query expansion is needed. For example, if a query does not have enough * results, an expanded query with @@ -892,11 +920,11 @@ export class SearchServiceClient { * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error * is returned. * @param {google.cloud.retail.v2.SearchRequest.DynamicFacetSpec} request.dynamicFacetSpec + * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic + * to enable dynamic facets. Do not set this field. + * * The specification for dynamically generated facets. Notice that only * textual facets can be dynamically generated. - * - * This feature requires additional allowlisting. Contact Retail Search - * support team if you are interested in using dynamic facet feature. * @param {google.cloud.retail.v2.SearchRequest.BoostSpec} request.boostSpec * Boost specification to boost certain products. See more details at this * [user guide](https://cloud.google.com/retail/docs/boosting). @@ -913,12 +941,15 @@ export class SearchServiceClient { * @param {string[]} request.variantRollupKeys * The keys to fetch and rollup the matching * {@link google.cloud.retail.v2.Product.Type.VARIANT|variant} - * {@link google.cloud.retail.v2.Product|Product}s attributes. The attributes from - * all the matching {@link google.cloud.retail.v2.Product.Type.VARIANT|variant} - * {@link google.cloud.retail.v2.Product|Product}s are merged and de-duplicated. - * Notice that rollup {@link google.cloud.retail.v2.Product.Type.VARIANT|variant} - * {@link google.cloud.retail.v2.Product|Product}s attributes will lead to extra - * query latency. Maximum number of keys is 10. + * {@link google.cloud.retail.v2.Product|Product}s attributes, + * {@link google.cloud.retail.v2.FulfillmentInfo|FulfillmentInfo} or + * {@link google.cloud.retail.v2.LocalInventory|LocalInventory}s attributes. The + * attributes from all the matching + * {@link google.cloud.retail.v2.Product.Type.VARIANT|variant} + * {@link google.cloud.retail.v2.Product|Product}s or + * {@link google.cloud.retail.v2.LocalInventory|LocalInventory}s are merged and + * de-duplicated. Notice that rollup attributes will lead to extra query + * latency. Maximum number of keys is 30. * * For {@link google.cloud.retail.v2.FulfillmentInfo|FulfillmentInfo}, a * fulfillment type and a fulfillment ID must be provided in the format of @@ -933,6 +964,7 @@ export class SearchServiceClient { * * discount * * variantId * * inventory(place_id,price) + * * inventory(place_id,original_price) * * inventory(place_id,attributes.key), where key is any key in the * {@link |Product.inventories.attributes} map. * * attributes.key, where key is any key in the @@ -992,6 +1024,8 @@ export class SearchServiceClient { * @param {google.cloud.retail.v2.SearchRequest.SearchMode} request.searchMode * The search mode of the search request. If not specified, a single search * request triggers both product search and faceted search. + * @param {google.cloud.retail.v2.SearchRequest.PersonalizationSpec} request.personalizationSpec + * The specification for personalization. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} diff --git a/packages/google-cloud-retail/src/v2/search_service_proto_list.json b/packages/google-cloud-retail/src/v2/search_service_proto_list.json index 4db248503a9..dd7dfb7a71b 100644 --- a/packages/google-cloud-retail/src/v2/search_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2/search_service_proto_list.json @@ -7,6 +7,7 @@ "../../protos/google/cloud/retail/v2/prediction_service.proto", "../../protos/google/cloud/retail/v2/product.proto", "../../protos/google/cloud/retail/v2/product_service.proto", + "../../protos/google/cloud/retail/v2/promotion.proto", "../../protos/google/cloud/retail/v2/purge_config.proto", "../../protos/google/cloud/retail/v2/search_service.proto", "../../protos/google/cloud/retail/v2/user_event.proto", 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 cb78d27b192..4853609b4b1 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 @@ -866,13 +866,14 @@ export class UserEventServiceClient { >; } /** - * Triggers a user event rejoin operation with latest product catalog. Events + * 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 API can be used to trigger a 'join' operation on specified + * 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 wrong product catalog. + * 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. diff --git a/packages/google-cloud-retail/src/v2/user_event_service_proto_list.json b/packages/google-cloud-retail/src/v2/user_event_service_proto_list.json index 4db248503a9..dd7dfb7a71b 100644 --- a/packages/google-cloud-retail/src/v2/user_event_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2/user_event_service_proto_list.json @@ -7,6 +7,7 @@ "../../protos/google/cloud/retail/v2/prediction_service.proto", "../../protos/google/cloud/retail/v2/product.proto", "../../protos/google/cloud/retail/v2/product_service.proto", + "../../protos/google/cloud/retail/v2/promotion.proto", "../../protos/google/cloud/retail/v2/purge_config.proto", "../../protos/google/cloud/retail/v2/search_service.proto", "../../protos/google/cloud/retail/v2/user_event.proto", 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 5c244a23ca2..d723d5c0e49 100644 --- a/packages/google-cloud-retail/src/v2beta/catalog_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/catalog_service_client.ts @@ -164,18 +164,30 @@ export class CatalogServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + attributesConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' + ), branchPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}' ), catalogPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}' ), + completionConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig' + ), + controlPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' + ), locationPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}' ), productPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' ), + servingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' + ), }; // Some of the methods on this service return "paged" results, @@ -243,6 +255,13 @@ export class CatalogServiceClient { 'updateCatalog', 'setDefaultBranch', 'getDefaultBranch', + 'getCompletionConfig', + 'updateCompletionConfig', + 'getAttributesConfig', + 'updateAttributesConfig', + 'addCatalogAttribute', + 'removeCatalogAttribute', + 'replaceCatalogAttribute', ]; for (const methodName of catalogServiceStubMethods) { const callPromise = this.catalogServiceStub.then( @@ -464,90 +483,817 @@ export class CatalogServiceClient { * * UserEventService will only join events with products from branch * {newBranch}. * - * This feature is only available for users who have Retail Search enabled. - * Please submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.catalog + * Full resource name of the catalog, such as + * `projects/* /locations/global/catalogs/default_catalog`. + * @param {string} request.branchId + * The final component of the resource name of a branch. + * + * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT + * error is returned. + * + * If there are no sufficient active products in the targeted branch and + * {@link google.cloud.retail.v2beta.SetDefaultBranchRequest.force|force} is not + * set, a FAILED_PRECONDITION error is returned. + * @param {string} request.note + * Some note on this request, this can be retrieved by + * {@link google.cloud.retail.v2beta.CatalogService.GetDefaultBranch|CatalogService.GetDefaultBranch} + * before next valid default branch set occurs. + * + * This field must be a UTF-8 encoded string with a length limit of 1,000 + * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * @param {boolean} request.force + * If set to true, it permits switching to a branch with + * {@link google.cloud.retail.v2beta.SetDefaultBranchRequest.branch_id|branch_id} + * even if it has no sufficient active products. + * @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 [Empty]{@link google.protobuf.Empty}. + * 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/v2beta/catalog_service.set_default_branch.js + * region_tag:retail_v2beta_generated_CatalogService_SetDefaultBranch_async + */ + setDefaultBranch( + request?: protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest | undefined, + {} | undefined + ] + >; + setDefaultBranch( + request: protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setDefaultBranch( + request: protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setDefaultBranch( + request?: protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest | 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'] = + gax.routingHeader.fromParams({ + catalog: request.catalog || '', + }); + this.initialize(); + return this.innerApiCalls.setDefaultBranch(request, options, callback); + } + /** + * Get which branch is currently default branch set by + * {@link google.cloud.retail.v2beta.CatalogService.SetDefaultBranch|CatalogService.SetDefaultBranch} + * method under a specified parent catalog. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.catalog + * The parent catalog resource name, such as + * `projects/* /locations/global/catalogs/default_catalog`. + * @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 [GetDefaultBranchResponse]{@link google.cloud.retail.v2beta.GetDefaultBranchResponse}. + * 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/v2beta/catalog_service.get_default_branch.js + * region_tag:retail_v2beta_generated_CatalogService_GetDefaultBranch_async + */ + getDefaultBranch( + request?: protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2beta.IGetDefaultBranchResponse, + protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest | undefined, + {} | undefined + ] + >; + getDefaultBranch( + request: protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2beta.IGetDefaultBranchResponse, + | protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDefaultBranch( + request: protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest, + callback: Callback< + protos.google.cloud.retail.v2beta.IGetDefaultBranchResponse, + | protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDefaultBranch( + request?: protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2beta.IGetDefaultBranchResponse, + | protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2beta.IGetDefaultBranchResponse, + | protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2beta.IGetDefaultBranchResponse, + protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest | 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'] = + gax.routingHeader.fromParams({ + catalog: request.catalog || '', + }); + this.initialize(); + return this.innerApiCalls.getDefaultBranch(request, options, callback); + } + /** + * Gets a {@link google.cloud.retail.v2beta.CompletionConfig|CompletionConfig}. + * + * @param {Object} request + * 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 + * @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 [CompletionConfig]{@link google.cloud.retail.v2beta.CompletionConfig}. + * 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/v2beta/catalog_service.get_completion_config.js + * region_tag:retail_v2beta_generated_CatalogService_GetCompletionConfig_async + */ + getCompletionConfig( + request?: protos.google.cloud.retail.v2beta.IGetCompletionConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2beta.ICompletionConfig, + protos.google.cloud.retail.v2beta.IGetCompletionConfigRequest | undefined, + {} | undefined + ] + >; + getCompletionConfig( + request: protos.google.cloud.retail.v2beta.IGetCompletionConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2beta.ICompletionConfig, + | protos.google.cloud.retail.v2beta.IGetCompletionConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCompletionConfig( + request: protos.google.cloud.retail.v2beta.IGetCompletionConfigRequest, + callback: Callback< + protos.google.cloud.retail.v2beta.ICompletionConfig, + | protos.google.cloud.retail.v2beta.IGetCompletionConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCompletionConfig( + request?: protos.google.cloud.retail.v2beta.IGetCompletionConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2beta.ICompletionConfig, + | protos.google.cloud.retail.v2beta.IGetCompletionConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2beta.ICompletionConfig, + | protos.google.cloud.retail.v2beta.IGetCompletionConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2beta.ICompletionConfig, + protos.google.cloud.retail.v2beta.IGetCompletionConfigRequest | 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'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getCompletionConfig(request, options, callback); + } + /** + * Updates the + * {@link google.cloud.retail.v2beta.CompletionConfig|CompletionConfig}s. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.retail.v2beta.CompletionConfig} request.completionConfig + * Required. The + * {@link google.cloud.retail.v2beta.CompletionConfig|CompletionConfig} to update. + * + * If the caller does not have permission to update the + * {@link google.cloud.retail.v2beta.CompletionConfig|CompletionConfig}, then a + * PERMISSION_DENIED error is returned. + * + * If the {@link google.cloud.retail.v2beta.CompletionConfig|CompletionConfig} to + * update does not exist, a NOT_FOUND error is returned. + * @param {google.protobuf.FieldMask} request.updateMask + * Indicates which fields in the provided + * {@link google.cloud.retail.v2beta.CompletionConfig|CompletionConfig} to update. + * The following are the only supported fields: + * + * * {@link google.cloud.retail.v2beta.CompletionConfig.matching_order|CompletionConfig.matching_order} + * * {@link google.cloud.retail.v2beta.CompletionConfig.max_suggestions|CompletionConfig.max_suggestions} + * * {@link google.cloud.retail.v2beta.CompletionConfig.min_prefix_length|CompletionConfig.min_prefix_length} + * * {@link google.cloud.retail.v2beta.CompletionConfig.auto_learning|CompletionConfig.auto_learning} + * + * If not set, all supported fields are updated. + * @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 [CompletionConfig]{@link google.cloud.retail.v2beta.CompletionConfig}. + * 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/v2beta/catalog_service.update_completion_config.js + * region_tag:retail_v2beta_generated_CatalogService_UpdateCompletionConfig_async + */ + updateCompletionConfig( + request?: protos.google.cloud.retail.v2beta.IUpdateCompletionConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2beta.ICompletionConfig, + ( + | protos.google.cloud.retail.v2beta.IUpdateCompletionConfigRequest + | undefined + ), + {} | undefined + ] + >; + updateCompletionConfig( + request: protos.google.cloud.retail.v2beta.IUpdateCompletionConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2beta.ICompletionConfig, + | protos.google.cloud.retail.v2beta.IUpdateCompletionConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCompletionConfig( + request: protos.google.cloud.retail.v2beta.IUpdateCompletionConfigRequest, + callback: Callback< + protos.google.cloud.retail.v2beta.ICompletionConfig, + | protos.google.cloud.retail.v2beta.IUpdateCompletionConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCompletionConfig( + request?: protos.google.cloud.retail.v2beta.IUpdateCompletionConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2beta.ICompletionConfig, + | protos.google.cloud.retail.v2beta.IUpdateCompletionConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2beta.ICompletionConfig, + | protos.google.cloud.retail.v2beta.IUpdateCompletionConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2beta.ICompletionConfig, + ( + | protos.google.cloud.retail.v2beta.IUpdateCompletionConfigRequest + | 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'] = + gax.routingHeader.fromParams({ + 'completion_config.name': request.completionConfig!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateCompletionConfig( + request, + options, + callback + ); + } + /** + * Gets an {@link google.cloud.retail.v2beta.AttributesConfig|AttributesConfig}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Full AttributesConfig resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig + * @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 [AttributesConfig]{@link google.cloud.retail.v2beta.AttributesConfig}. + * 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/v2beta/catalog_service.get_attributes_config.js + * region_tag:retail_v2beta_generated_CatalogService_GetAttributesConfig_async + */ + getAttributesConfig( + request?: protos.google.cloud.retail.v2beta.IGetAttributesConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2beta.IAttributesConfig, + protos.google.cloud.retail.v2beta.IGetAttributesConfigRequest | undefined, + {} | undefined + ] + >; + getAttributesConfig( + request: protos.google.cloud.retail.v2beta.IGetAttributesConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IGetAttributesConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAttributesConfig( + request: protos.google.cloud.retail.v2beta.IGetAttributesConfigRequest, + callback: Callback< + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IGetAttributesConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAttributesConfig( + request?: protos.google.cloud.retail.v2beta.IGetAttributesConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IGetAttributesConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IGetAttributesConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2beta.IAttributesConfig, + protos.google.cloud.retail.v2beta.IGetAttributesConfigRequest | 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'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getAttributesConfig(request, options, callback); + } + /** + * Updates the + * {@link google.cloud.retail.v2beta.AttributesConfig|AttributesConfig}. + * + * The catalog attributes in the request will be updated in the catalog, or + * inserted if they do not exist. Existing catalog attributes not included in + * the request will remain unchanged. Attributes that are assigned to + * products, but do not exist at the catalog level, are always included in the + * response. The product attribute is assigned default values for missing + * catalog attribute fields, e.g., searchable and dynamic facetable options. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.retail.v2beta.AttributesConfig} request.attributesConfig + * Required. The + * {@link google.cloud.retail.v2beta.AttributesConfig|AttributesConfig} to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Indicates which fields in the provided + * {@link google.cloud.retail.v2beta.AttributesConfig|AttributesConfig} to update. + * The following is the only supported field: + * + * * {@link google.cloud.retail.v2beta.AttributesConfig.catalog_attributes|AttributesConfig.catalog_attributes} + * + * If not set, all supported fields are updated. + * @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 [AttributesConfig]{@link google.cloud.retail.v2beta.AttributesConfig}. + * 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/v2beta/catalog_service.update_attributes_config.js + * region_tag:retail_v2beta_generated_CatalogService_UpdateAttributesConfig_async + */ + updateAttributesConfig( + request?: protos.google.cloud.retail.v2beta.IUpdateAttributesConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2beta.IAttributesConfig, + ( + | protos.google.cloud.retail.v2beta.IUpdateAttributesConfigRequest + | undefined + ), + {} | undefined + ] + >; + updateAttributesConfig( + request: protos.google.cloud.retail.v2beta.IUpdateAttributesConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IUpdateAttributesConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAttributesConfig( + request: protos.google.cloud.retail.v2beta.IUpdateAttributesConfigRequest, + callback: Callback< + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IUpdateAttributesConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAttributesConfig( + request?: protos.google.cloud.retail.v2beta.IUpdateAttributesConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IUpdateAttributesConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IUpdateAttributesConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2beta.IAttributesConfig, + ( + | protos.google.cloud.retail.v2beta.IUpdateAttributesConfigRequest + | 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'] = + gax.routingHeader.fromParams({ + 'attributes_config.name': request.attributesConfig!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateAttributesConfig( + request, + options, + callback + ); + } + /** + * Adds the specified + * {@link google.cloud.retail.v2beta.CatalogAttribute|CatalogAttribute} to the + * {@link google.cloud.retail.v2beta.AttributesConfig|AttributesConfig}. + * + * If the {@link google.cloud.retail.v2beta.CatalogAttribute|CatalogAttribute} to + * add already exists, an ALREADY_EXISTS error is returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.attributesConfig + * Required. Full AttributesConfig resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig + * @param {google.cloud.retail.v2beta.CatalogAttribute} request.catalogAttribute + * Required. The + * {@link google.cloud.retail.v2beta.CatalogAttribute|CatalogAttribute} to add. + * @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 [AttributesConfig]{@link google.cloud.retail.v2beta.AttributesConfig}. + * 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/v2beta/catalog_service.add_catalog_attribute.js + * region_tag:retail_v2beta_generated_CatalogService_AddCatalogAttribute_async + */ + addCatalogAttribute( + request?: protos.google.cloud.retail.v2beta.IAddCatalogAttributeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2beta.IAttributesConfig, + protos.google.cloud.retail.v2beta.IAddCatalogAttributeRequest | undefined, + {} | undefined + ] + >; + addCatalogAttribute( + request: protos.google.cloud.retail.v2beta.IAddCatalogAttributeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IAddCatalogAttributeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addCatalogAttribute( + request: protos.google.cloud.retail.v2beta.IAddCatalogAttributeRequest, + callback: Callback< + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IAddCatalogAttributeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addCatalogAttribute( + request?: protos.google.cloud.retail.v2beta.IAddCatalogAttributeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IAddCatalogAttributeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IAddCatalogAttributeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2beta.IAttributesConfig, + protos.google.cloud.retail.v2beta.IAddCatalogAttributeRequest | 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'] = + gax.routingHeader.fromParams({ + attributes_config: request.attributesConfig || '', + }); + this.initialize(); + return this.innerApiCalls.addCatalogAttribute(request, options, callback); + } + /** + * Removes the specified + * {@link google.cloud.retail.v2beta.CatalogAttribute|CatalogAttribute} from the + * {@link google.cloud.retail.v2beta.AttributesConfig|AttributesConfig}. + * + * If the {@link google.cloud.retail.v2beta.CatalogAttribute|CatalogAttribute} to + * remove does not exist, a NOT_FOUND error is returned. * * @param {Object} request * The request object that will be sent. - * @param {string} request.catalog - * Full resource name of the catalog, such as - * `projects/* /locations/global/catalogs/default_catalog`. - * @param {string} request.branchId - * The final component of the resource name of a branch. - * - * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT - * error is returned. - * @param {string} request.note - * Some note on this request, this can be retrieved by - * {@link google.cloud.retail.v2beta.CatalogService.GetDefaultBranch|CatalogService.GetDefaultBranch} - * before next valid default branch set occurs. - * - * This field must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * @param {string} request.attributesConfig + * Required. Full AttributesConfig resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig + * @param {string} request.key + * Required. The attribute name key of the + * {@link google.cloud.retail.v2beta.CatalogAttribute|CatalogAttribute} to remove. * @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 [Empty]{@link google.protobuf.Empty}. + * The first element of the array is an object representing [AttributesConfig]{@link google.cloud.retail.v2beta.AttributesConfig}. * 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/v2beta/catalog_service.set_default_branch.js - * region_tag:retail_v2beta_generated_CatalogService_SetDefaultBranch_async + * @example include:samples/generated/v2beta/catalog_service.remove_catalog_attribute.js + * region_tag:retail_v2beta_generated_CatalogService_RemoveCatalogAttribute_async */ - setDefaultBranch( - request?: protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest, + removeCatalogAttribute( + request?: protos.google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest, options?: CallOptions ): Promise< [ - protos.google.protobuf.IEmpty, - protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest | undefined, + protos.google.cloud.retail.v2beta.IAttributesConfig, + ( + | protos.google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest + | undefined + ), {} | undefined ] >; - setDefaultBranch( - request: protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest, + removeCatalogAttribute( + request: protos.google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest, options: CallOptions, callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest | null | undefined, {} | null | undefined > ): void; - setDefaultBranch( - request: protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest, + removeCatalogAttribute( + request: protos.google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest, callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest | null | undefined, {} | null | undefined > ): void; - setDefaultBranch( - request?: protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest, + removeCatalogAttribute( + request?: protos.google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.protobuf.IEmpty, - protos.google.cloud.retail.v2beta.ISetDefaultBranchRequest | undefined, + protos.google.cloud.retail.v2beta.IAttributesConfig, + ( + | protos.google.cloud.retail.v2beta.IRemoveCatalogAttributeRequest + | undefined + ), {} | undefined ] > | void { @@ -564,88 +1310,110 @@ export class CatalogServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ - catalog: request.catalog || '', + attributes_config: request.attributesConfig || '', }); this.initialize(); - return this.innerApiCalls.setDefaultBranch(request, options, callback); + return this.innerApiCalls.removeCatalogAttribute( + request, + options, + callback + ); } /** - * Get which branch is currently default branch set by - * {@link google.cloud.retail.v2beta.CatalogService.SetDefaultBranch|CatalogService.SetDefaultBranch} - * method under a specified parent catalog. + * Replaces the specified + * {@link google.cloud.retail.v2beta.CatalogAttribute|CatalogAttribute} in the + * {@link google.cloud.retail.v2beta.AttributesConfig|AttributesConfig} by updating + * the catalog attribute with the same + * {@link google.cloud.retail.v2beta.CatalogAttribute.key|CatalogAttribute.key}. * - * This feature is only available for users who have Retail Search enabled. - * Please submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * If the {@link google.cloud.retail.v2beta.CatalogAttribute|CatalogAttribute} to + * replace does not exist, a NOT_FOUND error is returned. * * @param {Object} request * The request object that will be sent. - * @param {string} request.catalog - * The parent catalog resource name, such as - * `projects/* /locations/global/catalogs/default_catalog`. + * @param {string} request.attributesConfig + * Required. Full AttributesConfig resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig + * @param {google.cloud.retail.v2beta.CatalogAttribute} request.catalogAttribute + * Required. The updated + * {@link google.cloud.retail.v2beta.CatalogAttribute|CatalogAttribute}. + * @param {google.protobuf.FieldMask} request.updateMask + * Indicates which fields in the provided + * {@link google.cloud.retail.v2beta.CatalogAttribute|CatalogAttribute} to update. + * The following are NOT supported: + * + * * {@link google.cloud.retail.v2beta.CatalogAttribute.key|CatalogAttribute.key} + * + * If not set, all supported fields are updated. * @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 [GetDefaultBranchResponse]{@link google.cloud.retail.v2beta.GetDefaultBranchResponse}. + * The first element of the array is an object representing [AttributesConfig]{@link google.cloud.retail.v2beta.AttributesConfig}. * 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/v2beta/catalog_service.get_default_branch.js - * region_tag:retail_v2beta_generated_CatalogService_GetDefaultBranch_async + * @example include:samples/generated/v2beta/catalog_service.replace_catalog_attribute.js + * region_tag:retail_v2beta_generated_CatalogService_ReplaceCatalogAttribute_async */ - getDefaultBranch( - request?: protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest, + replaceCatalogAttribute( + request?: protos.google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.retail.v2beta.IGetDefaultBranchResponse, - protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest | undefined, + protos.google.cloud.retail.v2beta.IAttributesConfig, + ( + | protos.google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest + | undefined + ), {} | undefined ] >; - getDefaultBranch( - request: protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest, + replaceCatalogAttribute( + request: protos.google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest, options: CallOptions, callback: Callback< - protos.google.cloud.retail.v2beta.IGetDefaultBranchResponse, - | protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest | null | undefined, {} | null | undefined > ): void; - getDefaultBranch( - request: protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest, + replaceCatalogAttribute( + request: protos.google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest, callback: Callback< - protos.google.cloud.retail.v2beta.IGetDefaultBranchResponse, - | protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest | null | undefined, {} | null | undefined > ): void; - getDefaultBranch( - request?: protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest, + replaceCatalogAttribute( + request?: protos.google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.retail.v2beta.IGetDefaultBranchResponse, - | protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.retail.v2beta.IGetDefaultBranchResponse, - | protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest + protos.google.cloud.retail.v2beta.IAttributesConfig, + | protos.google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.retail.v2beta.IGetDefaultBranchResponse, - protos.google.cloud.retail.v2beta.IGetDefaultBranchRequest | undefined, + protos.google.cloud.retail.v2beta.IAttributesConfig, + ( + | protos.google.cloud.retail.v2beta.IReplaceCatalogAttributeRequest + | undefined + ), {} | undefined ] > | void { @@ -662,10 +1430,14 @@ export class CatalogServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ - catalog: request.catalog || '', + attributes_config: request.attributesConfig || '', }); this.initialize(); - return this.innerApiCalls.getDefaultBranch(request, options, callback); + return this.innerApiCalls.replaceCatalogAttribute( + request, + options, + callback + ); } /** @@ -916,6 +1688,61 @@ export class CatalogServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified attributesConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + attributesConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.attributesConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).project; + } + + /** + * Parse the location from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).location; + } + + /** + * Parse the catalog from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).catalog; + } + /** * Return a fully-qualified branch resource name string. * @@ -1032,6 +1859,128 @@ export class CatalogServiceClient { return this.pathTemplates.catalogPathTemplate.match(catalogName).catalog; } + /** + * Return a fully-qualified completionConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + completionConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.completionConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).project; + } + + /** + * Parse the location from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).location; + } + + /** + * Parse the catalog from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).catalog; + } + + /** + * Return a fully-qualified control resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} control + * @returns {string} Resource name string. + */ + controlPath( + project: string, + location: string, + catalog: string, + control: string + ) { + return this.pathTemplates.controlPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + control: control, + }); + } + + /** + * Parse the project from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the project. + */ + matchProjectFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).project; + } + + /** + * Parse the location from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the location. + */ + matchLocationFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).location; + } + + /** + * Parse the catalog from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).catalog; + } + + /** + * Parse the control from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the control. + */ + matchControlFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).control; + } + /** * Return a fully-qualified location resource name string. * @@ -1149,6 +2098,77 @@ export class CatalogServiceClient { return this.pathTemplates.productPathTemplate.match(productName).product; } + /** + * Return a fully-qualified servingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} serving_config + * @returns {string} Resource name string. + */ + servingConfigPath( + project: string, + location: string, + catalog: string, + servingConfig: string + ) { + return this.pathTemplates.servingConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + serving_config: servingConfig, + }); + } + + /** + * Parse the project from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .project; + } + + /** + * Parse the location from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .location; + } + + /** + * Parse the catalog from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .catalog; + } + + /** + * Parse the serving_config from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the serving_config. + */ + matchServingConfigFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .serving_config; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-retail/src/v2beta/catalog_service_client_config.json b/packages/google-cloud-retail/src/v2beta/catalog_service_client_config.json index 096f9c8d886..cd2aebd157d 100644 --- a/packages/google-cloud-retail/src/v2beta/catalog_service_client_config.json +++ b/packages/google-cloud-retail/src/v2beta/catalog_service_client_config.json @@ -48,6 +48,41 @@ "timeout_millis": 5000, "retry_codes_name": "idempotent", "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" + }, + "GetCompletionConfig": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" + }, + "UpdateCompletionConfig": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" + }, + "GetAttributesConfig": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" + }, + "UpdateAttributesConfig": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" + }, + "AddCatalogAttribute": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" + }, + "RemoveCatalogAttribute": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" + }, + "ReplaceCatalogAttribute": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" } } } diff --git a/packages/google-cloud-retail/src/v2beta/catalog_service_proto_list.json b/packages/google-cloud-retail/src/v2beta/catalog_service_proto_list.json index 4ec26e01ef2..7cee73e6f3f 100644 --- a/packages/google-cloud-retail/src/v2beta/catalog_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2beta/catalog_service_proto_list.json @@ -3,13 +3,18 @@ "../../protos/google/cloud/retail/v2beta/catalog_service.proto", "../../protos/google/cloud/retail/v2beta/common.proto", "../../protos/google/cloud/retail/v2beta/completion_service.proto", + "../../protos/google/cloud/retail/v2beta/control.proto", + "../../protos/google/cloud/retail/v2beta/control_service.proto", "../../protos/google/cloud/retail/v2beta/export_config.proto", "../../protos/google/cloud/retail/v2beta/import_config.proto", "../../protos/google/cloud/retail/v2beta/prediction_service.proto", "../../protos/google/cloud/retail/v2beta/product.proto", "../../protos/google/cloud/retail/v2beta/product_service.proto", + "../../protos/google/cloud/retail/v2beta/promotion.proto", "../../protos/google/cloud/retail/v2beta/purge_config.proto", "../../protos/google/cloud/retail/v2beta/search_service.proto", + "../../protos/google/cloud/retail/v2beta/serving_config.proto", + "../../protos/google/cloud/retail/v2beta/serving_config_service.proto", "../../protos/google/cloud/retail/v2beta/user_event.proto", "../../protos/google/cloud/retail/v2beta/user_event_service.proto" ] 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 c4c1acb2f00..c74abaf3f70 100644 --- a/packages/google-cloud-retail/src/v2beta/completion_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/completion_service_client.ts @@ -41,8 +41,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 submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * Please enable Retail Search on Cloud Console before using this feature. * @class * @memberof v2beta */ @@ -166,12 +165,24 @@ export class CompletionServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + attributesConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' + ), catalogPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}' ), + completionConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig' + ), + controlPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' + ), productPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' ), + servingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -339,8 +350,7 @@ export class CompletionServiceClient { * Completes the specified prefix with keyword suggestions. * * This feature is only available for users who have Retail Search enabled. - * Please submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * Please enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. @@ -354,21 +364,20 @@ export class CompletionServiceClient { * * The maximum number of allowed characters is 255. * @param {string} request.visitorId - * A unique identifier for tracking visitors. For example, this could be - * implemented with an HTTP cookie, which should be able to uniquely identify - * a visitor on a single device. This unique identifier should not change if - * the visitor logs in or out of the website. + * Required field. A unique identifier for tracking visitors. For example, + * this could be implemented with an HTTP cookie, which should be able to + * uniquely identify a visitor on a single device. This unique identifier + * should not change if the visitor logs in or out of the website. * * The field must be a UTF-8 encoded string with a length limit of 128 * characters. Otherwise, an INVALID_ARGUMENT error is returned. * @param {string[]} request.languageCodes - * The list of languages of the query. This is - * the BCP-47 language code, such as "en-US" or "sr-Latn". - * For more information, see - * [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - * - * The maximum number of allowed characters is 255. - * Only "en-US" is currently supported. + * The language filters applied to the output suggestions. If set, it should + * contain the language of the query. If not set, suggestions are returned + * without considering language restrictions. This is the BCP-47 language + * code, such as "en-US" or "sr-Latn". For more information, see [Tags for + * 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. @@ -400,7 +409,8 @@ export class CompletionServiceClient { * contact Cloud Retail support team first. * @param {number} request.maxSuggestions * Completion max suggestions. If left unset or set to 0, then will fallback - * to the configured value {@link |CompletionConfig.max_suggestions}. + * to the configured value + * {@link google.cloud.retail.v2beta.CompletionConfig.max_suggestions|CompletionConfig.max_suggestions}. * * The maximum allowed max suggestions is 20. If it is set higher, it will be * capped by 20. @@ -492,11 +502,13 @@ export class CompletionServiceClient { /** * Bulk import of processed completion dataset. * - * Request processing may be synchronous. Partial updating is not supported. + * 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 submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * Please enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. @@ -646,6 +658,61 @@ export class CompletionServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified attributesConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + attributesConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.attributesConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).project; + } + + /** + * Parse the location from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).location; + } + + /** + * Parse the catalog from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).catalog; + } + /** * Return a fully-qualified catalog resource name string. * @@ -695,6 +762,128 @@ export class CompletionServiceClient { return this.pathTemplates.catalogPathTemplate.match(catalogName).catalog; } + /** + * Return a fully-qualified completionConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + completionConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.completionConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).project; + } + + /** + * Parse the location from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).location; + } + + /** + * Parse the catalog from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).catalog; + } + + /** + * Return a fully-qualified control resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} control + * @returns {string} Resource name string. + */ + controlPath( + project: string, + location: string, + catalog: string, + control: string + ) { + return this.pathTemplates.controlPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + control: control, + }); + } + + /** + * Parse the project from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the project. + */ + matchProjectFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).project; + } + + /** + * Parse the location from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the location. + */ + matchLocationFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).location; + } + + /** + * Parse the catalog from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).catalog; + } + + /** + * Parse the control from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the control. + */ + matchControlFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).control; + } + /** * Return a fully-qualified product resource name string. * @@ -776,6 +965,77 @@ export class CompletionServiceClient { return this.pathTemplates.productPathTemplate.match(productName).product; } + /** + * Return a fully-qualified servingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} serving_config + * @returns {string} Resource name string. + */ + servingConfigPath( + project: string, + location: string, + catalog: string, + servingConfig: string + ) { + return this.pathTemplates.servingConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + serving_config: servingConfig, + }); + } + + /** + * Parse the project from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .project; + } + + /** + * Parse the location from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .location; + } + + /** + * Parse the catalog from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .catalog; + } + + /** + * Parse the serving_config from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the serving_config. + */ + matchServingConfigFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .serving_config; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-retail/src/v2beta/completion_service_proto_list.json b/packages/google-cloud-retail/src/v2beta/completion_service_proto_list.json index 4ec26e01ef2..7cee73e6f3f 100644 --- a/packages/google-cloud-retail/src/v2beta/completion_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2beta/completion_service_proto_list.json @@ -3,13 +3,18 @@ "../../protos/google/cloud/retail/v2beta/catalog_service.proto", "../../protos/google/cloud/retail/v2beta/common.proto", "../../protos/google/cloud/retail/v2beta/completion_service.proto", + "../../protos/google/cloud/retail/v2beta/control.proto", + "../../protos/google/cloud/retail/v2beta/control_service.proto", "../../protos/google/cloud/retail/v2beta/export_config.proto", "../../protos/google/cloud/retail/v2beta/import_config.proto", "../../protos/google/cloud/retail/v2beta/prediction_service.proto", "../../protos/google/cloud/retail/v2beta/product.proto", "../../protos/google/cloud/retail/v2beta/product_service.proto", + "../../protos/google/cloud/retail/v2beta/promotion.proto", "../../protos/google/cloud/retail/v2beta/purge_config.proto", "../../protos/google/cloud/retail/v2beta/search_service.proto", + "../../protos/google/cloud/retail/v2beta/serving_config.proto", + "../../protos/google/cloud/retail/v2beta/serving_config_service.proto", "../../protos/google/cloud/retail/v2beta/user_event.proto", "../../protos/google/cloud/retail/v2beta/user_event_service.proto" ] diff --git a/packages/google-cloud-retail/src/v2beta/control_service_client.ts b/packages/google-cloud-retail/src/v2beta/control_service_client.ts new file mode 100644 index 00000000000..4f05678336f --- /dev/null +++ b/packages/google-cloud-retail/src/v2beta/control_service_client.ts @@ -0,0 +1,1340 @@ +// 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. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v2beta/control_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './control_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service for modifying Control. + * @class + * @memberof v2beta + */ +export class ControlServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + controlServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ControlServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ControlServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // 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; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + attributesConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' + ), + catalogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}' + ), + completionConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig' + ), + controlPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' + ), + productPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' + ), + servingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listControls: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'controls' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.retail.v2beta.ControlService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.controlServiceStub) { + return this.controlServiceStub; + } + + // Put together the "service stub" for + // google.cloud.retail.v2beta.ControlService. + this.controlServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.retail.v2beta.ControlService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.retail.v2beta.ControlService, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const controlServiceStubMethods = [ + 'createControl', + 'deleteControl', + 'updateControl', + 'getControl', + 'listControls', + ]; + for (const methodName of controlServiceStubMethods) { + const callPromise = this.controlServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.controlServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'retail.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'retail.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Creates a Control. + * + * If the {@link google.cloud.retail.v2beta.Control|Control} to create already + * exists, an ALREADY_EXISTS error is returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Full resource name of parent catalog. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * @param {google.cloud.retail.v2beta.Control} request.control + * Required. The Control to create. + * @param {string} request.controlId + * Required. The ID to use for the Control, which will become the final + * component of the Control's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link 0-9|a-z}-_/. + * @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 [Control]{@link google.cloud.retail.v2beta.Control}. + * 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/v2beta/control_service.create_control.js + * region_tag:retail_v2beta_generated_ControlService_CreateControl_async + */ + createControl( + request?: protos.google.cloud.retail.v2beta.ICreateControlRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2beta.IControl, + protos.google.cloud.retail.v2beta.ICreateControlRequest | undefined, + {} | undefined + ] + >; + createControl( + request: protos.google.cloud.retail.v2beta.ICreateControlRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2beta.IControl, + | protos.google.cloud.retail.v2beta.ICreateControlRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createControl( + request: protos.google.cloud.retail.v2beta.ICreateControlRequest, + callback: Callback< + protos.google.cloud.retail.v2beta.IControl, + | protos.google.cloud.retail.v2beta.ICreateControlRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createControl( + request?: protos.google.cloud.retail.v2beta.ICreateControlRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2beta.IControl, + | protos.google.cloud.retail.v2beta.ICreateControlRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2beta.IControl, + | protos.google.cloud.retail.v2beta.ICreateControlRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2beta.IControl, + protos.google.cloud.retail.v2beta.ICreateControlRequest | 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'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createControl(request, options, callback); + } + /** + * Deletes a Control. + * + * If the {@link google.cloud.retail.v2beta.Control|Control} to delete does not + * exist, a NOT_FOUND error is returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Control to delete. 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. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * 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/v2beta/control_service.delete_control.js + * region_tag:retail_v2beta_generated_ControlService_DeleteControl_async + */ + deleteControl( + request?: protos.google.cloud.retail.v2beta.IDeleteControlRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.retail.v2beta.IDeleteControlRequest | undefined, + {} | undefined + ] + >; + deleteControl( + request: protos.google.cloud.retail.v2beta.IDeleteControlRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.retail.v2beta.IDeleteControlRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteControl( + request: protos.google.cloud.retail.v2beta.IDeleteControlRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.retail.v2beta.IDeleteControlRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteControl( + request?: protos.google.cloud.retail.v2beta.IDeleteControlRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.retail.v2beta.IDeleteControlRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.retail.v2beta.IDeleteControlRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.retail.v2beta.IDeleteControlRequest | 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'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteControl(request, options, callback); + } + /** + * Updates a Control. + * + * {@link google.cloud.retail.v2beta.Control|Control} cannot be set to a different + * oneof field, if so an INVALID_ARGUMENT is returned. If the + * {@link google.cloud.retail.v2beta.Control|Control} to delete does not exist, a + * NOT_FOUND error is returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.retail.v2beta.Control} request.control + * Required. The Control to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Indicates which fields in the provided + * {@link google.cloud.retail.v2beta.Control|Control} to update. The following are + * NOT supported: + * + * * {@link google.cloud.retail.v2beta.Control.name|Control.name} + * + * If not set or empty, all supported fields are updated. + * @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 [Control]{@link google.cloud.retail.v2beta.Control}. + * 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/v2beta/control_service.update_control.js + * region_tag:retail_v2beta_generated_ControlService_UpdateControl_async + */ + updateControl( + request?: protos.google.cloud.retail.v2beta.IUpdateControlRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2beta.IControl, + protos.google.cloud.retail.v2beta.IUpdateControlRequest | undefined, + {} | undefined + ] + >; + updateControl( + request: protos.google.cloud.retail.v2beta.IUpdateControlRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2beta.IControl, + | protos.google.cloud.retail.v2beta.IUpdateControlRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateControl( + request: protos.google.cloud.retail.v2beta.IUpdateControlRequest, + callback: Callback< + protos.google.cloud.retail.v2beta.IControl, + | protos.google.cloud.retail.v2beta.IUpdateControlRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateControl( + request?: protos.google.cloud.retail.v2beta.IUpdateControlRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2beta.IControl, + | protos.google.cloud.retail.v2beta.IUpdateControlRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2beta.IControl, + | protos.google.cloud.retail.v2beta.IUpdateControlRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2beta.IControl, + protos.google.cloud.retail.v2beta.IUpdateControlRequest | 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'] = + gax.routingHeader.fromParams({ + 'control.name': request.control!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateControl(request, options, callback); + } + /** + * Gets a Control. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Control to delete. 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. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Control]{@link google.cloud.retail.v2beta.Control}. + * 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/v2beta/control_service.get_control.js + * region_tag:retail_v2beta_generated_ControlService_GetControl_async + */ + getControl( + request?: protos.google.cloud.retail.v2beta.IGetControlRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2beta.IControl, + protos.google.cloud.retail.v2beta.IGetControlRequest | undefined, + {} | undefined + ] + >; + getControl( + request: protos.google.cloud.retail.v2beta.IGetControlRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2beta.IControl, + protos.google.cloud.retail.v2beta.IGetControlRequest | null | undefined, + {} | null | undefined + > + ): void; + getControl( + request: protos.google.cloud.retail.v2beta.IGetControlRequest, + callback: Callback< + protos.google.cloud.retail.v2beta.IControl, + protos.google.cloud.retail.v2beta.IGetControlRequest | null | undefined, + {} | null | undefined + > + ): void; + getControl( + request?: protos.google.cloud.retail.v2beta.IGetControlRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2beta.IControl, + | protos.google.cloud.retail.v2beta.IGetControlRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2beta.IControl, + protos.google.cloud.retail.v2beta.IGetControlRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2beta.IControl, + protos.google.cloud.retail.v2beta.IGetControlRequest | 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'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getControl(request, options, callback); + } + + /** + * Lists all Controls linked to this catalog. + * + * @param {Object} request + * 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} + * @param {number} [request.pageSize] + * Optional. Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListControls` call. + * Provide this to retrieve the subsequent page. + * @param {string} [request.filter] + * Optional. A filter to apply on the list results. Supported features: + * + * * List all the products under the parent branch if + * {@link google.cloud.retail.v2beta.ListControlsRequest.filter|filter} is unset. + * * List controls that are used in a single ServingConfig: + * 'serving_config = "boosted_home_page_cvr"' + * @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 Array of [Control]{@link google.cloud.retail.v2beta.Control}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listControlsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listControls( + request?: protos.google.cloud.retail.v2beta.IListControlsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2beta.IControl[], + protos.google.cloud.retail.v2beta.IListControlsRequest | null, + protos.google.cloud.retail.v2beta.IListControlsResponse + ] + >; + listControls( + request: protos.google.cloud.retail.v2beta.IListControlsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.retail.v2beta.IListControlsRequest, + | protos.google.cloud.retail.v2beta.IListControlsResponse + | null + | undefined, + protos.google.cloud.retail.v2beta.IControl + > + ): void; + listControls( + request: protos.google.cloud.retail.v2beta.IListControlsRequest, + callback: PaginationCallback< + protos.google.cloud.retail.v2beta.IListControlsRequest, + | protos.google.cloud.retail.v2beta.IListControlsResponse + | null + | undefined, + protos.google.cloud.retail.v2beta.IControl + > + ): void; + listControls( + request?: protos.google.cloud.retail.v2beta.IListControlsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.retail.v2beta.IListControlsRequest, + | protos.google.cloud.retail.v2beta.IListControlsResponse + | null + | undefined, + protos.google.cloud.retail.v2beta.IControl + >, + callback?: PaginationCallback< + protos.google.cloud.retail.v2beta.IListControlsRequest, + | protos.google.cloud.retail.v2beta.IListControlsResponse + | null + | undefined, + protos.google.cloud.retail.v2beta.IControl + > + ): Promise< + [ + protos.google.cloud.retail.v2beta.IControl[], + protos.google.cloud.retail.v2beta.IListControlsRequest | null, + protos.google.cloud.retail.v2beta.IListControlsResponse + ] + > | 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'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listControls(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * 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} + * @param {number} [request.pageSize] + * Optional. Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListControls` call. + * Provide this to retrieve the subsequent page. + * @param {string} [request.filter] + * Optional. A filter to apply on the list results. Supported features: + * + * * List all the products under the parent branch if + * {@link google.cloud.retail.v2beta.ListControlsRequest.filter|filter} is unset. + * * List controls that are used in a single ServingConfig: + * 'serving_config = "boosted_home_page_cvr"' + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Control]{@link google.cloud.retail.v2beta.Control} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listControlsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listControlsStream( + request?: protos.google.cloud.retail.v2beta.IListControlsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const defaultCallSettings = this._defaults['listControls']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listControls.createStream( + this.innerApiCalls.listControls as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listControls`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * 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} + * @param {number} [request.pageSize] + * Optional. Maximum number of results to return. If unspecified, defaults + * to 50. Max allowed value is 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListControls` call. + * Provide this to retrieve the subsequent page. + * @param {string} [request.filter] + * Optional. A filter to apply on the list results. Supported features: + * + * * List all the products under the parent branch if + * {@link google.cloud.retail.v2beta.ListControlsRequest.filter|filter} is unset. + * * List controls that are used in a single ServingConfig: + * 'serving_config = "boosted_home_page_cvr"' + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Control]{@link google.cloud.retail.v2beta.Control}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v2beta/control_service.list_controls.js + * region_tag:retail_v2beta_generated_ControlService_ListControls_async + */ + listControlsAsync( + request?: protos.google.cloud.retail.v2beta.IListControlsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const defaultCallSettings = this._defaults['listControls']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listControls.asyncIterate( + this.innerApiCalls['listControls'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified attributesConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + attributesConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.attributesConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).project; + } + + /** + * Parse the location from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).location; + } + + /** + * Parse the catalog from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).catalog; + } + + /** + * Return a fully-qualified catalog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + catalogPath(project: string, location: string, catalog: string) { + return this.pathTemplates.catalogPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from Catalog resource. + * + * @param {string} catalogName + * A fully-qualified path representing Catalog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCatalogName(catalogName: string) { + return this.pathTemplates.catalogPathTemplate.match(catalogName).project; + } + + /** + * Parse the location from Catalog resource. + * + * @param {string} catalogName + * A fully-qualified path representing Catalog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCatalogName(catalogName: string) { + return this.pathTemplates.catalogPathTemplate.match(catalogName).location; + } + + /** + * Parse the catalog from Catalog resource. + * + * @param {string} catalogName + * A fully-qualified path representing Catalog resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromCatalogName(catalogName: string) { + return this.pathTemplates.catalogPathTemplate.match(catalogName).catalog; + } + + /** + * Return a fully-qualified completionConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + completionConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.completionConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).project; + } + + /** + * Parse the location from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).location; + } + + /** + * Parse the catalog from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).catalog; + } + + /** + * Return a fully-qualified control resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} control + * @returns {string} Resource name string. + */ + controlPath( + project: string, + location: string, + catalog: string, + control: string + ) { + return this.pathTemplates.controlPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + control: control, + }); + } + + /** + * Parse the project from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the project. + */ + matchProjectFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).project; + } + + /** + * Parse the location from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the location. + */ + matchLocationFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).location; + } + + /** + * Parse the catalog from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).catalog; + } + + /** + * Parse the control from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the control. + */ + matchControlFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).control; + } + + /** + * Return a fully-qualified product resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} branch + * @param {string} product + * @returns {string} Resource name string. + */ + productPath( + project: string, + location: string, + catalog: string, + branch: string, + product: string + ) { + return this.pathTemplates.productPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + branch: branch, + product: product, + }); + } + + /** + * Parse the project from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).project; + } + + /** + * Parse the location from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).location; + } + + /** + * Parse the catalog from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).catalog; + } + + /** + * Parse the branch from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).branch; + } + + /** + * Parse the product from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the product. + */ + matchProductFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).product; + } + + /** + * Return a fully-qualified servingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} serving_config + * @returns {string} Resource name string. + */ + servingConfigPath( + project: string, + location: string, + catalog: string, + servingConfig: string + ) { + return this.pathTemplates.servingConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + serving_config: servingConfig, + }); + } + + /** + * Parse the project from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .project; + } + + /** + * Parse the location from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .location; + } + + /** + * Parse the catalog from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .catalog; + } + + /** + * Parse the serving_config from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the serving_config. + */ + matchServingConfigFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .serving_config; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.controlServiceStub && !this._terminated) { + return this.controlServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-retail/src/v2beta/control_service_client_config.json b/packages/google-cloud-retail/src/v2beta/control_service_client_config.json new file mode 100644 index 00000000000..b7572aeb833 --- /dev/null +++ b/packages/google-cloud-retail/src/v2beta/control_service_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.retail.v2beta.ControlService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateControl": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteControl": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateControl": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetControl": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListControls": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-retail/src/v2beta/control_service_proto_list.json b/packages/google-cloud-retail/src/v2beta/control_service_proto_list.json new file mode 100644 index 00000000000..7cee73e6f3f --- /dev/null +++ b/packages/google-cloud-retail/src/v2beta/control_service_proto_list.json @@ -0,0 +1,20 @@ +[ + "../../protos/google/cloud/retail/v2beta/catalog.proto", + "../../protos/google/cloud/retail/v2beta/catalog_service.proto", + "../../protos/google/cloud/retail/v2beta/common.proto", + "../../protos/google/cloud/retail/v2beta/completion_service.proto", + "../../protos/google/cloud/retail/v2beta/control.proto", + "../../protos/google/cloud/retail/v2beta/control_service.proto", + "../../protos/google/cloud/retail/v2beta/export_config.proto", + "../../protos/google/cloud/retail/v2beta/import_config.proto", + "../../protos/google/cloud/retail/v2beta/prediction_service.proto", + "../../protos/google/cloud/retail/v2beta/product.proto", + "../../protos/google/cloud/retail/v2beta/product_service.proto", + "../../protos/google/cloud/retail/v2beta/promotion.proto", + "../../protos/google/cloud/retail/v2beta/purge_config.proto", + "../../protos/google/cloud/retail/v2beta/search_service.proto", + "../../protos/google/cloud/retail/v2beta/serving_config.proto", + "../../protos/google/cloud/retail/v2beta/serving_config_service.proto", + "../../protos/google/cloud/retail/v2beta/user_event.proto", + "../../protos/google/cloud/retail/v2beta/user_event_service.proto" +] diff --git a/packages/google-cloud-retail/src/v2beta/gapic_metadata.json b/packages/google-cloud-retail/src/v2beta/gapic_metadata.json index e48d92e5b5d..f9c6514cba0 100644 --- a/packages/google-cloud-retail/src/v2beta/gapic_metadata.json +++ b/packages/google-cloud-retail/src/v2beta/gapic_metadata.json @@ -25,6 +25,41 @@ "getDefaultBranch" ] }, + "GetCompletionConfig": { + "methods": [ + "getCompletionConfig" + ] + }, + "UpdateCompletionConfig": { + "methods": [ + "updateCompletionConfig" + ] + }, + "GetAttributesConfig": { + "methods": [ + "getAttributesConfig" + ] + }, + "UpdateAttributesConfig": { + "methods": [ + "updateAttributesConfig" + ] + }, + "AddCatalogAttribute": { + "methods": [ + "addCatalogAttribute" + ] + }, + "RemoveCatalogAttribute": { + "methods": [ + "removeCatalogAttribute" + ] + }, + "ReplaceCatalogAttribute": { + "methods": [ + "replaceCatalogAttribute" + ] + }, "ListCatalogs": { "methods": [ "listCatalogs", @@ -52,6 +87,41 @@ "getDefaultBranch" ] }, + "GetCompletionConfig": { + "methods": [ + "getCompletionConfig" + ] + }, + "UpdateCompletionConfig": { + "methods": [ + "updateCompletionConfig" + ] + }, + "GetAttributesConfig": { + "methods": [ + "getAttributesConfig" + ] + }, + "UpdateAttributesConfig": { + "methods": [ + "updateAttributesConfig" + ] + }, + "AddCatalogAttribute": { + "methods": [ + "addCatalogAttribute" + ] + }, + "RemoveCatalogAttribute": { + "methods": [ + "removeCatalogAttribute" + ] + }, + "ReplaceCatalogAttribute": { + "methods": [ + "replaceCatalogAttribute" + ] + }, "ListCatalogs": { "methods": [ "listCatalogs", @@ -97,6 +167,74 @@ } } }, + "ControlService": { + "clients": { + "grpc": { + "libraryClient": "ControlServiceClient", + "rpcs": { + "CreateControl": { + "methods": [ + "createControl" + ] + }, + "DeleteControl": { + "methods": [ + "deleteControl" + ] + }, + "UpdateControl": { + "methods": [ + "updateControl" + ] + }, + "GetControl": { + "methods": [ + "getControl" + ] + }, + "ListControls": { + "methods": [ + "listControls", + "listControlsStream", + "listControlsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ControlServiceClient", + "rpcs": { + "CreateControl": { + "methods": [ + "createControl" + ] + }, + "DeleteControl": { + "methods": [ + "deleteControl" + ] + }, + "UpdateControl": { + "methods": [ + "updateControl" + ] + }, + "GetControl": { + "methods": [ + "getControl" + ] + }, + "ListControls": { + "methods": [ + "listControls", + "listControlsStream", + "listControlsAsync" + ] + } + } + } + } + }, "PredictionService": { "clients": { "grpc": { @@ -166,6 +304,16 @@ "removeFulfillmentPlaces" ] }, + "AddLocalInventories": { + "methods": [ + "addLocalInventories" + ] + }, + "RemoveLocalInventories": { + "methods": [ + "removeLocalInventories" + ] + }, "ListProducts": { "methods": [ "listProducts", @@ -218,6 +366,16 @@ "removeFulfillmentPlaces" ] }, + "AddLocalInventories": { + "methods": [ + "addLocalInventories" + ] + }, + "RemoveLocalInventories": { + "methods": [ + "removeLocalInventories" + ] + }, "ListProducts": { "methods": [ "listProducts", @@ -257,6 +415,94 @@ } } }, + "ServingConfigService": { + "clients": { + "grpc": { + "libraryClient": "ServingConfigServiceClient", + "rpcs": { + "CreateServingConfig": { + "methods": [ + "createServingConfig" + ] + }, + "DeleteServingConfig": { + "methods": [ + "deleteServingConfig" + ] + }, + "UpdateServingConfig": { + "methods": [ + "updateServingConfig" + ] + }, + "GetServingConfig": { + "methods": [ + "getServingConfig" + ] + }, + "AddControl": { + "methods": [ + "addControl" + ] + }, + "RemoveControl": { + "methods": [ + "removeControl" + ] + }, + "ListServingConfigs": { + "methods": [ + "listServingConfigs", + "listServingConfigsStream", + "listServingConfigsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ServingConfigServiceClient", + "rpcs": { + "CreateServingConfig": { + "methods": [ + "createServingConfig" + ] + }, + "DeleteServingConfig": { + "methods": [ + "deleteServingConfig" + ] + }, + "UpdateServingConfig": { + "methods": [ + "updateServingConfig" + ] + }, + "GetServingConfig": { + "methods": [ + "getServingConfig" + ] + }, + "AddControl": { + "methods": [ + "addControl" + ] + }, + "RemoveControl": { + "methods": [ + "removeControl" + ] + }, + "ListServingConfigs": { + "methods": [ + "listServingConfigs", + "listServingConfigsStream", + "listServingConfigsAsync" + ] + } + } + } + } + }, "UserEventService": { "clients": { "grpc": { diff --git a/packages/google-cloud-retail/src/v2beta/index.ts b/packages/google-cloud-retail/src/v2beta/index.ts index 79cde8aa80a..a7e4f6ba79f 100644 --- a/packages/google-cloud-retail/src/v2beta/index.ts +++ b/packages/google-cloud-retail/src/v2beta/index.ts @@ -18,7 +18,9 @@ export {CatalogServiceClient} from './catalog_service_client'; export {CompletionServiceClient} from './completion_service_client'; +export {ControlServiceClient} from './control_service_client'; export {PredictionServiceClient} from './prediction_service_client'; export {ProductServiceClient} from './product_service_client'; export {SearchServiceClient} from './search_service_client'; +export {ServingConfigServiceClient} from './serving_config_service_client'; export {UserEventServiceClient} from './user_event_service_client'; 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 a89b187a973..514d4e4b083 100644 --- a/packages/google-cloud-retail/src/v2beta/prediction_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/prediction_service_client.ts @@ -155,12 +155,24 @@ export class PredictionServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + attributesConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' + ), catalogPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}' ), + completionConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig' + ), + controlPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' + ), productPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' ), + servingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' + ), }; // Put together the default options sent with requests. @@ -345,9 +357,12 @@ export class PredictionServiceClient { * * filterOutOfStockItems tag=(-"promotional") * * filterOutOfStockItems * - * If your filter blocks all prediction results, nothing will be returned. If - * you want generic (unfiltered) popular products to be returned instead, set - * `strictFiltering` to false in `PredictRequest.params`. + * 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. * @param {boolean} request.validateOnly * Use validate only mode for this prediction query. If set to true, a * dummy model will be used that returns arbitrary products. @@ -478,6 +493,61 @@ export class PredictionServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified attributesConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + attributesConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.attributesConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).project; + } + + /** + * Parse the location from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).location; + } + + /** + * Parse the catalog from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).catalog; + } + /** * Return a fully-qualified catalog resource name string. * @@ -527,6 +597,128 @@ export class PredictionServiceClient { return this.pathTemplates.catalogPathTemplate.match(catalogName).catalog; } + /** + * Return a fully-qualified completionConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + completionConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.completionConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).project; + } + + /** + * Parse the location from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).location; + } + + /** + * Parse the catalog from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).catalog; + } + + /** + * Return a fully-qualified control resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} control + * @returns {string} Resource name string. + */ + controlPath( + project: string, + location: string, + catalog: string, + control: string + ) { + return this.pathTemplates.controlPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + control: control, + }); + } + + /** + * Parse the project from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the project. + */ + matchProjectFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).project; + } + + /** + * Parse the location from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the location. + */ + matchLocationFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).location; + } + + /** + * Parse the catalog from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).catalog; + } + + /** + * Parse the control from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the control. + */ + matchControlFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).control; + } + /** * Return a fully-qualified product resource name string. * @@ -608,6 +800,77 @@ export class PredictionServiceClient { return this.pathTemplates.productPathTemplate.match(productName).product; } + /** + * Return a fully-qualified servingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} serving_config + * @returns {string} Resource name string. + */ + servingConfigPath( + project: string, + location: string, + catalog: string, + servingConfig: string + ) { + return this.pathTemplates.servingConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + serving_config: servingConfig, + }); + } + + /** + * Parse the project from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .project; + } + + /** + * Parse the location from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .location; + } + + /** + * Parse the catalog from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .catalog; + } + + /** + * Parse the serving_config from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the serving_config. + */ + matchServingConfigFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .serving_config; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-retail/src/v2beta/prediction_service_proto_list.json b/packages/google-cloud-retail/src/v2beta/prediction_service_proto_list.json index 4ec26e01ef2..7cee73e6f3f 100644 --- a/packages/google-cloud-retail/src/v2beta/prediction_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2beta/prediction_service_proto_list.json @@ -3,13 +3,18 @@ "../../protos/google/cloud/retail/v2beta/catalog_service.proto", "../../protos/google/cloud/retail/v2beta/common.proto", "../../protos/google/cloud/retail/v2beta/completion_service.proto", + "../../protos/google/cloud/retail/v2beta/control.proto", + "../../protos/google/cloud/retail/v2beta/control_service.proto", "../../protos/google/cloud/retail/v2beta/export_config.proto", "../../protos/google/cloud/retail/v2beta/import_config.proto", "../../protos/google/cloud/retail/v2beta/prediction_service.proto", "../../protos/google/cloud/retail/v2beta/product.proto", "../../protos/google/cloud/retail/v2beta/product_service.proto", + "../../protos/google/cloud/retail/v2beta/promotion.proto", "../../protos/google/cloud/retail/v2beta/purge_config.proto", "../../protos/google/cloud/retail/v2beta/search_service.proto", + "../../protos/google/cloud/retail/v2beta/serving_config.proto", + "../../protos/google/cloud/retail/v2beta/serving_config_service.proto", "../../protos/google/cloud/retail/v2beta/user_event.proto", "../../protos/google/cloud/retail/v2beta/user_event_service.proto" ] 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 aa5f24129f2..cb218273048 100644 --- a/packages/google-cloud-retail/src/v2beta/product_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/product_service_client.ts @@ -167,15 +167,27 @@ export class ProductServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + attributesConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' + ), branchPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}' ), catalogPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}' ), + completionConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig' + ), + controlPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' + ), productPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' ), + servingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' + ), }; // Some of the methods on this service return "paged" results, @@ -225,6 +237,18 @@ export class ProductServiceClient { const removeFulfillmentPlacesMetadata = protoFilesRoot.lookup( '.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata' ) as gax.protobuf.Type; + const addLocalInventoriesResponse = protoFilesRoot.lookup( + '.google.cloud.retail.v2beta.AddLocalInventoriesResponse' + ) as gax.protobuf.Type; + const addLocalInventoriesMetadata = protoFilesRoot.lookup( + '.google.cloud.retail.v2beta.AddLocalInventoriesMetadata' + ) as gax.protobuf.Type; + const removeLocalInventoriesResponse = protoFilesRoot.lookup( + '.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse' + ) as gax.protobuf.Type; + const removeLocalInventoriesMetadata = protoFilesRoot.lookup( + '.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { importProducts: new this._gaxModule.LongrunningDescriptor( @@ -251,6 +275,20 @@ export class ProductServiceClient { removeFulfillmentPlacesMetadata ) ), + addLocalInventories: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + addLocalInventoriesResponse.decode.bind(addLocalInventoriesResponse), + addLocalInventoriesMetadata.decode.bind(addLocalInventoriesMetadata) + ), + removeLocalInventories: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + removeLocalInventoriesResponse.decode.bind( + removeLocalInventoriesResponse + ), + removeLocalInventoriesMetadata.decode.bind( + removeLocalInventoriesMetadata + ) + ), }; // Put together the default options sent with requests. @@ -312,6 +350,8 @@ export class ProductServiceClient { 'setInventory', 'addFulfillmentPlaces', 'removeFulfillmentPlaces', + 'addLocalInventories', + 'removeLocalInventories', ]; for (const methodName of productServiceStubMethods) { const callPromise = this.productServiceStub.then( @@ -844,15 +884,7 @@ export class ProductServiceClient { * If no updateMask is specified, requires products.create permission. * If updateMask is specified, requires products.update permission. * @param {string} request.requestId - * Unique identifier provided by client, within the ancestor - * dataset scope. Ensures idempotency and used for request deduplication. - * Server-generated if unspecified. Up to 128 characters long and must match - * the pattern: `{@link |a-zA-Z0-9_]+`. This is returned as [Operation.name} in - * {@link google.cloud.retail.v2beta.ImportMetadata|ImportMetadata}. - * - * Only supported when - * {@link google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode|ImportProductsRequest.reconciliation_mode} - * is set to `FULL`. + * Deprecated. This field has no effect. * @param {google.cloud.retail.v2beta.ProductInputConfig} request.inputConfig * Required. The desired input location of the data. * @param {google.cloud.retail.v2beta.ImportErrorsConfig} request.errorsConfig @@ -1034,7 +1066,8 @@ export class ProductServiceClient { * {@link google.cloud.retail.v2beta.CreateProductRequest.product|CreateProductRequest.product}, * then any pre-existing inventory information for this product will be used. * - * If no inventory fields are set in {@link |UpdateProductRequest.set_mask}, + * If no inventory fields are set in + * {@link google.cloud.retail.v2beta.SetInventoryRequest.set_mask|SetInventoryRequest.set_mask}, * then any existing inventory information will be preserved. * * Pre-existing inventory information can only be updated with @@ -1044,8 +1077,7 @@ export class ProductServiceClient { * {@link google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces|RemoveFulfillmentPlaces}. * * This feature is only available for users who have Retail Search enabled. - * Please submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * Please enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. @@ -1077,6 +1109,24 @@ export class ProductServiceClient { * provided or default value for * {@link google.cloud.retail.v2beta.SetInventoryRequest.set_time|SetInventoryRequest.set_time}. * + * The caller can replace place IDs for a subset of fulfillment types in the + * following ways: + * + * * Adds "fulfillment_info" in + * {@link google.cloud.retail.v2beta.SetInventoryRequest.set_mask|SetInventoryRequest.set_mask} + * * Specifies only the desired fulfillment types and corresponding place IDs + * to update in {@link |SetInventoryRequest.inventory.fulfillment_info} + * + * The caller can clear all place IDs from a subset of fulfillment types in + * the following ways: + * + * * Adds "fulfillment_info" in + * {@link google.cloud.retail.v2beta.SetInventoryRequest.set_mask|SetInventoryRequest.set_mask} + * * Specifies only the desired fulfillment types to clear in + * {@link |SetInventoryRequest.inventory.fulfillment_info} + * * Checks that only the desired fulfillment info types have empty + * {@link |SetInventoryRequest.inventory.fulfillment_info.place_ids} + * * The last update time is recorded for the following inventory fields: * * {@link google.cloud.retail.v2beta.Product.price_info|Product.price_info} * * {@link google.cloud.retail.v2beta.Product.availability|Product.availability} @@ -1248,8 +1298,7 @@ export class ProductServiceClient { * {@link google.cloud.retail.v2beta.ProductService.ListProducts|ListProducts}. * * This feature is only available for users who have Retail Search enabled. - * Please submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * Please enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. @@ -1452,8 +1501,7 @@ export class ProductServiceClient { * {@link google.cloud.retail.v2beta.ProductService.ListProducts|ListProducts}. * * This feature is only available for users who have Retail Search enabled. - * Please submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * Please enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. @@ -1641,6 +1689,379 @@ export class ProductServiceClient { protos.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata >; } + /** + * Updates local inventory information for a + * {@link google.cloud.retail.v2beta.Product|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 + * {@link google.cloud.retail.v2beta.Product|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 + * {@link google.cloud.retail.v2beta.Product|Product} queried by + * {@link google.cloud.retail.v2beta.ProductService.GetProduct|GetProduct} or + * {@link google.cloud.retail.v2beta.ProductService.ListProducts|ListProducts}. + * + * Local inventory information can only be modified using this method. + * {@link google.cloud.retail.v2beta.ProductService.CreateProduct|CreateProduct} + * and + * {@link google.cloud.retail.v2beta.ProductService.UpdateProduct|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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.product + * Required. Full resource name of + * {@link google.cloud.retail.v2beta.Product|Product}, such as + * `projects/* /locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * + * If the caller does not have permission to access the + * {@link google.cloud.retail.v2beta.Product|Product}, regardless of whether or not + * it exists, a PERMISSION_DENIED error is returned. + * @param {number[]} request.localInventories + * Required. A list of inventory information at difference places. Each place + * is identified by its place ID. At most 3000 inventories are allowed per + * request. + * @param {google.protobuf.FieldMask} request.addMask + * Indicates which inventory fields in the provided list of + * {@link google.cloud.retail.v2beta.LocalInventory|LocalInventory} to update. The + * field is updated to the provided value. + * + * If a field is set while the place does not have a previous local inventory, + * the local inventory at that store is created. + * + * If a field is set while the value of that field is not provided, the + * original field value, if it exists, is deleted. + * + * If the mask is not set or set with empty paths, all inventory fields will + * be updated. + * + * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + * is returned and the entire update will be ignored. + * @param {google.protobuf.Timestamp} request.addTime + * The time when the inventory updates are issued. Used to prevent + * out-of-order updates on local inventory fields. If not provided, the + * internal system time will be used. + * @param {boolean} request.allowMissing + * If set to true, and the {@link google.cloud.retail.v2beta.Product|Product} is + * not found, the local inventory will still be processed and retained for at + * most 1 day and processed once the + * {@link google.cloud.retail.v2beta.Product|Product} is created. If set to false, + * a NOT_FOUND error is returned if the + * {@link google.cloud.retail.v2beta.Product|Product} is not found. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2beta/product_service.add_local_inventories.js + * region_tag:retail_v2beta_generated_ProductService_AddLocalInventories_async + */ + addLocalInventories( + request?: protos.google.cloud.retail.v2beta.IAddLocalInventoriesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.retail.v2beta.IAddLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.IAddLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + addLocalInventories( + request: protos.google.cloud.retail.v2beta.IAddLocalInventoriesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.retail.v2beta.IAddLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.IAddLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + addLocalInventories( + request: protos.google.cloud.retail.v2beta.IAddLocalInventoriesRequest, + callback: Callback< + LROperation< + protos.google.cloud.retail.v2beta.IAddLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.IAddLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + addLocalInventories( + request?: protos.google.cloud.retail.v2beta.IAddLocalInventoriesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.retail.v2beta.IAddLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.IAddLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.retail.v2beta.IAddLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.IAddLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.retail.v2beta.IAddLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.IAddLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | 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'] = + gax.routingHeader.fromParams({ + product: request.product || '', + }); + this.initialize(); + return this.innerApiCalls.addLocalInventories(request, options, callback); + } + /** + * Check the status of the long running operation returned by `addLocalInventories()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2beta/product_service.add_local_inventories.js + * region_tag:retail_v2beta_generated_ProductService_AddLocalInventories_async + */ + async checkAddLocalInventoriesProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.retail.v2beta.AddLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.AddLocalInventoriesMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.addLocalInventories, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.retail.v2beta.AddLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.AddLocalInventoriesMetadata + >; + } + /** + * Remove local inventory information for a + * {@link google.cloud.retail.v2beta.Product|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 + * {@link google.cloud.retail.v2beta.Product|Product} queried by + * {@link google.cloud.retail.v2beta.ProductService.GetProduct|GetProduct} or + * {@link google.cloud.retail.v2beta.ProductService.ListProducts|ListProducts}. + * + * Local inventory information can only be removed using this method. + * {@link google.cloud.retail.v2beta.ProductService.CreateProduct|CreateProduct} + * and + * {@link google.cloud.retail.v2beta.ProductService.UpdateProduct|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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.product + * Required. Full resource name of + * {@link google.cloud.retail.v2beta.Product|Product}, such as + * `projects/* /locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + * + * If the caller does not have permission to access the + * {@link google.cloud.retail.v2beta.Product|Product}, regardless of whether or not + * it exists, a PERMISSION_DENIED error is returned. + * @param {string[]} request.placeIds + * Required. A list of place IDs to have their inventory deleted. + * At most 3000 place IDs are allowed per request. + * @param {google.protobuf.Timestamp} request.removeTime + * The time when the inventory deletions are issued. Used to prevent + * out-of-order updates and deletions on local inventory fields. If not + * provided, the internal system time will be used. + * @param {boolean} request.allowMissing + * If set to true, and the {@link google.cloud.retail.v2beta.Product|Product} is + * not found, the local inventory removal request will still be processed and + * retained for at most 1 day and processed once the + * {@link google.cloud.retail.v2beta.Product|Product} is created. If set to false, + * a NOT_FOUND error is returned if the + * {@link google.cloud.retail.v2beta.Product|Product} is not found. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2beta/product_service.remove_local_inventories.js + * region_tag:retail_v2beta_generated_ProductService_RemoveLocalInventories_async + */ + removeLocalInventories( + request?: protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + removeLocalInventories( + request: protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + removeLocalInventories( + request: protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesRequest, + callback: Callback< + LROperation< + protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + removeLocalInventories( + request?: protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesMetadata + >, + protos.google.longrunning.IOperation | 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'] = + gax.routingHeader.fromParams({ + product: request.product || '', + }); + this.initialize(); + return this.innerApiCalls.removeLocalInventories( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `removeLocalInventories()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2beta/product_service.remove_local_inventories.js + * region_tag:retail_v2beta_generated_ProductService_RemoveLocalInventories_async + */ + async checkRemoveLocalInventoriesProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.removeLocalInventories, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata + >; + } /** * Gets a list of {@link google.cloud.retail.v2beta.Product|Product}s. * @@ -2041,6 +2462,61 @@ export class ProductServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified attributesConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + attributesConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.attributesConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).project; + } + + /** + * Parse the location from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).location; + } + + /** + * Parse the catalog from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).catalog; + } + /** * Return a fully-qualified branch resource name string. * @@ -2157,6 +2633,128 @@ export class ProductServiceClient { return this.pathTemplates.catalogPathTemplate.match(catalogName).catalog; } + /** + * Return a fully-qualified completionConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + completionConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.completionConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).project; + } + + /** + * Parse the location from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).location; + } + + /** + * Parse the catalog from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).catalog; + } + + /** + * Return a fully-qualified control resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} control + * @returns {string} Resource name string. + */ + controlPath( + project: string, + location: string, + catalog: string, + control: string + ) { + return this.pathTemplates.controlPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + control: control, + }); + } + + /** + * Parse the project from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the project. + */ + matchProjectFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).project; + } + + /** + * Parse the location from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the location. + */ + matchLocationFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).location; + } + + /** + * Parse the catalog from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).catalog; + } + + /** + * Parse the control from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the control. + */ + matchControlFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).control; + } + /** * Return a fully-qualified product resource name string. * @@ -2238,6 +2836,77 @@ export class ProductServiceClient { return this.pathTemplates.productPathTemplate.match(productName).product; } + /** + * Return a fully-qualified servingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} serving_config + * @returns {string} Resource name string. + */ + servingConfigPath( + project: string, + location: string, + catalog: string, + servingConfig: string + ) { + return this.pathTemplates.servingConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + serving_config: servingConfig, + }); + } + + /** + * Parse the project from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .project; + } + + /** + * Parse the location from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .location; + } + + /** + * Parse the catalog from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .catalog; + } + + /** + * Parse the serving_config from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the serving_config. + */ + matchServingConfigFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .serving_config; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-retail/src/v2beta/product_service_client_config.json b/packages/google-cloud-retail/src/v2beta/product_service_client_config.json index d4f16440baf..459b579d7a8 100644 --- a/packages/google-cloud-retail/src/v2beta/product_service_client_config.json +++ b/packages/google-cloud-retail/src/v2beta/product_service_client_config.json @@ -82,6 +82,16 @@ "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "AddLocalInventories": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "RemoveLocalInventories": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" } } } diff --git a/packages/google-cloud-retail/src/v2beta/product_service_proto_list.json b/packages/google-cloud-retail/src/v2beta/product_service_proto_list.json index 4ec26e01ef2..7cee73e6f3f 100644 --- a/packages/google-cloud-retail/src/v2beta/product_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2beta/product_service_proto_list.json @@ -3,13 +3,18 @@ "../../protos/google/cloud/retail/v2beta/catalog_service.proto", "../../protos/google/cloud/retail/v2beta/common.proto", "../../protos/google/cloud/retail/v2beta/completion_service.proto", + "../../protos/google/cloud/retail/v2beta/control.proto", + "../../protos/google/cloud/retail/v2beta/control_service.proto", "../../protos/google/cloud/retail/v2beta/export_config.proto", "../../protos/google/cloud/retail/v2beta/import_config.proto", "../../protos/google/cloud/retail/v2beta/prediction_service.proto", "../../protos/google/cloud/retail/v2beta/product.proto", "../../protos/google/cloud/retail/v2beta/product_service.proto", + "../../protos/google/cloud/retail/v2beta/promotion.proto", "../../protos/google/cloud/retail/v2beta/purge_config.proto", "../../protos/google/cloud/retail/v2beta/search_service.proto", + "../../protos/google/cloud/retail/v2beta/serving_config.proto", + "../../protos/google/cloud/retail/v2beta/serving_config_service.proto", "../../protos/google/cloud/retail/v2beta/user_event.proto", "../../protos/google/cloud/retail/v2beta/user_event_service.proto" ] 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 d48e22859a0..69ca63706c3 100644 --- a/packages/google-cloud-retail/src/v2beta/search_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/search_service_client.ts @@ -44,8 +44,7 @@ const version = require('../../../package.json').version; * Service for search. * * This feature is only available for users who have Retail Search enabled. - * Please submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * Please enable Retail Search on Cloud Console before using this feature. * @class * @memberof v2beta */ @@ -168,15 +167,27 @@ export class SearchServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + attributesConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' + ), branchPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}' ), catalogPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}' ), + completionConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig' + ), + controlPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' + ), productPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' ), + servingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' + ), }; // Some of the methods on this service return "paged" results, @@ -326,14 +337,13 @@ export class SearchServiceClient { * Performs a search. * * This feature is only available for users who have Retail Search enabled. - * Please submit a form [here](https://cloud.google.com/contact) to contact - * cloud sales if you are interested in using Retail Search. + * Please enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. * @param {string} request.placement * Required. The resource name of the search engine placement, such as - * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. + * `projects/* /locations/global/catalogs/default_catalog/placements/default_search` * This field is used to identify the serving configuration name and the set * of models that will be used to make the search. * @param {string} request.branch @@ -390,6 +400,9 @@ export class SearchServiceClient { * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {string} request.canonicalFilter + * The default filter that is applied when a user performs a search without + * checking any filters on the search page. + * * The filter applied to every search request when quality improvement such as * query expansion is needed. For example, if a query does not have enough * results, an expanded query with @@ -413,11 +426,11 @@ export class SearchServiceClient { * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error * is returned. * @param {google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec} request.dynamicFacetSpec + * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic + * to enable dynamic facets. Do not set this field. + * * The specification for dynamically generated facets. Notice that only * textual facets can be dynamically generated. - * - * This feature requires additional allowlisting. Contact Retail Search - * support team if you are interested in using dynamic facet feature. * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec} request.boostSpec * Boost specification to boost certain products. See more details at this * [user guide](https://cloud.google.com/retail/docs/boosting). @@ -437,11 +450,13 @@ export class SearchServiceClient { * {@link google.cloud.retail.v2beta.Product.Type.VARIANT|variant} * {@link google.cloud.retail.v2beta.Product|Product}s attributes, * {@link google.cloud.retail.v2beta.FulfillmentInfo|FulfillmentInfo} or - * {@link |LocalInventory}s attributes. The attributes from all the matching + * {@link google.cloud.retail.v2beta.LocalInventory|LocalInventory}s attributes. + * The attributes from all the matching * {@link google.cloud.retail.v2beta.Product.Type.VARIANT|variant} - * {@link google.cloud.retail.v2beta.Product|Product}s or {@link |LocalInventory}s are - * merged and de-duplicated. Notice that rollup attributes will lead to extra - * query latency. Maximum number of keys is 30. + * {@link google.cloud.retail.v2beta.Product|Product}s or + * {@link google.cloud.retail.v2beta.LocalInventory|LocalInventory}s are merged and + * de-duplicated. Notice that rollup attributes will lead to extra query + * latency. Maximum number of keys is 30. * * For {@link google.cloud.retail.v2beta.FulfillmentInfo|FulfillmentInfo}, a * fulfillment type and a fulfillment ID must be provided in the format of @@ -516,6 +531,8 @@ export class SearchServiceClient { * @param {google.cloud.retail.v2beta.SearchRequest.SearchMode} request.searchMode * The search mode of the search request. If not specified, a single search * request triggers both product search and faceted search. + * @param {google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec} request.personalizationSpec + * The specification for personalization. * @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. @@ -602,7 +619,7 @@ export class SearchServiceClient { * The request object that will be sent. * @param {string} request.placement * Required. The resource name of the search engine placement, such as - * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. + * `projects/* /locations/global/catalogs/default_catalog/placements/default_search` * This field is used to identify the serving configuration name and the set * of models that will be used to make the search. * @param {string} request.branch @@ -659,6 +676,9 @@ export class SearchServiceClient { * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {string} request.canonicalFilter + * The default filter that is applied when a user performs a search without + * checking any filters on the search page. + * * The filter applied to every search request when quality improvement such as * query expansion is needed. For example, if a query does not have enough * results, an expanded query with @@ -682,11 +702,11 @@ export class SearchServiceClient { * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error * is returned. * @param {google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec} request.dynamicFacetSpec + * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic + * to enable dynamic facets. Do not set this field. + * * The specification for dynamically generated facets. Notice that only * textual facets can be dynamically generated. - * - * This feature requires additional allowlisting. Contact Retail Search - * support team if you are interested in using dynamic facet feature. * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec} request.boostSpec * Boost specification to boost certain products. See more details at this * [user guide](https://cloud.google.com/retail/docs/boosting). @@ -706,11 +726,13 @@ export class SearchServiceClient { * {@link google.cloud.retail.v2beta.Product.Type.VARIANT|variant} * {@link google.cloud.retail.v2beta.Product|Product}s attributes, * {@link google.cloud.retail.v2beta.FulfillmentInfo|FulfillmentInfo} or - * {@link |LocalInventory}s attributes. The attributes from all the matching + * {@link google.cloud.retail.v2beta.LocalInventory|LocalInventory}s attributes. + * The attributes from all the matching * {@link google.cloud.retail.v2beta.Product.Type.VARIANT|variant} - * {@link google.cloud.retail.v2beta.Product|Product}s or {@link |LocalInventory}s are - * merged and de-duplicated. Notice that rollup attributes will lead to extra - * query latency. Maximum number of keys is 30. + * {@link google.cloud.retail.v2beta.Product|Product}s or + * {@link google.cloud.retail.v2beta.LocalInventory|LocalInventory}s are merged and + * de-duplicated. Notice that rollup attributes will lead to extra query + * latency. Maximum number of keys is 30. * * For {@link google.cloud.retail.v2beta.FulfillmentInfo|FulfillmentInfo}, a * fulfillment type and a fulfillment ID must be provided in the format of @@ -785,6 +807,8 @@ export class SearchServiceClient { * @param {google.cloud.retail.v2beta.SearchRequest.SearchMode} request.searchMode * The search mode of the search request. If not specified, a single search * request triggers both product search and faceted search. + * @param {google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec} request.personalizationSpec + * The specification for personalization. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -827,7 +851,7 @@ export class SearchServiceClient { * The request object that will be sent. * @param {string} request.placement * Required. The resource name of the search engine placement, such as - * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. + * `projects/* /locations/global/catalogs/default_catalog/placements/default_search` * This field is used to identify the serving configuration name and the set * of models that will be used to make the search. * @param {string} request.branch @@ -884,6 +908,9 @@ export class SearchServiceClient { * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {string} request.canonicalFilter + * The default filter that is applied when a user performs a search without + * checking any filters on the search page. + * * The filter applied to every search request when quality improvement such as * query expansion is needed. For example, if a query does not have enough * results, an expanded query with @@ -907,11 +934,11 @@ export class SearchServiceClient { * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error * is returned. * @param {google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec} request.dynamicFacetSpec + * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic + * to enable dynamic facets. Do not set this field. + * * The specification for dynamically generated facets. Notice that only * textual facets can be dynamically generated. - * - * This feature requires additional allowlisting. Contact Retail Search - * support team if you are interested in using dynamic facet feature. * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec} request.boostSpec * Boost specification to boost certain products. See more details at this * [user guide](https://cloud.google.com/retail/docs/boosting). @@ -931,11 +958,13 @@ export class SearchServiceClient { * {@link google.cloud.retail.v2beta.Product.Type.VARIANT|variant} * {@link google.cloud.retail.v2beta.Product|Product}s attributes, * {@link google.cloud.retail.v2beta.FulfillmentInfo|FulfillmentInfo} or - * {@link |LocalInventory}s attributes. The attributes from all the matching + * {@link google.cloud.retail.v2beta.LocalInventory|LocalInventory}s attributes. + * The attributes from all the matching * {@link google.cloud.retail.v2beta.Product.Type.VARIANT|variant} - * {@link google.cloud.retail.v2beta.Product|Product}s or {@link |LocalInventory}s are - * merged and de-duplicated. Notice that rollup attributes will lead to extra - * query latency. Maximum number of keys is 30. + * {@link google.cloud.retail.v2beta.Product|Product}s or + * {@link google.cloud.retail.v2beta.LocalInventory|LocalInventory}s are merged and + * de-duplicated. Notice that rollup attributes will lead to extra query + * latency. Maximum number of keys is 30. * * For {@link google.cloud.retail.v2beta.FulfillmentInfo|FulfillmentInfo}, a * fulfillment type and a fulfillment ID must be provided in the format of @@ -1010,6 +1039,8 @@ export class SearchServiceClient { * @param {google.cloud.retail.v2beta.SearchRequest.SearchMode} request.searchMode * The search mode of the search request. If not specified, a single search * request triggers both product search and faceted search. + * @param {google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec} request.personalizationSpec + * The specification for personalization. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -1048,6 +1079,61 @@ export class SearchServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified attributesConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + attributesConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.attributesConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).project; + } + + /** + * Parse the location from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).location; + } + + /** + * Parse the catalog from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).catalog; + } + /** * Return a fully-qualified branch resource name string. * @@ -1164,6 +1250,128 @@ export class SearchServiceClient { return this.pathTemplates.catalogPathTemplate.match(catalogName).catalog; } + /** + * Return a fully-qualified completionConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + completionConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.completionConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).project; + } + + /** + * Parse the location from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).location; + } + + /** + * Parse the catalog from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).catalog; + } + + /** + * Return a fully-qualified control resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} control + * @returns {string} Resource name string. + */ + controlPath( + project: string, + location: string, + catalog: string, + control: string + ) { + return this.pathTemplates.controlPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + control: control, + }); + } + + /** + * Parse the project from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the project. + */ + matchProjectFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).project; + } + + /** + * Parse the location from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the location. + */ + matchLocationFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).location; + } + + /** + * Parse the catalog from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).catalog; + } + + /** + * Parse the control from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the control. + */ + matchControlFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).control; + } + /** * Return a fully-qualified product resource name string. * @@ -1245,6 +1453,77 @@ export class SearchServiceClient { return this.pathTemplates.productPathTemplate.match(productName).product; } + /** + * Return a fully-qualified servingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} serving_config + * @returns {string} Resource name string. + */ + servingConfigPath( + project: string, + location: string, + catalog: string, + servingConfig: string + ) { + return this.pathTemplates.servingConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + serving_config: servingConfig, + }); + } + + /** + * Parse the project from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .project; + } + + /** + * Parse the location from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .location; + } + + /** + * Parse the catalog from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .catalog; + } + + /** + * Parse the serving_config from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the serving_config. + */ + matchServingConfigFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .serving_config; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-retail/src/v2beta/search_service_proto_list.json b/packages/google-cloud-retail/src/v2beta/search_service_proto_list.json index 4ec26e01ef2..7cee73e6f3f 100644 --- a/packages/google-cloud-retail/src/v2beta/search_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2beta/search_service_proto_list.json @@ -3,13 +3,18 @@ "../../protos/google/cloud/retail/v2beta/catalog_service.proto", "../../protos/google/cloud/retail/v2beta/common.proto", "../../protos/google/cloud/retail/v2beta/completion_service.proto", + "../../protos/google/cloud/retail/v2beta/control.proto", + "../../protos/google/cloud/retail/v2beta/control_service.proto", "../../protos/google/cloud/retail/v2beta/export_config.proto", "../../protos/google/cloud/retail/v2beta/import_config.proto", "../../protos/google/cloud/retail/v2beta/prediction_service.proto", "../../protos/google/cloud/retail/v2beta/product.proto", "../../protos/google/cloud/retail/v2beta/product_service.proto", + "../../protos/google/cloud/retail/v2beta/promotion.proto", "../../protos/google/cloud/retail/v2beta/purge_config.proto", "../../protos/google/cloud/retail/v2beta/search_service.proto", + "../../protos/google/cloud/retail/v2beta/serving_config.proto", + "../../protos/google/cloud/retail/v2beta/serving_config_service.proto", "../../protos/google/cloud/retail/v2beta/user_event.proto", "../../protos/google/cloud/retail/v2beta/user_event_service.proto" ] 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 new file mode 100644 index 00000000000..2695705160d --- /dev/null +++ b/packages/google-cloud-retail/src/v2beta/serving_config_service_client.ts @@ -0,0 +1,1520 @@ +// 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. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v2beta/serving_config_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './serving_config_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service for modifying ServingConfig. + * @class + * @memberof v2beta + */ +export class ServingConfigServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + servingConfigServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ServingConfigServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ServingConfigServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // 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; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + attributesConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' + ), + catalogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}' + ), + completionConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig' + ), + controlPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' + ), + productPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' + ), + servingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listServingConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'servingConfigs' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.retail.v2beta.ServingConfigService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.servingConfigServiceStub) { + return this.servingConfigServiceStub; + } + + // Put together the "service stub" for + // google.cloud.retail.v2beta.ServingConfigService. + this.servingConfigServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.retail.v2beta.ServingConfigService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.retail.v2beta.ServingConfigService, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const servingConfigServiceStubMethods = [ + 'createServingConfig', + 'deleteServingConfig', + 'updateServingConfig', + 'getServingConfig', + 'listServingConfigs', + 'addControl', + 'removeControl', + ]; + for (const methodName of servingConfigServiceStubMethods) { + const callPromise = this.servingConfigServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.servingConfigServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'retail.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'retail.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Creates a ServingConfig. + * + * A maximum of 100 {@link google.cloud.retail.v2beta.ServingConfig|ServingConfig}s + * are allowed in a {@link google.cloud.retail.v2beta.Catalog|Catalog}, otherwise + * a FAILED_PRECONDITION error is returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Full resource name of parent. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * @param {google.cloud.retail.v2beta.ServingConfig} request.servingConfig + * Required. The ServingConfig to create. + * @param {string} request.servingConfigId + * Required. The ID to use for the ServingConfig, which will become the final + * component of the ServingConfig's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link 0-9|a-z}-_/. + * @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 [ServingConfig]{@link google.cloud.retail.v2beta.ServingConfig}. + * 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/v2beta/serving_config_service.create_serving_config.js + * region_tag:retail_v2beta_generated_ServingConfigService_CreateServingConfig_async + */ + createServingConfig( + request?: protos.google.cloud.retail.v2beta.ICreateServingConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2beta.IServingConfig, + protos.google.cloud.retail.v2beta.ICreateServingConfigRequest | undefined, + {} | undefined + ] + >; + createServingConfig( + request: protos.google.cloud.retail.v2beta.ICreateServingConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + | protos.google.cloud.retail.v2beta.ICreateServingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createServingConfig( + request: protos.google.cloud.retail.v2beta.ICreateServingConfigRequest, + callback: Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + | protos.google.cloud.retail.v2beta.ICreateServingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createServingConfig( + request?: protos.google.cloud.retail.v2beta.ICreateServingConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + | protos.google.cloud.retail.v2beta.ICreateServingConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + | protos.google.cloud.retail.v2beta.ICreateServingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2beta.IServingConfig, + protos.google.cloud.retail.v2beta.ICreateServingConfigRequest | 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'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createServingConfig(request, options, callback); + } + /** + * Deletes a ServingConfig. + * + * Returns a NotFound error if the ServingConfig does not exist. + * + * @param {Object} request + * 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} + * @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 [Empty]{@link google.protobuf.Empty}. + * 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/v2beta/serving_config_service.delete_serving_config.js + * region_tag:retail_v2beta_generated_ServingConfigService_DeleteServingConfig_async + */ + deleteServingConfig( + request?: protos.google.cloud.retail.v2beta.IDeleteServingConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.retail.v2beta.IDeleteServingConfigRequest | undefined, + {} | undefined + ] + >; + deleteServingConfig( + request: protos.google.cloud.retail.v2beta.IDeleteServingConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.retail.v2beta.IDeleteServingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteServingConfig( + request: protos.google.cloud.retail.v2beta.IDeleteServingConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.retail.v2beta.IDeleteServingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteServingConfig( + request?: protos.google.cloud.retail.v2beta.IDeleteServingConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.retail.v2beta.IDeleteServingConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.retail.v2beta.IDeleteServingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.retail.v2beta.IDeleteServingConfigRequest | 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'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteServingConfig(request, options, callback); + } + /** + * Updates a ServingConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.retail.v2beta.ServingConfig} request.servingConfig + * Required. The ServingConfig to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Indicates which fields in the provided + * {@link google.cloud.retail.v2beta.ServingConfig|ServingConfig} to update. The + * following are NOT supported: + * + * * {@link google.cloud.retail.v2beta.ServingConfig.name|ServingConfig.name} + * + * If not set, all supported fields are updated. + * @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 [ServingConfig]{@link google.cloud.retail.v2beta.ServingConfig}. + * 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/v2beta/serving_config_service.update_serving_config.js + * region_tag:retail_v2beta_generated_ServingConfigService_UpdateServingConfig_async + */ + updateServingConfig( + request?: protos.google.cloud.retail.v2beta.IUpdateServingConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2beta.IServingConfig, + protos.google.cloud.retail.v2beta.IUpdateServingConfigRequest | undefined, + {} | undefined + ] + >; + updateServingConfig( + request: protos.google.cloud.retail.v2beta.IUpdateServingConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + | protos.google.cloud.retail.v2beta.IUpdateServingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateServingConfig( + request: protos.google.cloud.retail.v2beta.IUpdateServingConfigRequest, + callback: Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + | protos.google.cloud.retail.v2beta.IUpdateServingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateServingConfig( + request?: protos.google.cloud.retail.v2beta.IUpdateServingConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + | protos.google.cloud.retail.v2beta.IUpdateServingConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + | protos.google.cloud.retail.v2beta.IUpdateServingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2beta.IServingConfig, + protos.google.cloud.retail.v2beta.IUpdateServingConfigRequest | 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'] = + gax.routingHeader.fromParams({ + 'serving_config.name': request.servingConfig!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateServingConfig(request, options, callback); + } + /** + * Gets a ServingConfig. + * + * Returns a NotFound error if the ServingConfig does not exist. + * + * @param {Object} request + * 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} + * @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 [ServingConfig]{@link google.cloud.retail.v2beta.ServingConfig}. + * 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/v2beta/serving_config_service.get_serving_config.js + * region_tag:retail_v2beta_generated_ServingConfigService_GetServingConfig_async + */ + getServingConfig( + request?: protos.google.cloud.retail.v2beta.IGetServingConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2beta.IServingConfig, + protos.google.cloud.retail.v2beta.IGetServingConfigRequest | undefined, + {} | undefined + ] + >; + getServingConfig( + request: protos.google.cloud.retail.v2beta.IGetServingConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + | protos.google.cloud.retail.v2beta.IGetServingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getServingConfig( + request: protos.google.cloud.retail.v2beta.IGetServingConfigRequest, + callback: Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + | protos.google.cloud.retail.v2beta.IGetServingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getServingConfig( + request?: protos.google.cloud.retail.v2beta.IGetServingConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + | protos.google.cloud.retail.v2beta.IGetServingConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + | protos.google.cloud.retail.v2beta.IGetServingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2beta.IServingConfig, + protos.google.cloud.retail.v2beta.IGetServingConfigRequest | 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'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getServingConfig(request, options, callback); + } + /** + * Enables a Control on the specified ServingConfig. + * The control is added in the last position of the list of controls + * it belongs to (e.g. if it's a facet spec control it will be applied + * in the last position of servingConfig.facetSpecIds) + * Returns a ALREADY_EXISTS error if the control has already been applied. + * Returns a FAILED_PRECONDITION error if the addition could exceed maximum + * number of control allowed for that type of control. + * + * @param {Object} request + * 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} + * @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. + * @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 [ServingConfig]{@link google.cloud.retail.v2beta.ServingConfig}. + * 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/v2beta/serving_config_service.add_control.js + * region_tag:retail_v2beta_generated_ServingConfigService_AddControl_async + */ + addControl( + request?: protos.google.cloud.retail.v2beta.IAddControlRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2beta.IServingConfig, + protos.google.cloud.retail.v2beta.IAddControlRequest | undefined, + {} | undefined + ] + >; + addControl( + request: protos.google.cloud.retail.v2beta.IAddControlRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + protos.google.cloud.retail.v2beta.IAddControlRequest | null | undefined, + {} | null | undefined + > + ): void; + addControl( + request: protos.google.cloud.retail.v2beta.IAddControlRequest, + callback: Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + protos.google.cloud.retail.v2beta.IAddControlRequest | null | undefined, + {} | null | undefined + > + ): void; + addControl( + request?: protos.google.cloud.retail.v2beta.IAddControlRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + | protos.google.cloud.retail.v2beta.IAddControlRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + protos.google.cloud.retail.v2beta.IAddControlRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2beta.IServingConfig, + protos.google.cloud.retail.v2beta.IAddControlRequest | 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'] = + gax.routingHeader.fromParams({ + serving_config: request.servingConfig || '', + }); + this.initialize(); + return this.innerApiCalls.addControl(request, options, callback); + } + /** + * Disables a Control on the specified ServingConfig. + * The control is removed from the ServingConfig. + * Returns a NOT_FOUND error if the Control is not enabled for the + * ServingConfig. + * + * @param {Object} request + * 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} + * @param {string} request.controlId + * Required. The id of the control to apply. Assumed to be in the same catalog + * as the serving config. + * @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 [ServingConfig]{@link google.cloud.retail.v2beta.ServingConfig}. + * 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/v2beta/serving_config_service.remove_control.js + * region_tag:retail_v2beta_generated_ServingConfigService_RemoveControl_async + */ + removeControl( + request?: protos.google.cloud.retail.v2beta.IRemoveControlRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2beta.IServingConfig, + protos.google.cloud.retail.v2beta.IRemoveControlRequest | undefined, + {} | undefined + ] + >; + removeControl( + request: protos.google.cloud.retail.v2beta.IRemoveControlRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + | protos.google.cloud.retail.v2beta.IRemoveControlRequest + | null + | undefined, + {} | null | undefined + > + ): void; + removeControl( + request: protos.google.cloud.retail.v2beta.IRemoveControlRequest, + callback: Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + | protos.google.cloud.retail.v2beta.IRemoveControlRequest + | null + | undefined, + {} | null | undefined + > + ): void; + removeControl( + request?: protos.google.cloud.retail.v2beta.IRemoveControlRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + | protos.google.cloud.retail.v2beta.IRemoveControlRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2beta.IServingConfig, + | protos.google.cloud.retail.v2beta.IRemoveControlRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2beta.IServingConfig, + protos.google.cloud.retail.v2beta.IRemoveControlRequest | 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'] = + gax.routingHeader.fromParams({ + serving_config: request.servingConfig || '', + }); + this.initialize(); + return this.innerApiCalls.removeControl(request, options, callback); + } + + /** + * Lists all ServingConfigs linked to this catalog. + * + * @param {Object} request + * 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} + * @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 + * returned. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListServingConfigs` call. + * Provide this to retrieve the subsequent page. + * @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 Array of [ServingConfig]{@link google.cloud.retail.v2beta.ServingConfig}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listServingConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listServingConfigs( + request?: protos.google.cloud.retail.v2beta.IListServingConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2beta.IServingConfig[], + protos.google.cloud.retail.v2beta.IListServingConfigsRequest | null, + protos.google.cloud.retail.v2beta.IListServingConfigsResponse + ] + >; + listServingConfigs( + request: protos.google.cloud.retail.v2beta.IListServingConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.retail.v2beta.IListServingConfigsRequest, + | protos.google.cloud.retail.v2beta.IListServingConfigsResponse + | null + | undefined, + protos.google.cloud.retail.v2beta.IServingConfig + > + ): void; + listServingConfigs( + request: protos.google.cloud.retail.v2beta.IListServingConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.retail.v2beta.IListServingConfigsRequest, + | protos.google.cloud.retail.v2beta.IListServingConfigsResponse + | null + | undefined, + protos.google.cloud.retail.v2beta.IServingConfig + > + ): void; + listServingConfigs( + request?: protos.google.cloud.retail.v2beta.IListServingConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.retail.v2beta.IListServingConfigsRequest, + | protos.google.cloud.retail.v2beta.IListServingConfigsResponse + | null + | undefined, + protos.google.cloud.retail.v2beta.IServingConfig + >, + callback?: PaginationCallback< + protos.google.cloud.retail.v2beta.IListServingConfigsRequest, + | protos.google.cloud.retail.v2beta.IListServingConfigsResponse + | null + | undefined, + protos.google.cloud.retail.v2beta.IServingConfig + > + ): Promise< + [ + protos.google.cloud.retail.v2beta.IServingConfig[], + protos.google.cloud.retail.v2beta.IListServingConfigsRequest | null, + protos.google.cloud.retail.v2beta.IListServingConfigsResponse + ] + > | 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'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listServingConfigs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * 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} + * @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 + * returned. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListServingConfigs` call. + * Provide this to retrieve the subsequent page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ServingConfig]{@link google.cloud.retail.v2beta.ServingConfig} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listServingConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listServingConfigsStream( + request?: protos.google.cloud.retail.v2beta.IListServingConfigsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const defaultCallSettings = this._defaults['listServingConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listServingConfigs.createStream( + this.innerApiCalls.listServingConfigs as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listServingConfigs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * 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} + * @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 + * returned. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListServingConfigs` call. + * Provide this to retrieve the subsequent page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ServingConfig]{@link google.cloud.retail.v2beta.ServingConfig}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v2beta/serving_config_service.list_serving_configs.js + * region_tag:retail_v2beta_generated_ServingConfigService_ListServingConfigs_async + */ + listServingConfigsAsync( + request?: protos.google.cloud.retail.v2beta.IListServingConfigsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const defaultCallSettings = this._defaults['listServingConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listServingConfigs.asyncIterate( + this.innerApiCalls['listServingConfigs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified attributesConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + attributesConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.attributesConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).project; + } + + /** + * Parse the location from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).location; + } + + /** + * Parse the catalog from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).catalog; + } + + /** + * Return a fully-qualified catalog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + catalogPath(project: string, location: string, catalog: string) { + return this.pathTemplates.catalogPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from Catalog resource. + * + * @param {string} catalogName + * A fully-qualified path representing Catalog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCatalogName(catalogName: string) { + return this.pathTemplates.catalogPathTemplate.match(catalogName).project; + } + + /** + * Parse the location from Catalog resource. + * + * @param {string} catalogName + * A fully-qualified path representing Catalog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCatalogName(catalogName: string) { + return this.pathTemplates.catalogPathTemplate.match(catalogName).location; + } + + /** + * Parse the catalog from Catalog resource. + * + * @param {string} catalogName + * A fully-qualified path representing Catalog resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromCatalogName(catalogName: string) { + return this.pathTemplates.catalogPathTemplate.match(catalogName).catalog; + } + + /** + * Return a fully-qualified completionConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + completionConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.completionConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).project; + } + + /** + * Parse the location from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).location; + } + + /** + * Parse the catalog from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).catalog; + } + + /** + * Return a fully-qualified control resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} control + * @returns {string} Resource name string. + */ + controlPath( + project: string, + location: string, + catalog: string, + control: string + ) { + return this.pathTemplates.controlPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + control: control, + }); + } + + /** + * Parse the project from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the project. + */ + matchProjectFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).project; + } + + /** + * Parse the location from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the location. + */ + matchLocationFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).location; + } + + /** + * Parse the catalog from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).catalog; + } + + /** + * Parse the control from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the control. + */ + matchControlFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).control; + } + + /** + * Return a fully-qualified product resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} branch + * @param {string} product + * @returns {string} Resource name string. + */ + productPath( + project: string, + location: string, + catalog: string, + branch: string, + product: string + ) { + return this.pathTemplates.productPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + branch: branch, + product: product, + }); + } + + /** + * Parse the project from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).project; + } + + /** + * Parse the location from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).location; + } + + /** + * Parse the catalog from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).catalog; + } + + /** + * Parse the branch from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).branch; + } + + /** + * Parse the product from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the product. + */ + matchProductFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).product; + } + + /** + * Return a fully-qualified servingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} serving_config + * @returns {string} Resource name string. + */ + servingConfigPath( + project: string, + location: string, + catalog: string, + servingConfig: string + ) { + return this.pathTemplates.servingConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + serving_config: servingConfig, + }); + } + + /** + * Parse the project from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .project; + } + + /** + * Parse the location from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .location; + } + + /** + * Parse the catalog from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .catalog; + } + + /** + * Parse the serving_config from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the serving_config. + */ + matchServingConfigFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .serving_config; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.servingConfigServiceStub && !this._terminated) { + return this.servingConfigServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-retail/src/v2beta/serving_config_service_client_config.json b/packages/google-cloud-retail/src/v2beta/serving_config_service_client_config.json new file mode 100644 index 00000000000..2d17b5273c2 --- /dev/null +++ b/packages/google-cloud-retail/src/v2beta/serving_config_service_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.retail.v2beta.ServingConfigService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateServingConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteServingConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateServingConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetServingConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListServingConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddControl": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveControl": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-retail/src/v2beta/serving_config_service_proto_list.json b/packages/google-cloud-retail/src/v2beta/serving_config_service_proto_list.json new file mode 100644 index 00000000000..7cee73e6f3f --- /dev/null +++ b/packages/google-cloud-retail/src/v2beta/serving_config_service_proto_list.json @@ -0,0 +1,20 @@ +[ + "../../protos/google/cloud/retail/v2beta/catalog.proto", + "../../protos/google/cloud/retail/v2beta/catalog_service.proto", + "../../protos/google/cloud/retail/v2beta/common.proto", + "../../protos/google/cloud/retail/v2beta/completion_service.proto", + "../../protos/google/cloud/retail/v2beta/control.proto", + "../../protos/google/cloud/retail/v2beta/control_service.proto", + "../../protos/google/cloud/retail/v2beta/export_config.proto", + "../../protos/google/cloud/retail/v2beta/import_config.proto", + "../../protos/google/cloud/retail/v2beta/prediction_service.proto", + "../../protos/google/cloud/retail/v2beta/product.proto", + "../../protos/google/cloud/retail/v2beta/product_service.proto", + "../../protos/google/cloud/retail/v2beta/promotion.proto", + "../../protos/google/cloud/retail/v2beta/purge_config.proto", + "../../protos/google/cloud/retail/v2beta/search_service.proto", + "../../protos/google/cloud/retail/v2beta/serving_config.proto", + "../../protos/google/cloud/retail/v2beta/serving_config_service.proto", + "../../protos/google/cloud/retail/v2beta/user_event.proto", + "../../protos/google/cloud/retail/v2beta/user_event_service.proto" +] 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 b927ad9af4e..68813baf6ad 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 @@ -162,12 +162,24 @@ export class UserEventServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + attributesConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' + ), catalogPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}' ), + completionConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig' + ), + controlPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' + ), productPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' ), + servingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -879,13 +891,14 @@ export class UserEventServiceClient { >; } /** - * Triggers a user event rejoin operation with latest product catalog. Events + * 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 API can be used to trigger a 'join' operation on specified + * 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 wrong product catalog. + * 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. @@ -1031,6 +1044,61 @@ export class UserEventServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified attributesConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + attributesConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.attributesConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).project; + } + + /** + * Parse the location from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).location; + } + + /** + * Parse the catalog from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).catalog; + } + /** * Return a fully-qualified catalog resource name string. * @@ -1080,6 +1148,128 @@ export class UserEventServiceClient { return this.pathTemplates.catalogPathTemplate.match(catalogName).catalog; } + /** + * Return a fully-qualified completionConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + completionConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.completionConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).project; + } + + /** + * Parse the location from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).location; + } + + /** + * Parse the catalog from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).catalog; + } + + /** + * Return a fully-qualified control resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} control + * @returns {string} Resource name string. + */ + controlPath( + project: string, + location: string, + catalog: string, + control: string + ) { + return this.pathTemplates.controlPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + control: control, + }); + } + + /** + * Parse the project from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the project. + */ + matchProjectFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).project; + } + + /** + * Parse the location from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the location. + */ + matchLocationFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).location; + } + + /** + * Parse the catalog from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).catalog; + } + + /** + * Parse the control from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the control. + */ + matchControlFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).control; + } + /** * Return a fully-qualified product resource name string. * @@ -1161,6 +1351,77 @@ export class UserEventServiceClient { return this.pathTemplates.productPathTemplate.match(productName).product; } + /** + * Return a fully-qualified servingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} serving_config + * @returns {string} Resource name string. + */ + servingConfigPath( + project: string, + location: string, + catalog: string, + servingConfig: string + ) { + return this.pathTemplates.servingConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + serving_config: servingConfig, + }); + } + + /** + * Parse the project from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .project; + } + + /** + * Parse the location from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .location; + } + + /** + * Parse the catalog from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .catalog; + } + + /** + * Parse the serving_config from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the serving_config. + */ + matchServingConfigFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .serving_config; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-retail/src/v2beta/user_event_service_proto_list.json b/packages/google-cloud-retail/src/v2beta/user_event_service_proto_list.json index 4ec26e01ef2..7cee73e6f3f 100644 --- a/packages/google-cloud-retail/src/v2beta/user_event_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2beta/user_event_service_proto_list.json @@ -3,13 +3,18 @@ "../../protos/google/cloud/retail/v2beta/catalog_service.proto", "../../protos/google/cloud/retail/v2beta/common.proto", "../../protos/google/cloud/retail/v2beta/completion_service.proto", + "../../protos/google/cloud/retail/v2beta/control.proto", + "../../protos/google/cloud/retail/v2beta/control_service.proto", "../../protos/google/cloud/retail/v2beta/export_config.proto", "../../protos/google/cloud/retail/v2beta/import_config.proto", "../../protos/google/cloud/retail/v2beta/prediction_service.proto", "../../protos/google/cloud/retail/v2beta/product.proto", "../../protos/google/cloud/retail/v2beta/product_service.proto", + "../../protos/google/cloud/retail/v2beta/promotion.proto", "../../protos/google/cloud/retail/v2beta/purge_config.proto", "../../protos/google/cloud/retail/v2beta/search_service.proto", + "../../protos/google/cloud/retail/v2beta/serving_config.proto", + "../../protos/google/cloud/retail/v2beta/serving_config_service.proto", "../../protos/google/cloud/retail/v2beta/user_event.proto", "../../protos/google/cloud/retail/v2beta/user_event_service.proto" ] diff --git a/packages/google-cloud-retail/system-test/fixtures/sample/src/index.js b/packages/google-cloud-retail/system-test/fixtures/sample/src/index.js index 986ce62b21c..2416074dc50 100644 --- a/packages/google-cloud-retail/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-retail/system-test/fixtures/sample/src/index.js @@ -22,9 +22,11 @@ const retail = require('@google-cloud/retail'); function main() { const catalogServiceClient = new retail.CatalogServiceClient(); const completionServiceClient = new retail.CompletionServiceClient(); + const controlServiceClient = new retail.ControlServiceClient(); const predictionServiceClient = new retail.PredictionServiceClient(); const productServiceClient = new retail.ProductServiceClient(); const searchServiceClient = new retail.SearchServiceClient(); + const servingConfigServiceClient = new retail.ServingConfigServiceClient(); const userEventServiceClient = new retail.UserEventServiceClient(); } diff --git a/packages/google-cloud-retail/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-retail/system-test/fixtures/sample/src/index.ts index 4dfeab32f92..d913e8282d1 100644 --- a/packages/google-cloud-retail/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-retail/system-test/fixtures/sample/src/index.ts @@ -19,9 +19,11 @@ import { CatalogServiceClient, CompletionServiceClient, + ControlServiceClient, PredictionServiceClient, ProductServiceClient, SearchServiceClient, + ServingConfigServiceClient, UserEventServiceClient, } from '@google-cloud/retail'; @@ -32,6 +34,9 @@ function doStuffWithCatalogServiceClient(client: CatalogServiceClient) { function doStuffWithCompletionServiceClient(client: CompletionServiceClient) { client.close(); } +function doStuffWithControlServiceClient(client: ControlServiceClient) { + client.close(); +} function doStuffWithPredictionServiceClient(client: PredictionServiceClient) { client.close(); } @@ -41,6 +46,11 @@ function doStuffWithProductServiceClient(client: ProductServiceClient) { function doStuffWithSearchServiceClient(client: SearchServiceClient) { client.close(); } +function doStuffWithServingConfigServiceClient( + client: ServingConfigServiceClient +) { + client.close(); +} function doStuffWithUserEventServiceClient(client: UserEventServiceClient) { client.close(); } @@ -53,6 +63,9 @@ function main() { const completionServiceClient = new CompletionServiceClient(); doStuffWithCompletionServiceClient(completionServiceClient); // check that the client instance can be created + const controlServiceClient = new ControlServiceClient(); + doStuffWithControlServiceClient(controlServiceClient); + // check that the client instance can be created const predictionServiceClient = new PredictionServiceClient(); doStuffWithPredictionServiceClient(predictionServiceClient); // check that the client instance can be created @@ -62,6 +75,9 @@ function main() { const searchServiceClient = new SearchServiceClient(); doStuffWithSearchServiceClient(searchServiceClient); // check that the client instance can be created + const servingConfigServiceClient = new ServingConfigServiceClient(); + doStuffWithServingConfigServiceClient(servingConfigServiceClient); + // check that the client instance can be created const userEventServiceClient = new UserEventServiceClient(); doStuffWithUserEventServiceClient(userEventServiceClient); } diff --git a/packages/google-cloud-retail/test/gapic_catalog_service_v2beta.ts b/packages/google-cloud-retail/test/gapic_catalog_service_v2beta.ts index 0d44d0303bf..9ad1be17b7c 100644 --- a/packages/google-cloud-retail/test/gapic_catalog_service_v2beta.ts +++ b/packages/google-cloud-retail/test/gapic_catalog_service_v2beta.ts @@ -592,6 +592,927 @@ describe('v2beta.CatalogServiceClient', () => { }); }); + describe('getCompletionConfig', () => { + it('invokes getCompletionConfig without error', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.GetCompletionConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.CompletionConfig() + ); + client.innerApiCalls.getCompletionConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.getCompletionConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getCompletionConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getCompletionConfig without error using callback', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.GetCompletionConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.CompletionConfig() + ); + client.innerApiCalls.getCompletionConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCompletionConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2beta.ICompletionConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getCompletionConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getCompletionConfig with error', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.GetCompletionConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getCompletionConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getCompletionConfig(request), expectedError); + assert( + (client.innerApiCalls.getCompletionConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getCompletionConfig with closed client', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.GetCompletionConfigRequest() + ); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCompletionConfig(request), expectedError); + }); + }); + + describe('updateCompletionConfig', () => { + it('invokes updateCompletionConfig without error', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.UpdateCompletionConfigRequest() + ); + request.completionConfig = {}; + request.completionConfig.name = ''; + const expectedHeaderRequestParams = 'completion_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.CompletionConfig() + ); + client.innerApiCalls.updateCompletionConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.updateCompletionConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateCompletionConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateCompletionConfig without error using callback', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.UpdateCompletionConfigRequest() + ); + request.completionConfig = {}; + request.completionConfig.name = ''; + const expectedHeaderRequestParams = 'completion_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.CompletionConfig() + ); + client.innerApiCalls.updateCompletionConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCompletionConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2beta.ICompletionConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateCompletionConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateCompletionConfig with error', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.UpdateCompletionConfigRequest() + ); + request.completionConfig = {}; + request.completionConfig.name = ''; + const expectedHeaderRequestParams = 'completion_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCompletionConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateCompletionConfig(request), + expectedError + ); + assert( + (client.innerApiCalls.updateCompletionConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateCompletionConfig with closed client', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.UpdateCompletionConfigRequest() + ); + request.completionConfig = {}; + request.completionConfig.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateCompletionConfig(request), + expectedError + ); + }); + }); + + describe('getAttributesConfig', () => { + it('invokes getAttributesConfig without error', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.GetAttributesConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AttributesConfig() + ); + client.innerApiCalls.getAttributesConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.getAttributesConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getAttributesConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getAttributesConfig without error using callback', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.GetAttributesConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AttributesConfig() + ); + client.innerApiCalls.getAttributesConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAttributesConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2beta.IAttributesConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getAttributesConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getAttributesConfig with error', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.GetAttributesConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getAttributesConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getAttributesConfig(request), expectedError); + assert( + (client.innerApiCalls.getAttributesConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getAttributesConfig with closed client', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.GetAttributesConfigRequest() + ); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAttributesConfig(request), expectedError); + }); + }); + + describe('updateAttributesConfig', () => { + it('invokes updateAttributesConfig without error', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.UpdateAttributesConfigRequest() + ); + request.attributesConfig = {}; + request.attributesConfig.name = ''; + const expectedHeaderRequestParams = 'attributes_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AttributesConfig() + ); + client.innerApiCalls.updateAttributesConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.updateAttributesConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateAttributesConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateAttributesConfig without error using callback', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.UpdateAttributesConfigRequest() + ); + request.attributesConfig = {}; + request.attributesConfig.name = ''; + const expectedHeaderRequestParams = 'attributes_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AttributesConfig() + ); + client.innerApiCalls.updateAttributesConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAttributesConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2beta.IAttributesConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateAttributesConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateAttributesConfig with error', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.UpdateAttributesConfigRequest() + ); + request.attributesConfig = {}; + request.attributesConfig.name = ''; + const expectedHeaderRequestParams = 'attributes_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAttributesConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateAttributesConfig(request), + expectedError + ); + assert( + (client.innerApiCalls.updateAttributesConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateAttributesConfig with closed client', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.UpdateAttributesConfigRequest() + ); + request.attributesConfig = {}; + request.attributesConfig.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateAttributesConfig(request), + expectedError + ); + }); + }); + + describe('addCatalogAttribute', () => { + it('invokes addCatalogAttribute without error', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AddCatalogAttributeRequest() + ); + request.attributesConfig = ''; + const expectedHeaderRequestParams = 'attributes_config='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AttributesConfig() + ); + client.innerApiCalls.addCatalogAttribute = + stubSimpleCall(expectedResponse); + const [response] = await client.addCatalogAttribute(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addCatalogAttribute as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addCatalogAttribute without error using callback', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AddCatalogAttributeRequest() + ); + request.attributesConfig = ''; + const expectedHeaderRequestParams = 'attributes_config='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AttributesConfig() + ); + client.innerApiCalls.addCatalogAttribute = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addCatalogAttribute( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2beta.IAttributesConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addCatalogAttribute as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addCatalogAttribute with error', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AddCatalogAttributeRequest() + ); + request.attributesConfig = ''; + const expectedHeaderRequestParams = 'attributes_config='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addCatalogAttribute = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.addCatalogAttribute(request), expectedError); + assert( + (client.innerApiCalls.addCatalogAttribute as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addCatalogAttribute with closed client', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AddCatalogAttributeRequest() + ); + request.attributesConfig = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.addCatalogAttribute(request), expectedError); + }); + }); + + describe('removeCatalogAttribute', () => { + it('invokes removeCatalogAttribute without error', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest() + ); + request.attributesConfig = ''; + const expectedHeaderRequestParams = 'attributes_config='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AttributesConfig() + ); + client.innerApiCalls.removeCatalogAttribute = + stubSimpleCall(expectedResponse); + const [response] = await client.removeCatalogAttribute(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeCatalogAttribute as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removeCatalogAttribute without error using callback', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest() + ); + request.attributesConfig = ''; + const expectedHeaderRequestParams = 'attributes_config='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AttributesConfig() + ); + client.innerApiCalls.removeCatalogAttribute = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeCatalogAttribute( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2beta.IAttributesConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeCatalogAttribute as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes removeCatalogAttribute with error', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest() + ); + request.attributesConfig = ''; + const expectedHeaderRequestParams = 'attributes_config='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeCatalogAttribute = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.removeCatalogAttribute(request), + expectedError + ); + assert( + (client.innerApiCalls.removeCatalogAttribute as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removeCatalogAttribute with closed client', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest() + ); + request.attributesConfig = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.removeCatalogAttribute(request), + expectedError + ); + }); + }); + + describe('replaceCatalogAttribute', () => { + it('invokes replaceCatalogAttribute without error', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest() + ); + request.attributesConfig = ''; + const expectedHeaderRequestParams = 'attributes_config='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AttributesConfig() + ); + client.innerApiCalls.replaceCatalogAttribute = + stubSimpleCall(expectedResponse); + const [response] = await client.replaceCatalogAttribute(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.replaceCatalogAttribute as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes replaceCatalogAttribute without error using callback', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest() + ); + request.attributesConfig = ''; + const expectedHeaderRequestParams = 'attributes_config='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AttributesConfig() + ); + client.innerApiCalls.replaceCatalogAttribute = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.replaceCatalogAttribute( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2beta.IAttributesConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.replaceCatalogAttribute as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes replaceCatalogAttribute with error', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest() + ); + request.attributesConfig = ''; + const expectedHeaderRequestParams = 'attributes_config='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.replaceCatalogAttribute = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.replaceCatalogAttribute(request), + expectedError + ); + assert( + (client.innerApiCalls.replaceCatalogAttribute as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes replaceCatalogAttribute with closed client', async () => { + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest() + ); + request.attributesConfig = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.replaceCatalogAttribute(request), + expectedError + ); + }); + }); + describe('listCatalogs', () => { it('invokes listCatalogs without error', async () => { const client = new catalogserviceModule.v2beta.CatalogServiceClient({ @@ -876,6 +1797,73 @@ describe('v2beta.CatalogServiceClient', () => { }); describe('Path templates', () => { + describe('attributesConfig', () => { + const fakePath = '/rendered/path/attributesConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributesConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.attributesConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('attributesConfigPath', () => { + const result = client.attributesConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.attributesConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAttributesConfigName', () => { + const result = client.matchProjectFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAttributesConfigName', () => { + const result = client.matchLocationFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromAttributesConfigName', () => { + const result = client.matchCatalogFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('branch', () => { const fakePath = '/rendered/path/branch'; const expectedParameters = { @@ -1016,6 +2004,149 @@ describe('v2beta.CatalogServiceClient', () => { }); }); + describe('completionConfig', () => { + const fakePath = '/rendered/path/completionConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.completionConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.completionConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('completionConfigPath', () => { + const result = client.completionConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.completionConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCompletionConfigName', () => { + const result = client.matchProjectFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCompletionConfigName', () => { + const result = client.matchLocationFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromCompletionConfigName', () => { + const result = client.matchCatalogFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('control', () => { + const fakePath = '/rendered/path/control'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + control: 'controlValue', + }; + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.controlPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.controlPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('controlPath', () => { + const result = client.controlPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'controlValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.controlPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromControlName', () => { + const result = client.matchProjectFromControlName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromControlName', () => { + const result = client.matchLocationFromControlName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromControlName', () => { + const result = client.matchCatalogFromControlName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchControlFromControlName', () => { + const result = client.matchControlFromControlName(fakePath); + assert.strictEqual(result, 'controlValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('location', () => { const fakePath = '/rendered/path/location'; const expectedParameters = { @@ -1152,5 +2283,81 @@ describe('v2beta.CatalogServiceClient', () => { ); }); }); + + describe('servingConfig', () => { + const fakePath = '/rendered/path/servingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + serving_config: 'servingConfigValue', + }; + const client = new catalogserviceModule.v2beta.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.servingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.servingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('servingConfigPath', () => { + const result = client.servingConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'servingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.servingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromServingConfigName', () => { + const result = client.matchProjectFromServingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromServingConfigName', () => { + const result = client.matchLocationFromServingConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromServingConfigName', () => { + const result = client.matchCatalogFromServingConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServingConfigFromServingConfigName', () => { + const result = client.matchServingConfigFromServingConfigName(fakePath); + assert.strictEqual(result, 'servingConfigValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-retail/test/gapic_completion_service_v2beta.ts b/packages/google-cloud-retail/test/gapic_completion_service_v2beta.ts index e3bed3a8a4a..f987631a969 100644 --- a/packages/google-cloud-retail/test/gapic_completion_service_v2beta.ts +++ b/packages/google-cloud-retail/test/gapic_completion_service_v2beta.ts @@ -520,6 +520,75 @@ describe('v2beta.CompletionServiceClient', () => { }); describe('Path templates', () => { + describe('attributesConfig', () => { + const fakePath = '/rendered/path/attributesConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new completionserviceModule.v2beta.CompletionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.attributesConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.attributesConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('attributesConfigPath', () => { + const result = client.attributesConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.attributesConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAttributesConfigName', () => { + const result = client.matchProjectFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAttributesConfigName', () => { + const result = client.matchLocationFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromAttributesConfigName', () => { + const result = client.matchCatalogFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('catalog', () => { const fakePath = '/rendered/path/catalog'; const expectedParameters = { @@ -586,6 +655,153 @@ describe('v2beta.CompletionServiceClient', () => { }); }); + describe('completionConfig', () => { + const fakePath = '/rendered/path/completionConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new completionserviceModule.v2beta.CompletionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.completionConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.completionConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('completionConfigPath', () => { + const result = client.completionConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.completionConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCompletionConfigName', () => { + const result = client.matchProjectFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCompletionConfigName', () => { + const result = client.matchLocationFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromCompletionConfigName', () => { + const result = client.matchCatalogFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('control', () => { + const fakePath = '/rendered/path/control'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + control: 'controlValue', + }; + const client = new completionserviceModule.v2beta.CompletionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.controlPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.controlPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('controlPath', () => { + const result = client.controlPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'controlValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.controlPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromControlName', () => { + const result = client.matchProjectFromControlName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromControlName', () => { + const result = client.matchLocationFromControlName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromControlName', () => { + const result = client.matchCatalogFromControlName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchControlFromControlName', () => { + const result = client.matchControlFromControlName(fakePath); + assert.strictEqual(result, 'controlValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('product', () => { const fakePath = '/rendered/path/product'; const expectedParameters = { @@ -675,5 +891,83 @@ describe('v2beta.CompletionServiceClient', () => { ); }); }); + + describe('servingConfig', () => { + const fakePath = '/rendered/path/servingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + serving_config: 'servingConfigValue', + }; + const client = new completionserviceModule.v2beta.CompletionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.servingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.servingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('servingConfigPath', () => { + const result = client.servingConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'servingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.servingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromServingConfigName', () => { + const result = client.matchProjectFromServingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromServingConfigName', () => { + const result = client.matchLocationFromServingConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromServingConfigName', () => { + const result = client.matchCatalogFromServingConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServingConfigFromServingConfigName', () => { + const result = client.matchServingConfigFromServingConfigName(fakePath); + assert.strictEqual(result, 'servingConfigValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-retail/test/gapic_control_service_v2beta.ts b/packages/google-cloud-retail/test/gapic_control_service_v2beta.ts new file mode 100644 index 00000000000..2fb4e17b608 --- /dev/null +++ b/packages/google-cloud-retail/test/gapic_control_service_v2beta.ts @@ -0,0 +1,1443 @@ +// 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. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as controlserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2beta.ControlServiceClient', () => { + it('has servicePath', () => { + const servicePath = + controlserviceModule.v2beta.ControlServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + controlserviceModule.v2beta.ControlServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = controlserviceModule.v2beta.ControlServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new controlserviceModule.v2beta.ControlServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.controlServiceStub, undefined); + await client.initialize(); + assert(client.controlServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.controlServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.controlServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('createControl', () => { + it('invokes createControl without error', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.CreateControlRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.Control() + ); + client.innerApiCalls.createControl = stubSimpleCall(expectedResponse); + const [response] = await client.createControl(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createControl without error using callback', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.CreateControlRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.Control() + ); + client.innerApiCalls.createControl = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createControl( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2beta.IControl | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createControl with error', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.CreateControlRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createControl = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createControl(request), expectedError); + assert( + (client.innerApiCalls.createControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createControl with closed client', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.CreateControlRequest() + ); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createControl(request), expectedError); + }); + }); + + describe('deleteControl', () => { + it('invokes deleteControl without error', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.DeleteControlRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteControl = stubSimpleCall(expectedResponse); + const [response] = await client.deleteControl(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteControl without error using callback', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.DeleteControlRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteControl = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteControl( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteControl with error', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.DeleteControlRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteControl = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteControl(request), expectedError); + assert( + (client.innerApiCalls.deleteControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteControl with closed client', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.DeleteControlRequest() + ); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteControl(request), expectedError); + }); + }); + + describe('updateControl', () => { + it('invokes updateControl without error', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.UpdateControlRequest() + ); + request.control = {}; + request.control.name = ''; + const expectedHeaderRequestParams = 'control.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.Control() + ); + client.innerApiCalls.updateControl = stubSimpleCall(expectedResponse); + const [response] = await client.updateControl(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateControl without error using callback', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.UpdateControlRequest() + ); + request.control = {}; + request.control.name = ''; + const expectedHeaderRequestParams = 'control.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.Control() + ); + client.innerApiCalls.updateControl = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateControl( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2beta.IControl | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateControl with error', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.UpdateControlRequest() + ); + request.control = {}; + request.control.name = ''; + const expectedHeaderRequestParams = 'control.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateControl = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateControl(request), expectedError); + assert( + (client.innerApiCalls.updateControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateControl with closed client', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.UpdateControlRequest() + ); + request.control = {}; + request.control.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateControl(request), expectedError); + }); + }); + + describe('getControl', () => { + it('invokes getControl without error', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.GetControlRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.Control() + ); + client.innerApiCalls.getControl = stubSimpleCall(expectedResponse); + const [response] = await client.getControl(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getControl without error using callback', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.GetControlRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.Control() + ); + client.innerApiCalls.getControl = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getControl( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2beta.IControl | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getControl with error', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.GetControlRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getControl = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getControl(request), expectedError); + assert( + (client.innerApiCalls.getControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getControl with closed client', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.GetControlRequest() + ); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getControl(request), expectedError); + }); + }); + + describe('listControls', () => { + it('invokes listControls without error', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ListControlsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.retail.v2beta.Control()), + generateSampleMessage(new protos.google.cloud.retail.v2beta.Control()), + generateSampleMessage(new protos.google.cloud.retail.v2beta.Control()), + ]; + client.innerApiCalls.listControls = stubSimpleCall(expectedResponse); + const [response] = await client.listControls(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listControls as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listControls without error using callback', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ListControlsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.retail.v2beta.Control()), + generateSampleMessage(new protos.google.cloud.retail.v2beta.Control()), + generateSampleMessage(new protos.google.cloud.retail.v2beta.Control()), + ]; + client.innerApiCalls.listControls = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listControls( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2beta.IControl[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listControls as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listControls with error', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ListControlsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listControls = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listControls(request), expectedError); + assert( + (client.innerApiCalls.listControls as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listControlsStream without error', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ListControlsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.retail.v2beta.Control()), + generateSampleMessage(new protos.google.cloud.retail.v2beta.Control()), + generateSampleMessage(new protos.google.cloud.retail.v2beta.Control()), + ]; + client.descriptors.page.listControls.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listControlsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.retail.v2beta.Control[] = []; + stream.on( + 'data', + (response: protos.google.cloud.retail.v2beta.Control) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listControls.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listControls, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listControls.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listControlsStream with error', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ListControlsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listControls.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listControlsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.retail.v2beta.Control[] = []; + stream.on( + 'data', + (response: protos.google.cloud.retail.v2beta.Control) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listControls.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listControls, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listControls.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listControls without error', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ListControlsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.retail.v2beta.Control()), + generateSampleMessage(new protos.google.cloud.retail.v2beta.Control()), + generateSampleMessage(new protos.google.cloud.retail.v2beta.Control()), + ]; + client.descriptors.page.listControls.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.retail.v2beta.IControl[] = []; + const iterable = client.listControlsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listControls.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listControls.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listControls with error', async () => { + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ListControlsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listControls.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listControlsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.retail.v2beta.IControl[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listControls.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listControls.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('attributesConfig', () => { + const fakePath = '/rendered/path/attributesConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributesConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.attributesConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('attributesConfigPath', () => { + const result = client.attributesConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.attributesConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAttributesConfigName', () => { + const result = client.matchProjectFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAttributesConfigName', () => { + const result = client.matchLocationFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromAttributesConfigName', () => { + const result = client.matchCatalogFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('catalog', () => { + const fakePath = '/rendered/path/catalog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.catalogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.catalogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('catalogPath', () => { + const result = client.catalogPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.catalogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCatalogName', () => { + const result = client.matchProjectFromCatalogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.catalogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCatalogName', () => { + const result = client.matchLocationFromCatalogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.catalogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromCatalogName', () => { + const result = client.matchCatalogFromCatalogName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.catalogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('completionConfig', () => { + const fakePath = '/rendered/path/completionConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.completionConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.completionConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('completionConfigPath', () => { + const result = client.completionConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.completionConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCompletionConfigName', () => { + const result = client.matchProjectFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCompletionConfigName', () => { + const result = client.matchLocationFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromCompletionConfigName', () => { + const result = client.matchCatalogFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('control', () => { + const fakePath = '/rendered/path/control'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + control: 'controlValue', + }; + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.controlPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.controlPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('controlPath', () => { + const result = client.controlPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'controlValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.controlPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromControlName', () => { + const result = client.matchProjectFromControlName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromControlName', () => { + const result = client.matchLocationFromControlName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromControlName', () => { + const result = client.matchCatalogFromControlName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchControlFromControlName', () => { + const result = client.matchControlFromControlName(fakePath); + assert.strictEqual(result, 'controlValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('product', () => { + const fakePath = '/rendered/path/product'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + branch: 'branchValue', + product: 'productValue', + }; + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.productPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.productPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('productPath', () => { + const result = client.productPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'branchValue', + 'productValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.productPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProductName', () => { + const result = client.matchProjectFromProductName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProductName', () => { + const result = client.matchLocationFromProductName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromProductName', () => { + const result = client.matchCatalogFromProductName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProductName', () => { + const result = client.matchBranchFromProductName(fakePath); + assert.strictEqual(result, 'branchValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchProductFromProductName', () => { + const result = client.matchProductFromProductName(fakePath); + assert.strictEqual(result, 'productValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('servingConfig', () => { + const fakePath = '/rendered/path/servingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + serving_config: 'servingConfigValue', + }; + const client = new controlserviceModule.v2beta.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.servingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.servingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('servingConfigPath', () => { + const result = client.servingConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'servingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.servingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromServingConfigName', () => { + const result = client.matchProjectFromServingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromServingConfigName', () => { + const result = client.matchLocationFromServingConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromServingConfigName', () => { + const result = client.matchCatalogFromServingConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServingConfigFromServingConfigName', () => { + const result = client.matchServingConfigFromServingConfigName(fakePath); + assert.strictEqual(result, 'servingConfigValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-retail/test/gapic_prediction_service_v2beta.ts b/packages/google-cloud-retail/test/gapic_prediction_service_v2beta.ts index a18527b3f52..cfb1b96bb4c 100644 --- a/packages/google-cloud-retail/test/gapic_prediction_service_v2beta.ts +++ b/packages/google-cloud-retail/test/gapic_prediction_service_v2beta.ts @@ -279,6 +279,75 @@ describe('v2beta.PredictionServiceClient', () => { }); describe('Path templates', () => { + describe('attributesConfig', () => { + const fakePath = '/rendered/path/attributesConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new predictionserviceModule.v2beta.PredictionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.attributesConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.attributesConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('attributesConfigPath', () => { + const result = client.attributesConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.attributesConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAttributesConfigName', () => { + const result = client.matchProjectFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAttributesConfigName', () => { + const result = client.matchLocationFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromAttributesConfigName', () => { + const result = client.matchCatalogFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('catalog', () => { const fakePath = '/rendered/path/catalog'; const expectedParameters = { @@ -345,6 +414,153 @@ describe('v2beta.PredictionServiceClient', () => { }); }); + describe('completionConfig', () => { + const fakePath = '/rendered/path/completionConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new predictionserviceModule.v2beta.PredictionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.completionConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.completionConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('completionConfigPath', () => { + const result = client.completionConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.completionConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCompletionConfigName', () => { + const result = client.matchProjectFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCompletionConfigName', () => { + const result = client.matchLocationFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromCompletionConfigName', () => { + const result = client.matchCatalogFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('control', () => { + const fakePath = '/rendered/path/control'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + control: 'controlValue', + }; + const client = new predictionserviceModule.v2beta.PredictionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.controlPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.controlPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('controlPath', () => { + const result = client.controlPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'controlValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.controlPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromControlName', () => { + const result = client.matchProjectFromControlName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromControlName', () => { + const result = client.matchLocationFromControlName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromControlName', () => { + const result = client.matchCatalogFromControlName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchControlFromControlName', () => { + const result = client.matchControlFromControlName(fakePath); + assert.strictEqual(result, 'controlValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('product', () => { const fakePath = '/rendered/path/product'; const expectedParameters = { @@ -434,5 +650,83 @@ describe('v2beta.PredictionServiceClient', () => { ); }); }); + + describe('servingConfig', () => { + const fakePath = '/rendered/path/servingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + serving_config: 'servingConfigValue', + }; + const client = new predictionserviceModule.v2beta.PredictionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.servingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.servingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('servingConfigPath', () => { + const result = client.servingConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'servingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.servingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromServingConfigName', () => { + const result = client.matchProjectFromServingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromServingConfigName', () => { + const result = client.matchLocationFromServingConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromServingConfigName', () => { + const result = client.matchCatalogFromServingConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServingConfigFromServingConfigName', () => { + const result = client.matchServingConfigFromServingConfigName(fakePath); + assert.strictEqual(result, 'servingConfigValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-retail/test/gapic_product_service_v2.ts b/packages/google-cloud-retail/test/gapic_product_service_v2.ts index 7b44c9e06f3..5ec737f973f 100644 --- a/packages/google-cloud-retail/test/gapic_product_service_v2.ts +++ b/packages/google-cloud-retail/test/gapic_product_service_v2.ts @@ -1530,6 +1530,397 @@ describe('v2.ProductServiceClient', () => { }); }); + describe('addLocalInventories', () => { + it('invokes addLocalInventories without error', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2.AddLocalInventoriesRequest() + ); + request.product = ''; + const expectedHeaderRequestParams = 'product='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.addLocalInventories = + stubLongRunningCall(expectedResponse); + const [operation] = await client.addLocalInventories(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addLocalInventories as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addLocalInventories without error using callback', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2.AddLocalInventoriesRequest() + ); + request.product = ''; + const expectedHeaderRequestParams = 'product='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.addLocalInventories = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addLocalInventories( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.retail.v2.IAddLocalInventoriesResponse, + protos.google.cloud.retail.v2.IAddLocalInventoriesMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.retail.v2.IAddLocalInventoriesResponse, + protos.google.cloud.retail.v2.IAddLocalInventoriesMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addLocalInventories as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addLocalInventories with call error', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2.AddLocalInventoriesRequest() + ); + request.product = ''; + const expectedHeaderRequestParams = 'product='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addLocalInventories = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.addLocalInventories(request), expectedError); + assert( + (client.innerApiCalls.addLocalInventories as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addLocalInventories with LRO error', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2.AddLocalInventoriesRequest() + ); + request.product = ''; + const expectedHeaderRequestParams = 'product='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addLocalInventories = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.addLocalInventories(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.addLocalInventories as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkAddLocalInventoriesProgress without error', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkAddLocalInventoriesProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkAddLocalInventoriesProgress with error', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkAddLocalInventoriesProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('removeLocalInventories', () => { + it('invokes removeLocalInventories without error', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2.RemoveLocalInventoriesRequest() + ); + request.product = ''; + const expectedHeaderRequestParams = 'product='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.removeLocalInventories = + stubLongRunningCall(expectedResponse); + const [operation] = await client.removeLocalInventories(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeLocalInventories as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removeLocalInventories without error using callback', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2.RemoveLocalInventoriesRequest() + ); + request.product = ''; + const expectedHeaderRequestParams = 'product='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.removeLocalInventories = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeLocalInventories( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.retail.v2.IRemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2.IRemoveLocalInventoriesMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.retail.v2.IRemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2.IRemoveLocalInventoriesMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeLocalInventories as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes removeLocalInventories with call error', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2.RemoveLocalInventoriesRequest() + ); + request.product = ''; + const expectedHeaderRequestParams = 'product='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeLocalInventories = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.removeLocalInventories(request), + expectedError + ); + assert( + (client.innerApiCalls.removeLocalInventories as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removeLocalInventories with LRO error', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2.RemoveLocalInventoriesRequest() + ); + request.product = ''; + const expectedHeaderRequestParams = 'product='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeLocalInventories = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.removeLocalInventories(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.removeLocalInventories as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkRemoveLocalInventoriesProgress without error', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRemoveLocalInventoriesProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRemoveLocalInventoriesProgress with error', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRemoveLocalInventoriesProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('listProducts', () => { it('invokes listProducts without error', async () => { const client = new productserviceModule.v2.ProductServiceClient({ diff --git a/packages/google-cloud-retail/test/gapic_product_service_v2beta.ts b/packages/google-cloud-retail/test/gapic_product_service_v2beta.ts index e7d63680517..9c3fe63714f 100644 --- a/packages/google-cloud-retail/test/gapic_product_service_v2beta.ts +++ b/packages/google-cloud-retail/test/gapic_product_service_v2beta.ts @@ -1530,6 +1530,397 @@ describe('v2beta.ProductServiceClient', () => { }); }); + describe('addLocalInventories', () => { + it('invokes addLocalInventories without error', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AddLocalInventoriesRequest() + ); + request.product = ''; + const expectedHeaderRequestParams = 'product='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.addLocalInventories = + stubLongRunningCall(expectedResponse); + const [operation] = await client.addLocalInventories(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addLocalInventories as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addLocalInventories without error using callback', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AddLocalInventoriesRequest() + ); + request.product = ''; + const expectedHeaderRequestParams = 'product='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.addLocalInventories = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addLocalInventories( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.retail.v2beta.IAddLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.IAddLocalInventoriesMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.retail.v2beta.IAddLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.IAddLocalInventoriesMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addLocalInventories as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addLocalInventories with call error', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AddLocalInventoriesRequest() + ); + request.product = ''; + const expectedHeaderRequestParams = 'product='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addLocalInventories = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.addLocalInventories(request), expectedError); + assert( + (client.innerApiCalls.addLocalInventories as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addLocalInventories with LRO error', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AddLocalInventoriesRequest() + ); + request.product = ''; + const expectedHeaderRequestParams = 'product='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addLocalInventories = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.addLocalInventories(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.addLocalInventories as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkAddLocalInventoriesProgress without error', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkAddLocalInventoriesProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkAddLocalInventoriesProgress with error', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkAddLocalInventoriesProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('removeLocalInventories', () => { + it('invokes removeLocalInventories without error', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest() + ); + request.product = ''; + const expectedHeaderRequestParams = 'product='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.removeLocalInventories = + stubLongRunningCall(expectedResponse); + const [operation] = await client.removeLocalInventories(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeLocalInventories as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removeLocalInventories without error using callback', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest() + ); + request.product = ''; + const expectedHeaderRequestParams = 'product='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.removeLocalInventories = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeLocalInventories( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesResponse, + protos.google.cloud.retail.v2beta.IRemoveLocalInventoriesMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeLocalInventories as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes removeLocalInventories with call error', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest() + ); + request.product = ''; + const expectedHeaderRequestParams = 'product='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeLocalInventories = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.removeLocalInventories(request), + expectedError + ); + assert( + (client.innerApiCalls.removeLocalInventories as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removeLocalInventories with LRO error', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest() + ); + request.product = ''; + const expectedHeaderRequestParams = 'product='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeLocalInventories = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.removeLocalInventories(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.removeLocalInventories as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkRemoveLocalInventoriesProgress without error', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRemoveLocalInventoriesProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRemoveLocalInventoriesProgress with error', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRemoveLocalInventoriesProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('listProducts', () => { it('invokes listProducts without error', async () => { const client = new productserviceModule.v2beta.ProductServiceClient({ @@ -1814,6 +2205,73 @@ describe('v2beta.ProductServiceClient', () => { }); describe('Path templates', () => { + describe('attributesConfig', () => { + const fakePath = '/rendered/path/attributesConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributesConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.attributesConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('attributesConfigPath', () => { + const result = client.attributesConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.attributesConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAttributesConfigName', () => { + const result = client.matchProjectFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAttributesConfigName', () => { + const result = client.matchLocationFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromAttributesConfigName', () => { + const result = client.matchCatalogFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('branch', () => { const fakePath = '/rendered/path/branch'; const expectedParameters = { @@ -1954,6 +2412,149 @@ describe('v2beta.ProductServiceClient', () => { }); }); + describe('completionConfig', () => { + const fakePath = '/rendered/path/completionConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.completionConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.completionConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('completionConfigPath', () => { + const result = client.completionConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.completionConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCompletionConfigName', () => { + const result = client.matchProjectFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCompletionConfigName', () => { + const result = client.matchLocationFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromCompletionConfigName', () => { + const result = client.matchCatalogFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('control', () => { + const fakePath = '/rendered/path/control'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + control: 'controlValue', + }; + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.controlPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.controlPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('controlPath', () => { + const result = client.controlPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'controlValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.controlPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromControlName', () => { + const result = client.matchProjectFromControlName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromControlName', () => { + const result = client.matchLocationFromControlName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromControlName', () => { + const result = client.matchCatalogFromControlName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchControlFromControlName', () => { + const result = client.matchControlFromControlName(fakePath); + assert.strictEqual(result, 'controlValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('product', () => { const fakePath = '/rendered/path/product'; const expectedParameters = { @@ -2041,5 +2642,81 @@ describe('v2beta.ProductServiceClient', () => { ); }); }); + + describe('servingConfig', () => { + const fakePath = '/rendered/path/servingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + serving_config: 'servingConfigValue', + }; + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.servingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.servingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('servingConfigPath', () => { + const result = client.servingConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'servingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.servingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromServingConfigName', () => { + const result = client.matchProjectFromServingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromServingConfigName', () => { + const result = client.matchLocationFromServingConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromServingConfigName', () => { + const result = client.matchCatalogFromServingConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServingConfigFromServingConfigName', () => { + const result = client.matchServingConfigFromServingConfigName(fakePath); + assert.strictEqual(result, 'servingConfigValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-retail/test/gapic_search_service_v2beta.ts b/packages/google-cloud-retail/test/gapic_search_service_v2beta.ts index b325ad1e2de..df54dc501ad 100644 --- a/packages/google-cloud-retail/test/gapic_search_service_v2beta.ts +++ b/packages/google-cloud-retail/test/gapic_search_service_v2beta.ts @@ -521,6 +521,73 @@ describe('v2beta.SearchServiceClient', () => { }); describe('Path templates', () => { + describe('attributesConfig', () => { + const fakePath = '/rendered/path/attributesConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new searchserviceModule.v2beta.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributesConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.attributesConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('attributesConfigPath', () => { + const result = client.attributesConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.attributesConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAttributesConfigName', () => { + const result = client.matchProjectFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAttributesConfigName', () => { + const result = client.matchLocationFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromAttributesConfigName', () => { + const result = client.matchCatalogFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('branch', () => { const fakePath = '/rendered/path/branch'; const expectedParameters = { @@ -661,6 +728,149 @@ describe('v2beta.SearchServiceClient', () => { }); }); + describe('completionConfig', () => { + const fakePath = '/rendered/path/completionConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new searchserviceModule.v2beta.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.completionConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.completionConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('completionConfigPath', () => { + const result = client.completionConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.completionConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCompletionConfigName', () => { + const result = client.matchProjectFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCompletionConfigName', () => { + const result = client.matchLocationFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromCompletionConfigName', () => { + const result = client.matchCatalogFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('control', () => { + const fakePath = '/rendered/path/control'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + control: 'controlValue', + }; + const client = new searchserviceModule.v2beta.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.controlPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.controlPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('controlPath', () => { + const result = client.controlPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'controlValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.controlPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromControlName', () => { + const result = client.matchProjectFromControlName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromControlName', () => { + const result = client.matchLocationFromControlName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromControlName', () => { + const result = client.matchCatalogFromControlName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchControlFromControlName', () => { + const result = client.matchControlFromControlName(fakePath); + assert.strictEqual(result, 'controlValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('product', () => { const fakePath = '/rendered/path/product'; const expectedParameters = { @@ -748,5 +958,81 @@ describe('v2beta.SearchServiceClient', () => { ); }); }); + + describe('servingConfig', () => { + const fakePath = '/rendered/path/servingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + serving_config: 'servingConfigValue', + }; + const client = new searchserviceModule.v2beta.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.servingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.servingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('servingConfigPath', () => { + const result = client.servingConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'servingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.servingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromServingConfigName', () => { + const result = client.matchProjectFromServingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromServingConfigName', () => { + const result = client.matchLocationFromServingConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromServingConfigName', () => { + const result = client.matchCatalogFromServingConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServingConfigFromServingConfigName', () => { + const result = client.matchServingConfigFromServingConfigName(fakePath); + assert.strictEqual(result, 'servingConfigValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-retail/test/gapic_serving_config_service_v2beta.ts b/packages/google-cloud-retail/test/gapic_serving_config_service_v2beta.ts new file mode 100644 index 00000000000..dbad34bbb43 --- /dev/null +++ b/packages/google-cloud-retail/test/gapic_serving_config_service_v2beta.ts @@ -0,0 +1,1767 @@ +// 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. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as servingconfigserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2beta.ServingConfigServiceClient', () => { + it('has servicePath', () => { + const servicePath = + servingconfigserviceModule.v2beta.ServingConfigServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + servingconfigserviceModule.v2beta.ServingConfigServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + servingconfigserviceModule.v2beta.ServingConfigServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.servingConfigServiceStub, undefined); + await client.initialize(); + assert(client.servingConfigServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.servingConfigServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.servingConfigServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('createServingConfig', () => { + it('invokes createServingConfig without error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.CreateServingConfigRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ); + client.innerApiCalls.createServingConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.createServingConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createServingConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createServingConfig without error using callback', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.CreateServingConfigRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ); + client.innerApiCalls.createServingConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createServingConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2beta.IServingConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createServingConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createServingConfig with error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.CreateServingConfigRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createServingConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createServingConfig(request), expectedError); + assert( + (client.innerApiCalls.createServingConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createServingConfig with closed client', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.CreateServingConfigRequest() + ); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createServingConfig(request), expectedError); + }); + }); + + describe('deleteServingConfig', () => { + it('invokes deleteServingConfig without error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.DeleteServingConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteServingConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteServingConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteServingConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteServingConfig without error using callback', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.DeleteServingConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteServingConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteServingConfig( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteServingConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteServingConfig with error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.DeleteServingConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteServingConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteServingConfig(request), expectedError); + assert( + (client.innerApiCalls.deleteServingConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteServingConfig with closed client', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.DeleteServingConfigRequest() + ); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteServingConfig(request), expectedError); + }); + }); + + describe('updateServingConfig', () => { + it('invokes updateServingConfig without error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.UpdateServingConfigRequest() + ); + request.servingConfig = {}; + request.servingConfig.name = ''; + const expectedHeaderRequestParams = 'serving_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ); + client.innerApiCalls.updateServingConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.updateServingConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateServingConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateServingConfig without error using callback', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.UpdateServingConfigRequest() + ); + request.servingConfig = {}; + request.servingConfig.name = ''; + const expectedHeaderRequestParams = 'serving_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ); + client.innerApiCalls.updateServingConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateServingConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2beta.IServingConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateServingConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateServingConfig with error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.UpdateServingConfigRequest() + ); + request.servingConfig = {}; + request.servingConfig.name = ''; + const expectedHeaderRequestParams = 'serving_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateServingConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateServingConfig(request), expectedError); + assert( + (client.innerApiCalls.updateServingConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateServingConfig with closed client', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.UpdateServingConfigRequest() + ); + request.servingConfig = {}; + request.servingConfig.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateServingConfig(request), expectedError); + }); + }); + + describe('getServingConfig', () => { + it('invokes getServingConfig without error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.GetServingConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ); + client.innerApiCalls.getServingConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getServingConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getServingConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getServingConfig without error using callback', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.GetServingConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ); + client.innerApiCalls.getServingConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getServingConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2beta.IServingConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getServingConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getServingConfig with error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.GetServingConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getServingConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getServingConfig(request), expectedError); + assert( + (client.innerApiCalls.getServingConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getServingConfig with closed client', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.GetServingConfigRequest() + ); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getServingConfig(request), expectedError); + }); + }); + + describe('addControl', () => { + it('invokes addControl without error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AddControlRequest() + ); + request.servingConfig = ''; + const expectedHeaderRequestParams = 'serving_config='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ); + client.innerApiCalls.addControl = stubSimpleCall(expectedResponse); + const [response] = await client.addControl(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addControl without error using callback', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AddControlRequest() + ); + request.servingConfig = ''; + const expectedHeaderRequestParams = 'serving_config='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ); + client.innerApiCalls.addControl = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addControl( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2beta.IServingConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addControl with error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AddControlRequest() + ); + request.servingConfig = ''; + const expectedHeaderRequestParams = 'serving_config='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addControl = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.addControl(request), expectedError); + assert( + (client.innerApiCalls.addControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addControl with closed client', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.AddControlRequest() + ); + request.servingConfig = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.addControl(request), expectedError); + }); + }); + + describe('removeControl', () => { + it('invokes removeControl without error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.RemoveControlRequest() + ); + request.servingConfig = ''; + const expectedHeaderRequestParams = 'serving_config='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ); + client.innerApiCalls.removeControl = stubSimpleCall(expectedResponse); + const [response] = await client.removeControl(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removeControl without error using callback', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.RemoveControlRequest() + ); + request.servingConfig = ''; + const expectedHeaderRequestParams = 'serving_config='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ); + client.innerApiCalls.removeControl = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeControl( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2beta.IServingConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes removeControl with error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.RemoveControlRequest() + ); + request.servingConfig = ''; + const expectedHeaderRequestParams = 'serving_config='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeControl = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.removeControl(request), expectedError); + assert( + (client.innerApiCalls.removeControl as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removeControl with closed client', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.RemoveControlRequest() + ); + request.servingConfig = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.removeControl(request), expectedError); + }); + }); + + describe('listServingConfigs', () => { + it('invokes listServingConfigs without error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ListServingConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ), + generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ), + generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ), + ]; + client.innerApiCalls.listServingConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.listServingConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listServingConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listServingConfigs without error using callback', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ListServingConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ), + generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ), + generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ), + ]; + client.innerApiCalls.listServingConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listServingConfigs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2beta.IServingConfig[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listServingConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listServingConfigs with error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ListServingConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listServingConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listServingConfigs(request), expectedError); + assert( + (client.innerApiCalls.listServingConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listServingConfigsStream without error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ListServingConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ), + generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ), + generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ), + ]; + client.descriptors.page.listServingConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listServingConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.retail.v2beta.ServingConfig[] = []; + stream.on( + 'data', + (response: protos.google.cloud.retail.v2beta.ServingConfig) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listServingConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listServingConfigs, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listServingConfigs.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listServingConfigsStream with error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ListServingConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listServingConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listServingConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.retail.v2beta.ServingConfig[] = []; + stream.on( + 'data', + (response: protos.google.cloud.retail.v2beta.ServingConfig) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listServingConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listServingConfigs, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listServingConfigs.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listServingConfigs without error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ListServingConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ), + generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ), + generateSampleMessage( + new protos.google.cloud.retail.v2beta.ServingConfig() + ), + ]; + client.descriptors.page.listServingConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.retail.v2beta.IServingConfig[] = []; + const iterable = client.listServingConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listServingConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listServingConfigs.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listServingConfigs with error', async () => { + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.ListServingConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listServingConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listServingConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.retail.v2beta.IServingConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listServingConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listServingConfigs.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('attributesConfig', () => { + const fakePath = '/rendered/path/attributesConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributesConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.attributesConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('attributesConfigPath', () => { + const result = client.attributesConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.attributesConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAttributesConfigName', () => { + const result = client.matchProjectFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAttributesConfigName', () => { + const result = client.matchLocationFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromAttributesConfigName', () => { + const result = client.matchCatalogFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('catalog', () => { + const fakePath = '/rendered/path/catalog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.catalogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.catalogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('catalogPath', () => { + const result = client.catalogPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.catalogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCatalogName', () => { + const result = client.matchProjectFromCatalogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.catalogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCatalogName', () => { + const result = client.matchLocationFromCatalogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.catalogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromCatalogName', () => { + const result = client.matchCatalogFromCatalogName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.catalogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('completionConfig', () => { + const fakePath = '/rendered/path/completionConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.completionConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.completionConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('completionConfigPath', () => { + const result = client.completionConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.completionConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCompletionConfigName', () => { + const result = client.matchProjectFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCompletionConfigName', () => { + const result = client.matchLocationFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromCompletionConfigName', () => { + const result = client.matchCatalogFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('control', () => { + const fakePath = '/rendered/path/control'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + control: 'controlValue', + }; + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.controlPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.controlPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('controlPath', () => { + const result = client.controlPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'controlValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.controlPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromControlName', () => { + const result = client.matchProjectFromControlName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromControlName', () => { + const result = client.matchLocationFromControlName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromControlName', () => { + const result = client.matchCatalogFromControlName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchControlFromControlName', () => { + const result = client.matchControlFromControlName(fakePath); + assert.strictEqual(result, 'controlValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('product', () => { + const fakePath = '/rendered/path/product'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + branch: 'branchValue', + product: 'productValue', + }; + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.productPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.productPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('productPath', () => { + const result = client.productPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'branchValue', + 'productValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.productPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProductName', () => { + const result = client.matchProjectFromProductName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProductName', () => { + const result = client.matchLocationFromProductName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromProductName', () => { + const result = client.matchCatalogFromProductName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProductName', () => { + const result = client.matchBranchFromProductName(fakePath); + assert.strictEqual(result, 'branchValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchProductFromProductName', () => { + const result = client.matchProductFromProductName(fakePath); + assert.strictEqual(result, 'productValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('servingConfig', () => { + const fakePath = '/rendered/path/servingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + serving_config: 'servingConfigValue', + }; + const client = + new servingconfigserviceModule.v2beta.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.servingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.servingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('servingConfigPath', () => { + const result = client.servingConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'servingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.servingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromServingConfigName', () => { + const result = client.matchProjectFromServingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromServingConfigName', () => { + const result = client.matchLocationFromServingConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromServingConfigName', () => { + const result = client.matchCatalogFromServingConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServingConfigFromServingConfigName', () => { + const result = client.matchServingConfigFromServingConfigName(fakePath); + assert.strictEqual(result, 'servingConfigValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-retail/test/gapic_user_event_service_v2beta.ts b/packages/google-cloud-retail/test/gapic_user_event_service_v2beta.ts index c460e94e213..610c49176ae 100644 --- a/packages/google-cloud-retail/test/gapic_user_event_service_v2beta.ts +++ b/packages/google-cloud-retail/test/gapic_user_event_service_v2beta.ts @@ -1011,6 +1011,73 @@ describe('v2beta.UserEventServiceClient', () => { }); describe('Path templates', () => { + describe('attributesConfig', () => { + const fakePath = '/rendered/path/attributesConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new usereventserviceModule.v2beta.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributesConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.attributesConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('attributesConfigPath', () => { + const result = client.attributesConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.attributesConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAttributesConfigName', () => { + const result = client.matchProjectFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAttributesConfigName', () => { + const result = client.matchLocationFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromAttributesConfigName', () => { + const result = client.matchCatalogFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('catalog', () => { const fakePath = '/rendered/path/catalog'; const expectedParameters = { @@ -1075,6 +1142,149 @@ describe('v2beta.UserEventServiceClient', () => { }); }); + describe('completionConfig', () => { + const fakePath = '/rendered/path/completionConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new usereventserviceModule.v2beta.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.completionConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.completionConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('completionConfigPath', () => { + const result = client.completionConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.completionConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCompletionConfigName', () => { + const result = client.matchProjectFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCompletionConfigName', () => { + const result = client.matchLocationFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromCompletionConfigName', () => { + const result = client.matchCatalogFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('control', () => { + const fakePath = '/rendered/path/control'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + control: 'controlValue', + }; + const client = new usereventserviceModule.v2beta.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.controlPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.controlPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('controlPath', () => { + const result = client.controlPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'controlValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.controlPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromControlName', () => { + const result = client.matchProjectFromControlName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromControlName', () => { + const result = client.matchLocationFromControlName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromControlName', () => { + const result = client.matchCatalogFromControlName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchControlFromControlName', () => { + const result = client.matchControlFromControlName(fakePath); + assert.strictEqual(result, 'controlValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('product', () => { const fakePath = '/rendered/path/product'; const expectedParameters = { @@ -1162,5 +1372,81 @@ describe('v2beta.UserEventServiceClient', () => { ); }); }); + + describe('servingConfig', () => { + const fakePath = '/rendered/path/servingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + serving_config: 'servingConfigValue', + }; + const client = new usereventserviceModule.v2beta.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.servingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.servingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('servingConfigPath', () => { + const result = client.servingConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'servingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.servingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromServingConfigName', () => { + const result = client.matchProjectFromServingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromServingConfigName', () => { + const result = client.matchLocationFromServingConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromServingConfigName', () => { + const result = client.matchCatalogFromServingConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServingConfigFromServingConfigName', () => { + const result = client.matchServingConfigFromServingConfigName(fakePath); + assert.strictEqual(result, 'servingConfigValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); });